pax_global_header00006660000000000000000000000064122412464070014514gustar00rootroot0000000000000052 comment=ddc5f2dbdb2f95d77bfec8c92d338bfa958b6463 saga-2.1.0+dfsg/000077500000000000000000000000001224124640700133465ustar00rootroot00000000000000saga-2.1.0+dfsg/AUTHORS000066400000000000000000000011171224124640700144160ustar00rootroot00000000000000_______________________________________________________________________________ SAGA 2.0 - System for Automated Geoscientific Analyses _______________________________________________________________________________ AUTHORS _______________________________________________________________________________ Date: May, 15th 2007 A. System Development - Olaf Conrad - Thomas Schorr - Stefan Liersch - Victor Olaya - Andre Ringeler B. Modules Please have a look at the module descriptions supplied with each module on information about the responsible authors. saga-2.1.0+dfsg/COPYING000066400000000000000000001045131224124640700144050ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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. Copyright (C) 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 . 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: Copyright (C) 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 . 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 . saga-2.1.0+dfsg/ChangeLog000066400000000000000000015572561224124640700151450ustar00rootroot000000000000002012-06-12 13:41 manfred-e * src/saga_core/saga_api/module.cpp: saga_api: fix gcc build error 2012-06-08 10:29 oconrad * src/modules/grid/grid_tools/Grid_Merge.cpp, src/modules/grid/grid_tools/Grid_Merge.h: grid_tools, mosaicking: renamed from 'merge grids', new options added for overlapping areas (min, max, mean, feathering/blending) 2012-06-07 15:35 oconrad * src/saga_core/saga_gui/project.cpp, src/saga_core/saga_gui/project.h: saga_gui, project: versioning added (backward compatility, choosing correct symbology for rgb-coded grids) 2012-06-07 15:33 oconrad * src/saga_core/saga_api/parameter.cpp, src/saga_core/saga_api/parameters.h: saga_api, CSG_Parameters_Grid_Target: alternative init_user() function added 2012-06-06 14:33 oconrad * src/saga_core/saga_api/module.cpp, src/saga_core/saga_api/module.h, src/saga_core/saga_api/module_library.cpp, src/saga_core/saga_api/module_library.h, src/saga_core/saga_cmd/saga_cmd.cpp, src/saga_core/saga_gui/res_commands.cpp, src/saga_core/saga_gui/res_commands.h, src/saga_core/saga_gui/wksp_module.cpp, src/saga_core/saga_gui/wksp_module_manager.cpp: saga_api, saga_cmd, saga_gui: creating module documentation files. related to saga-gis-developer mailing list thread: http://sourceforge.net/mailarchive/forum.php?thread_name=4FCEF035.3010604%40faunalia.it&forum_name=saga-gis-developer 2012-06-04 15:48 oconrad * src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_grid.h: saga_gui, drawing grids: multi-processor support not for file-cached/compressed grids 2012-06-04 15:46 oconrad * src/saga_core/saga_api/shapes_polygons.cpp: saga_api, polygon clipping: precision bug 2012-06-04 09:43 reklov_w * src/modules_io/gdal/io_gdal/gdal_driver.cpp: io_gdal, gdal_driver: fix unicode issue in message output of gdal error message 2012-06-01 15:13 oconrad * src/modules/shapes/shapes_tools/shapes_buffer.cpp, src/modules/shapes/shapes_tools/shapes_buffer.h: shapes_buffer: bug fixes and improvements, using polygon offset method of clipper library 2012-06-01 10:56 oconrad * src/modules/shapes/shapes_tools/shapes_buffer.cpp, src/modules/shapes/shapes_tools/shapes_buffer.h: shapes_buffer: bug fixes and improvements, using polygon offset method of clipper library 2012-06-01 08:43 oconrad * src/modules/shapes/shapes_grid/Grid_Polygon_Clip.cpp, src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h: clip grid with polygon: 'crop grid to data' is now optionally (disabled by default) 2012-06-01 08:34 reklov_w * src/saga_core/saga_cmd/module_library.cpp: saga_cmd: fix quoting of parameters (with spaces) 2012-05-31 11:24 oconrad * src/saga_core/saga_api/clipper.cpp, src/saga_core/saga_api/shapes.h, src/saga_core/saga_api/shapes_polygons.cpp: saga_api, polygon clipping: simplify and buffer functions added, including a necessary patch to clipper library (limiting number of vertices when adding an arc) 2012-05-30 16:52 oconrad * src/saga_core/saga_api/geo_functions.cpp: saga_api, sg_get_crossing(): bug fix, crossing position has not been set under certain circumstances 2012-05-30 16:51 oconrad * src/saga_core/saga_api/clipper.cpp, src/saga_core/saga_api/clipper.hpp: saga_api, clipper: update to v4.8.3 2012-05-30 13:48 oconrad * src/modules_io/gdal/io_gdal/gdal_import.cpp: io_gdal, import grid: corrected transformation counter 2012-05-30 13:05 oconrad * src/modules/shapes/shapes_grid/Grid_Polygon_Clip.cpp, src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h: clip grid with polygon: clip region now also takes respect of no-data values in supplied grids 2012-05-30 13:04 oconrad * src/saga_core/saga_cmd/module_library.cpp: saga_cmd: file names for output object lists can be specified now, e.g.: saga_cmd shapes_grid 7 -POLYGONS=buf.shp -INPUT=a;b;c -OUTPUT=a_buf;b_buf;c_buf 2012-05-30 13:00 oconrad * src/saga_core/saga_api/module.h: saga_api, module_grid: additional grid system functions exposed 2012-05-30 12:59 oconrad * src/saga_core/saga_api/mat_tools.cpp, src/saga_core/saga_api/mat_tools.h: saga_api, math_tools: sg_get_digit_count(int number) added 2012-05-25 12:52 oconrad * src/modules_io/gdal/io_gdal/gdal_import.cpp: gdal_import: improved transformation options, optionally import only a subset from multiband grids 2012-05-25 12:32 oconrad * src/modules_io/gdal/io_gdal/gdal_driver.cpp, src/modules_io/gdal/io_gdal/gdal_driver.h, src/modules_io/gdal/io_gdal/gdal_import.cpp, src/modules_io/gdal/io_gdal/gdal_import.h: gdal_import: improved transformation options, optionally import only a subset from multiband grids 2012-05-25 12:30 oconrad * src/saga_core/saga_api/geo_classes.cpp, src/saga_core/saga_api/geo_tools.h: saga_api, csg_rect: union() function added that takes a single point (csg_point) 2012-05-25 12:29 oconrad * src/saga_core/saga_api/grid.cpp: saga_api, csg_grid: default no-data value for byte grids set to '0' (instead of '-127') 2012-05-25 08:34 oconrad * src/modules/grid/grid_spline/Gridding_Spline_Base.cpp: multi-level-b-spline: point-loading bug fixed 2012-05-24 06:55 manfred-e * src/modules/grid/grid_analysis/Grid_AHP.cpp: modules: grid_analysis: Analytical Hierarchy Process: calculation fix 2012-05-21 14:22 reklov_w * src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp, src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h: PC Reclassifier/Subset Extractor: optionally create new attribute with reclassification result 2012-05-14 10:34 reklov_w * src/saga_core/saga_api/dataobject.cpp: saga_api: changing default NoData range of data objects from -99999;-999 to -99999;-99999 in order to avoid problems with marine data 2012-05-14 10:04 reklov_w * src/modules/shapes/shapes_tools/Makefile.am, src/modules/shapes/shapes_tools/QueryParser.cpp, src/modules/shapes/shapes_tools/QueryParser.h: shapes_tools: fix Makefile.am and remove depreciated files 2012-05-14 09:58 oconrad * src/saga_core/saga_gui/wksp_table.cpp: saga_gui, wksp_table: bug fix, parameter initializing 2012-05-11 14:28 oconrad * src/saga_core/saga_api/table_io.cpp: saga_api, table_io: recognizing no-data values loading/saving text tables 2012-05-11 14:27 oconrad * src/modules/table/table_tools/Join_Tables.cpp, src/modules/table/table_tools/Join_Tables.h, src/modules/table/table_tools/MLB_Interface.cpp: table_tools: a simple 'append columns from other table' tool 2012-05-11 13:47 reklov_w * src/saga_core/saga_gui/wksp_data_manager.cpp: saga_gui: fix error if saga_gui is closed and saga_gui.cfg file is not existing ("can't remove file") 2012-05-10 11:37 oconrad * src/modules/grid/grid_calculus/Grid_Calculator.cpp: saga_api, formula parser: get_value() made const, easier usage for parallel processing 2012-05-10 11:36 oconrad * src/modules/grid/grid_calculus/Grid_Plotter.cpp, src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp, src/modules/table/table_calculus/Fit.cpp, src/saga_core/saga_api/mat_formula.cpp, src/saga_core/saga_api/mat_tools.h, src/saga_core/saga_api/mat_trend.cpp: saga_api, formula parser: get_value() made const, easier usage for parallel processing 2012-05-10 11:25 reklov_w * src/modules_io/shapes/io_shapes/pointcloud_to_text_file.cpp, src/modules_io/shapes/io_shapes/pointcloud_to_text_file.h: point cloud to text file: enhancements (speed) 2012-05-10 11:16 oconrad * src/saga_core/saga_gui/wksp_pointcloud.cpp: saga_gui, pointcloud: display correct settings for rgb coded attribute 2012-05-10 10:04 reklov_w * src/saga_core/saga_gui/wksp_pointcloud.cpp: saga_gui, wksp_pointcloud.cpp: fix parameter enable for RGB coloring 2012-05-07 14:23 manfred-e * src/modules/grid/grid_analysis/owa.cpp: modules: grid_analysis: ordered weight average: bug fix (ignored values/grids) 2012-05-03 09:33 reklov_w * src/saga_core/saga_cmd/module_library.cpp: saga_cmd / module_library.cpp: set svn eol keyword and convert to LF 2012-05-03 09:31 reklov_w * src/saga_core/saga_cmd/module_library.cpp: saga_cmd: change usage of wxCommandLineParse (SetCmdLine) to prevent re-setting of locale; fixes unintended usage of ',' as decimal separator during argument parsing and module execution 2012-05-02 15:37 oconrad * src/modules/grid/grid_gridding/Shapes2Grid.cpp, src/modules/grid/grid_gridding/Shapes2Grid.h: grid_gridding, shapes to grid: polygon match for either grid nodes or cells (latter can be useful for polygon sizes around or less than the grid cell sizes) 2012-05-02 15:35 oconrad * src/modules/grid/grid_tools/Grid_Gaps_Resampling.cpp: grid_tools, close gaps (resampling): prevent possible non-stop loops 2012-04-27 12:49 oconrad * src/saga_core/saga_gui/wksp_layer.cpp: saga_gui/wksp_layer: 'save as ...' dialog, suggests a file name 2012-04-27 12:47 oconrad * src/modules/grid/grid_tools/Grid_Gaps_Resampling.cpp, src/modules/grid/grid_tools/Grid_Gaps_Resampling.h: 'close gaps with resampling' module: further options added 2012-04-27 12:45 oconrad * src/modules/grid/grid_gridding/Shapes2Grid.cpp, src/modules/grid/grid_gridding/Shapes2Grid.h: 'shapes2grid' module: output of just '0/1' (data/no-data) option added (instead of attribute values) 2012-04-27 12:43 oconrad * src/modules/shapes/shapes_tools/shapes_extents.cpp: 'get shapes' extent' module: get 'total extent' option added 2012-04-26 15:44 oconrad * src/dev_tools/dev_tools.vcxproj, src/dev_tools/tl_extract.cpp: dev_tools: updated to saga 2.1.0 2012-04-26 15:44 oconrad * src/modules/grid/grid_tools/Grid_Gaps_Resampling.cpp, src/modules/grid/grid_tools/Grid_Gaps_Resampling.h, src/modules/grid/grid_tools/MLB_Interface.cpp, src/modules/grid/grid_tools/Makefile.am, src/modules/grid/grid_tools/grid_tools.vcxproj, src/modules/grid/grid_tools/grid_tools.vcxproj.filters: grid tool added: close gaps using stepwise resampling 2012-04-26 15:42 oconrad * src/saga_core/saga_api/grid.h: saga_api/grid: is_InGrid_byPos(), optional check for no-data 2012-04-26 15:41 oconrad * src/saga_core/saga_api/mat_matrix.cpp, src/saga_core/saga_api/mat_spline.cpp: saga_api: memory allocation check 2012-04-26 12:02 reklov_w * src/modules/grid/grid_tools/Grid_Tiling.cpp, src/modules/grid/grid_tools/Grid_Tiling.h: Grid Tools - Tiling: added possibility to write output (individually) to disk 2012-04-26 11:58 manfred-e * src/modules_io/gdal/io_gdal/gdal_driver.cpp, src/modules_io/gdal/io_gdal/gdal_export.cpp, src/modules_io/gdal/io_gdal/gdal_export_geotiff.cpp: modules: io_gdal: improved error handling for raster and geotiff export 2012-04-24 14:02 reklov_w * src/modules_io/gdal/io_gdal/gdal_driver.cpp: gdal_driver.cpp: fix string issue 2012-04-24 11:42 manfred-e * src/saga_core/saga_gui/Makefile.am: saga_gui: fixes tracker id 3432061: hardcoded MLIBPATH 2012-04-24 09:44 manfred-e * src/modules_io/gdal/io_gdal/gdal_driver.cpp, src/modules_io/gdal/io_gdal/gdal_driver.h, src/modules_io/gdal/io_gdal/gdal_export.cpp, src/modules_io/gdal/io_gdal/gdal_export_geotiff.cpp: modules: io_gdal: added gdal Creation Options support for raster export 2012-04-24 09:04 oconrad * src/modules_io/table/io_table/io_table_txt.cpp: table import (text): minor bug fix 2012-04-17 14:22 oconrad * src/saga_core/saga_cmd/callback.cpp, src/saga_core/saga_cmd/callback.h, src/saga_core/saga_cmd/module_library.cpp, src/saga_core/saga_cmd/module_library.h, src/saga_core/saga_cmd/saga_cmd.cpp: saga_cmd: solving external module dependencies (e.g. in ta_compound>basic ta) and some minor optimizations 2012-04-13 09:54 oconrad * src/modules_io/shapes/io_shapes/MLB_Interface.cpp, src/modules_io/shapes/io_shapes/Makefile.am, src/modules_io/shapes/io_shapes/io_shapes.vcxproj, src/modules_io/shapes/io_shapes/io_shapes.vcxproj.filters, src/modules_io/shapes/io_shapes/wktb.cpp, src/modules_io/shapes/io_shapes/wktb.h, src/saga_core/saga_api/shapes_ogis.cpp: added: import/export simple features, well known text (wkt) format 2012-04-12 08:23 reklov_w * src/saga_core/saga_api/geo_functions.cpp: saga_api, geo_functions, SG_Get_Crossing: fix (avoid) precision issue in case vertices are identical by explicit test for equality 2012-04-11 17:50 reklov_w * src/modules/shapes/shapes_tools/shapes_generate.cpp: generate shapes module: small bug fix for first id 2012-04-11 17:35 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tc_iwahashi_pike.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tc_iwahashi_pike.h: morphometry: terrain classification after iwahashi & pike (2007, geomorphology) 2012-04-10 21:39 reklov_w * src/modules/shapes/shapes_tools/MLB_Interface.cpp, src/modules/shapes/shapes_tools/Makefile.am, src/modules/shapes/shapes_tools/shapes_generate.cpp, src/modules/shapes/shapes_tools/shapes_generate.h, src/modules/shapes/shapes_tools/shapes_tools.vcxproj, src/modules/shapes/shapes_tools/shapes_tools.vcxproj.filters: new module "generate shapes" added to MLB Shapes-Tools: Allows to generate point, line or polygon shapes from a table with x and y coordinates and an identifier 2012-04-05 09:55 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_morphometry/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.vcxproj.filters, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tc_iwahashi_pike.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tc_iwahashi_pike.h: morphometry: terrain classification after iwahashi & pike (2007, geomorphology) 2012-04-05 08:42 oconrad * src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.cpp: e00 import: bug fixes, memory leaks 2012-04-05 08:36 oconrad * src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.h: modules: 'geostatistics' renamed to 'spatial and geostatistics' (for correctness) 2012-03-30 14:21 oconrad * src/modules/grid/grid_filter/Filter_Rank.cpp, src/modules/grid/grid_filter/Filter_Rank.h: grid_filter/rank filter: bug fix and performance improvements 2012-03-30 14:20 oconrad * src/saga_core/saga_api/grid.h, src/saga_core/saga_api/grid_system.cpp: saga_api, grid_cell_adressor: squared 'radius' option added 2012-03-30 14:19 oconrad * src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.cpp: modules: 'geostatistics' renamed to 'spatial and geostatistics' (for correctness) 2012-03-29 15:38 oconrad * src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_layer.cpp, src/saga_core/saga_gui/wksp_pointcloud.cpp, src/saga_core/saga_gui/wksp_shapes.cpp: saga_gui: colour classification parameters, further enhancements 2012-03-29 15:37 oconrad * src/saga_core/saga_gui/dlg_base.cpp, src/saga_core/saga_gui/dlg_list_grid.cpp: saga_gui: grid list dialog, grid system selector visibility bug 2012-03-29 09:06 reklov_w * src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.h: Zonal Grid Statistics: fix bug 'Zonal Grid Statistics - noData handling - ID: 3512321' and further improvements 2012-03-28 17:17 oconrad * src/modules/table/table_tools/MLB_Interface.cpp, src/modules/table/table_tools/Makefile.am, src/modules/table/table_tools/table_change_field_type.cpp, src/modules/table/table_tools/table_change_field_type.h, src/modules/table/table_tools/table_tools.vcxproj, src/modules/table/table_tools/table_tools.vcxproj.filters, src/saga_core/saga_api/table.cpp, src/saga_core/saga_api/table_io.cpp, src/saga_core/saga_gui/helper.cpp, src/saga_core/saga_gui/res_commands.cpp, src/saga_core/saga_gui/res_commands.h, src/saga_core/saga_gui/view_table.cpp, src/saga_core/saga_gui/view_table.h, src/saga_core/saga_gui/view_table_control.cpp, src/saga_core/saga_gui/view_table_control.h: saga_api, saga_gui, table_tools: change a table field's data type (e.g. from integer to text) 2012-03-27 16:41 oconrad * src/saga_core/saga_gui/active_legend.cpp, src/saga_core/saga_gui/active_legend.h, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_layer.cpp, src/saga_core/saga_gui/wksp_layer_classify.cpp, src/saga_core/saga_gui/wksp_layer_classify.h, src/saga_core/saga_gui/wksp_layer_legend.cpp, src/saga_core/saga_gui/wksp_layer_legend.h, src/saga_core/saga_gui/wksp_map.cpp, src/saga_core/saga_gui/wksp_map.h, src/saga_core/saga_gui/wksp_pointcloud.cpp, src/saga_core/saga_gui/wksp_pointcloud.h, src/saga_core/saga_gui/wksp_shapes.cpp, src/saga_core/saga_gui/wksp_shapes_line.cpp, src/saga_core/saga_gui/wksp_shapes_line.h, src/saga_core/saga_gui/wksp_shapes_point.cpp, src/saga_core/saga_gui/wksp_shapes_point.h, src/saga_core/saga_gui/wksp_shapes_polygon.cpp, src/saga_core/saga_gui/wksp_shapes_polygon.h, src/saga_core/saga_gui/wksp_tin.cpp, src/saga_core/saga_gui/wksp_tin.h: saga_gui: colour classification and legend stuff 2012-03-16 14:03 reklov_w * src/saga_core/saga_gui/wksp_grid.cpp: saga_gui, wksp_grid: fix string issue 2012-03-15 16:54 oconrad * src/modules_io/grid/io_grid_image/grid_import.cpp, src/saga_core/saga_gui/view_histogram.cpp, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_layer.cpp, src/saga_core/saga_gui/wksp_layer_classify.cpp, src/saga_core/saga_gui/wksp_layer_classify.h, src/saga_core/saga_gui/wksp_layer_legend.cpp, src/saga_core/saga_gui/wksp_shapes.cpp: saga_gui: discrete/graduated colour classification implemented (graduated now interpolates colours from discrete palette) 2012-03-15 16:51 oconrad * src/modules_projection/pj_proj4/pj_proj4/crs_assign.cpp: set projection: automatic update of description tab (saga_gui) 2012-03-14 10:24 oconrad * src/modules/shapes/shapes_polygons/Polygon_SelfIntersection.cpp: module added: 'self-intersection' for polygons of one layer 2012-03-14 10:03 oconrad * src/modules/shapes/shapes_polygons/MLB_Interface.cpp, src/modules/shapes/shapes_polygons/Makefile.am, src/modules/shapes/shapes_polygons/Polygon_SelfIntersection.cpp, src/modules/shapes/shapes_polygons/Polygon_SelfIntersection.h, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj.filters: module added: 'self-intersection' for polygons of one layer 2012-03-13 15:02 oconrad * src/modules/shapes/shapes_polygons/MLB_Interface.cpp, src/modules/shapes/shapes_polygons/Makefile.am, src/modules/shapes/shapes_polygons/Polygon_Clip.cpp, src/modules/shapes/shapes_polygons/Polygon_Clip.h, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj.filters: shapes_polygon: polygon clipping for shapes 2012-03-13 15:00 oconrad * src/modules_io/gdal/io_gdal/MLB_Interface.cpp, src/modules_io/gdal/io_gdal/Makefile.am, src/modules_io/gdal/io_gdal/io_gdal.vcxproj, src/modules_io/gdal/io_gdal/io_gdal.vcxproj.filters, src/modules_io/gdal/io_gdal/ogr_export_kml.cpp, src/modules_io/gdal/io_gdal/ogr_export_kml.h: io_gdal: kml export module, including automated projection to geographic coordinates 2012-03-12 16:17 oconrad * src/modules_geostatistics/geostatistics/geostatistics_regression/grid_multi_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.h, src/saga_core/saga_api/mat_regression_multiple.cpp, src/saga_core/saga_api/mat_tools.h: saga_api, csg_regression_multiple: optional cross validation added 2012-03-12 16:17 oconrad * src/modules_recreations/recreations/recreations_fractals/Grid_FractalDimension.cpp, src/modules_recreations/recreations/recreations_fractals/Grid_FractalDimension.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.h: modules, geomorphometry, fractal geometry: surface area calculation 2012-03-08 17:08 oconrad * src/modules/grid/grid_analysis/Grid_CVA.cpp, src/modules/grid/grid_analysis/Grid_CVA.h: change vector analysis: reworked and improved 2012-03-06 11:09 reklov_w * src/modules_io/shapes/io_shapes_las/las_info.cpp: LAS Info: fix broken strings in message output (wx2.9 issue) 2012-03-01 08:31 oconrad * src/saga_core/saga_gui/res/saga.ger.txt: saga_gui/resources: updated german tranlation table (many thanx again to juergen brunke) 2012-02-29 17:57 oconrad * src/saga_core/saga_api/quadtree.cpp, src/saga_core/saga_api/shapes.h: saga_api, quadtree: fixing linux link error 2012-02-29 15:44 oconrad * src/modules_io/gdal/io_gdal/gdal_import.cpp: io_gdal, gdal_import: bug fix loading subgrids without gui (e.g. netcdf from saga_cmd) 2012-02-29 10:38 reklov_w * src/saga_core/saga_gui/saga.cpp: saga_gui: fix Process_Wait() to avoid endless loop 2012-02-28 16:31 oconrad * src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary_global.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal_global.h: kriging interpolation: support for parallel processing 2012-02-28 16:30 oconrad * src/saga_core/saga_api/mat_formula.cpp, src/saga_core/saga_api/mat_tools.h: saga_api, formula parser: support for parallel processing 2012-02-28 16:29 oconrad * src/saga_core/saga_api/geo_functions.cpp, src/saga_core/saga_api/geo_tools.h, src/saga_core/saga_api/quadtree.cpp, src/saga_core/saga_api/shapes.h: saga_api, quadtree search engine: support for polar coordinates and parallel processing 2012-02-21 13:34 reklov_w * src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp: polygon properties module: bug fix (invalid parameter identifier) in case optional output is set to [create] 2012-02-21 13:27 reklov_w * src/modules/shapes/shapes_polygons/shape_index.cpp: shapes indices module: bug fix to enable copying of geometry in case optional output is set to [create]; fix division by zero (area) 2012-02-13 21:07 reklov_w * src/saga_core/saga_api/parameters.cpp: saga_api, parameters.cpp: eliminating gcc compiler warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ and warning: ‘pParameter’ may be used uninitialized in this function 2012-02-13 20:38 reklov_w * src/saga_core/saga_gui/saga.cpp, src/saga_core/saga_gui/saga.h: saga_gui: locale setting workaround for wxwidgets 2.9.3, more comments in the sources. 2012-02-06 09:14 reklov_w * src/saga_core/saga_api/parameters.cpp: saga_api, parameters/Set_Parameter(): add parameter type point cloud 2012-02-03 11:38 oconrad * src/modules/shapes/shapes_points/gps_track_aggregation.cpp, src/modules/shapes/shapes_points/gps_track_aggregation.h: shapes_point, gps_track_aggregation: enhanced fixed time span option 2012-02-02 15:24 reklov_w * src/saga_core/saga_gui/saga_frame.cpp: saga_gui: fix (wxgtk) display of scatterplot toolbar on gui startup 2012-02-02 14:15 reklov_w * src/saga_core/saga_gui/saga_frame.cpp: saga_gui: fix (wxgtk) EVT_SIZE of wxMDIParentFrame by explicitly connecting (and disconnecting) the wxObjectEventFunction. prevented a response when resizing the main window (no redraw) 2012-02-02 10:49 reklov_w * src/saga_core/saga_gui/saga_frame.cpp: saga_gui: fix (wxgtk) placement of progress bar by temporary hack found in wxwidgets statbar sample 2012-02-01 10:02 reklov_w * src/saga_core/saga_gui/data_source_files.cpp: saga_gui, CData_Source_Files: fix 'Gtk-CRITICAL **: gtk_widget_set_size_request: assertion height >= -1 failed' within wxGenericDirCtrl constructor by setting File Filter afterwards 2012-01-31 07:33 reklov_w * src/saga_core/saga_gui/saga_frame.cpp: saga_gui: fix event handling of map view toolbar 2012-01-26 16:28 oconrad * src/modules/shapes/shapes_polygons/Polygons_From_Lines.cpp: lines to polygon conversion: optionally as one single multipolygon object 2012-01-26 13:53 oconrad * src/modules/shapes/shapes_points/gps_track_aggregation.cpp, src/modules/shapes/shapes_points/gps_track_aggregation.h: shapes_point, gps_track_aggregation: bug fixes, distance calculation for lat/lon, enhanced time span aggregation 2012-01-26 13:51 oconrad * src/saga_core/saga_api/geo_functions.cpp, src/saga_core/saga_api/geo_tools.h: saga_api, geo_functions: new function for calculation of distances in polar coordinates (longitude/latitude) 2012-01-26 13:47 oconrad * src/modules_io/table/io_table/io_table_txt.cpp, src/modules_io/table/io_table/io_table_txt.h: io_table: CTable_Text_Import_Fixed_Cols, enhanced imput option 2012-01-26 13:44 oconrad * src/modules/grid/grid_calculus/Fuzzify.cpp: grid_calculus: bug fix, fuzzify 2012-01-26 13:43 oconrad * src/modules_images/modules_imagery/imagery_classification/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_classification/Makefile.am, src/modules_images/modules_imagery/imagery_classification/classify_supervised_polygons.cpp, src/modules_images/modules_imagery/imagery_classification/classify_supervised_polygons.h, src/modules_images/modules_imagery/imagery_classification/imagery_classification.vcxproj, src/modules_images/modules_imagery/imagery_classification/imagery_classification.vcxproj.filters: imagery_classification: supervised polygon classification added 2012-01-19 14:46 reklov_w * src/modules/shapes/shapes_lines/line_simplification.cpp: line simplification module: fix corrupt characters in description string and add parameter descriptions 2012-01-18 11:08 reklov_w * src/modules_io/grid/io_grid_image/MLB_Interface.cpp, src/modules_io/grid/io_grid_image/grid_export.cpp: io_grid_image: fix duplicate image handlers 2012-01-18 09:57 reklov_w * src/saga_core/saga_cmd/module_library.cpp: saga_cmd: fix parameter setting of cmd line parser in case of strings 2012-01-16 15:46 reklov_w * src/saga_core/saga_cmd/callback.cpp: saga_cmd: fix corrupt message output (callbacks) 2012-01-15 19:05 reklov_w * src/saga_core/saga_api/api_core.cpp, src/saga_core/saga_api/api_core.h, src/saga_core/saga_cmd/saga_cmd.cpp, src/saga_core/saga_gui/wksp_module_manager.cpp: saga_api, saga_gui, saga_cmd: implementation of methods to set and get the MAX_NUM_THREADS to use with OMP in saga_api, module library settings in saga_gui and flag for saga_cmd 2012-01-12 15:29 oconrad * src/saga_core/saga_api/parameter.cpp: saga_api, parameter: copying enabled flag on assign() 2012-01-12 15:27 oconrad * src/modules_images/modules_imagery/imagery_classification/classify_supervised.cpp, src/modules_images/modules_imagery/imagery_classification/classify_supervised.h, src/saga_core/saga_api/mat_tools.cpp, src/saga_core/saga_api/mat_tools.h: saga_api, module: supervised classification for grids 2012-01-12 12:25 oconrad * src/saga_core/saga_api/mat_tools.cpp, src/saga_core/saga_api/mat_tools.h: saga_api: new class added for supervised data classification 2012-01-11 21:48 manfred-e * src/modules_io/grid/io_grid_image/grid_export.cpp: modules: io_grid_images: increased precision for coordinates in word files and kml files; fixes accuray problem with lat/long projection in combination with high resolution grids 2012-01-10 09:19 oconrad * src/saga_core/saga_api/mat_regression_multiple.cpp: saga_api, multiple regression: backward regression used a (slightly) wrong degree of freedom 2012-01-09 14:37 oconrad * src/saga_core/saga_api/mat_regression_multiple.cpp: saga_api, multiple regression: backward regression used a (slightly) wrong degree of freedom 2012-01-06 13:42 reklov_w * src/saga_core/saga_api/parameters.h: saga_api, parameters.h: revert rev1284 (include of stdint.h causes serious problems under windows, redefining integer types), and, as problematic method Set_Value(int Value) is not used at all, simply remove it 2012-01-05 22:54 manfred-e * src/modules/grid/grid_gridding/Shapes2Grid.cpp, src/modules/shapes/shapes_grid/Grid_Polygon_Clip.cpp, src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.cpp: modules: shapes_grid, grid_gridding: fix for missing last column in result grids 2012-01-05 14:29 oconrad * src/modules_contrib/garden/garden_webservices/garden_webservices.vcxproj: garden_webservices: compiling mswvc x64 targets (fixed) 2012-01-05 14:08 oconrad * src/saga_core/saga_api/module.cpp, src/saga_core/saga_api/parameter.cpp, src/saga_core/saga_api/parameter_data.cpp, src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_api/parameters.h: saga_api, parameters: bug fix, creating optional output data 2012-01-04 15:32 oconrad * src/modules/shapes/shapes_polygons/Polygon_Union.cpp: module, polygon dissolve: bug fix (dissolve all) 2012-01-04 14:53 oconrad * src/saga_core/saga_api/parameters.cpp: saga_api, module/parameters: input check depends on how module is managed 2012-01-04 14:52 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp, src/saga_core/saga_api/table.cpp: saga_api, table: don't allow empty field names 2012-01-04 13:54 oconrad * src/saga_core/saga_gui/parameters_properties.cpp, src/saga_core/saga_gui/wksp_module_manager.cpp: saga_gui: combobox (propertygrid) assertion removed, wx to saga string conversion 2012-01-04 11:18 reklov_w * src/saga_core/saga_cmd/saga_cmd.cpp, src/saga_core/saga_gui/saga.cpp: SAGA GUI, SAGA CMD: set LC_NUMERIC locale to C in order to assure . as decimal separator in string operations 2012-01-04 10:59 oconrad * src/saga_core/saga_gui/wksp_data_manager.cpp, src/saga_core/saga_gui/wksp_data_menu_file.cpp: saga_gui: recent files menu (bug fix) 2012-01-04 10:46 oconrad * src/saga_core/saga_api/grid_memory.cpp, src/saga_core/saga_api/module.cpp, src/saga_core/saga_api/parameters.cpp: saga_api: prevent modules to crash on grid memory allocation failure 2012-01-03 10:59 manfred-e * src/saga_core/saga_cmd/Makefile.am: saga_cmd: fix default search path for module libraries on linux 2012-01-03 10:49 manfred-e * src/saga_core/saga_api/parameters.h: saga_api: gcc warning int-to-pointer-cast 2012-01-02 16:01 oconrad * src/saga_core/saga_gui/callback.cpp, src/saga_core/saga_gui/project.cpp, src/saga_core/saga_gui/project.h, src/saga_core/saga_gui/view_map_3d_image.cpp, src/saga_core/saga_gui/view_map_3d_image.h, src/saga_core/saga_gui/view_table_control.cpp, src/saga_core/saga_gui/view_table_control.h, src/saga_core/saga_gui/wksp.cpp, src/saga_core/saga_gui/wksp.h, src/saga_core/saga_gui/wksp_data_layers.cpp, src/saga_core/saga_gui/wksp_data_layers.h, src/saga_core/saga_gui/wksp_data_manager.cpp, src/saga_core/saga_gui/wksp_data_manager.h, src/saga_core/saga_gui/wksp_data_menu_file.cpp, src/saga_core/saga_gui/wksp_data_menu_file.h, src/saga_core/saga_gui/wksp_grid_manager.cpp, src/saga_core/saga_gui/wksp_grid_manager.h, src/saga_core/saga_gui/wksp_map_buttons.cpp, src/saga_core/saga_gui/wksp_map_buttons.h, src/saga_core/saga_gui/wksp_module.cpp, src/saga_core/saga_gui/wksp_module.h, src/saga_core/saga_gui/wksp_module_manager.cpp, src/saga_core/saga_gui/wksp_module_manager.h, src/saga_core/saga_gui/wksp_pointcloud_manager.cpp, src/saga_core/saga_gui/wksp_pointcloud_manager.h, src/saga_core/saga_gui/wksp_shapes_manager.cpp, src/saga_core/saga_gui/wksp_shapes_manager.h, src/saga_core/saga_gui/wksp_table_manager.cpp, src/saga_core/saga_gui/wksp_table_manager.h, src/saga_core/saga_gui/wksp_tin_manager.cpp, src/saga_core/saga_gui/wksp_tin_manager.h: saga_gui: string issues 2011-12-29 17:13 manfred-e * src/modules_images/modules_vigra/vigra/vigra_distance.cpp, src/modules_images/modules_vigra/vigra/vigra_edges.cpp, src/modules_images/modules_vigra/vigra/vigra_fft.cpp, src/modules_images/modules_vigra/vigra/vigra_morphology.cpp, src/modules_images/modules_vigra/vigra/vigra_smoothing.cpp, src/modules_images/modules_vigra/vigra/vigra_watershed.cpp: modules: vigra: fix wx2.9 string issues (linux) 2011-12-27 13:10 reklov_w * src/modules_io/db/io_odbc/table.cpp: io_odbc: fix warning 'taking address of temporary' 2011-12-27 12:53 reklov_w * src/modules_contrib/garden/garden_webservices/wms_import.cpp: garden_webservices, wms import: fix wx2.9 string issues (warning: taking address of temporary) 2011-12-27 12:46 reklov_w * src/saga_core/saga_gui/helper.cpp, src/saga_core/saga_gui/parameters_control.cpp, src/saga_core/saga_gui/parameters_properties.cpp, src/saga_core/saga_gui/project.cpp, src/saga_core/saga_gui/view_histogram.cpp, src/saga_core/saga_gui/view_table_control.cpp, src/saga_core/saga_gui/wksp_base_control.cpp, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_map.cpp: saga_gui: fix wx2.9 string issues (warning: taking address of temporary) 2011-12-27 11:59 reklov_w * src/saga_core/saga_cmd/module_library.cpp, src/saga_core/saga_cmd/saga_cmd.cpp: saga_cmd: fix wx2.9 string issues (warning: taking address of temporary, warning: cannot pass objects of non-POD type ... call will abort at runtime) 2011-12-22 15:48 reklov_w * Makefile.am, configure.in, src/dev_tools/Makefile.am, src/modules/grid/grid_analysis/Makefile.am, src/modules/grid/grid_calculus/Makefile.am, src/modules/grid/grid_calculus_bsl/Makefile.am, src/modules/grid/grid_filter/Makefile.am, src/modules/grid/grid_gridding/Makefile.am, src/modules/grid/grid_spline/Makefile.am, src/modules/grid/grid_tools/Makefile.am, src/modules/grid/grid_visualisation/Makefile.am, src/modules/pointcloud/pointcloud_tools/Makefile.am, src/modules/pointcloud/pointcloud_viewer/Makefile.am, src/modules/shapes/shapes_grid/Makefile.am, src/modules/shapes/shapes_lines/Makefile.am, src/modules/shapes/shapes_lines_ex/Makefile.am, src/modules/shapes/shapes_points/Makefile.am, src/modules/shapes/shapes_polygons/Makefile.am, src/modules/shapes/shapes_tools/Makefile.am, src/modules/shapes/shapes_transect/Makefile.am, src/modules/table/table_calculus/Makefile.am, src/modules/table/table_tools/Makefile.am, src/modules/tin/tin_tools/Makefile.am, src/modules/tin/tin_viewer/Makefile.am, src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile.am, src/modules_contrib/contrib_s_liersch/ihacres/Makefile.am, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/Makefile.am, src/modules_contrib/garden/garden_3d_viewer/Makefile.am, src/modules_contrib/garden/garden_webservices/Makefile.am, src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile.am, src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile.am, src/modules_geostatistics/geostatistics/geostatistics_points/Makefile.am, src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.am, src/modules_images/modules_imagery/imagery_classification/Makefile.am, src/modules_images/modules_imagery/imagery_rga/Makefile.am, src/modules_images/modules_imagery/imagery_segmentation/Makefile.am, src/modules_images/modules_imagery/imagery_tools/Makefile.am, src/modules_images/modules_opencv/opencv/Makefile.am, src/modules_images/modules_vigra/vigra/Makefile.am, src/modules_io/db/io_db_mysql/Makefile.am, src/modules_io/db/io_odbc/Makefile.am, src/modules_io/docs/docs_html/Makefile.am, src/modules_io/docs/docs_pdf/Makefile.am, src/modules_io/esri_e00/io_esri_e00/Makefile.am, src/modules_io/gdal/io_gdal/Makefile.am, src/modules_io/gps/io_gps/Makefile.am, src/modules_io/grid/io_grid/Makefile.am, src/modules_io/grid/io_grid_grib2/Makefile.am, src/modules_io/grid/io_grid_image/Makefile.am, src/modules_io/shapes/io_shapes/Makefile.am, src/modules_io/shapes/io_shapes_dxf/Makefile.am, src/modules_io/shapes/io_shapes_las/Makefile.am, src/modules_io/table/io_table/Makefile.am, src/modules_lectures/lectures/lectures_introduction/Makefile.am, src/modules_projection/pj_georeference/pj_georeference/Makefile.am, src/modules_projection/pj_geotrans/pj_geotrans/Makefile.am, src/modules_projection/pj_proj4/pj_proj4/Makefile.am, src/modules_recreations/recreations/recreations_fractals/Makefile.am, src/modules_recreations/recreations/recreations_games/Makefile.am, src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile.am, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile.am, src/modules_simulation/fire/sim_fire_spreading/Makefile.am, src/modules_simulation/hydrology/sim_hydrology/Makefile.am, src/modules_template/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile.am, src/saga_core/saga_api/Makefile.am, src/saga_core/saga_cmd/Makefile.am, src/saga_core/saga_gdi/Makefile.am, src/saga_core/saga_gui/Makefile.am, src/saga_core/saga_odbc/Makefile.am: implement --enable-openmp configuration in autobuild system 2011-12-22 12:15 oconrad * src/saga_core/saga_gui/parameters_control.cpp: saga_gui, parameters_control: hide/show - enable/disable bug fix 2011-12-22 11:42 oconrad * src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_gui/parameters_control.cpp, src/saga_core/saga_gui/view_scatterplot.cpp: saga_gui: grid/scatter plot, improved target selection (points/grid) 2011-12-22 11:41 oconrad * src/saga_core/saga_gui/dc_helper.h, src/saga_core/saga_gui/wksp_grid.cpp: saga_gui: labeling (map, raster data) with 'boundary effect' 2011-12-22 08:52 oconrad * src/saga_core/saga_api/mat_regression_multiple.cpp: saga_api, multiple regression analysis: bug fix (backward/stepwise) 2011-12-21 11:57 reklov_w * src/modules/pointcloud/pointcloud_tools/pointcloud_tools.vcxproj, src/modules/pointcloud/pointcloud_viewer/pointcloud_viewer.vcxproj, src/modules/tin/tin_viewer/tin_viewer.vcxproj, src/modules_contrib/garden/garden_3d_viewer/garden_3d_viewer.vcxproj, src/modules_contrib/garden/garden_webservices/garden_webservices.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_kriging/geostatistics_kriging.vcxproj, src/modules_io/grid/io_grid_image/io_grid_image.vcxproj, src/modules_io/shapes/io_shapes/io_shapes.vcxproj, src/modules_io/shapes/io_shapes_las/io_shapes_las.vcxproj, src/saga_core/saga_api/saga_api.vcxproj, src/saga_core/saga_cmd/saga_cmd.vcxproj, src/saga_core/saga_gdi/saga_gdi.vcxproj, src/saga_core/saga_gui/saga_gui.vcxproj, src/saga_core/saga_odbc/saga_odbc.vcxproj: fix vcxproj files to compile unicode debug target with wx 2.9 2011-12-21 11:08 reklov_w * src/saga_core/saga_gui/Makefile.am: saga_gui: fix wx libs linking in Makefile.am 2011-12-21 09:15 oconrad * src/saga_core/saga_gui/dc_helper.cpp, src/saga_core/saga_gui/wksp_shapes.cpp, src/saga_core/saga_gui/wksp_shapes.h, src/saga_core/saga_gui/wksp_shapes_line.cpp, src/saga_core/saga_gui/wksp_shapes_point.cpp, src/saga_core/saga_gui/wksp_shapes_points.cpp, src/saga_core/saga_gui/wksp_shapes_polygon.cpp: saga_gui: labeling (map, vector data) with 'boundary effect' 2011-12-21 09:13 oconrad * src/saga_core/saga_api/api_core.h, src/saga_core/saga_api/parameters.cpp: saga 2.1: linux build with wxWidgets 2.9 2011-12-20 20:35 reklov_w * src/modules_contrib/garden/garden_webservices/wms_import.cpp, src/saga_core/saga_gui/wksp_base_control.cpp: saga_gui, wms_import: fix no matching function for call to ‘const wxScopedWCharBuffer’ 2011-12-20 20:17 reklov_w * README: updating README for current state of trunk (2.0.9) 2011-12-20 16:29 oconrad * src/saga_core/saga_gui/dc_helper.cpp, src/saga_core/saga_gui/dc_helper.h: saga_gui: draw_text with boundary effect 2011-12-20 16:12 oconrad * src/saga_core/saga_api/api_core.h, src/saga_core/saga_api/metadata.cpp, src/saga_core/saga_api/parameter_data.cpp, src/saga_core/saga_cmd/saga_cmd.cpp, src/saga_core/saga_gui/Makefile.am, src/saga_core/saga_gui/helper.cpp, src/saga_core/saga_gui/view_histogram.cpp, src/saga_core/saga_gui/view_table_control.cpp, src/saga_core/saga_gui/wksp_shapes_point.cpp, src/saga_core/saga_odbc/saga_odbc.cpp: enabling saga 2.1 linux build with wxWidgets 2.9 remaining issues: - toolbar buttons (don't send message) - makefile (enabling openmp support) 2011-12-19 15:44 oconrad * src/saga_core/saga_api/mat_regression_multiple.cpp, src/saga_core/saga_api/mat_tools.h, src/saga_core/saga_api/shapes_ogis.cpp: saga_api, multiple regression analysis: bug fix (backward/stepwise) 2011-12-16 15:12 oconrad * src/modules_contrib/contrib_s_liersch/ihacres/ihacres_basin.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_cal.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_v1.cpp, src/modules_io/db/io_odbc/io_odbc.vcxproj, src/modules_io/db/io_odbc/table.cpp, src/modules_io/docs/docs_html/svg_interactive_map.cpp, src/modules_io/docs/docs_html/svg_interactive_map.h, src/modules_io/docs/docs_pdf/doc_pdf.cpp, src/modules_io/docs/docs_pdf/doc_pdf.h, src/modules_io/gdal/io_gdal/gdal_driver.cpp, src/modules_io/gdal/io_gdal/ogr_driver.cpp, src/modules_io/grid/io_grid/esri_arcinfo.cpp, src/modules_io/shapes/io_shapes_las/las_info.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_transform.cpp, src/saga_core/saga_api/api_colors.cpp, src/saga_core/saga_api/api_core.h, src/saga_core/saga_api/api_file.cpp, src/saga_core/saga_api/api_memory.cpp, src/saga_core/saga_api/api_string.cpp, src/saga_core/saga_api/grid_io.cpp, src/saga_core/saga_api/metadata.cpp, src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_api/saga_api.h, src/saga_core/saga_api/shapes_io.cpp, src/saga_core/saga_api/table.h, src/saga_core/saga_api/table_dbase.cpp, src/saga_core/saga_api/table_io.cpp, src/saga_core/saga_api/table_record.cpp, src/saga_core/saga_api/table_value.h, src/saga_core/saga_cmd/module_library.cpp, src/saga_core/saga_gui/callback.cpp, src/saga_core/saga_gui/dlg_about.cpp, src/saga_core/saga_gui/parameters_control.cpp, src/saga_core/saga_gui/parameters_properties.cpp, src/saga_core/saga_gui/view_histogram.cpp, src/saga_core/saga_gui/view_table_control.cpp, src/saga_core/saga_gui/wksp_base_control.cpp, src/saga_core/saga_gui/wksp_layer_classify.cpp, src/saga_core/saga_odbc/saga_odbc.cpp: linux/wxstring related changes 2011-12-15 16:00 oconrad * src/saga_core/saga_api/mat_regression_multiple.cpp: saga_api, multiple regression analysis: bug fix (f-test, precise significance) 2011-12-15 15:57 oconrad * src/saga_core/saga_api/grid_operation.cpp: saga_api, grid resampling: parallel processing support 2011-12-15 15:56 oconrad * src/saga_core/saga_gui/view_scatterplot.cpp, src/saga_core/saga_gui/view_scatterplot.h, src/saga_core/saga_gui/wksp_base_control.cpp: saga_gui, scatter plot: enhanced visualization options 2011-12-15 15:55 oconrad * src/saga_core/saga_api/saga_api.vcxproj, src/saga_core/saga_cmd/saga_cmd.vcxproj, src/saga_core/saga_gdi/saga_gdi.vcxproj, src/saga_core/saga_gui/saga_gui.vcxproj: saga_core projects: open mp flags and wx2.9 dependencies updated for all targets 2011-12-15 15:51 oconrad * src/saga_core/saga_gui/res/saga.ico, src/saga_core/saga_gui/res/xpm/saga_icon_16.xpm, src/saga_core/saga_gui/res/xpm/saga_icon_32.xpm: saga_gui: icon changed 2011-12-15 15:48 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.cpp: saga wetness index: optimizations and parallel processing support 2011-12-15 15:47 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tpi.cpp: convergence index, relative heights, topographic position index: optimizations and parallel processing support 2011-12-15 15:44 oconrad * src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp: multiple regression (points/grids): bug fix (include coordinates) 2011-12-15 15:43 oconrad * src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.h: principle components analysis: bug fix and inverse transformation added 2011-12-15 15:41 oconrad * src/modules_images/modules_imagery/imagery_tools/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_tools/Makefile.am, src/modules_images/modules_imagery/imagery_tools/evi.cpp, src/modules_images/modules_imagery/imagery_tools/evi.h, src/modules_images/modules_imagery/imagery_tools/imagery_tools.vcxproj, src/modules_images/modules_imagery/imagery_tools/imagery_tools.vcxproj.filters, src/modules_images/modules_imagery/imagery_tools/pansharpening.cpp, src/modules_images/modules_imagery/imagery_tools/pansharpening.h, src/modules_images/modules_imagery/imagery_tools/tasseled_cap.cpp, src/modules_images/modules_imagery/imagery_tools/tasseled_cap.h: imagery_tools: vegetation indices and pansharpening reworked and added 2011-12-02 16:02 oconrad * src/modules/grid/grid_gridding/Interpolation.cpp, src/modules/grid/grid_spline/Gridding_Spline_Base.cpp, src/modules/grid/grid_tools/Grid_Value_Type.cpp, src/modules/pointcloud/pointcloud_tools/pointcloud_tools.vcxproj, src/modules_contrib/garden/garden_webservices/wms_import.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/grid_multi_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.cpp, src/modules_images/modules_imagery/imagery_classification/decision_tree.cpp, src/saga_core/saga_api/api_callback.cpp, src/saga_core/saga_api/api_core.h, src/saga_core/saga_api/api_file.cpp, src/saga_core/saga_api/api_string.cpp, src/saga_core/saga_api/dataobject.cpp, src/saga_core/saga_api/module.cpp, src/saga_core/saga_api/module_library.cpp, src/saga_core/saga_api/module_library.h, src/saga_core/saga_api/parameter_data.cpp, src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_api/parameters.h, src/saga_core/saga_api/table_io.cpp, src/saga_core/saga_cmd/module_library.cpp, src/saga_core/saga_cmd/saga_cmd.cpp, src/saga_core/saga_gui/Makefile.am, src/saga_core/saga_gui/callback.cpp, src/saga_core/saga_gui/dlg_colors.cpp, src/saga_core/saga_gui/helper.cpp, src/saga_core/saga_gui/info_messages.cpp, src/saga_core/saga_gui/parameters_control.cpp, src/saga_core/saga_gui/parameters_properties.cpp, src/saga_core/saga_gui/project.cpp, src/saga_core/saga_gui/res_commands.cpp, src/saga_core/saga_gui/res_commands.h, src/saga_core/saga_gui/saga.cpp, src/saga_core/saga_gui/view_histogram.cpp, src/saga_core/saga_gui/view_map_control.cpp, src/saga_core/saga_gui/view_scatterplot.cpp, src/saga_core/saga_gui/view_scatterplot.h, src/saga_core/saga_gui/wksp_base_control.cpp, src/saga_core/saga_gui/wksp_data_manager.cpp, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_layer.cpp, src/saga_core/saga_gui/wksp_map.cpp, src/saga_core/saga_gui/wksp_module.cpp, src/saga_core/saga_gui/wksp_module_manager.cpp, src/saga_core/saga_gui/wksp_module_manager.h, src/saga_core/saga_gui/wksp_table.cpp, src/saga_core/saga_odbc/saga_odbc.cpp: enabling saga 2.1 linux build with wxWidgets 2.9 some remaining issues: - csg_string::format/printf (unicode problem?) - toolbar buttons (don't send message) - makefile (enabling openmp support) 2011-11-25 13:42 oconrad * src/dev_tools/MLB_Interface.cpp, src/dev_tools/tl_extract.h, src/dev_tools/tl_merge.h, src/dev_tools/tl_union.h, src/modules/grid/grid_analysis/Cost_Anisotropic.h, src/modules/grid/grid_analysis/Cost_Isotropic.h, src/modules/grid/grid_analysis/LeastCostPathProfile.h, src/modules/grid/grid_analysis/LeastCostPathProfile_Points.h, src/modules/grid/grid_analysis/MLB_Interface.cpp, src/modules/grid/grid_analysis/Soil_Texture.h, src/modules/grid/grid_analysis/fragmentation_base.h, src/modules/grid/grid_analysis/grid_analysis.vcxproj, src/modules/grid/grid_calculus/Fuzzify.h, src/modules/grid/grid_calculus/FuzzyAND.h, src/modules/grid/grid_calculus/FuzzyOR.h, src/modules/grid/grid_calculus/Grid_Geometric_Figures.h, src/modules/grid/grid_calculus/Grid_Plotter.h, src/modules/grid/grid_calculus/Grid_Random_Field.h, src/modules/grid/grid_calculus/Grid_Random_Terrain.h, src/modules/grid/grid_calculus/MLB_Interface.cpp, src/modules/grid/grid_calculus/gradient_cartes_polar.h, src/modules/grid/grid_calculus/grid_calculus.vcxproj, src/modules/grid/grid_calculus/grid_metric_conversion.h, src/modules/grid/grid_calculus_bsl/MLB_Interface.cpp, src/modules/grid/grid_calculus_bsl/grid_calculus_bsl.vcxproj, src/modules/grid/grid_filter/MLB_Interface.cpp, src/modules/grid/grid_filter/grid_filter.vcxproj, src/modules/grid/grid_gridding/Interpolation.h, src/modules/grid/grid_gridding/MLB_Interface.cpp, src/modules/grid/grid_gridding/grid_gridding.vcxproj, src/modules/grid/grid_spline/Gridding_Spline_Base.h, src/modules/grid/grid_spline/MLB_Interface.cpp, src/modules/grid/grid_spline/grid_spline.vcxproj, src/modules/grid/grid_tools/CreateGridSystem.h, src/modules/grid/grid_tools/Grid_Aggregate.h, src/modules/grid/grid_tools/Grid_Buffer.h, src/modules/grid/grid_tools/Grid_Buffer_Proximity.h, src/modules/grid/grid_tools/Grid_Completion.h, src/modules/grid/grid_tools/Grid_ConstantGrid.h, src/modules/grid/grid_tools/Grid_CropToData.h, src/modules/grid/grid_tools/Grid_Cut.h, src/modules/grid/grid_tools/Grid_Fill.h, src/modules/grid/grid_tools/Grid_Gaps.h, src/modules/grid/grid_tools/Grid_Gaps_OneCell.h, src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.h, src/modules/grid/grid_tools/Grid_Mask.h, src/modules/grid/grid_tools/Grid_Merge.h, src/modules/grid/grid_tools/Grid_Proximity.h, src/modules/grid/grid_tools/Grid_Resample.h, src/modules/grid/grid_tools/Grid_ThresholdBuffer.h, src/modules/grid/grid_tools/Grid_Tiling.h, src/modules/grid/grid_tools/Grid_Value_Reclassify.h, src/modules/grid/grid_tools/Grid_Value_Replace.h, src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h, src/modules/grid/grid_tools/Grid_Value_Request.h, src/modules/grid/grid_tools/Grid_Value_Type.h, src/modules/grid/grid_tools/GridsFromTableAndGrid.h, src/modules/grid/grid_tools/MLB_Interface.cpp, src/modules/grid/grid_tools/grid_tools.vcxproj, src/modules/grid/grid_visualisation/MLB_Interface.cpp, src/modules/grid/grid_visualisation/grid_visualisation.vcxproj, src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp, src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.h, src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.cpp, src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.h, src/modules/pointcloud/pointcloud_tools/pc_cut.h, src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.h, src/modules/pointcloud/pointcloud_tools/pc_from_grid.h, src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h, src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h, src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.h, src/modules/pointcloud/pointcloud_tools/pc_to_grid.h, src/modules/pointcloud/pointcloud_tools/pc_to_shapes.h, src/modules/pointcloud/pointcloud_tools/pc_transform.h, src/modules/pointcloud/pointcloud_tools/pointcloud_tools.vcxproj, src/modules/pointcloud/pointcloud_viewer/MLB_Interface.cpp, src/modules/pointcloud/pointcloud_viewer/pointcloud_viewer.vcxproj, src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp, src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.h, src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h, src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.h, src/modules/shapes/shapes_grid/Grid_To_Contour.h, src/modules/shapes/shapes_grid/Grid_To_Gradient.h, src/modules/shapes/shapes_grid/Grid_To_Points.h, src/modules/shapes/shapes_grid/Grid_To_Points_Random.h, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.h, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.h, src/modules/shapes/shapes_grid/MLB_Interface.cpp, src/modules/shapes/shapes_grid/grid_extent.h, src/modules/shapes/shapes_grid/grid_local_extremes_to_points.h, src/modules/shapes/shapes_grid/shapes_grid.vcxproj, src/modules/shapes/shapes_lines/Lines_From_Points.h, src/modules/shapes/shapes_lines/Lines_From_Polygons.h, src/modules/shapes/shapes_lines/MLB_Interface.cpp, src/modules/shapes/shapes_lines/shapes_lines.vcxproj, src/modules/shapes/shapes_lines_ex/MLB_Interface.cpp, src/modules/shapes/shapes_points/MLB_Interface.cpp, src/modules/shapes/shapes_points/Points_From_Lines.h, src/modules/shapes/shapes_points/Points_From_Table.h, src/modules/shapes/shapes_points/convex_hull.h, src/modules/shapes/shapes_points/gps_track_aggregation.h, src/modules/shapes/shapes_points/select_points.h, src/modules/shapes/shapes_points/shapes_points.vcxproj, src/modules/shapes/shapes_polygons/MLB_Interface.cpp, src/modules/shapes/shapes_polygons/Polygons_From_Lines.h, src/modules/shapes/shapes_polygons/polygon_to_points.h, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj, src/modules/shapes/shapes_tools/MLB_Interface.cpp, src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h, src/modules/shapes/shapes_tools/QueryBuilder.h, src/modules/shapes/shapes_tools/SearchInTable.h, src/modules/shapes/shapes_tools/SelectByTheme.h, src/modules/shapes/shapes_tools/SeparateShapes.h, src/modules/shapes/shapes_tools/Shapes_Create_Empty.h, src/modules/shapes/shapes_tools/Shapes_Merge.h, src/modules/shapes/shapes_tools/shapes_cut.h, src/modules/shapes/shapes_tools/shapes_cut_interactive.h, src/modules/shapes/shapes_tools/shapes_split.h, src/modules/shapes/shapes_tools/shapes_split_by_attribute.h, src/modules/shapes/shapes_tools/shapes_split_randomly.h, src/modules/shapes/shapes_tools/shapes_tools.vcxproj, src/modules/shapes/shapes_transect/MLB_Interface.cpp, src/modules/shapes/shapes_transect/shapes_transect.vcxproj, src/modules/table/table_calculus/MLB_Interface.cpp, src/modules/table/table_calculus/Table_Calculator.h, src/modules/table/table_calculus/Table_Trend.h, src/modules/table/table_calculus/etp_hargreave.h, src/modules/table/table_calculus/table_calculus.vcxproj, src/modules/table/table_calculus/table_fill_record_gaps.h, src/modules/table/table_tools/Join_Tables.h, src/modules/table/table_tools/MLB_Interface.cpp, src/modules/table/table_tools/Table_Create_Empty.h, src/modules/table/table_tools/table_change_date_format.h, src/modules/table/table_tools/table_tools.vcxproj, src/modules/tin/tin_tools/MLB_Interface.cpp, src/modules/tin/tin_tools/TIN_Flow_Parallel.h, src/modules/tin/tin_tools/TIN_Flow_Trace.h, src/modules/tin/tin_tools/TIN_From_Grid.h, src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.h, src/modules/tin/tin_tools/TIN_From_Shapes.h, src/modules/tin/tin_tools/TIN_Gradient.h, src/modules/tin/tin_tools/TIN_To_Shapes.h, src/modules/tin/tin_tools/tin_tools.vcxproj, src/modules/tin/tin_viewer/MLB_Interface.cpp, src/modules/tin/tin_viewer/tin_view_control.cpp, src/modules/tin/tin_viewer/tin_viewer.vcxproj, src/modules_contrib/contrib_a_perego/contrib_a_perego/A1WiTh.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/A2WiTh.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/A3WiTh.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa1.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa2.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/contrib_a_perego.vcxproj, src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping1.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping2.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/directional1.h, src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres.vcxproj, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/MLB_Interface.cpp, src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.cpp, src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.cpp, src/modules_contrib/garden/garden_3d_viewer/garden_3d_viewer.vcxproj, src/modules_contrib/garden/garden_webservices/MLB_Interface.cpp, src/modules_contrib/garden/garden_webservices/garden_webservices.vcxproj, src/modules_contrib/garden/garden_webservices/wms_import.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/geostatistics_grid.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/geostatistics_kriging.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/geostatistics_points.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.vcxproj, src/modules_images/modules_imagery/imagery_classification/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_classification/imagery_classification.vcxproj, src/modules_images/modules_imagery/imagery_rga/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_rga/imagery_rga.vcxproj, src/modules_images/modules_imagery/imagery_segmentation/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_segmentation/imagery_segmentation.vcxproj, src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.cpp, src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.h, src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.cpp, src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.h, src/modules_images/modules_imagery/imagery_tools/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_tools/imagery_tools.vcxproj, src/modules_images/modules_opencv/opencv/MLB_Interface.cpp, src/modules_images/modules_opencv/opencv/opencv.vcxproj, src/modules_images/modules_vigra/vigra/MLB_Interface.cpp, src/modules_images/modules_vigra/vigra/vigra.vcxproj, src/modules_images/modules_vigra/vigra/vigra_fft.h, src/modules_io/db/io_db_mysql/Get_Table.h, src/modules_io/db/io_odbc/MLB_Interface.cpp, src/modules_io/db/io_odbc/io_odbc.vcxproj, src/modules_io/db/io_odbc/pgis_shapes.cpp, src/modules_io/db/io_odbc/pgis_shapes.h, src/modules_io/db/io_odbc/shapes.cpp, src/modules_io/db/io_odbc/shapes.h, src/modules_io/db/io_odbc/table.h, src/modules_io/docs/docs_html/MLB_Interface.cpp, src/modules_io/docs/docs_html/doc_html.cpp, src/modules_io/docs/docs_html/docs_html.vcxproj, src/modules_io/docs/docs_pdf/MLB_Interface.cpp, src/modules_io/docs/docs_pdf/doc_pdf.cpp, src/modules_io/docs/docs_pdf/docs_pdf.vcxproj, src/modules_io/esri_e00/io_esri_e00/MLB_Interface.cpp, src/modules_io/esri_e00/io_esri_e00/io_esri_e00.vcxproj, src/modules_io/gdal/io_gdal/MLB_Interface.cpp, src/modules_io/gdal/io_gdal/io_gdal.vcxproj, src/modules_io/gps/io_gps/MLB_Interface.cpp, src/modules_io/gps/io_gps/io_gps.vcxproj, src/modules_io/grid/io_grid/MLB_Interface.cpp, src/modules_io/grid/io_grid/bmp_export.h, src/modules_io/grid/io_grid/erdas_lan.h, src/modules_io/grid/io_grid/esri_arcinfo.cpp, src/modules_io/grid/io_grid/esri_arcinfo.h, src/modules_io/grid/io_grid/grid_table.h, src/modules_io/grid/io_grid/io_grid.vcxproj, src/modules_io/grid/io_grid/mola.h, src/modules_io/grid/io_grid/raw.h, src/modules_io/grid/io_grid/srtm30.h, src/modules_io/grid/io_grid/surfer.h, src/modules_io/grid/io_grid/usgs_srtm.h, src/modules_io/grid/io_grid/wrf.h, src/modules_io/grid/io_grid/xyz.h, src/modules_io/grid/io_grid_grib2/MLB_Interface.cpp, src/modules_io/grid/io_grid_grib2/grib2_import.h, src/modules_io/grid/io_grid_grib2/io_grid_grib2.vcxproj, src/modules_io/grid/io_grid_image/MLB_Interface.cpp, src/modules_io/grid/io_grid_image/grid_export.h, src/modules_io/grid/io_grid_image/grid_import.h, src/modules_io/grid/io_grid_image/io_grid_image.vcxproj, src/modules_io/shapes/io_shapes/MLB_Interface.cpp, src/modules_io/shapes/io_shapes/atlas_bna.h, src/modules_io/shapes/io_shapes/generate.h, src/modules_io/shapes/io_shapes/gpx.h, src/modules_io/shapes/io_shapes/gstat.h, src/modules_io/shapes/io_shapes/io_shapes.vcxproj, src/modules_io/shapes/io_shapes/pointcloud_from_file.h, src/modules_io/shapes/io_shapes/pointcloud_from_text_file.h, src/modules_io/shapes/io_shapes/pointcloud_to_text_file.cpp, src/modules_io/shapes/io_shapes/pointcloud_to_text_file.h, src/modules_io/shapes/io_shapes/stl.h, src/modules_io/shapes/io_shapes/surfer_bln.h, src/modules_io/shapes/io_shapes/svg.h, src/modules_io/shapes/io_shapes/wasp_map.h, src/modules_io/shapes/io_shapes/xyz.h, src/modules_io/shapes/io_shapes_dxf/MLB_Interface.cpp, src/modules_io/shapes/io_shapes_dxf/dxf_import.h, src/modules_io/shapes/io_shapes_dxf/io_shapes_dxf.vcxproj, src/modules_io/shapes/io_shapes_las/MLB_Interface.cpp, src/modules_io/shapes/io_shapes_las/io_shapes_las.vcxproj, src/modules_io/shapes/io_shapes_las/las_export.h, src/modules_io/shapes/io_shapes_las/las_import.h, src/modules_io/shapes/io_shapes_las/las_info.h, src/modules_io/table/io_table/MLB_Interface.cpp, src/modules_io/table/io_table/io_table.vcxproj, src/modules_io/table/io_table/io_table_txt.h, src/modules_lectures/lectures/lectures_introduction/MLB_Interface.cpp, src/modules_lectures/lectures/lectures_introduction/lectures_introduction.vcxproj, src/modules_projection/pj_georeference/pj_georeference/MLB_Interface.cpp, src/modules_projection/pj_georeference/pj_georeference/pj_georeference.vcxproj, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Grid.h, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Shapes.h, src/modules_projection/pj_geotrans/pj_geotrans/MLB_Interface.cpp, src/modules_projection/pj_geotrans/pj_geotrans/pj_geotrans.vcxproj, src/modules_projection/pj_proj4/pj_proj4/MLB_Interface.cpp, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Grid.h, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Shapes.h, src/modules_projection/pj_proj4/pj_proj4/pj_proj4.vcxproj, src/modules_recreations/recreations/recreations_fractals/MLB_Interface.cpp, src/modules_recreations/recreations/recreations_fractals/recreations_fractals.vcxproj, src/modules_recreations/recreations/recreations_games/MLB_Interface.cpp, src/modules_recreations/recreations/recreations_games/recreations_games.vcxproj, src/modules_simulation/cellular_automata/sim_cellular_automata/MLB_Interface.cpp, src/modules_simulation/cellular_automata/sim_cellular_automata/sim_cellular_automata.vcxproj, src/modules_simulation/ecosystems/sim_ecosystems_hugget/MLB_Interface.cpp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/sim_ecosystems_hugget.vcxproj, src/modules_simulation/fire/sim_fire_spreading/MLB_Interface.cpp, src/modules_simulation/fire/sim_fire_spreading/sim_fire_spreading.vcxproj, src/modules_simulation/hydrology/sim_hydrology/MLB_Interface.cpp, src/modules_simulation/hydrology/sim_hydrology/sim_hydrology.vcxproj, src/modules_template/MLB_Interface.cpp, src/modules_template/My_Module.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ta_channels.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_compound/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_compound/ta_compound.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaDownslope.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFlood.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_massflux.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_width.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_lighting/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/ta_lighting.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/air_flow_height.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mass_balance_index.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ruggedness.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tpi.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/wind_effect.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/ta_preprocessor.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_profiles/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/ta_profiles.vcxproj, src/saga_core/saga_api/api_callback.cpp, src/saga_core/saga_api/api_core.cpp, src/saga_core/saga_api/api_core.h, src/saga_core/saga_api/api_file.cpp, src/saga_core/saga_api/api_string.cpp, src/saga_core/saga_api/api_translator.cpp, src/saga_core/saga_api/dataobject.cpp, src/saga_core/saga_api/dataobject.h, src/saga_core/saga_api/geo_classes.cpp, src/saga_core/saga_api/grid.cpp, src/saga_core/saga_api/grid_io.cpp, src/saga_core/saga_api/grid_memory.cpp, src/saga_core/saga_api/grid_operation.cpp, src/saga_core/saga_api/grid_system.cpp, src/saga_core/saga_api/mat_formula.cpp, src/saga_core/saga_api/mat_regression_multiple.cpp, src/saga_core/saga_api/mat_spline.cpp, src/saga_core/saga_api/mat_tools.cpp, src/saga_core/saga_api/mat_trend.cpp, src/saga_core/saga_api/metadata.cpp, src/saga_core/saga_api/module.cpp, src/saga_core/saga_api/module.h, src/saga_core/saga_api/module_library.cpp, src/saga_core/saga_api/module_library.h, src/saga_core/saga_api/module_library_interface.cpp, src/saga_core/saga_api/parameter.cpp, src/saga_core/saga_api/parameter_data.cpp, src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_api/parameters.h, src/saga_core/saga_api/pointcloud.cpp, src/saga_core/saga_api/pointcloud.h, src/saga_core/saga_api/projections.cpp, src/saga_core/saga_api/saga_api.h, src/saga_core/saga_api/saga_api.vcxproj, src/saga_core/saga_api/shapes.cpp, src/saga_core/saga_api/shapes.h, src/saga_core/saga_api/shapes_io.cpp, src/saga_core/saga_api/table.cpp, src/saga_core/saga_api/table.h, src/saga_core/saga_api/table_io.cpp, src/saga_core/saga_api/tin.cpp, src/saga_core/saga_cmd/callback.cpp, src/saga_core/saga_cmd/module_library.cpp, src/saga_core/saga_cmd/module_library.h, src/saga_core/saga_cmd/saga_cmd.cpp, src/saga_core/saga_cmd/saga_cmd.vcxproj, src/saga_core/saga_gdi/saga_gdi.vcxproj, src/saga_core/saga_gdi/sgdi_diagram.cpp, src/saga_core/saga_gui/active.cpp, src/saga_core/saga_gui/active_attributes.cpp, src/saga_core/saga_gui/active_history.cpp, src/saga_core/saga_gui/active_history.h, src/saga_core/saga_gui/active_legend.cpp, src/saga_core/saga_gui/data_source.cpp, src/saga_core/saga_gui/dc_helper.cpp, src/saga_core/saga_gui/dlg_about.cpp, src/saga_core/saga_gui/dlg_colors.cpp, src/saga_core/saga_gui/dlg_list_grid.cpp, src/saga_core/saga_gui/dlg_parameters.cpp, src/saga_core/saga_gui/helper.cpp, src/saga_core/saga_gui/helper.h, src/saga_core/saga_gui/info.cpp, src/saga_core/saga_gui/info_messages.cpp, src/saga_core/saga_gui/parameters_control.cpp, src/saga_core/saga_gui/parameters_properties.cpp, src/saga_core/saga_gui/parameters_properties.h, src/saga_core/saga_gui/project.cpp, src/saga_core/saga_gui/project.h, src/saga_core/saga_gui/res_commands.cpp, src/saga_core/saga_gui/res_commands.h, src/saga_core/saga_gui/res_controls.cpp, src/saga_core/saga_gui/res_controls.h, src/saga_core/saga_gui/res_dialogs.cpp, src/saga_core/saga_gui/res_dialogs.h, src/saga_core/saga_gui/saga.cpp, src/saga_core/saga_gui/saga_frame.cpp, src/saga_core/saga_gui/saga_frame.h, src/saga_core/saga_gui/saga_gui.vcxproj, src/saga_core/saga_gui/saga_gui.vcxproj.filters, src/saga_core/saga_gui/view_histogram.cpp, src/saga_core/saga_gui/view_layout.cpp, src/saga_core/saga_gui/view_layout_info.cpp, src/saga_core/saga_gui/view_map.cpp, src/saga_core/saga_gui/view_map_3d.cpp, src/saga_core/saga_gui/view_map_3d_image.cpp, src/saga_core/saga_gui/view_map_control.cpp, src/saga_core/saga_gui/view_ruler.cpp, src/saga_core/saga_gui/view_scatterplot.cpp, src/saga_core/saga_gui/view_table.cpp, src/saga_core/saga_gui/view_table_control.cpp, src/saga_core/saga_gui/view_table_diagram.cpp, src/saga_core/saga_gui/wksp.cpp, src/saga_core/saga_gui/wksp_base_control.cpp, src/saga_core/saga_gui/wksp_base_control.h, src/saga_core/saga_gui/wksp_base_item.cpp, src/saga_core/saga_gui/wksp_data_layers.cpp, src/saga_core/saga_gui/wksp_data_manager.cpp, src/saga_core/saga_gui/wksp_data_manager.h, src/saga_core/saga_gui/wksp_data_menu_files.cpp, src/saga_core/saga_gui/wksp_data_menu_files.h, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_grid_manager.cpp, src/saga_core/saga_gui/wksp_grid_system.cpp, src/saga_core/saga_gui/wksp_layer.cpp, src/saga_core/saga_gui/wksp_layer.h, src/saga_core/saga_gui/wksp_layer_classify.cpp, src/saga_core/saga_gui/wksp_map.cpp, src/saga_core/saga_gui/wksp_map_buttons.cpp, src/saga_core/saga_gui/wksp_map_layer.cpp, src/saga_core/saga_gui/wksp_map_manager.cpp, src/saga_core/saga_gui/wksp_module.cpp, src/saga_core/saga_gui/wksp_module.h, src/saga_core/saga_gui/wksp_module_library.cpp, src/saga_core/saga_gui/wksp_module_manager.cpp, src/saga_core/saga_gui/wksp_module_manager.h, src/saga_core/saga_gui/wksp_pointcloud.cpp, src/saga_core/saga_gui/wksp_pointcloud.h, src/saga_core/saga_gui/wksp_pointcloud_manager.cpp, src/saga_core/saga_gui/wksp_shapes.cpp, src/saga_core/saga_gui/wksp_shapes.h, src/saga_core/saga_gui/wksp_shapes_edit.cpp, src/saga_core/saga_gui/wksp_shapes_line.cpp, src/saga_core/saga_gui/wksp_shapes_manager.cpp, src/saga_core/saga_gui/wksp_shapes_point.cpp, src/saga_core/saga_gui/wksp_shapes_polygon.cpp, src/saga_core/saga_gui/wksp_shapes_type.cpp, src/saga_core/saga_gui/wksp_table.cpp, src/saga_core/saga_gui/wksp_table.h, src/saga_core/saga_gui/wksp_table_manager.cpp, src/saga_core/saga_gui/wksp_tin.cpp, src/saga_core/saga_gui/wksp_tin_manager.cpp, src/saga_core/saga_gui/wx, src/saga_core/saga_odbc/saga_odbc.cpp, src/saga_core/saga_odbc/saga_odbc.vcxproj: saga 2.1: upgrade for wxWidgets 3.0 (2.9). 2011-11-24 12:23 oconrad * src/modules/grid/grid_gridding/grid_gridding.vcproj, src/modules/grid/grid_tools/grid_tools.vcproj, src/modules/shapes/shapes_points/shapes_points.vcproj, src/modules/shapes/shapes_polygons/shapes_polygons.vcproj, src/modules/shapes/shapes_tools/shapes_tools.vcproj, src/modules/table/table_calculus/table_calculus.vcproj, src/modules/table/table_tools/table_tools.vcproj, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.vcproj, src/modules_images/modules_imagery/imagery_classification/imagery_classification.vcproj, src/modules_io/docs/docs_pdf/docs_pdf.vcproj, src/modules_io/grid/io_grid/io_grid.vcproj, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.vcproj, src/saga_core/saga_api/saga_api.vcproj, src/saga_core/saga_gui/saga_gui.vcproj: update of msvc9 project files (win32 only) 2011-11-23 18:33 johanvdw * src/saga_core/saga_api/Makefile.am: Remove saga_api_py from dist target 2011-11-23 18:22 oconrad * src/saga_core/saga_gui/res/saga.ger.txt: saga_gui, german translation: update 2011-11-23 18:22 oconrad * src/saga_core/saga_api/saga_api_to_python_win.bat, src/saga_core/saga_api/saga_api_to_python_win.py: saga_api, msw python build: update 2011-11-23 08:49 oconrad * src/saga_core/saga_api/mat_tools.h: saga_api, csg_test_distribution: missing dll export (win) added 2011-11-22 16:21 oconrad * configure.in: linux build: version 2.0.8 2011-11-22 15:44 oconrad * src/saga_core/saga_gui/project.cpp: saga_gui, projects: improved 'save modified...' dialog 2011-11-22 15:14 oconrad * src/saga_core/saga_api/parameter.cpp: saga_api, user defined grid system: fixes 'interpolation problem' reported in user forum http://sourceforge.net/projects/saga-gis/forums/forum/790705/topic/4659827?message=10598261 2011-11-22 15:13 oconrad * src/saga_core/saga_api/shapes_polygons.cpp: saga_api, shapes_polygons: precision of area calculation, bug fixed 2011-11-22 11:17 oconrad * src/modules/grid/grid_analysis/grid_analysis.vcxproj, src/modules/grid/grid_calculus/grid_calculus.vcxproj, src/modules/grid/grid_calculus_bsl/grid_calculus_bsl.vcxproj, src/modules/grid/grid_filter/grid_filter.vcxproj, src/modules/grid/grid_gridding/grid_gridding.vcxproj, src/modules/grid/grid_spline/grid_spline.vcxproj, src/modules/grid/grid_tools/grid_tools.vcxproj, src/modules/grid/grid_visualisation/grid_visualisation.vcxproj, src/modules/pointcloud/pointcloud_tools/pointcloud_tools.vcxproj, src/modules/pointcloud/pointcloud_viewer/pointcloud_viewer.vcxproj, src/modules/shapes/shapes_grid/shapes_grid.vcxproj, src/modules/shapes/shapes_lines/shapes_lines.vcxproj, src/modules/shapes/shapes_lines/shapes_lines.vcxproj.filters, src/modules/shapes/shapes_points/shapes_points.vcxproj, src/modules/shapes/shapes_transect/shapes_transect.vcxproj, src/modules/table/table_calculus/table_calculus.vcxproj, src/modules/table/table_tools/table_tools.vcxproj, src/modules/tin/tin_tools/tin_tools.vcxproj, src/modules/tin/tin_viewer/tin_viewer.vcxproj, src/modules_contrib/contrib_a_perego/contrib_a_perego/contrib_a_perego.vcxproj, src/modules_contrib/contrib_s_liersch/ihacres/ihacres.vcxproj, src/modules_contrib/garden/garden_3d_viewer/garden_3d_viewer.vcxproj, src/modules_contrib/garden/garden_webservices/garden_webservices.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_grid/geostatistics_grid.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_grid/geostatistics_grid.vcxproj.filters, src/modules_geostatistics/geostatistics/geostatistics_kriging/geostatistics_kriging.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_points/geostatistics_points.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.vcxproj, src/modules_images/modules_imagery/imagery_classification/imagery_classification.vcxproj, src/modules_images/modules_imagery/imagery_rga/imagery_rga.vcxproj, src/modules_images/modules_imagery/imagery_segmentation/imagery_segmentation.vcxproj, src/modules_images/modules_imagery/imagery_tools/imagery_tools.vcxproj, src/modules_images/modules_opencv/opencv/opencv.vcxproj, src/modules_images/modules_vigra/vigra/vigra.vcxproj, src/modules_io/db/io_odbc/io_odbc.vcxproj, src/modules_io/docs/docs_html/docs_html.vcxproj, src/modules_io/esri_e00/io_esri_e00/io_esri_e00.vcxproj, src/modules_io/gdal/io_gdal/io_gdal.vcxproj, src/modules_io/gps/io_gps/io_gps.vcxproj, src/modules_io/grid/io_grid/io_grid.vcxproj, src/modules_io/grid/io_grid_grib2/io_grid_grib2.vcxproj, src/modules_io/grid/io_grid_image/io_grid_image.vcxproj, src/modules_io/shapes/io_shapes/io_shapes.vcxproj, src/modules_io/shapes/io_shapes_dxf/io_shapes_dxf.vcxproj, src/modules_io/shapes/io_shapes_las/io_shapes_las.vcxproj, src/modules_io/table/io_table/io_table.vcxproj, src/modules_lectures/lectures/lectures_introduction/lectures_introduction.vcxproj, src/modules_projection/pj_georeference/pj_georeference/pj_georeference.vcxproj, src/modules_projection/pj_geotrans/pj_geotrans/pj_geotrans.vcxproj, src/modules_projection/pj_proj4/pj_proj4/pj_proj4.vcxproj, src/modules_recreations/recreations/recreations_fractals/recreations_fractals.vcxproj, src/modules_recreations/recreations/recreations_games/recreations_games.vcxproj, src/modules_simulation/cellular_automata/sim_cellular_automata/sim_cellular_automata.vcxproj, src/modules_simulation/ecosystems/sim_ecosystems_hugget/sim_ecosystems_hugget.vcxproj, src/modules_simulation/fire/sim_fire_spreading/sim_fire_spreading.vcxproj, src/modules_simulation/hydrology/sim_hydrology/sim_hydrology.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_channels/ta_channels.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_compound/ta_compound.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_lighting/ta_lighting.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/ta_preprocessor.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_profiles/ta_profiles.vcxproj, src/saga_core/saga_cmd/saga_cmd.vcxproj, src/saga_core/saga_gdi/saga_gdi.vcxproj, src/saga_core/saga_gui/saga_gui.vcxproj, src/saga_core/saga_odbc/saga_odbc.vcxproj: vcx project files: parallel compilation enabled for release targets 2011-11-22 11:14 oconrad * src/saga_core/saga_api/grid.cpp: saga_api, grid index creation: bug fix, long array pointer allocated with int size (crashes under linux 64bit) 2011-11-22 11:12 oconrad * src/modules/shapes/shapes_polygons/Makefile.am, src/modules/shapes/shapes_polygons/Polygon_Clipper.cpp, src/modules/shapes/shapes_polygons/Polygon_Clipper.h, src/modules/shapes/shapes_polygons/Polygon_Intersection.cpp, src/modules/shapes/shapes_polygons/Polygon_Union.cpp, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj.filters, src/modules/shapes/shapes_tools/Makefile.am, src/modules/shapes/shapes_tools/Polygon_Clipper.cpp, src/modules/shapes/shapes_tools/Polygon_Clipper.h, src/modules/shapes/shapes_tools/shapes_buffer.cpp, src/modules/shapes/shapes_tools/shapes_tools.vcxproj, src/modules/shapes/shapes_tools/shapes_tools.vcxproj.filters, src/modules_io/docs/docs_pdf/Makefile.am, src/modules_io/docs/docs_pdf/Polygon_Clipper.cpp, src/modules_io/docs/docs_pdf/Polygon_Clipper.h, src/modules_io/docs/docs_pdf/Profile_Cross_Sections.cpp, src/modules_io/docs/docs_pdf/docs_pdf.vcxproj, src/modules_io/docs/docs_pdf/docs_pdf.vcxproj.filters, src/saga_core/saga_api/Makefile.am, src/saga_core/saga_api/clipper.cpp, src/saga_core/saga_api/clipper.hpp, src/saga_core/saga_api/saga_api.vcxproj, src/saga_core/saga_api/saga_api.vcxproj.filters, src/saga_core/saga_api/shapes.h, src/saga_core/saga_api/shapes_polygons.cpp: saga_api, polygon clip modules: alan murta's gpc has been replaced by the free and open source software polygon clipping library 'clipper' (angus johnson, http://sourceforge.net/projects/polyclipping/) 2011-11-18 15:52 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.h: ta_lighting, topographic correction: bug fix (division by zero) and enhancements 2011-11-18 11:14 reklov_w * src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp: RGB Composite module: fix naming of output grid 2011-11-16 10:16 reklov_w * src/saga_core/saga_api/mat_tools.h: saga_api, regression multiple: declaration of Get_R() removed (was not defined and broke python API library (unresolved symbol)) 2011-11-16 09:23 reklov_w * src/saga_core/saga_gui/dlg_list_grid.cpp: saga_gui, grid list dialog: fix crash in case no grid datasets are loaded 2011-11-15 16:28 oconrad * src/saga_core/saga_api/module.h, src/saga_core/saga_api/saga_api.cpp, src/saga_core/saga_api/saga_api.h, src/saga_core/saga_cmd/saga_cmd.cpp, src/saga_core/saga_gui/dlg_about.cpp, src/saga_core/saga_gui/saga.cpp, src/saga_core/saga_gui/saga.h: saga_api, saga_cmd, saga_gui: version update (coming 2.0.8), one single version for these subprojects 2011-11-11 09:23 reklov_w * src/modules_io/shapes/io_shapes/Makefile.am: PC To Textfile (io_shapes): patch of Makefile.am to make the module compile with rev1223 2011-11-11 09:11 reklov_w * src/modules_io/shapes/io_shapes/io_shapes.vcxproj, src/modules_io/shapes/io_shapes/pointcloud_to_text_file.cpp, src/modules_io/shapes/io_shapes/pointcloud_to_text_file.h: PC To Text Files module (io_shapes): patch to make the module working on the command line 2011-11-07 11:42 reklov_w * src/saga_core/saga_cmd/saga_cmd.cpp: saga_cmd: update --help string for new flags 2011-11-07 11:20 reklov_w * src/saga_core/saga_cmd/saga_cmd.cpp: saga_cmd: new argument -v (--version) implemented; prints out version number of saga_cmd and saga api (requested feature on dev-mailing list) 2011-11-07 11:08 reklov_w * src/saga_core/saga_cmd/callback.cpp, src/saga_core/saga_cmd/callback.h, src/saga_core/saga_cmd/saga_cmd.cpp: saga_cmd: introducing quiet flag - no progress output, but messages; allows for better logging of batch processes 2011-11-07 10:33 oconrad * src/saga_core/saga_cmd/callback.cpp: saga_cmd: optimization (speed up) of progress notification 2011-11-07 10:22 reklov_w * src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.cpp: fix rev1216 by changing explicit typecast from CSG_Parameter* to CSG_Grid* 2011-11-07 09:02 oconrad * src/modules/pointcloud/pointcloud_tools/pc_cut.cpp, src/saga_core/saga_cmd/module_library.cpp: saga_cmd: bug fix, loading unused grid system parameters for additional parameter lists 2011-11-05 18:31 reklov_w * src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.cpp: fix 'ambigous call' of overloaded function Set_Parameter() for gcc by explicit typecast to CGS_Parameter* 2011-11-04 10:28 oconrad * src/modules/pointcloud/pointcloud_tools/pc_cut.cpp: pointcloud_tools/cutting: saga_cmd compatibility 2011-11-03 10:22 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.h: ta_channels, vertical_channel_distance: no data support, speed optimisation 2011-11-03 10:21 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.h: ta_channels, d8_flow_analysis: channel segment output as 3d-lines 2011-11-03 10:19 oconrad * src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.cpp: garden_3d_viewer: support for 3d lines 2011-11-03 10:19 oconrad * src/modules/grid/grid_calculus/MLB_Interface.cpp, src/modules/grid/grid_calculus/grid_difference.cpp, src/modules/grid/grid_calculus/grid_difference.h: grid_calculus: bug fix for grids_sum/grids_product; grid_division module added 2011-11-03 10:17 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.cpp, src/saga_core/saga_api/module_library.h: saga_api; module_library: makro for module execution added 2011-11-03 10:16 oconrad * src/saga_core/saga_gui/wksp_shapes.cpp: saga_gui; wksp_shapes: output of extent 2011-10-28 14:34 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp: ta_channels, overland flow distance: bug fix; memory adressing on large data sets 2011-10-28 14:30 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.h: ta_channels, overland flow distance: bug fix; memory adressing on large data sets 2011-10-28 11:54 oconrad * src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.h: geostatistics_kriging: 'logarithmic transformation' option added 2011-10-27 12:56 oconrad * src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.h: variogram_dialog: pair count displayable, prevent to analyze distances greater than maximum distance in data 2011-10-27 12:53 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.h: ta_channels, d8_flow_analysis/vertical distance: minor improvements 2011-10-27 12:52 oconrad * src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.cpp: grid statistics for polygon: 'sum' parameter added 2011-10-26 18:50 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.h: ta_channels, d8 flow analysis: channels now based on strahler order, automated catchment basin delineation added 2011-10-26 16:33 oconrad * configure.in, src/modules_terrain_analysis/terrain_analysis/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile.am, src/saga_core/saga_api/module_library.cpp: saga_api, ta_compound: module_library_manager/linux related fixes 2011-10-25 15:23 oconrad * src/modules_io/gdal/io_gdal/gdal_import.cpp, src/modules_io/gdal/io_gdal/ogr_import.cpp, src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.cpp, src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.cpp, src/saga.vc10.sln, src/saga_core/saga_api/module_library.cpp, src/saga_core/saga_api/module_library.h, src/saga_core/saga_api/parameter_data.cpp, src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_api/parameters.h, src/saga_core/saga_gui/saga_frame.cpp, src/saga_core/saga_gui/wksp_data_manager.cpp, src/saga_core/saga_gui/wksp_module_library.cpp, src/saga_core/saga_gui/wksp_module_library.h, src/saga_core/saga_gui/wksp_module_manager.cpp: saga_api, saga_gui, (ta_compound): module library management moved to saga_api, class saga_api::CSG_Module_Library_Manager, global instance available via saga_api::SG_Get_Module_Libray_Manager(), serious tests recommended 2011-10-21 12:22 oconrad * src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.h, src/saga_core/saga_api/mat_trend.cpp: geostatistics_kriging: enhanced interactive variogram fitting options 2011-10-21 12:21 oconrad * src/saga_core/saga_cmd/module_library.cpp, src/saga_core/saga_cmd/module_library.h: saga_cmd, bug fix: additional parameters have not been set from command line 2011-10-17 18:35 reklov_w * src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.cpp: drop point cloud attribute module: lost commit to fix rev. 1163 2011-10-17 12:34 reklov_w * src/saga_core/saga_gui/helper.h, src/saga_core/saga_gui/wksp_grid.cpp: GUI: grid description now correctly reports number of (noData) cells as long (was int) 2011-10-14 11:29 oconrad * src/modules/grid/grid_calculus/Grid_Calculator.cpp, src/modules/grid/grid_calculus/Grid_Calculator.h, src/modules/table/table_calculus/Table_Calculator.cpp, src/saga_core/saga_api/mat_formula.cpp: grid_calculator: improved error message, different grid systems accessible, addressing via letters (a, b, c, ...) or index (g1, g2, g3, ...) 2011-10-14 11:26 oconrad * src/saga_core/saga_gui/helper.cpp, src/saga_core/saga_gui/helper.h, src/saga_core/saga_gui/wksp_grid.cpp: saga_gui, wksp_grid: human readible memory sizes 2011-10-14 10:51 oconrad * src/saga_core/saga_gui/parameters_properties.cpp: saga_gui, parameter dialog: data lists now show if input/output ('>>', '<<') 2011-10-12 07:53 reklov_w * src/saga_core/saga_cmd/saga_cmd.cpp: fix rev1190 (saga_core: saga_cmd: fixes segfaults with wxgtk 2.8.12) to support wx versions older than 2.8.11 2011-10-11 08:58 oconrad * src/saga_core/saga_api/mat_regression_multiple.cpp: saga_api, multiple linear regression: output of correct variable name when stepping out (stepwise). compatibility with ms excel for coefficients table (tables starting with 'id' are expected to be a 'sylk' table) 2011-10-10 17:53 manfred-e * src/saga_core/saga_cmd/saga_cmd.cpp: saga_core: saga_cmd: fixes segfaults with wxgtk 2.8.12 2011-10-10 13:08 oconrad * src/saga_core/saga_api/api_colors.cpp: saga_api, colors: unicode compatibility for loading ascii coded palette files 2011-10-10 12:38 oconrad * src/modules/shapes/shapes_points/convex_hull.cpp, src/modules/shapes/shapes_points/convex_hull.h: shapes_points, convex hull: minimum bounding rectangle calculation added 2011-10-10 12:37 oconrad * src/modules/grid/grid_calculus/grid_difference.cpp: grid_calculus, sum, product: no data value support 2011-10-10 12:36 oconrad * src/modules/table/table_calculus/Table_Calculator.cpp: table_calculus, calculator: no data value support 2011-10-10 12:35 oconrad * src/modules/table/table_tools/table_change_date_format.cpp: table_tools, change time format: bug fix 2011-10-10 10:21 oconrad * src/saga_core/saga_api/projections.cpp: saga_api: fixes unicode incompatibilities with configuration files 2011-10-10 10:13 reklov_w * src/saga_core/saga_api/projections.cpp: API projections.cpp: fix of fix in rev 1182 - dataset projection files now always written as plain ASCII 2011-10-10 09:01 reklov_w * src/saga_core/saga_api/projections.cpp: API projections.cpp: fix unicode issues - dataset projection files now always written as plain ASCII 2011-10-10 08:59 reklov_w * src/saga_core/saga_api/api_colors.cpp: api_colors.cpp: fix unicode issues - color palette file identifiers now defined as plain ASCII 2011-10-10 07:24 manfred-e * configure.in: fixed bug 3420803: odbc library check 2011-09-30 08:21 oconrad * src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.am, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.vcxproj.filters, src/modules_geostatistics/geostatistics/geostatistics_regression/grid_multi_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/grid_multi_grid_regression.h, src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp: multiple regression for grid/grids added 2011-09-28 16:09 oconrad * src/saga_core/saga_gui/wksp_data_manager.cpp: saga_gui: bug fix in wksp_data_manager::get_dataobject_list(); solves bug item 3390337 http://sourceforge.net/tracker/?func=detail&atid=632652&aid=3390337&group_id=102728 2011-09-28 08:06 oconrad * src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.am, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.vcxproj.filters, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_grid.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_points.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_points.h: geographically weighted regression: bug fix (no data handling), simple version for points added 2011-09-28 08:01 oconrad * src/modules_projection/pj_proj4/pj_proj4/pj_proj4.vcxproj, src/saga_core/saga_api/projections.cpp, src/saga_core/saga_gui/res/saga_dic.txt: proj4 related: getting prepared to version 4.8 (support for 'interrupted goode homolosine' and other) 2011-09-28 07:58 oconrad * src/modules/shapes/shapes_tools/Polygon_Clipper.cpp: shapes_tools, buffer: call to 'exit()' removed; fixes bug item 3412916 https://sourceforge.net/tracker/?func=detail&atid=632652&aid=3412916&group_id=102728 2011-09-23 14:40 oconrad * src/modules_simulation/hydrology/sim_hydrology/topmodel.cpp, src/modules_simulation/hydrology/sim_hydrology/topmodel.h: sim_hydrology, topmodel: flexible field selection for input table 2011-09-23 14:39 oconrad * src/saga_core/saga_api/mat_spline.cpp: saga_api, mat_spline: memory bug fix 2011-09-23 14:38 oconrad * src/modules/table/table_tools/table_change_date_format.cpp: table_tools, change date format: bug fix and julian datum added 2011-09-23 14:37 oconrad * src/modules/table/table_calculus/MLB_Interface.cpp, src/modules/table/table_calculus/Makefile.am, src/modules/table/table_calculus/Table_Calculator.cpp, src/modules/table/table_calculus/etp_hargreave.cpp, src/modules/table/table_calculus/etp_hargreave.h, src/modules/table/table_calculus/table_calculus.vcxproj, src/modules/table/table_calculus/table_calculus.vcxproj.filters, src/modules/table/table_calculus/table_fill_record_gaps.cpp, src/modules/table/table_calculus/table_fill_record_gaps.h: table_calculus, added: pot. daily evapotranspiration after hargreave and distribution to hourly values. simple data gap filling routine 2011-09-21 16:57 oconrad * src/modules/shapes/shapes_points/MLB_Interface.cpp, src/modules/shapes/shapes_points/Makefile.am, src/modules/shapes/shapes_points/gps_track_aggregation.cpp, src/modules/shapes/shapes_points/gps_track_aggregation.h, src/modules/shapes/shapes_points/shapes_points.vcxproj, src/modules/shapes/shapes_points/shapes_points.vcxproj.filters: module for track point aggregation added 2011-09-21 16:56 oconrad * src/modules/table/table_tools/MLB_Interface.cpp, src/modules/table/table_tools/Makefile.am, src/modules/table/table_tools/table_change_date_format.cpp, src/modules/table/table_tools/table_change_date_format.h, src/modules/table/table_tools/table_tools.vcxproj, src/modules/table/table_tools/table_tools.vcxproj.filters, src/saga_core/saga_api/table.cpp, src/saga_core/saga_api/table.h, src/saga_core/saga_api/table_io.cpp, src/saga_core/saga_gui/res_dialogs.cpp, src/saga_core/saga_gui/wksp_data_manager.cpp: api/gui/modules, table related: csg_table minor text import bugs fixed, csv support enhanced, modules for date/time format changing added 2011-09-21 08:47 reklov_w * src/saga_core/saga_gui/wksp_pointcloud.cpp: SAGA GUI: update test of PointCloud NoData values due to API changes in is_NoData() 2011-09-21 08:45 reklov_w * src/saga_core/saga_api/pointcloud.h: SAGA API, pointcloud.h: ATTENTION - isNoData() and Set_NoData() methods now take field number instead of attribute number as input 2011-09-21 07:20 reklov_w * src/modules_io/shapes/io_shapes_las/las_import.cpp, src/modules_io/shapes/io_shapes_las/las_info.cpp: LAS Import and LAS Info modules: fix/implement LAS version check, now unsupported file versions are rejected 2011-09-18 13:29 reklov_w * src/saga_core/saga_gui/wksp_pointcloud.cpp: SAGA GUI: PointCloud attribute's NoData value range is now taken into account when map is drawn 2011-09-16 08:55 reklov_w * src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp, src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h: Point Cloud Reclassifier / Subset Extractor module: bug fix floating field detection, other enhancements (e.g. colorization of output) 2011-09-16 07:38 reklov_w * src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.cpp, src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.h: Drop Point Cloud Attribute module: fix output naming issue and other enhancements 2011-09-15 09:20 manfred-e * src/saga_core/saga_api/Makefile.am: saga_api, python interface: platform specific install path fix 2011-09-15 08:37 reklov_w * src/saga_core/saga_api/mat_regression_multiple.cpp: fix gcc error in mat_regression_multiple.cpp:257: error: operands to ?: have different types ‘const wchar_t*’ and ‘CSG_String’ 2011-09-14 15:11 oconrad * src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.h, src/saga_core/saga_api/mat_matrix.cpp, src/saga_core/saga_api/mat_regression.cpp, src/saga_core/saga_api/mat_regression_multiple.cpp, src/saga_core/saga_api/mat_tools.cpp, src/saga_core/saga_api/mat_tools.h: saga_api, multiple linear regression module: automated predictor selection added (forward, backward, stepwise) 2011-09-14 15:09 oconrad * src/saga_core/saga_api/api_memory.cpp: saga_api, csg_bytes: hex-string conversion bug fixed 2011-09-14 14:55 oconrad * src/saga_core/saga_api/shapes_ogis.cpp: saga_api: shape to well-known-binary conversion bug fixed 2011-09-14 09:38 oconrad * src/saga_core/saga_api/shape_polygon.cpp: saga_api, polygon centroids: precision bug fix 2011-09-14 08:38 manfred-e * src/saga_core/saga_api/Makefile.am: saga API python interface: fixed platform specific install path 2011-09-06 11:32 johanvdw * src/modules/shapes/shapes_polygons/shape_index.cpp: Fix spelling error, closes bug:#3404844 2011-09-03 12:23 johanvdw * src/saga_core/saga_api/Makefile.am: Support make -j when building the python interface 2011-09-01 13:20 oconrad * src/modules_io/grid/io_grid/MLB_Interface.cpp, src/modules_io/grid/io_grid/Makefile.am, src/modules_io/grid/io_grid/io_grid.vcxproj, src/modules_io/grid/io_grid/io_grid.vcxproj.filters, src/modules_io/grid/io_grid/wrf.cpp, src/modules_io/grid/io_grid/wrf.h: io_grid modules added: wrf geogrid import/export (http://www.wrf-model.org) 2011-08-29 13:31 oconrad * src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp: module 'point statistics for polygons': saga_cmd usage enabled (stats obtained for all attributes by default) 2011-08-29 12:36 johanvdw * src/saga_core/saga_api/Makefile.am: Don't include saga_api_wrap.cxx in dist-target 2011-08-29 12:32 reklov_w * src/modules/grid/grid_tools/Grid_Buffer_Proximity.cpp: Grid Proximity Buffer module: bug fix, now module terminates in case the buffer distance is smaller than the grid cell size 2011-08-29 12:26 oconrad * src/modules/grid/grid_tools/Grid_CropToData.cpp, src/modules/grid/grid_tools/Grid_CropToData.h: module 'crop to data': grid list parameter for output added (enables saga_cmd scripting) 2011-08-29 12:18 reklov_w * src/modules/grid/grid_calculus/Grid_Calculator.cpp: Grid Calculator module: add new option to include NoData cells in calculation 2011-08-29 09:40 reklov_w * src/modules_io/table/io_table/io_table_txt.cpp: Import/Export Table: bug fix printf formatting (table export) and fix compiler warnings 2011-08-24 14:13 oconrad * src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.h, src/saga_core/saga_api/mat_regression_multiple.cpp: saga_api & multiple regression module: bug fix and optimisations 2011-08-22 16:01 oconrad * src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.h, src/saga_core/saga_api/mat_regression.cpp, src/saga_core/saga_api/mat_regression_multiple.cpp, src/saga_core/saga_api/mat_tools.cpp, src/saga_core/saga_api/mat_tools.h: saga_api & multiple regression module: adjusted r2 and significance tests for (multiple) regression analysis added 2011-08-04 16:43 manfred-e * src/modules/pointcloud/pointcloud_tools/pc_transform.cpp: point cloud transformation module: added support for 9 parameter transformation 2011-07-29 19:33 reklov_w * src/modules/grid/grid_spline/Gridding_Spline_TPS_Global.cpp, src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.cpp, src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.cpp: grid spline interpolation: fix character coding in source (now description works on linux unicode) 2011-07-29 19:19 reklov_w * src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_01.cpp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_02.cpp: simulation ecosystems hugget: fix string formatting (superscript in description _TW()) and typos 2011-07-29 13:28 reklov_w * src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.cpp: Upslope Area module: now optionally x/y coordinates of a point can be used instead of a grid as target area; feature request https://sourceforge.net/tracker/?func=detail&aid=3379797&group_id=102728&atid=632655 2011-07-27 12:23 reklov_w * src/modules_io/shapes/io_shapes_las/las_import.cpp: las import module: fix datatype of rgb field (now 4byte instead of 8byte integer) 2011-07-21 13:28 reklov_w * src/modules_io/shapes/io_shapes/io_shapes.vcxproj, src/modules_io/shapes/io_shapes/io_shapes.vcxproj.filters: io_shapes vc10 project files: added new module "export point cloud to test file" 2011-07-21 13:21 reklov_w * src/modules_io/shapes/io_shapes/pointcloud_from_file.cpp: renamed module 'import point cloud fom file' to 'import point cloud fom shape file' 2011-07-21 13:18 reklov_w * src/modules_io/shapes/io_shapes/MLB_Interface.cpp, src/modules_io/shapes/io_shapes/Makefile.am, src/modules_io/shapes/io_shapes/pointcloud_to_text_file.cpp, src/modules_io/shapes/io_shapes/pointcloud_to_text_file.h: added new module 'export point cloud to text file' 2011-07-19 20:36 reklov_w * src/modules/tin/Makefile.am, src/modules_contrib/garden/Makefile.am, src/modules_geostatistics/geostatistics/Makefile.am, src/modules_io/db/Makefile.am, src/modules_io/grid/io_grid_grib2/Makefile.am, src/modules_projection/pj_proj4/pj_proj4/Makefile.am, src/saga_core/Makefile.am: applying patches from Ben for the build system: configure flags --disable-gui and --disable-odbc 2011-07-19 20:30 reklov_w * configure.in, src/modules/pointcloud/Makefile.am: applying patches from Ben for the build system: configure flags --disable-gui and --disable-odbc 2011-07-14 10:25 reklov_w * src/saga_core/saga_gui/wksp_pointcloud.cpp: wksp_pointcloud.cpp: change default value aggregation to "highest z" 2011-07-14 10:14 reklov_w * src/saga_core/saga_gui/wksp_shapes_edit.cpp: wksp_shapes_edit.cpp: change svn keyword from "dummyprop" to "Id" 2011-07-14 09:59 reklov_w * src/saga_core/saga_gui/wksp_shapes_edit.cpp: GUI - change text from "save changes" to "apply changes" in edit shapes dialog 2011-07-14 07:45 reklov_w * src/modules_template/MLB_Interface.h: MLB Template: fix EXPORTS definition 2011-07-14 07:42 reklov_w * src/modules/grid/grid_gridding/Interpolation.h, src/modules/grid/grid_gridding/Interpolation_InverseDistance.h, src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.h, src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.h, src/modules/grid/grid_gridding/Interpolation_Shepard.h, src/modules/grid/grid_gridding/Interpolation_Triangulation.h, src/modules/grid/grid_gridding/Shapes2Grid.h, src/modules/grid/grid_gridding/grid_gridding.vcxproj, src/modules/grid/grid_gridding/kernel_density.h: grid_gridding: adding MLB EXPORTS definitions 2011-07-10 17:45 reklov_w * src/modules_template/README.txt, src/modules_template/create_custom_mlb_from_template.sh: script and instructions on how to use the module template on GNU/Linux added 2011-07-07 08:22 oconrad * src/modules_images/modules_imagery/imagery_classification/change_detection.cpp, src/modules_images/modules_imagery/imagery_classification/change_detection.h: module 'change detection': bug fix (class ids) 2011-07-06 15:53 oconrad * src/modules/shapes/shapes_tools/GraticuleBuilder.cpp: shapes_tools; graticule: rectangles with enumerated rows/columns 2011-07-06 15:51 oconrad * src/saga_core/saga_gui/helper.cpp: saga_gui; table control: open webbrowser (instead of searching for a default application) when link to be opened starts with ftp/http (alt + left mouse click) 2011-07-06 09:29 oconrad * src/saga_core/saga_gui/data_source_files.cpp, src/saga_core/saga_gui/data_source_files.h, src/saga_core/saga_gui/res_commands.cpp, src/saga_core/saga_gui/res_commands.h, src/saga_core/saga_gui/res_dialogs.cpp: saga_gui, data source control: context menu (refresh command), module libraries added to default filter 2011-07-06 09:26 oconrad * src/modules/shapes/shapes_points/MLB_Interface.cpp, src/modules/shapes/shapes_points/Makefile.am, src/modules/shapes/shapes_points/shapes_points.vcxproj, src/modules/shapes/shapes_points/shapes_points.vcxproj.filters, src/modules/shapes/shapes_points/thiessen_polygons.cpp, src/modules/shapes/shapes_points/thiessen_polygons.h: module added: create thiessen polygons from points. 2011-07-03 19:00 reklov_w * src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp, src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h: Point Cloud Reclassifier / Subset Extractor module: Parameters enable/disable implemented 2011-07-03 18:19 reklov_w * src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp, src/modules/grid/grid_tools/Grid_Value_Reclassify.h: Reclassify Grid Values module: Parameters enable/disable implemented 2011-06-30 09:19 oconrad * src/saga_core/saga_gui/data_source_files.cpp, src/saga_core/saga_gui/data_source_files.h: saga_gui: data source browser now stays enabled even if no mdi-child is open 2011-06-29 13:32 oconrad * src/saga_core/saga_gui/wksp_data_manager.cpp: saga_gui: try to load graphic formats (bmp, jpg, png, gif) via io_grid_image 2011-06-29 12:13 oconrad * src/saga_core/saga_gui/Makefile.am, src/saga_core/saga_gui/active.cpp, src/saga_core/saga_gui/data_source.cpp, src/saga_core/saga_gui/data_source.h, src/saga_core/saga_gui/data_source_files.cpp, src/saga_core/saga_gui/data_source_files.h, src/saga_core/saga_gui/res_commands.cpp, src/saga_core/saga_gui/res_commands.h, src/saga_core/saga_gui/res_controls.h, src/saga_core/saga_gui/res_dialogs.cpp, src/saga_core/saga_gui/res_dialogs.h, src/saga_core/saga_gui/res_images.cpp, src/saga_core/saga_gui/res_images.h, src/saga_core/saga_gui/saga_frame.cpp, src/saga_core/saga_gui/saga_frame.h, src/saga_core/saga_gui/saga_gui.vcxproj, src/saga_core/saga_gui/saga_gui.vcxproj.filters: saga_gui: data source browser added; currently only support for file system, in future database and internet sources will follow. 2011-06-24 15:02 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.cpp: ta_morphometry: curvature classification: grid name was not set, look-up table added 2011-06-24 14:36 oconrad * src/modules/grid/grid_tools/Grid_Resample.cpp: grid_tools: resampling: 'additional grids' have to be optional 2011-06-24 14:34 oconrad * src/modules_images/modules_imagery/imagery_classification/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_classification/Makefile.am, src/modules_images/modules_imagery/imagery_classification/decision_tree.cpp, src/modules_images/modules_imagery/imagery_classification/decision_tree.h, src/modules_images/modules_imagery/imagery_classification/imagery_classification.vcxproj, src/modules_images/modules_imagery/imagery_classification/imagery_classification.vcxproj.filters: imagery_classification: simple 'decision tree' added 2011-06-24 14:30 oconrad * src/saga_core/saga_api/parameter_data.cpp: saga_api: sub-parameters updates via serializing enabled 2011-06-23 09:20 johanvdw * src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tpi.cpp: Unicode fixes to commit r1107 2011-06-23 07:28 johanvdw * src/saga_core/saga_api/Makefile.am: Revert r1103, doesn't work on opensuse 2011-06-22 13:32 reklov_w * src/modules_template/template: removing unused folders and files from template module 2011-06-22 13:27 reklov_w * src/modules_template/MLB_Interface.cpp, src/modules_template/MLB_Interface.h, src/modules_template/Makefile.am, src/modules_template/My_Module.cpp, src/modules_template/My_Module.h, src/modules_template/Template.sln, src/modules_template/Template.vc10.sln, src/modules_template/Template.vcproj, src/modules_template/Template.vcxproj, src/modules_template/Template.vcxproj.filters: moving files of template module within modules_template 2011-06-22 13:03 reklov_w * src/modules_template/template/template/MLB_Interface.cpp, src/modules_template/template/template/MLB_Interface.h, src/modules_template/template/template/Makefile.am, src/modules_template/template/template/My_Module.cpp, src/modules_template/template/template/My_Module.h, src/modules_template/template/template/Template.cpp, src/modules_template/template/template/Template.h, src/modules_template/template/template/Template.vcproj, src/modules_template/template/template/Template.vcxproj, src/modules_template/template/template/Template.vcxproj.filters: updates for modules_template: MLB name still "Template", module now "My_Module" 2011-06-22 12:37 reklov_w * src/modules_template/template/template/Template.bat: removing Template.bat from module template (was used for MinGW which is not supported anymore) 2011-06-22 11:16 johanvdw * src/modules_io/gdal/io_gdal/gdal_driver.cpp, src/modules_io/gdal/io_gdal/gdal_driver.h, src/modules_io/gdal/io_gdal/gdal_import.cpp: Fix unicode issue while reporting driver name 2011-06-21 14:21 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_morphometry/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.vcxproj.filters, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tpi.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/tpi.h: ta_morphometry, module added: topographic position index (tpi) and tpi based landform classification 2011-06-21 14:18 oconrad * src/saga_core/saga_api/parameters.cpp: saga_api: parameters, on_parameter_changed() call on loading from stream 2011-06-21 14:11 oconrad * src/saga_core/saga_api/grid.h, src/saga_core/saga_api/grid_system.cpp: saga_api: CSG_Grid_Cell_Addressor::Set_Annulus() function added 2011-06-20 20:50 reklov_w * src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp, src/modules/grid/grid_tools/Grid_Shrink_Expand.h, src/modules/grid/grid_tools/MLB_Interface.cpp, src/modules/grid/grid_tools/Makefile.am, src/modules/grid/grid_tools/grid_tools.vcxproj, src/modules/grid/grid_tools/grid_tools.vcxproj.filters: new module Grid_Shrink_Expand added to MLB Grid_Tools 2011-06-19 18:11 johanvdw * src/saga_core/saga_api/Makefile.am: Build API only using base wxwidgets library, without gtk 2011-06-19 18:02 johanvdw * src/saga_core/saga_api/parameters.cpp: Small fix to previous commit for compiling with gcc (please review) 2011-06-17 12:52 oconrad * src/saga_core/saga_api/parameter_data.cpp, src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_api/parameters.h, src/saga_core/saga_api/saga_api.vcxproj, src/saga_core/saga_gui/helper.cpp, src/saga_core/saga_gui/helper.h, src/saga_core/saga_gui/parameters_properties.cpp, src/saga_core/saga_gui/res_dialogs.cpp, src/saga_core/saga_gui/res_dialogs.h, src/saga_core/saga_gui/view_scatterplot.cpp, src/saga_core/saga_gui/view_table_diagram.cpp, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_shapes.cpp: saga_api/saga_gui: parameter_font now stores a metadata string instead of a wxfont object. solves unnecessary lib-deps as discussed in http://sourceforge.net/mailarchive/forum.php?thread_name=4DFB0857.8070907%40faunalia.it&forum_name=saga-gis-developer 2011-06-17 00:47 johanvdw * src/modules_io/db/io_odbc/Makefile.am, src/saga_core/saga_odbc/otlv4.h: Fix building under GCC 4.6 2011-06-16 21:08 johanvdw * src/modules_contrib/garden/garden_webservices/MLB_Interface.cpp, src/modules_contrib/garden/garden_webservices/wms_import.cpp: Unicode fixes 2011-06-16 16:06 oconrad * src/modules/table/table_calculus/MLB_Interface.cpp, src/modules/table/table_calculus/Table_Calculator.cpp, src/modules/table/table_calculus/Table_Calculator.h, src/modules/table/table_calculus/Table_Trend.cpp, src/modules/table/table_calculus/Table_Trend.h, src/modules/table/table_tools/Join_Tables.cpp, src/modules/table/table_tools/Join_Tables.h, src/modules/table/table_tools/MLB_Interface.cpp, src/modules/table/table_tools/Makefile.am, src/modules/table/table_tools/Table_Create_Empty.cpp, src/modules/table/table_tools/Table_Create_Empty.h, src/modules/table/table_tools/Table_Enumerate.cpp, src/modules/table/table_tools/Table_Rotate.cpp, src/modules/table/table_tools/table_tools.vcxproj, src/modules/table/table_tools/table_tools.vcxproj.filters: module libraries table_tools & table_calculus: versions for shapes enhanced, join tables moved/added 2011-06-16 16:04 oconrad * src/modules/shapes/shapes_tools/JoinTables.cpp, src/modules/shapes/shapes_tools/JoinTables.h, src/modules/shapes/shapes_tools/MLB_Interface.cpp, src/modules/shapes/shapes_tools/Makefile.am, src/modules/shapes/shapes_tools/Shapes_Assign_Table.cpp, src/modules/shapes/shapes_tools/Shapes_Assign_Table.h, src/modules/shapes/shapes_tools/Shapes_Create_Empty.cpp, src/modules/shapes/shapes_tools/Shapes_Create_Empty.h, src/modules/shapes/shapes_tools/shapes_polar_to_cartes.cpp, src/modules/shapes/shapes_tools/shapes_polar_to_cartes.h, src/modules/shapes/shapes_tools/shapes_tools.vcxproj, src/modules/shapes/shapes_tools/shapes_tools.vcxproj.filters: module library shapes_tools: several renamings, join tables moved to table_tools, polar to cartesion (3d shapes) module added 2011-06-16 16:01 oconrad * src/modules/shapes/shapes_grid/Grid_To_Points.cpp: module Grid_To_Points: '...to Shapes' renamed to '...to Points' 2011-06-16 15:56 oconrad * src/modules/grid/grid_tools/Grid_Resample.cpp: module Grid_Resample: resampling of multiple grids added 2011-06-16 15:55 oconrad * src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp, src/modules/pointcloud/pointcloud_viewer/points_view_control.h: module pointcloud_viewer: dim effect added 2011-06-16 15:54 oconrad * src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp: module pc_from_shapes: support for 3d shapes added 2011-06-16 15:52 oconrad * src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.cpp, src/modules_contrib/garden/garden_webservices/MLB_Interface.cpp: garden modules: menu position moved to 'contributions' 2011-06-16 15:50 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_massflux.cpp: module ta_hydrology/flow_massflux: 'flow accumulation' renamed to 'catchmen area' 2011-06-15 12:01 oconrad * src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp: projection(4) modules: geostationary option 'satellite height' added 2011-06-15 11:26 oconrad * configure.in, src/modules_contrib/garden/Makefile.am, src/modules_contrib/garden/garden_webservices, src/modules_contrib/garden/garden_webservices/MLB_Interface.cpp, src/modules_contrib/garden/garden_webservices/MLB_Interface.h, src/modules_contrib/garden/garden_webservices/Makefile.am, src/modules_contrib/garden/garden_webservices/garden_webservices.vc10.sln, src/modules_contrib/garden/garden_webservices/garden_webservices.vcxproj, src/modules_contrib/garden/garden_webservices/garden_webservices.vcxproj.filters, src/modules_contrib/garden/garden_webservices/osm_import.cpp, src/modules_contrib/garden/garden_webservices/osm_import.h, src/modules_contrib/garden/garden_webservices/wms_import.cpp, src/modules_contrib/garden/garden_webservices/wms_import.h, src/saga.vc10.sln: module library added: garden_webservices - experimental interfaces to wms and openstreetmap data via internet 2011-06-14 15:54 oconrad * src/saga_core/saga_gui/wksp_shapes.cpp: saga_gui: look-up table creation for shapes: attribute fields update added 2011-06-09 09:46 reklov_w * src/modules_io/shapes/io_shapes/pointcloud_from_text_file.cpp, src/modules_io/shapes/io_shapes_las/las_import.cpp, src/saga_core/saga_gui/wksp_pointcloud.cpp: point clouds: value aggregation parameter moved from graduated color to display parameter section (now available for all coloring types) and renamed from COLORS_AGGREGATE to DISPLAY_VALUE_AGGREGATE 2011-06-08 10:12 reklov_w * src/modules/grid/grid_filter/Filter_Majority.cpp, src/modules/grid/grid_filter/Filter_Majority.h: reverting r1080 (patch 01-IntOverflow-Filter_Majority.patch) because VC10 complains about undefined overloads; using int for the filter kernel should be fine, otherwise there have further changes to be made (e.g. the majority count has to be long too) 2011-06-08 08:11 reklov_w * src/saga_core/saga_api/api_core.h, src/saga_core/saga_api/api_file.cpp, src/saga_core/saga_api/pointcloud.cpp, src/saga_core/saga_api/table_dbase.h, src/saga_core/saga_api/table_io.cpp: applying patches from tracker (5 Issues working with files bigger than 4Gb - ID: 3312690) - patch 06-LongFileOffsets.patch 2011-06-08 08:10 reklov_w * src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/fast_representativeness.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Surface.cpp, src/modules_images/modules_imagery/imagery_classification/classify_cluster_analysis.cpp, src/modules_images/modules_imagery/imagery_segmentation/rga_basic.cpp, src/modules_images/modules_imagery/imagery_segmentation/skeletonization.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_04.cpp, src/modules_simulation/cellular_automata/sim_cellular_automata/Wator.h, src/modules_simulation/hydrology/sim_hydrology/topmodel.cpp, src/modules_simulation/hydrology/sim_hydrology/topmodel_values.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Hypsometry.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Router.cpp: applying patches from tracker (5 Issues working with files bigger than 4Gb - ID: 3312690) - patch 05-IntOverflow-variables.patch 2011-06-08 08:08 reklov_w * src/saga_core/saga_api/grid.cpp, src/saga_core/saga_api/grid_io.cpp: applying patches from tracker (5 Issues working with files bigger than 4Gb - ID: 3312690) - patch 04-IntOverflow-CSG_Grid.patch 2011-06-08 08:07 reklov_w * src/modules/grid/grid_gridding/nn/nn.h, src/modules/grid/grid_gridding/nn/nnai.c, src/modules/grid/grid_spline/csa.c, src/modules/grid/grid_spline/csa.h: applying patches from tracker (5 Issues working with files bigger than 4Gb - ID: 3312690) - patch 03-IntOverflow-grid_resolution.patch 2011-06-08 08:05 reklov_w * src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.cpp, src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp, src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.cpp, src/modules_images/modules_imagery/imagery_classification/change_detection.cpp, src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.cpp, src/modules_images/modules_vigra/vigra/vigra_morphology.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_08.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_14.cpp, src/modules_simulation/hydrology/sim_hydrology/KinWav_D8.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Parallel.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveUp.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.cpp, src/saga_core/saga_api/grid.h, src/saga_core/saga_api/grid_memory.cpp, src/saga_core/saga_api/grid_operation.cpp, src/saga_core/saga_api/grid_system.cpp, src/saga_core/saga_api/module.h: applying patches from tracker (5 Issues working with files bigger than 4Gb - ID: 3312690) - patch 02-IntOverflow-Get_NCells.patch 2011-06-08 07:59 reklov_w * src/modules/grid/grid_filter/Filter_Majority.cpp, src/modules/grid/grid_filter/Filter_Majority.h: applying patches from tracker (5 Issues working with files bigger than 4Gb - ID: 3312690) - patch 01-IntOverflow-Filter_Majority.patch 2011-06-07 13:16 oconrad * src/saga_core/saga_api/grid_memory.cpp: saga_api: grid memory issue fixed (?!), related to bug tracker item: http://sourceforge.net/tracker/?func=detail&aid=3264149&group_id=102728&atid=632652 2011-06-07 11:12 oconrad * src/modules/pointcloud/pointcloud_tools/pc_to_shapes.cpp, src/saga_core/saga_api/pointcloud.cpp, src/saga_core/saga_gui/wksp_pointcloud.cpp: saga_api, saga_gui, module point cloud conversion: improved point cloud / shapes compatibility, rgb attribute choice added 2011-06-06 15:46 oconrad * src/saga_core/saga_gui/view_table_control.cpp: saga_gui: table control: update object properties when table changed (add, delete, rename fields) 2011-06-01 13:26 oconrad * src/saga_core/saga_gui/wksp_map.cpp, src/saga_core/saga_gui/wksp_map_manager.cpp: saga_gui: allow clipboard copies of maps without a frame 2011-05-31 16:15 oconrad * src/saga_core/saga_gui/parameters_control.cpp: saga_gui: parameter list control (correct dis-/enabling behaviour restored) 2011-05-31 15:04 oconrad * src/saga_core/saga_api/parameter.cpp, src/saga_core/saga_api/parameter_data.cpp, src/saga_core/saga_api/parameters.h, src/saga_core/saga_gui/parameters_control.cpp, src/saga_core/saga_gui/parameters_properties.cpp, src/saga_core/saga_gui/wksp_base_control.cpp: saga_api, saga_gui: fixed minor bugs in parameter lists 2011-05-31 15:03 oconrad * src/saga_core/saga_gui/helper.h: saga_gui: flexible floating point precision in description tab 2011-05-31 15:02 oconrad * src/modules/shapes/shapes_polygons/Polygon_Union.cpp: module polygon dissolve: optional does not drop inner boundaries 2011-05-27 08:41 oconrad * src/saga_core/saga_gui/project.cpp: saga_gui: project saving: adding file extension to proposed file names 2011-05-27 08:37 oconrad * src/modules/shapes/shapes_points/MLB_Interface.cpp, src/modules/shapes/shapes_points/Points_From_Lines.cpp, src/modules/shapes/shapes_points/Points_From_Lines.h: module added: multipoints to points conversion 2011-05-27 08:36 oconrad * src/modules_images/modules_imagery/imagery_classification/classify_cluster_analysis.cpp, src/saga_core/saga_api/mat_tools.cpp: saga_api: bug fix - cluster analysis: calculation of variances; minimum distance method stopped before it should 2011-05-25 14:21 oconrad * src/modules/shapes/shapes_tools/shapes_split_by_attribute.cpp: module: split shapes/table by attribute: bug fix 2011-05-24 08:41 oconrad * src/saga_core/saga_gui/project.cpp: saga_gui; project.cpp|save project bugs: scanf 32/64bit pointer, save all checker 2011-05-18 16:02 oconrad * src/modules/table/table_calculus/MLB_Interface.cpp, src/modules/table/table_calculus/Makefile.am, src/modules/table/table_calculus/Table_Calculator.cpp, src/modules/table/table_calculus/Table_Calculator.h, src/modules/table/table_calculus/table_calculus.vcxproj, src/modules/table/table_calculus/table_calculus.vcxproj.filters: modules: 'table calculator', field access now via field number (f1, f2, ..., fn) or field name (in square brackets, e.g. [field name]) 2011-05-18 15:58 oconrad * src/modules/shapes/shapes_lines/line_properties.cpp, src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp, src/modules/shapes/shapes_polygons/Polygon_Geometrics.h: modules: line/polygon properties unified 2011-05-18 12:47 oconrad * src/modules/shapes/shapes_polygons/MLB_Interface.cpp, src/modules/shapes/shapes_polygons/Makefile.am, src/modules/shapes/shapes_polygons/polygon_split_parts.cpp, src/modules/shapes/shapes_polygons/polygon_split_parts.h, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj.filters: module added: split multi-polygon parts 2011-05-18 12:45 oconrad * src/saga_core/saga_api/grid.cpp: saga_api: no data default value of unsigned byte grids set to -127 (do not have no data cells initially) 2011-05-18 12:42 oconrad * src/modules/grid/grid_gridding/Shapes2Grid.cpp, src/saga_core/saga_api/shape_line.cpp, src/saga_core/saga_api/shape_polygon.cpp: saga_api: bug fixed in determination of intersection type for polygons/lines with rectangular regions 2011-05-17 12:52 oconrad * src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.cpp, src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.h: e00 import: bug fix and enhancements 2011-05-17 12:51 oconrad * src/saga_core/saga_gui/wksp_base_item.cpp: saga_gui: unnecessary object description updates removed 2011-05-17 12:50 oconrad * src/saga_core/saga_gui/parameters_control.cpp: saga_gui: bug fix - integer properties with other than node parents now editable 2011-05-17 12:48 oconrad * src/saga_core/saga_api/shapes_io.cpp: saga_api: serious bug fixed!!! saving multi-part shapes 2011-05-09 07:59 oconrad * src/modules_io/gdal/io_gdal/gdal_driver.cpp, src/modules_io/gdal/io_gdal/gdal_driver.h, src/modules_io/gdal/io_gdal/gdal_export.cpp, src/modules_io/gdal/io_gdal/gdal_import.cpp, src/modules_io/gdal/io_gdal/io_gdal.vcxproj, src/saga_core/saga_gui/saga.cpp: gdal linkage updated and improved 2011-05-09 07:55 oconrad * src/saga_core/saga_api/api_core.h, src/saga_core/saga_api/api_file.cpp: api function added to get/set environment variables 2011-05-06 10:20 reklov_w * src/modules_io/grid/io_grid_image/grid_export.cpp: export image command line: now possible to export RGB coded grid as image 2011-05-05 16:13 oconrad * src/modules/shapes/shapes_points/remove_duplicates.cpp, src/modules/shapes/shapes_points/remove_duplicates.h: enhanced options for 'remove duplicate points' 2011-05-05 16:13 oconrad * src/saga_core/saga_gui/res_commands.cpp: naming error for table function 'Show' (not 'Add to Map') 2011-05-04 16:06 oconrad * configure.in, src/modules_contrib/Makefile.am, src/modules_contrib/garden/Makefile.am: garden added to linux configuration 2011-05-04 15:55 oconrad * src/modules_images/modules_opencv/opencv/opencv.h, src/modules_images/modules_opencv/opencv/opencv.vcxproj: update: linking to opencv v2.2 2011-05-04 15:54 oconrad * src/modules/grid/grid_calculus/grid_calculus.vcproj, src/modules/shapes/shapes_grid/shapes_grid.vcproj, src/modules_contrib/garden/garden_3d_viewer/garden_3d_viewer.vcproj, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.vcproj, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/ta_preprocessor.vcproj, src/saga.sln, src/saga_core/saga_gui/saga_gui.vcproj: update of vc9 projects (without x64 targets) 2011-05-04 14:29 oconrad * src/modules/grid/grid_analysis/grid_analysis.dsp, src/modules/grid/grid_calculus/grid_calculus.dsp, src/modules/grid/grid_calculus_bsl/grid_calculus_bsl.dsp, src/modules/grid/grid_filter/grid_filter.dsp, src/modules/grid/grid_gridding/grid_gridding.dsp, src/modules/grid/grid_spline/grid_spline.dsp, src/modules/grid/grid_tools/grid_tools.dsp, src/modules/grid/grid_visualisation/grid_visualisation.dsp, src/modules/pointcloud/pointcloud_tools/pointcloud_tools.dsp, src/modules/pointcloud/pointcloud_viewer/pointcloud_viewer.dsp, src/modules/shapes/shapes_grid/shapes_grid.dsp, src/modules/shapes/shapes_lines/shapes_lines.dsp, src/modules/shapes/shapes_lines_ex/shapes_lines_ex.dsp, src/modules/shapes/shapes_points/shapes_points.dsp, src/modules/shapes/shapes_polygons/shapes_polygons.dsp, src/modules/shapes/shapes_tools/shapes_tools.dsp, src/modules/shapes/shapes_transect/shapes_transect.dsp, src/modules/table/table_calculus/table_calculus.dsp, src/modules/table/table_tools/table_tools.dsp, src/modules/tin/tin_tools/tin_tools.dsp, src/modules/tin/tin_viewer/tin_viewer.dsp, src/modules_contrib/contrib_a_perego/contrib_a_perego/contrib_a_perego.dsp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres.dsp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/contrib_t_wutzler.dsp, src/modules_geostatistics/geostatistics/geostatistics_grid/geostatistics_grid.dsp, src/modules_geostatistics/geostatistics/geostatistics_kriging/geostatistics_kriging.dsp, src/modules_geostatistics/geostatistics/geostatistics_points/geostatistics_points.dsp, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.dsp, src/modules_images/modules_imagery/imagery_classification/imagery_classification.dsp, src/modules_images/modules_imagery/imagery_rga/imagery_rga.dsp, src/modules_images/modules_imagery/imagery_segmentation/imagery_segmentation.dsp, src/modules_images/modules_imagery/imagery_tools/imagery_tools.dsp, src/modules_images/modules_opencv/opencv/opencv.dsp, src/modules_images/modules_vigra/vigra/vigra.dsp, src/modules_io/db/io_db_mysql/io_db_mysql.dsp, src/modules_io/db/io_odbc/io_odbc.dsp, src/modules_io/docs/docs_html/docs_html.dsp, src/modules_io/docs/docs_pdf/docs_pdf.dsp, src/modules_io/esri_e00/io_esri_e00/io_esri_e00.dsp, src/modules_io/gdal/io_gdal/io_gdal.dsp, src/modules_io/gps/io_gps/io_gps.dsp, src/modules_io/grid/io_grid/io_grid.dsp, src/modules_io/grid/io_grid_grib2/io_grid_grib2.dsp, src/modules_io/grid/io_grid_grib2/io_grid_grib2.dsw, src/modules_io/grid/io_grid_grib2/io_grid_grib2_x.dsp, src/modules_io/grid/io_grid_image/io_grid_image.dsp, src/modules_io/shapes/io_shapes/io_shapes.dsp, src/modules_io/shapes/io_shapes_dxf/io_shapes_dxf.dsp, src/modules_io/shapes/io_shapes_las/io_shapes_las.dsp, src/modules_io/table/io_table/io_table.dsp, src/modules_lectures/lectures/lectures_introduction/lectures_introduction.dsp, src/modules_projection/pj_georeference/pj_georeference/pj_georeference.dsp, src/modules_projection/pj_geotrans/pj_geotrans/pj_geotrans.dsp, src/modules_projection/pj_proj4/pj_proj4/pj_proj4.dsp, src/modules_recreations/recreations/recreations_fractals/recreations_fractals.dsp, src/modules_recreations/recreations/recreations_games/recreations_games.dsp, src/modules_simulation/cellular_automata/sim_cellular_automata/sim_cellular_automata.dsp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/sim_ecosystems_hugget.dsp, src/modules_simulation/fire/sim_fire_spreading/sim_fire_spreading.dsp, src/modules_simulation/hydrology/sim_hydrology/sim_hydrology.dsp, src/modules_template/template/template/Template.dsp, src/modules_template/template/template/Template.dsw, src/modules_terrain_analysis/terrain_analysis/ta_channels/ta_channels.dsp, src/modules_terrain_analysis/terrain_analysis/ta_compound/ta_compound.dsp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.dsp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/ta_lighting.dsp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.dsp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/ta_preprocessor.dsp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/ta_profiles.dsp, src/saga.dsw, src/saga_core/saga_api/saga_api.dsp, src/saga_core/saga_cmd/saga_cmd.dsp, src/saga_core/saga_gdi/saga_gdi.dsp, src/saga_core/saga_gui/saga_gui.dsp, src/saga_core/saga_odbc/saga_odbc.dsp: support stopped for ms vc6 projects 2011-05-04 14:09 oconrad * src/saga.vc10.sln: experimental 3d shapes viewer added to SAGA's garden, where it will stay until harvest time has come 2011-05-04 14:06 oconrad * src/modules_contrib/garden, src/modules_contrib/garden/garden_3d_viewer, src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.cpp, src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.h, src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_dialog.cpp, src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_dialog.h, src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_module.cpp, src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_module.h, src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.cpp, src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.h, src/modules_contrib/garden/garden_3d_viewer/Makefile.am, src/modules_contrib/garden/garden_3d_viewer/garden_3d_viewer.vcproj, src/modules_contrib/garden/garden_3d_viewer/garden_3d_viewer.vcxproj, src/modules_contrib/garden/garden_3d_viewer/garden_3d_viewer.vcxproj.filters: experimental 3d shapes viewer added to SAGA's garden, where it will stay until harvest time has come 2011-05-04 14:02 oconrad * src/saga_core/saga_gui/res_commands.cpp, src/saga_core/saga_gui/res_commands.h, src/saga_core/saga_gui/view_map.cpp, src/saga_core/saga_gui/view_map.h, src/saga_core/saga_gui/wksp_map.cpp, src/saga_core/saga_gui/wksp_map.h, src/saga_core/saga_gui/wksp_shapes.cpp: added: map to rgb coded grid conversion (without file saving) 2011-05-04 14:00 oconrad * src/modules/tin/tin_viewer/tin_view_control.cpp, src/modules/tin/tin_viewer/tin_view_control.h, src/modules/tin/tin_viewer/tin_view_dialog.cpp, src/modules/tin/tin_viewer/tin_view_dialog.h, src/modules/tin/tin_viewer/tin_view_module.cpp: support for draping of rgb coded grids 2011-05-03 15:41 oconrad * src/saga_core/saga_gui/parameters_control.cpp: read-only properties (informative) are displayed in grayed mode (disabled) 2011-05-03 15:40 oconrad * src/modules/grid/grid_tools/Grid_Resample.cpp, src/saga_core/saga_api/parameter.cpp: bug fix and enhancement: user defined target grid 2011-05-03 15:38 oconrad * src/saga_core/saga_gui/wksp_pointcloud.cpp, src/saga_core/saga_gui/wksp_pointcloud.h: pointcloud properties 2011-05-03 10:53 oconrad * src/saga_core/saga_api/pointcloud.cpp: bug fix: missing call of create() in default constructor 2011-05-03 10:21 oconrad * src/modules/pointcloud/pointcloud_tools/pc_cut.cpp, src/saga_core/saga_gui/view_table_diagram.cpp, src/saga_core/saga_gui/wksp_shapes.cpp, src/saga_core/saga_gui/wksp_shapes_point.cpp, src/saga_core/saga_gui/wksp_shapes_polygon.cpp: property dialogs: improved display behaviour 2011-05-03 10:20 oconrad * src/modules_io/shapes/io_shapes_las/las_import.cpp: bug fix: data set has been swallowed 2011-05-03 10:15 oconrad * src/saga_core/saga_api/api_file.cpp: patched: get file name without extension 2011-05-02 16:04 oconrad * src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.cpp, src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp, src/modules_io/shapes/io_shapes/pointcloud_from_text_file.cpp, src/modules_io/shapes/io_shapes_las/las_import.cpp, src/saga_core/saga_gui/view_histogram.cpp, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_layer.cpp, src/saga_core/saga_gui/wksp_layer_classify.cpp, src/saga_core/saga_gui/wksp_pointcloud.cpp, src/saga_core/saga_gui/wksp_shapes.cpp, src/saga_core/saga_gui/wksp_shapes_line.cpp, src/saga_core/saga_gui/wksp_shapes_point.cpp, src/saga_core/saga_gui/wksp_shapes_polygon.cpp, src/saga_core/saga_gui/wksp_tin.cpp: bug fix: shapes parameter "COLORS_ATTRIB" has been replaced by "LUT_ATTRIB" and "METRIC_ATTRIB" 2011-04-29 11:52 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/burn_in_streams.cpp: burn in stream network: bug fix and makefile update 2011-04-28 16:29 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/burn_in_streams.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/burn_in_streams.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/ta_preprocessor.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/ta_preprocessor.vcxproj.filters: 'burn stream network into dem' module added 2011-04-28 16:21 oconrad * src/modules/grid/grid_analysis/Makefile.am: linux compiler error fixed 2011-04-28 16:18 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.vcxproj.filters: project entry removed for removed file (basin_grid.h) 2011-04-28 16:16 oconrad * src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.h, src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h, src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.h, src/modules/shapes/shapes_grid/Grid_To_Contour.h, src/modules/shapes/shapes_grid/Grid_To_Gradient.cpp, src/modules/shapes/shapes_grid/Grid_To_Gradient.h, src/modules/shapes/shapes_grid/Grid_To_Points.h, src/modules/shapes/shapes_grid/Grid_To_Points_Random.h, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.h, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.h, src/modules/shapes/shapes_grid/MLB_Interface.cpp, src/modules/shapes/shapes_grid/grid_extent.h, src/modules/shapes/shapes_grid/grid_local_extremes_to_points.h: shapes_grid modules: resorted and renamed (where appropriate) 2011-04-28 08:51 johanvdw * configure.in: Bump version number in configure.in 2011-04-27 19:45 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.h: unicode compiler error fixed 2011-04-27 19:34 oconrad * src/saga_core/saga_gui/wksp_shapes_polygon.cpp: bug fix: drawing polygons with unique symbol 2011-04-27 19:07 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.cpp: bug fix 2011-04-27 18:46 oconrad * src/saga_core/saga_gui/parameters_control.cpp, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_layer.cpp, src/saga_core/saga_gui/wksp_layer.h, src/saga_core/saga_gui/wksp_pointcloud.cpp, src/saga_core/saga_gui/wksp_shapes.cpp, src/saga_core/saga_gui/wksp_shapes_point.cpp, src/saga_core/saga_gui/wksp_tin.cpp: restructured data object parameters, hiding/disabling included 2011-04-27 18:45 oconrad * src/modules/tin/tin_viewer/MLB_Interface.cpp: module library name changed 2011-04-27 18:44 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_hydrology/BasinGrid.h: 2011-04-27 18:42 oconrad * src/saga_core/saga_api/dataobject.cpp, src/saga_core/saga_api/dataobject.h, src/saga_core/saga_api/grid.cpp, src/saga_core/saga_api/grid.h: get/set description methods for all csg_data_object derived classes 2011-04-27 18:40 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/BasinGrid.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Parallel.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveDown.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveUp.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFlood.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Pt.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_width.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.vcxproj.filters, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Morphometry.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ruggedness.cpp: changed namings and menu paths of terrain analysis modules 2011-04-27 10:19 oconrad * src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_base.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.h, src/saga_core/saga_api/module.cpp, src/saga_core/saga_api/module.h, src/saga_core/saga_api/parameter.cpp, src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_api/parameters.h, src/saga_core/saga_gui/parameters_control.cpp, src/saga_core/saga_gui/project.cpp, src/saga_core/saga_gui/project.h, src/saga_core/saga_gui/wksp_base_item.cpp, src/saga_core/saga_gui/wksp_base_item.h, src/saga_core/saga_gui/wksp_data_manager.h, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_grid.h, src/saga_core/saga_gui/wksp_grid_system.h, src/saga_core/saga_gui/wksp_layer.cpp, src/saga_core/saga_gui/wksp_layer.h, src/saga_core/saga_gui/wksp_map.cpp, src/saga_core/saga_gui/wksp_map.h, src/saga_core/saga_gui/wksp_map_manager.h, src/saga_core/saga_gui/wksp_module_manager.h, src/saga_core/saga_gui/wksp_pointcloud.cpp, src/saga_core/saga_gui/wksp_pointcloud.h, src/saga_core/saga_gui/wksp_shapes.cpp, src/saga_core/saga_gui/wksp_shapes.h, src/saga_core/saga_gui/wksp_shapes_line.cpp, src/saga_core/saga_gui/wksp_shapes_line.h, src/saga_core/saga_gui/wksp_shapes_point.cpp, src/saga_core/saga_gui/wksp_shapes_point.h, src/saga_core/saga_gui/wksp_shapes_points.cpp, src/saga_core/saga_gui/wksp_shapes_points.h, src/saga_core/saga_gui/wksp_shapes_polygon.cpp, src/saga_core/saga_gui/wksp_shapes_polygon.h, src/saga_core/saga_gui/wksp_table.cpp, src/saga_core/saga_gui/wksp_table.h, src/saga_core/saga_gui/wksp_tin.cpp, src/saga_core/saga_gui/wksp_tin.h: parameter change event: separate functions for changing and enabling other parameters 2011-04-26 16:21 oconrad * src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_grid.h, src/saga_core/saga_gui/wksp_shapes.cpp: hiding inactive properties from settings (colour options: grids, shapes) 2011-04-26 15:28 oconrad * src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp, src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_api/parameters.h, src/saga_core/saga_gui/parameters_control.cpp: bug fix: allow conditional changes of dependent parameters when one parameter changes 2011-04-26 12:53 oconrad * src/saga_core/saga_gui/helper.cpp: bug fix: double click on module (workspace), loading description from saga wiki caused deadlock 2011-04-26 11:53 oconrad * src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.cpp, src/saga_core/saga_api/api_colors.cpp, src/saga_core/saga_api/api_core.h, src/saga_core/saga_api/parameters.h, src/saga_core/saga_gui/parameters_control.cpp: property defaults and disabling: bug fix, disabled items will be hidden 2011-04-26 11:52 oconrad * src/modules/shapes/shapes_tools/Shapes_Assign_Table.cpp: BLOB support 2011-04-21 08:14 oconrad * src/saga_core/saga_gui/parameters_control.cpp: bug fix: restoring to defaults did not graphically update combo boxes 2011-04-20 18:14 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.h: context sensitive disabling of parameters added 2011-04-20 16:08 oconrad * src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp, src/saga_core/saga_gui/parameters_control.cpp: bug fix: dis-/enabling properties 2011-04-20 11:57 oconrad * src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp, src/saga_core/saga_api/parameter_data.cpp, src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_api/parameters.h, src/saga_core/saga_gui/dlg_parameters.cpp, src/saga_core/saga_gui/dlg_parameters.h, src/saga_core/saga_gui/parameters_control.cpp, src/saga_core/saga_gui/parameters_control.h, src/saga_core/saga_gui/res_controls.cpp, src/saga_core/saga_gui/res_controls.h: parameters support: state enabled/disabled, resetting of default values 2011-04-19 16:03 oconrad * src/saga_core/saga_gui/res/saga.ger.txt: german translation update (thanks to j.brunke, gifhorn) 2011-04-19 12:21 oconrad * src/saga_core/saga_gui/wksp_module_manager.cpp: module library manager description 2011-04-19 10:21 oconrad * src/saga_core/saga_gui/helper.cpp, src/saga_core/saga_gui/helper.h, src/saga_core/saga_gui/saga_frame.cpp, src/saga_core/saga_gui/saga_gui.vcxproj, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_module.cpp, src/saga_core/saga_gui/wksp_module_manager.cpp, src/saga_core/saga_gui/wksp_pointcloud.cpp, src/saga_core/saga_gui/wksp_shapes.cpp, src/saga_core/saga_gui/wksp_table.cpp, src/saga_core/saga_gui/wksp_tin.cpp: get module description optionally from online sources (http://sourceforge.net/apps/trac/saga-gis/wiki/) source page coding: library name (no 'lib' prefix) + '_' + module identifier (number) e.g. 'ta_morphometry_17' would refer to module 'Vector Ruggedness Measure (VRM)' 2011-04-19 09:56 oconrad * src/saga_core/saga_gui/wksp_module_library.cpp: bug fix 2011-04-19 09:55 oconrad * src/saga_core/saga_api/module.cpp, src/saga_core/saga_api/module.h, src/saga_core/saga_api/module_library_interface.cpp: support for live long module identifier 2011-04-18 13:43 oconrad * src/saga_core/saga_api/saga_api.h, src/saga_core/saga_gui/dlg_about.cpp: getting prepared for coming v2.0.7 release 2011-04-18 13:43 oconrad * src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_map_dc.h: bug fix: grid to image conversion solves http://sourceforge.net/tracker/?func=detail&aid=3251858&group_id=102728&atid=632652 2011-04-18 13:41 oconrad * src/saga_core/saga_api/api_string.cpp: bug fix: string to long conversion returned false for '0' solves http://sourceforge.net/tracker/?func=detail&aid=3287406&group_id=102728&atid=632652 2011-04-15 10:37 oconrad * src/saga_core/saga_api/shapes.h: changing vertex order of shapes: bug fix 2011-04-15 10:35 oconrad * src/saga_core/saga_api/shape_part.cpp, src/saga_core/saga_api/shapes.cpp, src/saga_core/saga_api/shapes.h: changing vertex order of shapes 2011-04-15 09:50 oconrad * src/saga_core/saga_api/shapes.cpp: minor bug fix in shapes make_clean() function (z/m polygon check!) 2011-04-15 08:35 oconrad * src/saga_core/saga_api/shapes.cpp, src/saga_core/saga_api/shapes.h, src/saga_core/saga_api/shapes_io.cpp: minor bug fix and enhancements in shapes classes 2011-04-14 16:05 oconrad * src/modules_io/gdal/io_gdal/ogr_driver.cpp, src/modules_io/gdal/io_gdal/ogr_driver.h, src/saga_core/saga_api/shape_part.cpp, src/saga_core/saga_api/shapes_io.cpp, src/saga_core/saga_gui/wksp_shapes.cpp: shape vertex dimension issues (x,y,z,m): bug fix writing x,y,z (no m) shapes, gdal/ogr support enabled 2011-04-13 16:47 oconrad * src/saga_core/saga_api/shapes.cpp, src/saga_core/saga_api/shapes_io.cpp: shapes z/m support: read/save bug fixed 2011-04-13 07:45 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.cpp: bug fix in profile from lines 2011-04-12 16:36 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.cpp: profiles from line: optionally uses field name for splitted line namings 2011-04-12 15:56 oconrad * src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.h: enhanced flexibility for polynomial regression 2011-04-12 15:55 oconrad * src/modules/shapes/shapes_polygons/polygon_to_points.cpp: z/m support for vertices 2011-04-12 15:54 oconrad * src/modules/shapes/shapes_polygons/polygon_line_intersection.cpp: polygon/line intersection bug fixed 2011-04-12 15:48 oconrad * src/saga_core/saga_api/shape_part.cpp, src/saga_core/saga_api/shape_points.cpp, src/saga_core/saga_api/shapes.h: z/m support for shape vertices 2011-04-07 14:42 oconrad * src/saga_core/saga_cmd/module_library.cpp, src/saga_core/saga_cmd/module_library.h: serious bug has been fixed which prevented saga_cmd to work! 2011-04-06 15:33 oconrad * src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_shapes.cpp: look-up table creation support for unique values, equal intervals, quantiles 2011-04-06 15:33 oconrad * src/saga_core/saga_api/table_dbase.cpp: return strings from dbase files without unnecessary (and often annoying) white spaces 2011-04-06 15:30 oconrad * src/modules/grid/grid_calculus/MLB_Interface.cpp, src/modules/grid/grid_calculus/Makefile.am, src/modules/grid/grid_calculus/grid_calculus.vcxproj, src/modules/grid/grid_calculus/grid_calculus.vcxproj.filters, src/modules/grid/grid_calculus/grid_difference.cpp, src/modules/grid/grid_calculus/grids_trend_polynom.cpp, src/modules/grid/grid_calculus/grids_trend_polynom.h: module added: cell wise trend function 2011-04-05 13:59 oconrad * src/modules_projection/pj_proj4/pj_proj4/PROJ4_Grid.cpp, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Grid.h, src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_transform.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_transform_grid.cpp: improved user defined target grid system analysis 2011-04-05 13:55 oconrad * src/modules/shapes/shapes_grid/MLB_Interface.cpp, src/modules/shapes/shapes_grid/Makefile.am, src/modules/shapes/shapes_grid/grid_extent.cpp, src/modules/shapes/shapes_grid/grid_extent.h, src/modules/shapes/shapes_grid/shapes_grid.vcxproj, src/modules/shapes/shapes_grid/shapes_grid.vcxproj.filters: module added: grid system extent as polygon layer 2011-04-04 12:57 reklov_w * src/modules/tin/tin_viewer/tin_viewer.vcproj, src/saga.sln: Update tin_viewer.vcproj file and add project to saga.sln for VS2008 compilation 2011-04-04 12:03 reklov_w * src/modules/grid/grid_analysis/grid_analysis.vcproj, src/modules/grid/grid_calculus/grid_calculus.vcproj, src/modules/shapes/shapes_lines/shapes_lines.vcproj, src/modules/shapes/shapes_points/shapes_points.vcproj, src/modules/shapes/shapes_polygons/shapes_polygons.vcproj, src/modules/shapes/shapes_tools/shapes_tools.vcproj, src/modules_io/db/io_odbc/io_odbc.vcproj, src/modules_terrain_analysis/terrain_analysis/ta_channels/ta_channels.vcproj: fix .vcproj files to make SAGA compile under VS2008 2011-04-03 11:05 reklov_w * src/saga_core/saga_gui/wksp_module.cpp: fix to respect bDialog in "stop execution" for interactive modules 2011-04-02 17:23 reklov_w * src/saga_core/saga_gui/callback.cpp: fix CALLBACK_STOP_EXECUTION for interactive modules 2011-04-01 10:38 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_morphometry/air_flow_height.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/air_flow_height.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/wind_effect.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/wind_effect.h: wind effect calculation support for variable wind directions/speeds 2011-04-01 10:37 oconrad * src/saga_core/saga_gui/wksp_shapes.cpp, src/saga_core/saga_gui/wksp_shapes_line.cpp, src/saga_core/saga_gui/wksp_shapes_point.cpp: 'no data' shapes only hidden in graduated colors mode, look-up table creation support for equal intervals 2011-04-01 10:35 oconrad * src/saga_core/saga_api/projections.cpp, src/saga_core/saga_gui/res/saga_dic.txt: ogc wkt datum conversion bug and swiss oblique mercator fix 2011-04-01 10:34 oconrad * src/saga_core/saga_api/grid_system.cpp: grid system destruction zeroes all dimensions 2011-03-28 10:37 reklov_w * src/saga_core/saga_api/mat_formula.cpp: fix description string of operators to handle "less than" character (html) 2011-03-28 10:36 reklov_w * src/saga_core/saga_gui/project.cpp: fix progress bar reset on "save project" 2011-03-27 17:51 reklov_w * src/saga_core/saga_api/pointcloud.cpp: fix automatic append of .spc file name extension on "project save all" 2011-03-25 13:26 oconrad * src/modules/grid/grid_gridding/nn/nncommon.c, src/modules_io/docs/docs_pdf/Profile_Cross_Sections.cpp: compilation error fixed (typos ;-) ) 2011-03-25 08:50 oconrad * src/modules/grid/grid_calculus/Makefile.am: rect/polar conversions moved to grid_calculus 2011-03-25 00:40 johanvdw * src/modules_simulation/hydrology/sim_hydrology/WaterRetentionCapacity.cpp: Fix memory leak 2011-03-25 00:37 johanvdw * src/modules_io/docs/docs_pdf/Profile_Cross_Sections.cpp: Another memory leak detected with cppcheck 2011-03-25 00:31 johanvdw * src/modules/grid/grid_gridding/nn/nncommon.c: Fix memory leak detected with cppcheck 2011-03-25 00:01 johanvdw * src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp: Fix mimatching deallocator (not really a problem, but fixing it removes a warning, making debugging easier) 2011-03-24 23:59 johanvdw * src/modules/grid/grid_calculus_bsl/pars_all.cpp: Fix memory leak 2011-03-24 23:56 johanvdw * src/modules/grid/grid_analysis/Grid_AHP.cpp, src/modules/grid/grid_analysis/owa.cpp: Only delete initialised variables 2011-03-24 23:50 johanvdw * src/saga_core/saga_api/shapes_ogis.cpp: Fix potential memory leak 2011-03-24 23:45 johanvdw * src/modules/grid/grid_analysis/Makefile.am: Remove rect/polar conversion from grid_analysis Makefile.am Fixes automated compilation 2011-03-24 17:23 oconrad * src/modules/grid/grid_analysis/Cost_PolarToRect.cpp, src/modules/grid/grid_analysis/Cost_PolarToRect.h, src/modules/grid/grid_analysis/Cost_RectToPolar.cpp, src/modules/grid/grid_analysis/Cost_RectToPolar.h, src/modules/grid/grid_analysis/grid_analysis.vcxproj, src/modules/grid/grid_analysis/grid_analysis.vcxproj.filters, src/modules/grid/grid_calculus/MLB_Interface.cpp, src/modules/grid/grid_calculus/gradient_cartes_polar.cpp, src/modules/grid/grid_calculus/gradient_cartes_polar.h, src/modules/grid/grid_calculus/grid_calculus.vcxproj, src/modules/grid/grid_calculus/grid_calculus.vcxproj.filters, src/modules/grid/grid_calculus/grid_metric_conversion.cpp, src/modules/grid/grid_calculus/grid_metric_conversion.h: 'rect/polar' conversion has been enhanced and moved to grid_calculus library. 2011-03-24 17:20 oconrad * src/modules/grid/grid_analysis/MLB_Interface.cpp, src/saga_core/saga_api/module.h, src/saga_core/saga_api/module_library.cpp, src/saga_core/saga_api/module_library_interface.cpp, src/saga_core/saga_cmd/module_library.cpp, src/saga_core/saga_cmd/module_library.h, src/saga_core/saga_cmd/saga_cmd.cpp, src/saga_core/saga_gui/saga.cpp, src/saga_core/saga_gui/wksp_module_library.cpp: module management enhancements: from now removed modules can be replaced by a dummy to continue module access via enumeration (e.g. for maintainence of scripts or R bindings) includes a preliminary bug fix in saga_cmd for https://sourceforge.net/tracker/?func=detail&atid=632652&aid=3240208&group_id=102728 2011-03-23 12:12 oconrad * src/modules/shapes/shapes_polygons/polygon_line_intersection.cpp: gcc compilation error fixed; improvements applied (but still to be continued) 2011-03-22 17:05 oconrad * src/modules/shapes/shapes_polygons/MLB_Interface.cpp, src/modules/shapes/shapes_polygons/Makefile.am, src/modules/shapes/shapes_polygons/polygon_line_intersection.cpp, src/modules/shapes/shapes_polygons/polygon_line_intersection.h, src/modules/shapes/shapes_polygons/polygon_to_edges_nodes.cpp, src/modules/shapes/shapes_polygons/polygon_to_edges_nodes.h, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj.filters, src/saga_core/saga_api/shapes.h: vector topology related studies (to be continued) 2011-03-20 23:46 reklov_w * src/saga_core/saga_gui/project.cpp: bug fix "save project" (datasets were actually not saved) for win 64bit 2011-03-18 16:21 oconrad * src/modules/shapes/shapes_tools/quadtree_structure.cpp, src/modules/shapes/shapes_tools/quadtree_structure.h, src/saga_core/saga_api/quadtree.cpp, src/saga_core/saga_api/shapes.h: improved csg_quadtree implementation 2011-03-18 16:20 oconrad * src/saga_core/saga_api/shape_polygon.cpp: improved polygon/shape intersection analysis 2011-03-18 16:18 oconrad * src/saga_core/saga_api/geo_functions.cpp: simplified crossing calculation 2011-03-18 16:17 oconrad * src/saga_core/saga_api/shapes_ogis.cpp: case insensitivity for ogc key words 2011-03-14 13:21 oconrad * src/modules/grid/grid_analysis/Soil_Texture.cpp, src/modules/grid/grid_analysis/Soil_Texture.h: bug fix and enhancements (input of sand, clay and silt) 2011-03-08 10:26 reklov_w * src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile.am: Helper.cpp/.h removed 2011-03-03 11:56 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_channels/Helper.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/Helper.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ta_channels.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_channels/ta_channels.vcxproj.filters: bug fix and clean up (helper.cpp/h removed) 2011-03-02 15:32 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.h: reworked extented watershed analysis 2011-03-02 15:31 oconrad * src/saga_core/saga_api/grid.h: CSG_Grid_System::Get_xTo(), ... functions made static 2011-02-27 00:58 reklov_w * src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp: added parameter choice for field data storage type of the attribute to calculate 2011-02-26 23:48 reklov_w * src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.cpp: fixed access violations due to "out of grid extent" value requests and memory leaks 2011-02-25 20:13 johanvdw * src/saga_core/saga_api/Makefile.am: Correction to previous fix 2011-02-25 15:17 oconrad * src/modules/table/table_tools/Table_Enumerate.cpp, src/saga_core/saga_api/table.cpp: CSG_Table::Assign/Create now accepts derived classes too (i.e. shapes, pointcloud) 2011-02-25 15:15 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.cpp: improved slope representation 2011-02-25 10:36 oconrad * src/modules/shapes/shapes_points/MLB_Interface.cpp, src/modules/shapes/shapes_points/Makefile.am, src/modules/shapes/shapes_points/points_thinning.cpp, src/modules/shapes/shapes_points/points_thinning.h, src/modules/shapes/shapes_points/shapes_points.vcxproj, src/modules/shapes/shapes_points/shapes_points.vcxproj.filters: points thinning module added 2011-02-25 10:33 johanvdw * src/saga_core/saga_api/Makefile.am: Small fix to enable python unicode build 2011-02-24 13:57 oconrad * src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.h: bug fix and optimisation 2011-02-24 13:56 oconrad * src/modules/shapes/shapes_tools/shapes_buffer.cpp: optional output of separate buffers for each input shape 2011-02-24 13:55 oconrad * src/saga_core/saga_api/grid.h, src/saga_core/saga_api/grid_system.cpp: CSG_Grid_Cell_Addressor: radius initialisation with floating point support 2011-02-24 13:53 oconrad * src/saga_core/saga_api/module.cpp: CSG_Module::On_Execute(): unnecessary check of additional parameters removed (could cause unwanted dialog popups) 2011-02-23 17:20 oconrad * configure.in, src/modules/tin/Makefile.am, src/modules/tin/tin_viewer, src/modules/tin/tin_viewer/MLB_Interface.cpp, src/modules/tin/tin_viewer/MLB_Interface.h, src/modules/tin/tin_viewer/Makefile.am, src/modules/tin/tin_viewer/tin_view_control.cpp, src/modules/tin/tin_viewer/tin_view_control.h, src/modules/tin/tin_viewer/tin_view_dialog.cpp, src/modules/tin/tin_viewer/tin_view_dialog.h, src/modules/tin/tin_viewer/tin_view_module.cpp, src/modules/tin/tin_viewer/tin_view_module.h, src/modules/tin/tin_viewer/tin_viewer.dsp, src/modules/tin/tin_viewer/tin_viewer.vcproj, src/modules/tin/tin_viewer/tin_viewer.vcxproj, src/modules/tin/tin_viewer/tin_viewer.vcxproj.filters, src/saga.vc10.sln: 2.5d viewer for tin added 2011-02-22 10:04 reklov_w * src/saga_core/saga_api/saga_api.h, src/saga_core/saga_api/saga_api_to_python_linux.py, src/saga_core/saga_api/saga_api_to_python_linux.sh, src/saga_core/saga_api/saga_api_to_python_win.bat, src/saga_core/saga_api/saga_api_to_python_win.py: introduced _SAGA_PYTHON preprocessor define (to allow also other swig builds than python) 2011-02-21 16:03 oconrad * src/modules/shapes/shapes_tools/SeparateShapes.cpp, src/modules/shapes/shapes_tools/SeparateShapes.h: module renamed and output changed to memory to meet saga module standards 2011-02-21 16:01 oconrad * src/modules/table/table_tools/Table_Enumerate.cpp: enumeration by record index added 2011-02-21 16:00 oconrad * src/modules/shapes/shapes_tools/quadtree_structure.cpp: counting of duplicate points 2011-02-21 15:59 oconrad * src/modules/shapes/shapes_points/MLB_Interface.cpp, src/modules/shapes/shapes_points/Makefile.am, src/modules/shapes/shapes_points/select_points.cpp, src/modules/shapes/shapes_points/select_points.h, src/modules/shapes/shapes_points/shapes_points.vcxproj, src/modules/shapes/shapes_points/shapes_points.vcxproj.filters: interactive point selection module added 2011-02-21 15:57 oconrad * src/modules/shapes/shapes_points/points_filter.cpp, src/modules/shapes/shapes_points/points_filter.h, src/modules/shapes/shapes_points/remove_duplicates.cpp, src/modules/shapes/shapes_points/remove_duplicates.h: adaption of new quadtree search features 2011-02-21 15:56 oconrad * src/saga_core/saga_api/quadtree.cpp, src/saga_core/saga_api/shapes.h: Quadtree classes: support for statistics and multiple points at same location 2011-02-21 15:54 oconrad * src/saga_core/saga_api/shapes.cpp: CSG_Shapes::Assign: now supports CSG_PointCloud class 2011-02-21 15:53 oconrad * src/saga_core/saga_api/mat_tools.cpp, src/saga_core/saga_api/mat_tools.h: CSG_Simple_Statistics: copy constructor, = operator, optional value list, added 2011-02-21 15:52 oconrad * src/saga_core/saga_api/api_core.h, src/saga_core/saga_api/api_file.cpp, src/saga_core/saga_api/api_memory.cpp: CSG_Array: copy constructor / = operator added 2011-02-21 15:51 oconrad * src/saga_core/saga_api/api_string.cpp, src/saga_core/saga_api/grid_io.cpp, src/saga_core/saga_api/mat_trend.cpp, src/saga_core/saga_api/pointcloud.cpp, src/saga_core/saga_api/table.cpp, src/saga_core/saga_api/table_dbase.cpp: size_t/int type castings (opressing unwanted compiler warnings) 2011-02-17 12:50 oconrad * src/modules/shapes/shapes_points/convex_hull.cpp: bug fix 2011-02-17 11:56 oconrad * src/modules/shapes/shapes_points/MLB_Interface.cpp, src/modules/shapes/shapes_points/Makefile.am, src/modules/shapes/shapes_points/convex_hull.cpp, src/modules/shapes/shapes_points/convex_hull.h, src/modules/shapes/shapes_points/shapes_points.vcxproj, src/modules/shapes/shapes_points/shapes_points.vcxproj.filters: convex hull construction added 2011-02-16 17:18 oconrad * src/modules/shapes/shapes_points/MLB_Interface.cpp, src/modules/shapes/shapes_points/Makefile.am, src/modules/shapes/shapes_points/points_filter.cpp, src/modules/shapes/shapes_points/points_filter.h, src/modules/shapes/shapes_points/shapes_points.vcxproj, src/modules/shapes/shapes_points/shapes_points.vcxproj.filters: points filter added 2011-02-16 17:15 oconrad * src/saga_core/saga_api/pointcloud.cpp: bug fix: Get_Shape(int), when requesting a record a second time 2011-02-16 17:13 oconrad * src/saga_core/saga_api/api_memory.cpp: bug fix, tracker: http://sourceforge.net/tracker/?func=detail&aid=3182340&group_id=102728&atid=632652 2011-02-15 14:27 oconrad * src/saga.vc10.sln: build order / dependencies updated 2011-02-15 08:43 oconrad * src/modules/shapes/shapes_lines/Lines_From_Points.cpp, src/modules/shapes/shapes_lines/Lines_From_Points.h, src/modules/shapes/shapes_lines/Lines_From_Polygons.cpp, src/modules/shapes/shapes_lines/Lines_From_Polygons.h, src/modules/shapes/shapes_points/Points_From_Lines.cpp, src/modules/shapes/shapes_points/Points_From_Lines.h, src/modules/shapes/shapes_points/Points_From_Table.cpp, src/modules/shapes/shapes_points/Points_From_Table.h, src/modules/shapes/shapes_polygons/Polygons_From_Lines.cpp, src/modules/shapes/shapes_polygons/Polygons_From_Lines.h, src/modules/shapes/shapes_polygons/polygon_to_points.cpp, src/modules/shapes/shapes_polygons/polygon_to_points.h: 2011-02-14 23:55 reklov_w * src/modules/shapes/shapes_lines/line_dissolve.cpp: fixed typo in line_dissolve.cpp module description 2011-02-14 23:54 reklov_w * src/modules/shapes/shapes_lines/Makefile.am: added line_dissolve module to Makefile.am 2011-02-14 21:52 reklov_w * src/saga_core/saga_gui/wksp_shapes_edit.cpp: fix gcc error in wksp_shapes_edit.cpp 2011-02-14 16:38 reklov_w * AUTHORS, ChangeLog, Makefile.am, NEWS, README, configure.in, m4/ax_pkg_swig.m4, m4/ax_python_devel.m4, m4/ax_swig_enable_cxx.m4, m4/ax_swig_python.m4, src/Makefile.am, src/dev_tools/MLB_Interface.cpp, src/dev_tools/MLB_Interface.h, src/dev_tools/Makefile.am, src/dev_tools/dev_tools.vc10.sln, src/dev_tools/dev_tools.vcxproj, src/dev_tools/dev_tools.vcxproj.filters, src/dev_tools/tl_extract.cpp, src/dev_tools/tl_extract.h, src/dev_tools/tl_merge.cpp, src/dev_tools/tl_merge.h, src/dev_tools/tl_union.cpp, src/dev_tools/tl_union.h, src/gpl.txt, src/install.txt, src/lgpl.txt, src/modules/Makefile.am, src/modules/grid/Makefile.am, src/modules/grid/grid_analysis/Cost_Anisotropic.cpp, src/modules/grid/grid_analysis/Cost_Anisotropic.h, src/modules/grid/grid_analysis/Cost_Isotropic.cpp, src/modules/grid/grid_analysis/Cost_Isotropic.h, src/modules/grid/grid_analysis/Cost_PolarToRect.cpp, src/modules/grid/grid_analysis/Cost_PolarToRect.h, src/modules/grid/grid_analysis/Cost_RectToPolar.cpp, src/modules/grid/grid_analysis/Cost_RectToPolar.h, src/modules/grid/grid_analysis/CoveredDistance.cpp, src/modules/grid/grid_analysis/CoveredDistance.h, src/modules/grid/grid_analysis/CrossClassification.cpp, src/modules/grid/grid_analysis/CrossClassification.h, src/modules/grid/grid_analysis/Grid_AHP.cpp, src/modules/grid/grid_analysis/Grid_AHP.h, src/modules/grid/grid_analysis/Grid_AggregationIndex.cpp, src/modules/grid/grid_analysis/Grid_AggregationIndex.h, src/modules/grid/grid_analysis/Grid_CVA.cpp, src/modules/grid/grid_analysis/Grid_CVA.h, src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.cpp, src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.h, src/modules/grid/grid_analysis/Grid_Pattern.cpp, src/modules/grid/grid_analysis/Grid_Pattern.h, src/modules/grid/grid_analysis/LeastCostPathProfile.cpp, src/modules/grid/grid_analysis/LeastCostPathProfile.h, src/modules/grid/grid_analysis/LeastCostPathProfile_Points.cpp, src/modules/grid/grid_analysis/LeastCostPathProfile_Points.h, src/modules/grid/grid_analysis/MLB_Interface.cpp, src/modules/grid/grid_analysis/MLB_Interface.h, src/modules/grid/grid_analysis/Makefile.am, src/modules/grid/grid_analysis/PointsEx.cpp, src/modules/grid/grid_analysis/PointsEx.h, src/modules/grid/grid_analysis/Soil_Texture.cpp, src/modules/grid/grid_analysis/Soil_Texture.h, src/modules/grid/grid_analysis/fragmentation_base.cpp, src/modules/grid/grid_analysis/fragmentation_base.h, src/modules/grid/grid_analysis/fragmentation_classify.cpp, src/modules/grid/grid_analysis/fragmentation_classify.h, src/modules/grid/grid_analysis/fragmentation_resampling.cpp, src/modules/grid/grid_analysis/fragmentation_resampling.h, src/modules/grid/grid_analysis/fragmentation_standard.cpp, src/modules/grid/grid_analysis/fragmentation_standard.h, src/modules/grid/grid_analysis/grid_analysis.dsp, src/modules/grid/grid_analysis/grid_analysis.vcproj, src/modules/grid/grid_analysis/grid_analysis.vcxproj, src/modules/grid/grid_analysis/grid_analysis.vcxproj.filters, src/modules/grid/grid_analysis/owa.cpp, src/modules/grid/grid_analysis/owa.h, src/modules/grid/grid_calculus/Fuzzify.cpp, src/modules/grid/grid_calculus/Fuzzify.h, src/modules/grid/grid_calculus/FuzzyAND.cpp, src/modules/grid/grid_calculus/FuzzyAND.h, src/modules/grid/grid_calculus/FuzzyOR.cpp, src/modules/grid/grid_calculus/FuzzyOR.h, src/modules/grid/grid_calculus/Grid_Calculator.cpp, src/modules/grid/grid_calculus/Grid_Calculator.h, src/modules/grid/grid_calculus/Grid_Geometric_Figures.cpp, src/modules/grid/grid_calculus/Grid_Geometric_Figures.h, src/modules/grid/grid_calculus/Grid_Normalise.cpp, src/modules/grid/grid_calculus/Grid_Normalise.h, src/modules/grid/grid_calculus/Grid_Plotter.cpp, src/modules/grid/grid_calculus/Grid_Plotter.h, src/modules/grid/grid_calculus/Grid_Random_Field.cpp, src/modules/grid/grid_calculus/Grid_Random_Field.h, src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp, src/modules/grid/grid_calculus/Grid_Random_Terrain.h, src/modules/grid/grid_calculus/Grid_Volume.cpp, src/modules/grid/grid_calculus/Grid_Volume.h, src/modules/grid/grid_calculus/MLB_Interface.cpp, src/modules/grid/grid_calculus/MLB_Interface.h, src/modules/grid/grid_calculus/Makefile.am, src/modules/grid/grid_calculus/grid_calculus.dsp, src/modules/grid/grid_calculus/grid_calculus.vcproj, src/modules/grid/grid_calculus/grid_calculus.vcxproj, src/modules/grid/grid_calculus/grid_calculus.vcxproj.filters, src/modules/grid/grid_calculus/grid_difference.cpp, src/modules/grid/grid_calculus/grid_difference.h, src/modules/grid/grid_calculus_bsl/MLB_Interface.cpp, src/modules/grid/grid_calculus_bsl/MLB_Interface.h, src/modules/grid/grid_calculus_bsl/Makefile.am, src/modules/grid/grid_calculus_bsl/ausdruck.cpp, src/modules/grid/grid_calculus_bsl/ausdruck.h, src/modules/grid/grid_calculus_bsl/auswert_anweisung.cpp, src/modules/grid/grid_calculus_bsl/auswert_anweisung.h, src/modules/grid/grid_calculus_bsl/auswert_foreach.cpp, src/modules/grid/grid_calculus_bsl/auswert_foreach.h, src/modules/grid/grid_calculus_bsl/auswert_if.cpp, src/modules/grid/grid_calculus_bsl/auswert_if.h, src/modules/grid/grid_calculus_bsl/auswert_zuweisung.cpp, src/modules/grid/grid_calculus_bsl/auswert_zuweisung.h, src/modules/grid/grid_calculus_bsl/basistypen.cpp, src/modules/grid/grid_calculus_bsl/basistypen.h, src/modules/grid/grid_calculus_bsl/bedingung.cpp, src/modules/grid/grid_calculus_bsl/bedingung.h, src/modules/grid/grid_calculus_bsl/bsl_interpreter.cpp, src/modules/grid/grid_calculus_bsl/bsl_interpreter.h, src/modules/grid/grid_calculus_bsl/diverses.cpp, src/modules/grid/grid_calculus_bsl/diverses.h, src/modules/grid/grid_calculus_bsl/foreach.cpp, src/modules/grid/grid_calculus_bsl/foreach.h, src/modules/grid/grid_calculus_bsl/funktion.cpp, src/modules/grid/grid_calculus_bsl/funktion.h, src/modules/grid/grid_calculus_bsl/funktion_numerisch.h, src/modules/grid/grid_calculus_bsl/funktion_statistisch.h, src/modules/grid/grid_calculus_bsl/gr_def.h, src/modules/grid/grid_calculus_bsl/gr_syst.h, src/modules/grid/grid_calculus_bsl/grid_bsl.cpp, src/modules/grid/grid_calculus_bsl/grid_bsl.h, src/modules/grid/grid_calculus_bsl/grid_calculus_bsl.dsp, src/modules/grid/grid_calculus_bsl/grid_calculus_bsl.vcproj, src/modules/grid/grid_calculus_bsl/grid_calculus_bsl.vcxproj, src/modules/grid/grid_calculus_bsl/grid_calculus_bsl.vcxproj.filters, src/modules/grid/grid_calculus_bsl/interpolation.cpp, src/modules/grid/grid_calculus_bsl/interpolation.h, src/modules/grid/grid_calculus_bsl/pars_all.cpp, src/modules/grid/grid_calculus_bsl/pars_all.h, src/modules/grid/grid_calculus_bsl/vector.cpp, src/modules/grid/grid_calculus_bsl/vector.h, src/modules/grid/grid_calculus_bsl/zuweisung.cpp, src/modules/grid/grid_calculus_bsl/zuweisung.h, src/modules/grid/grid_filter/Filter.cpp, src/modules/grid/grid_filter/Filter.h, src/modules/grid/grid_filter/FilterClumps.cpp, src/modules/grid/grid_filter/FilterClumps.h, src/modules/grid/grid_filter/Filter_3x3.cpp, src/modules/grid/grid_filter/Filter_3x3.h, src/modules/grid/grid_filter/Filter_Gauss.cpp, src/modules/grid/grid_filter/Filter_Gauss.h, src/modules/grid/grid_filter/Filter_LoG.cpp, src/modules/grid/grid_filter/Filter_LoG.h, src/modules/grid/grid_filter/Filter_Majority.cpp, src/modules/grid/grid_filter/Filter_Majority.h, src/modules/grid/grid_filter/Filter_Morphology.cpp, src/modules/grid/grid_filter/Filter_Morphology.h, src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.cpp, src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.h, src/modules/grid/grid_filter/Filter_Rank.cpp, src/modules/grid/grid_filter/Filter_Rank.h, src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.cpp, src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.h, src/modules/grid/grid_filter/MLB_Interface.cpp, src/modules/grid/grid_filter/MLB_Interface.h, src/modules/grid/grid_filter/Makefile.am, src/modules/grid/grid_filter/Pt.h, src/modules/grid/grid_filter/grid_filter.dsp, src/modules/grid/grid_filter/grid_filter.vcproj, src/modules/grid/grid_filter/grid_filter.vcxproj, src/modules/grid/grid_filter/grid_filter.vcxproj.filters, src/modules/grid/grid_gridding/Interpolation.cpp, src/modules/grid/grid_gridding/Interpolation.h, src/modules/grid/grid_gridding/Interpolation_InverseDistance.cpp, src/modules/grid/grid_gridding/Interpolation_InverseDistance.h, src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.cpp, src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.h, src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.cpp, src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.h, src/modules/grid/grid_gridding/Interpolation_Shepard.cpp, src/modules/grid/grid_gridding/Interpolation_Shepard.h, src/modules/grid/grid_gridding/Interpolation_Triangulation.cpp, src/modules/grid/grid_gridding/Interpolation_Triangulation.h, src/modules/grid/grid_gridding/MLB_Interface.cpp, src/modules/grid/grid_gridding/MLB_Interface.h, src/modules/grid/grid_gridding/Makefile.am, src/modules/grid/grid_gridding/Shapes2Grid.cpp, src/modules/grid/grid_gridding/Shapes2Grid.h, src/modules/grid/grid_gridding/Shepard.cpp, src/modules/grid/grid_gridding/Shepard.h, src/modules/grid/grid_gridding/grid_gridding.dsp, src/modules/grid/grid_gridding/grid_gridding.vcproj, src/modules/grid/grid_gridding/grid_gridding.vcxproj, src/modules/grid/grid_gridding/grid_gridding.vcxproj.filters, src/modules/grid/grid_gridding/kernel_density.cpp, src/modules/grid/grid_gridding/kernel_density.h, src/modules/grid/grid_gridding/nn/delaunay.c, src/modules/grid/grid_gridding/nn/delaunay.h, src/modules/grid/grid_gridding/nn/hash.c, src/modules/grid/grid_gridding/nn/hash.h, src/modules/grid/grid_gridding/nn/istack.c, src/modules/grid/grid_gridding/nn/istack.h, src/modules/grid/grid_gridding/nn/lpi.c, src/modules/grid/grid_gridding/nn/nan.h, src/modules/grid/grid_gridding/nn/nn.h, src/modules/grid/grid_gridding/nn/nnai.c, src/modules/grid/grid_gridding/nn/nncommon.c, src/modules/grid/grid_gridding/nn/nnpi.c, src/modules/grid/grid_gridding/nn/triangle.c, src/modules/grid/grid_gridding/nn/triangle.h, src/modules/grid/grid_gridding/nn/version.h, src/modules/grid/grid_spline/Gridding_Spline_BA.cpp, src/modules/grid/grid_spline/Gridding_Spline_BA.h, src/modules/grid/grid_spline/Gridding_Spline_Base.cpp, src/modules/grid/grid_spline/Gridding_Spline_Base.h, src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp, src/modules/grid/grid_spline/Gridding_Spline_CSA.h, src/modules/grid/grid_spline/Gridding_Spline_MBA.cpp, src/modules/grid/grid_spline/Gridding_Spline_MBA.h, src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.cpp, src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.h, src/modules/grid/grid_spline/Gridding_Spline_TPS_Global.cpp, src/modules/grid/grid_spline/Gridding_Spline_TPS_Global.h, src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.cpp, src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.h, src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.cpp, src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.h, src/modules/grid/grid_spline/MLB_Interface.cpp, src/modules/grid/grid_spline/MLB_Interface.h, src/modules/grid/grid_spline/Makefile.am, src/modules/grid/grid_spline/csa.c, src/modules/grid/grid_spline/csa.h, src/modules/grid/grid_spline/grid_spline.dsp, src/modules/grid/grid_spline/grid_spline.vcproj, src/modules/grid/grid_spline/grid_spline.vcxproj, src/modules/grid/grid_spline/grid_spline.vcxproj.filters, src/modules/grid/grid_tools/CreateGridSystem.cpp, src/modules/grid/grid_tools/CreateGridSystem.h, src/modules/grid/grid_tools/Grid_Aggregate.cpp, src/modules/grid/grid_tools/Grid_Aggregate.h, src/modules/grid/grid_tools/Grid_Buffer.cpp, src/modules/grid/grid_tools/Grid_Buffer.h, src/modules/grid/grid_tools/Grid_Buffer_Proximity.cpp, src/modules/grid/grid_tools/Grid_Buffer_Proximity.h, src/modules/grid/grid_tools/Grid_CombineGrids.cpp, src/modules/grid/grid_tools/Grid_CombineGrids.h, src/modules/grid/grid_tools/Grid_Completion.cpp, src/modules/grid/grid_tools/Grid_Completion.h, src/modules/grid/grid_tools/Grid_ConstantGrid.cpp, src/modules/grid/grid_tools/Grid_ConstantGrid.h, src/modules/grid/grid_tools/Grid_CropToData.cpp, src/modules/grid/grid_tools/Grid_CropToData.h, src/modules/grid/grid_tools/Grid_Cut.cpp, src/modules/grid/grid_tools/Grid_Cut.h, src/modules/grid/grid_tools/Grid_Fill.cpp, src/modules/grid/grid_tools/Grid_Fill.h, src/modules/grid/grid_tools/Grid_Gaps.cpp, src/modules/grid/grid_tools/Grid_Gaps.h, src/modules/grid/grid_tools/Grid_Gaps_OneCell.cpp, src/modules/grid/grid_tools/Grid_Gaps_OneCell.h, src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.cpp, src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.h, src/modules/grid/grid_tools/Grid_InvertNoData.cpp, src/modules/grid/grid_tools/Grid_InvertNoData.h, src/modules/grid/grid_tools/Grid_Mask.cpp, src/modules/grid/grid_tools/Grid_Mask.h, src/modules/grid/grid_tools/Grid_Merge.cpp, src/modules/grid/grid_tools/Grid_Merge.h, src/modules/grid/grid_tools/Grid_Orientation.cpp, src/modules/grid/grid_tools/Grid_Orientation.h, src/modules/grid/grid_tools/Grid_Proximity.cpp, src/modules/grid/grid_tools/Grid_Proximity.h, src/modules/grid/grid_tools/Grid_Resample.cpp, src/modules/grid/grid_tools/Grid_Resample.h, src/modules/grid/grid_tools/Grid_SortRaster.cpp, src/modules/grid/grid_tools/Grid_SortRaster.h, src/modules/grid/grid_tools/Grid_ThresholdBuffer.cpp, src/modules/grid/grid_tools/Grid_ThresholdBuffer.h, src/modules/grid/grid_tools/Grid_Tiling.cpp, src/modules/grid/grid_tools/Grid_Tiling.h, src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp, src/modules/grid/grid_tools/Grid_Value_Reclassify.h, src/modules/grid/grid_tools/Grid_Value_Replace.cpp, src/modules/grid/grid_tools/Grid_Value_Replace.h, src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.cpp, src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h, src/modules/grid/grid_tools/Grid_Value_Request.cpp, src/modules/grid/grid_tools/Grid_Value_Request.h, src/modules/grid/grid_tools/Grid_Value_Type.cpp, src/modules/grid/grid_tools/Grid_Value_Type.h, src/modules/grid/grid_tools/GridsFromTableAndGrid.cpp, src/modules/grid/grid_tools/GridsFromTableAndGrid.h, src/modules/grid/grid_tools/MLB_Interface.cpp, src/modules/grid/grid_tools/MLB_Interface.h, src/modules/grid/grid_tools/Makefile.am, src/modules/grid/grid_tools/Pt.h, src/modules/grid/grid_tools/grid_tools.dsp, src/modules/grid/grid_tools/grid_tools.vcproj, src/modules/grid/grid_tools/grid_tools.vcxproj, src/modules/grid/grid_tools/grid_tools.vcxproj.filters, src/modules/grid/grid_visualisation/Grid_3D_Image.cpp, src/modules/grid/grid_visualisation/Grid_3D_Image.h, src/modules/grid/grid_visualisation/Grid_Color_Blend.cpp, src/modules/grid/grid_visualisation/Grid_Color_Blend.h, src/modules/grid/grid_visualisation/Grid_Color_Rotate.cpp, src/modules/grid/grid_visualisation/Grid_Color_Rotate.h, src/modules/grid/grid_visualisation/Grid_Color_Triangle.cpp, src/modules/grid/grid_visualisation/Grid_Color_Triangle.h, src/modules/grid/grid_visualisation/Grid_Colors_Fit.cpp, src/modules/grid/grid_visualisation/Grid_Colors_Fit.h, src/modules/grid/grid_visualisation/Grid_Histogram_Surface.cpp, src/modules/grid/grid_visualisation/Grid_Histogram_Surface.h, src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp, src/modules/grid/grid_visualisation/Grid_RGB_Composite.h, src/modules/grid/grid_visualisation/MLB_Interface.cpp, src/modules/grid/grid_visualisation/MLB_Interface.h, src/modules/grid/grid_visualisation/Makefile.am, src/modules/grid/grid_visualisation/grid_visualisation.dsp, src/modules/grid/grid_visualisation/grid_visualisation.vcproj, src/modules/grid/grid_visualisation/grid_visualisation.vcxproj, src/modules/grid/grid_visualisation/grid_visualisation.vcxproj.filters, src/modules/pointcloud/Makefile.am, src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp, src/modules/pointcloud/pointcloud_tools/MLB_Interface.h, src/modules/pointcloud/pointcloud_tools/Makefile.am, src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp, src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.h, src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.cpp, src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.h, src/modules/pointcloud/pointcloud_tools/pc_cut.cpp, src/modules/pointcloud/pointcloud_tools/pc_cut.h, src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.cpp, src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.h, src/modules/pointcloud/pointcloud_tools/pc_from_grid.cpp, src/modules/pointcloud/pointcloud_tools/pc_from_grid.h, src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp, src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h, src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp, src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h, src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.cpp, src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.h, src/modules/pointcloud/pointcloud_tools/pc_to_grid.cpp, src/modules/pointcloud/pointcloud_tools/pc_to_grid.h, src/modules/pointcloud/pointcloud_tools/pc_to_shapes.cpp, src/modules/pointcloud/pointcloud_tools/pc_to_shapes.h, src/modules/pointcloud/pointcloud_tools/pc_transform.cpp, src/modules/pointcloud/pointcloud_tools/pc_transform.h, src/modules/pointcloud/pointcloud_tools/pointcloud_tools.dsp, src/modules/pointcloud/pointcloud_tools/pointcloud_tools.vcproj, src/modules/pointcloud/pointcloud_tools/pointcloud_tools.vcxproj, src/modules/pointcloud/pointcloud_tools/pointcloud_tools.vcxproj.filters, src/modules/pointcloud/pointcloud_viewer/MLB_Interface.cpp, src/modules/pointcloud/pointcloud_viewer/MLB_Interface.h, src/modules/pointcloud/pointcloud_viewer/Makefile.am, src/modules/pointcloud/pointcloud_viewer/pointcloud_viewer.dsp, src/modules/pointcloud/pointcloud_viewer/pointcloud_viewer.vcproj, src/modules/pointcloud/pointcloud_viewer/pointcloud_viewer.vcxproj, src/modules/pointcloud/pointcloud_viewer/pointcloud_viewer.vcxproj.filters, src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp, src/modules/pointcloud/pointcloud_viewer/points_view_control.h, src/modules/pointcloud/pointcloud_viewer/points_view_dialog.cpp, src/modules/pointcloud/pointcloud_viewer/points_view_dialog.h, src/modules/pointcloud/pointcloud_viewer/points_view_extent.cpp, src/modules/pointcloud/pointcloud_viewer/points_view_extent.h, src/modules/pointcloud/pointcloud_viewer/points_view_module.cpp, src/modules/pointcloud/pointcloud_viewer/points_view_module.h, src/modules/shapes/Makefile.am, src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp, src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.h, src/modules/shapes/shapes_grid/Grid_Polygon_Clip.cpp, src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h, src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.cpp, src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.h, src/modules/shapes/shapes_grid/Grid_To_Contour.cpp, src/modules/shapes/shapes_grid/Grid_To_Contour.h, src/modules/shapes/shapes_grid/Grid_To_Gradient.cpp, src/modules/shapes/shapes_grid/Grid_To_Gradient.h, src/modules/shapes/shapes_grid/Grid_To_Points.cpp, src/modules/shapes/shapes_grid/Grid_To_Points.h, src/modules/shapes/shapes_grid/Grid_To_Points_Random.cpp, src/modules/shapes/shapes_grid/Grid_To_Points_Random.h, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.cpp, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.h, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.cpp, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.h, src/modules/shapes/shapes_grid/MLB_Interface.cpp, src/modules/shapes/shapes_grid/MLB_Interface.h, src/modules/shapes/shapes_grid/Makefile.am, src/modules/shapes/shapes_grid/grid_local_extremes_to_points.cpp, src/modules/shapes/shapes_grid/grid_local_extremes_to_points.h, src/modules/shapes/shapes_grid/shapes_grid.dsp, src/modules/shapes/shapes_grid/shapes_grid.vcproj, src/modules/shapes/shapes_grid/shapes_grid.vcxproj, src/modules/shapes/shapes_grid/shapes_grid.vcxproj.filters, src/modules/shapes/shapes_lines/Lines_From_Points.cpp, src/modules/shapes/shapes_lines/Lines_From_Points.h, src/modules/shapes/shapes_lines/Lines_From_Polygons.cpp, src/modules/shapes/shapes_lines/Lines_From_Polygons.h, src/modules/shapes/shapes_lines/MLB_Interface.cpp, src/modules/shapes/shapes_lines/MLB_Interface.h, src/modules/shapes/shapes_lines/Makefile.am, src/modules/shapes/shapes_lines/line_dissolve.cpp, src/modules/shapes/shapes_lines/line_dissolve.h, src/modules/shapes/shapes_lines/line_polygon_intersection.cpp, src/modules/shapes/shapes_lines/line_polygon_intersection.h, src/modules/shapes/shapes_lines/line_properties.cpp, src/modules/shapes/shapes_lines/line_properties.h, src/modules/shapes/shapes_lines/line_simplification.cpp, src/modules/shapes/shapes_lines/line_simplification.h, src/modules/shapes/shapes_lines/shapes_lines.dsp, src/modules/shapes/shapes_lines/shapes_lines.vcproj, src/modules/shapes/shapes_lines/shapes_lines.vcxproj, src/modules/shapes/shapes_lines/shapes_lines.vcxproj.filters, src/modules/shapes/shapes_lines_ex/Containers.h, src/modules/shapes/shapes_lines_ex/DPHull.h, src/modules/shapes/shapes_lines_ex/LineApproximator.h, src/modules/shapes/shapes_lines_ex/MLB_Interface.cpp, src/modules/shapes/shapes_lines_ex/MLB_Interface.h, src/modules/shapes/shapes_lines_ex/Makefile.am, src/modules/shapes/shapes_lines_ex/PathHull.h, src/modules/shapes/shapes_lines_ex/SimplifyShapes.cpp, src/modules/shapes/shapes_lines_ex/SimplifyShapes.h, src/modules/shapes/shapes_lines_ex/shapes_lines_ex.dsp, src/modules/shapes/shapes_points/AddCoordinates.cpp, src/modules/shapes/shapes_points/AddCoordinates.h, src/modules/shapes/shapes_points/Clip_Points.cpp, src/modules/shapes/shapes_points/Clip_Points.h, src/modules/shapes/shapes_points/CountPoints.cpp, src/modules/shapes/shapes_points/CountPoints.h, src/modules/shapes/shapes_points/CreatePointGrid.cpp, src/modules/shapes/shapes_points/CreatePointGrid.h, src/modules/shapes/shapes_points/DistanceMatrix.cpp, src/modules/shapes/shapes_points/DistanceMatrix.h, src/modules/shapes/shapes_points/FitNPointsToShape.cpp, src/modules/shapes/shapes_points/FitNPointsToShape.h, src/modules/shapes/shapes_points/MLB_Interface.cpp, src/modules/shapes/shapes_points/MLB_Interface.h, src/modules/shapes/shapes_points/Makefile.am, src/modules/shapes/shapes_points/Points_From_Lines.cpp, src/modules/shapes/shapes_points/Points_From_Lines.h, src/modules/shapes/shapes_points/Points_From_Table.cpp, src/modules/shapes/shapes_points/Points_From_Table.h, src/modules/shapes/shapes_points/add_polygon_attributes.cpp, src/modules/shapes/shapes_points/add_polygon_attributes.h, src/modules/shapes/shapes_points/remove_duplicates.cpp, src/modules/shapes/shapes_points/remove_duplicates.h, src/modules/shapes/shapes_points/separate_by_direction.cpp, src/modules/shapes/shapes_points/separate_by_direction.h, src/modules/shapes/shapes_points/shapes_points.dsp, src/modules/shapes/shapes_points/shapes_points.vcproj, src/modules/shapes/shapes_points/shapes_points.vcxproj, src/modules/shapes/shapes_points/shapes_points.vcxproj.filters, src/modules/shapes/shapes_polygons/MLB_Interface.cpp, src/modules/shapes/shapes_polygons/MLB_Interface.h, src/modules/shapes/shapes_polygons/Makefile.am, src/modules/shapes/shapes_polygons/Polygon_Centroids.cpp, src/modules/shapes/shapes_polygons/Polygon_Centroids.h, src/modules/shapes/shapes_polygons/Polygon_Clipper.cpp, src/modules/shapes/shapes_polygons/Polygon_Clipper.h, src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp, src/modules/shapes/shapes_polygons/Polygon_Geometrics.h, src/modules/shapes/shapes_polygons/Polygon_Intersection.cpp, src/modules/shapes/shapes_polygons/Polygon_Intersection.h, src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp, src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.h, src/modules/shapes/shapes_polygons/Polygon_Union.cpp, src/modules/shapes/shapes_polygons/Polygon_Union.h, src/modules/shapes/shapes_polygons/Polygons_From_Lines.cpp, src/modules/shapes/shapes_polygons/Polygons_From_Lines.h, src/modules/shapes/shapes_polygons/polygon_to_points.cpp, src/modules/shapes/shapes_polygons/polygon_to_points.h, src/modules/shapes/shapes_polygons/shape_index.cpp, src/modules/shapes/shapes_polygons/shape_index.h, src/modules/shapes/shapes_polygons/shapes_polygons.dsp, src/modules/shapes/shapes_polygons/shapes_polygons.vcproj, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj, src/modules/shapes/shapes_polygons/shapes_polygons.vcxproj.filters, src/modules/shapes/shapes_tools/CreateChartLayer.cpp, src/modules/shapes/shapes_tools/CreateChartLayer.h, src/modules/shapes/shapes_tools/GraticuleBuilder.cpp, src/modules/shapes/shapes_tools/GraticuleBuilder.h, src/modules/shapes/shapes_tools/JoinTables.cpp, src/modules/shapes/shapes_tools/JoinTables.h, src/modules/shapes/shapes_tools/MLB_Interface.cpp, src/modules/shapes/shapes_tools/MLB_Interface.h, src/modules/shapes/shapes_tools/Makefile.am, src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.cpp, src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h, src/modules/shapes/shapes_tools/Polygon_Clipper.cpp, src/modules/shapes/shapes_tools/Polygon_Clipper.h, src/modules/shapes/shapes_tools/QueryBuilder.cpp, src/modules/shapes/shapes_tools/QueryBuilder.h, src/modules/shapes/shapes_tools/QueryParser.cpp, src/modules/shapes/shapes_tools/QueryParser.h, src/modules/shapes/shapes_tools/SearchInTable.cpp, src/modules/shapes/shapes_tools/SearchInTable.h, src/modules/shapes/shapes_tools/SelectByTheme.cpp, src/modules/shapes/shapes_tools/SelectByTheme.h, src/modules/shapes/shapes_tools/SeparateShapes.cpp, src/modules/shapes/shapes_tools/SeparateShapes.h, src/modules/shapes/shapes_tools/Shapes_Assign_Table.cpp, src/modules/shapes/shapes_tools/Shapes_Assign_Table.h, src/modules/shapes/shapes_tools/Shapes_Create_Empty.cpp, src/modules/shapes/shapes_tools/Shapes_Create_Empty.h, src/modules/shapes/shapes_tools/Shapes_Merge.cpp, src/modules/shapes/shapes_tools/Shapes_Merge.h, src/modules/shapes/shapes_tools/TransformShapes.cpp, src/modules/shapes/shapes_tools/TransformShapes.h, src/modules/shapes/shapes_tools/quadtree_structure.cpp, src/modules/shapes/shapes_tools/quadtree_structure.h, src/modules/shapes/shapes_tools/shapes_buffer.cpp, src/modules/shapes/shapes_tools/shapes_buffer.h, src/modules/shapes/shapes_tools/shapes_cut.cpp, src/modules/shapes/shapes_tools/shapes_cut.h, src/modules/shapes/shapes_tools/shapes_cut_interactive.cpp, src/modules/shapes/shapes_tools/shapes_cut_interactive.h, src/modules/shapes/shapes_tools/shapes_extents.cpp, src/modules/shapes/shapes_tools/shapes_extents.h, src/modules/shapes/shapes_tools/shapes_split.cpp, src/modules/shapes/shapes_tools/shapes_split.h, src/modules/shapes/shapes_tools/shapes_split_by_attribute.cpp, src/modules/shapes/shapes_tools/shapes_split_by_attribute.h, src/modules/shapes/shapes_tools/shapes_split_randomly.cpp, src/modules/shapes/shapes_tools/shapes_split_randomly.h, src/modules/shapes/shapes_tools/shapes_tools.dsp, src/modules/shapes/shapes_tools/shapes_tools.vcproj, src/modules/shapes/shapes_tools/shapes_tools.vcxproj, src/modules/shapes/shapes_tools/shapes_tools.vcxproj.filters, src/modules/shapes/shapes_transect/MLB_Interface.cpp, src/modules/shapes/shapes_transect/MLB_Interface.h, src/modules/shapes/shapes_transect/Makefile.am, src/modules/shapes/shapes_transect/Polygon_Transect.cpp, src/modules/shapes/shapes_transect/Polygon_Transect.h, src/modules/shapes/shapes_transect/shapes_transect.dsp, src/modules/shapes/shapes_transect/shapes_transect.vcproj, src/modules/shapes/shapes_transect/shapes_transect.vcxproj, src/modules/shapes/shapes_transect/shapes_transect.vcxproj.filters, src/modules/table/Makefile.am, src/modules/table/table_calculus/Fit.cpp, src/modules/table/table_calculus/Fit.h, src/modules/table/table_calculus/LMFit.cpp, src/modules/table/table_calculus/LMFit.h, src/modules/table/table_calculus/MLB_Interface.cpp, src/modules/table/table_calculus/MLB_Interface.h, src/modules/table/table_calculus/Makefile.am, src/modules/table/table_calculus/Table_Calculator.cpp, src/modules/table/table_calculus/Table_Calculator.h, src/modules/table/table_calculus/Table_CalculatorShapes.cpp, src/modules/table/table_calculus/Table_CalculatorShapes.h, src/modules/table/table_calculus/Table_Trend.cpp, src/modules/table/table_calculus/Table_Trend.h, src/modules/table/table_calculus/table_calculus.dsp, src/modules/table/table_calculus/table_calculus.vcproj, src/modules/table/table_calculus/table_calculus.vcxproj, src/modules/table/table_calculus/table_calculus.vcxproj.filters, src/modules/table/table_calculus/table_cluster_analysis.cpp, src/modules/table/table_calculus/table_cluster_analysis.h, src/modules/table/table_calculus/table_pca.cpp, src/modules/table/table_calculus/table_pca.h, src/modules/table/table_calculus/table_running_average.cpp, src/modules/table/table_calculus/table_running_average.h, src/modules/table/table_tools/MLB_Interface.cpp, src/modules/table/table_tools/MLB_Interface.h, src/modules/table/table_tools/Makefile.am, src/modules/table/table_tools/Table_Create_Empty.cpp, src/modules/table/table_tools/Table_Create_Empty.h, src/modules/table/table_tools/Table_Enumerate.cpp, src/modules/table/table_tools/Table_Enumerate.h, src/modules/table/table_tools/Table_Rotate.cpp, src/modules/table/table_tools/Table_Rotate.h, src/modules/table/table_tools/table_tools.dsp, src/modules/table/table_tools/table_tools.vcproj, src/modules/table/table_tools/table_tools.vcxproj, src/modules/table/table_tools/table_tools.vcxproj.filters, src/modules/tin/Makefile.am, src/modules/tin/tin_tools/MLB_Interface.cpp, src/modules/tin/tin_tools/MLB_Interface.h, src/modules/tin/tin_tools/Makefile.am, src/modules/tin/tin_tools/TIN_Flow_Parallel.cpp, src/modules/tin/tin_tools/TIN_Flow_Parallel.h, src/modules/tin/tin_tools/TIN_Flow_Trace.cpp, src/modules/tin/tin_tools/TIN_Flow_Trace.h, src/modules/tin/tin_tools/TIN_From_Grid.cpp, src/modules/tin/tin_tools/TIN_From_Grid.h, src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp, src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.h, src/modules/tin/tin_tools/TIN_From_Shapes.cpp, src/modules/tin/tin_tools/TIN_From_Shapes.h, src/modules/tin/tin_tools/TIN_Gradient.cpp, src/modules/tin/tin_tools/TIN_Gradient.h, src/modules/tin/tin_tools/TIN_To_Shapes.cpp, src/modules/tin/tin_tools/TIN_To_Shapes.h, src/modules/tin/tin_tools/tin_tools.dsp, src/modules/tin/tin_tools/tin_tools.vcproj, src/modules/tin/tin_tools/tin_tools.vcxproj, src/modules/tin/tin_tools/tin_tools.vcxproj.filters, src/modules_contrib/Makefile.am, src/modules_contrib/contrib_a_perego/Makefile.am, src/modules_contrib/contrib_a_perego/contrib_a_perego/A1WiTh.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/A1WiTh.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/A2WiTh.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/A2WiTh.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/A3WiTh.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/A3WiTh.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa1.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa1.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa2.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa2.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile.am, src/modules_contrib/contrib_a_perego/contrib_a_perego/contrib_a_perego.dsp, src/modules_contrib/contrib_a_perego/contrib_a_perego/contrib_a_perego.vcproj, src/modules_contrib/contrib_a_perego/contrib_a_perego/contrib_a_perego.vcxproj, src/modules_contrib/contrib_a_perego/contrib_a_perego/contrib_a_perego.vcxproj.filters, src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping1.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping1.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping2.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping2.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/directional1.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/directional1.h, src/modules_contrib/contrib_s_liersch/Makefile.am, src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.cpp, src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.h, src/modules_contrib/contrib_s_liersch/ihacres/Makefile.am, src/modules_contrib/contrib_s_liersch/ihacres/convert_sl.cpp, src/modules_contrib/contrib_s_liersch/ihacres/convert_sl.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres.dsp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres.vcproj, src/modules_contrib/contrib_s_liersch/ihacres/ihacres.vcxproj, src/modules_contrib/contrib_s_liersch/ihacres/ihacres.vcxproj.filters, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_basin.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_basin.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_bands.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_bands.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_cal.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_cal.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_eq.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_eq.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_v1.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_v1.h, src/modules_contrib/contrib_s_liersch/ihacres/model_tools.cpp, src/modules_contrib/contrib_s_liersch/ihacres/model_tools.h, src/modules_contrib/contrib_s_liersch/ihacres/snow_module.cpp, src/modules_contrib/contrib_s_liersch/ihacres/snow_module.h, src/modules_contrib/contrib_t_wutzler/Makefile.am, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/CompleteLinkage.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/CompleteLinkage.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/DebugStream.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/DebugStream.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/GridCalcError.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/GridCalcError.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/MLB_Interface.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/MLB_Interface.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/Makefile.am, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/NoDataValueError.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/NoDataValueError.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/Profiler.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/Profiler.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/contrib_t_wutzler.dsp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/rgbOverlay.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/rgbOverlay.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/tomaschTool.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/tomaschTool.h, src/modules_geostatistics/Makefile.am, src/modules_geostatistics/geostatistics/Makefile.am, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Directional_Statistics.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Directional_Statistics.h, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.h, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.h, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance.h, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance_Radius.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance_Radius.h, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.h, src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.h, src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile.am, src/modules_geostatistics/geostatistics/geostatistics_grid/fast_representativeness.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/fast_representativeness.h, src/modules_geostatistics/geostatistics/geostatistics_grid/geostatistics_grid.dsp, src/modules_geostatistics/geostatistics/geostatistics_grid/geostatistics_grid.vcproj, src/modules_geostatistics/geostatistics/geostatistics_grid/geostatistics_grid.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_grid/geostatistics_grid.vcxproj.filters, src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.h, src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.h, src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile.am, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary_global.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal_global.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/geostatistics_kriging.dsp, src/modules_geostatistics/geostatistics/geostatistics_kriging/geostatistics_kriging.vcproj, src/modules_geostatistics/geostatistics/geostatistics_kriging/geostatistics_kriging.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_kriging/geostatistics_kriging.vcxproj.filters, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary_global.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal_global.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.h, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.h, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Pattern_Analysis.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Pattern_Analysis.h, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Semi_Variances.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Semi_Variances.h, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Cloud.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Cloud.h, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Surface.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Surface.h, src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.h, src/modules_geostatistics/geostatistics/geostatistics_points/Makefile.am, src/modules_geostatistics/geostatistics/geostatistics_points/geostatistics_points.dsp, src/modules_geostatistics/geostatistics/geostatistics_points/geostatistics_points.vcproj, src/modules_geostatistics/geostatistics/geostatistics_points/geostatistics_points.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_points/geostatistics_points.vcxproj.filters, src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.h, src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.am, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.dsp, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.vcproj, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.vcxproj, src/modules_geostatistics/geostatistics/geostatistics_regression/geostatistics_regression.vcxproj.filters, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression.h, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_grid.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_grid.h, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.h, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression_grid.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression_grid.h, src/modules_geostatistics/geostatistics/geostatistics_regression/point_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_grid_regression.h, src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.h, src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.h, src/modules_images/Makefile.am, src/modules_images/modules_imagery/Makefile.am, src/modules_images/modules_imagery/imagery_classification/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_classification/MLB_Interface.h, src/modules_images/modules_imagery/imagery_classification/Makefile.am, src/modules_images/modules_imagery/imagery_classification/change_detection.cpp, src/modules_images/modules_imagery/imagery_classification/change_detection.h, src/modules_images/modules_imagery/imagery_classification/classify_cluster_analysis.cpp, src/modules_images/modules_imagery/imagery_classification/classify_cluster_analysis.h, src/modules_images/modules_imagery/imagery_classification/classify_supervised.cpp, src/modules_images/modules_imagery/imagery_classification/classify_supervised.h, src/modules_images/modules_imagery/imagery_classification/imagery_classification.dsp, src/modules_images/modules_imagery/imagery_classification/imagery_classification.vcproj, src/modules_images/modules_imagery/imagery_classification/imagery_classification.vcxproj, src/modules_images/modules_imagery/imagery_classification/imagery_classification.vcxproj.filters, src/modules_images/modules_imagery/imagery_rga/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_rga/MLB_Interface.h, src/modules_images/modules_imagery/imagery_rga/Makefile.am, src/modules_images/modules_imagery/imagery_rga/fast_region_growing.cpp, src/modules_images/modules_imagery/imagery_rga/fast_region_growing.h, src/modules_images/modules_imagery/imagery_rga/imagery_rga.dsp, src/modules_images/modules_imagery/imagery_rga/imagery_rga.vcproj, src/modules_images/modules_imagery/imagery_rga/imagery_rga.vcxproj, src/modules_images/modules_imagery/imagery_rga/imagery_rga.vcxproj.filters, src/modules_images/modules_imagery/imagery_segmentation/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_segmentation/MLB_Interface.h, src/modules_images/modules_imagery/imagery_segmentation/Makefile.am, src/modules_images/modules_imagery/imagery_segmentation/grid_seeds.cpp, src/modules_images/modules_imagery/imagery_segmentation/grid_seeds.h, src/modules_images/modules_imagery/imagery_segmentation/imagery_segmentation.dsp, src/modules_images/modules_imagery/imagery_segmentation/imagery_segmentation.vcproj, src/modules_images/modules_imagery/imagery_segmentation/imagery_segmentation.vcxproj, src/modules_images/modules_imagery/imagery_segmentation/imagery_segmentation.vcxproj.filters, src/modules_images/modules_imagery/imagery_segmentation/rga_basic.cpp, src/modules_images/modules_imagery/imagery_segmentation/rga_basic.h, src/modules_images/modules_imagery/imagery_segmentation/skeletonization.cpp, src/modules_images/modules_imagery/imagery_segmentation/skeletonization.h, src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.cpp, src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.h, src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.cpp, src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.h, src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.cpp, src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.h, src/modules_images/modules_imagery/imagery_tools/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_tools/MLB_Interface.h, src/modules_images/modules_imagery/imagery_tools/Makefile.am, src/modules_images/modules_imagery/imagery_tools/imagery_tools.dsp, src/modules_images/modules_imagery/imagery_tools/imagery_tools.vcproj, src/modules_images/modules_imagery/imagery_tools/imagery_tools.vcxproj, src/modules_images/modules_imagery/imagery_tools/imagery_tools.vcxproj.filters, src/modules_images/modules_opencv/Makefile.am, src/modules_images/modules_opencv/opencv/MLB_Interface.cpp, src/modules_images/modules_opencv/opencv/MLB_Interface.h, src/modules_images/modules_opencv/opencv/Makefile.am, src/modules_images/modules_opencv/opencv/opencv.cpp, src/modules_images/modules_opencv/opencv/opencv.dsp, src/modules_images/modules_opencv/opencv/opencv.h, src/modules_images/modules_opencv/opencv/opencv.vcproj, src/modules_images/modules_opencv/opencv/opencv.vcxproj, src/modules_images/modules_opencv/opencv/opencv.vcxproj.filters, src/modules_images/modules_opencv/opencv/opencv_fourier.cpp, src/modules_images/modules_opencv/opencv/opencv_fourier.h, src/modules_images/modules_opencv/opencv/opencv_morphology.cpp, src/modules_images/modules_opencv/opencv/opencv_morphology.h, src/modules_images/modules_opencv/opencv/opencv_svd.cpp, src/modules_images/modules_opencv/opencv/opencv_svd.h, src/modules_images/modules_vigra/Makefile.am, src/modules_images/modules_vigra/vigra/MLB_Interface.cpp, src/modules_images/modules_vigra/vigra/MLB_Interface.h, src/modules_images/modules_vigra/vigra/Makefile.am, src/modules_images/modules_vigra/vigra/vigra.cpp, src/modules_images/modules_vigra/vigra/vigra.dsp, src/modules_images/modules_vigra/vigra/vigra.h, src/modules_images/modules_vigra/vigra/vigra.sln, src/modules_images/modules_vigra/vigra/vigra.vcproj, src/modules_images/modules_vigra/vigra/vigra.vcxproj, src/modules_images/modules_vigra/vigra/vigra.vcxproj.filters, src/modules_images/modules_vigra/vigra/vigra_distance.cpp, src/modules_images/modules_vigra/vigra/vigra_distance.h, src/modules_images/modules_vigra/vigra/vigra_edges.cpp, src/modules_images/modules_vigra/vigra/vigra_edges.h, src/modules_images/modules_vigra/vigra/vigra_fft.cpp, src/modules_images/modules_vigra/vigra/vigra_fft.h, src/modules_images/modules_vigra/vigra/vigra_morphology.cpp, src/modules_images/modules_vigra/vigra/vigra_morphology.h, src/modules_images/modules_vigra/vigra/vigra_smoothing.cpp, src/modules_images/modules_vigra/vigra/vigra_smoothing.h, src/modules_images/modules_vigra/vigra/vigra_watershed.cpp, src/modules_images/modules_vigra/vigra/vigra_watershed.h, src/modules_io/Makefile.am, src/modules_io/db/Makefile.am, src/modules_io/db/io_db_mysql/Get_Table.cpp, src/modules_io/db/io_db_mysql/Get_Table.h, src/modules_io/db/io_db_mysql/MLB_Interface.cpp, src/modules_io/db/io_db_mysql/MLB_Interface.h, src/modules_io/db/io_db_mysql/Makefile.am, src/modules_io/db/io_db_mysql/io_db_mysql.dsp, src/modules_io/db/io_db_mysql/io_db_mysql.vcproj, src/modules_io/db/io_db_mysql/readme.txt, src/modules_io/db/io_odbc/MLB_Interface.cpp, src/modules_io/db/io_odbc/MLB_Interface.h, src/modules_io/db/io_odbc/Makefile.am, src/modules_io/db/io_odbc/get_connection.cpp, src/modules_io/db/io_odbc/get_connection.h, src/modules_io/db/io_odbc/io_odbc.dsp, src/modules_io/db/io_odbc/io_odbc.vcproj, src/modules_io/db/io_odbc/io_odbc.vcxproj, src/modules_io/db/io_odbc/io_odbc.vcxproj.filters, src/modules_io/db/io_odbc/pgis_shapes.cpp, src/modules_io/db/io_odbc/pgis_shapes.h, src/modules_io/db/io_odbc/shapes.cpp, src/modules_io/db/io_odbc/shapes.h, src/modules_io/db/io_odbc/table.cpp, src/modules_io/db/io_odbc/table.h, src/modules_io/docs/Makefile.am, src/modules_io/docs/docs_html/CreateWebContent.cpp, src/modules_io/docs/docs_html/CreateWebContent.h, src/modules_io/docs/docs_html/MLB_Interface.cpp, src/modules_io/docs/docs_html/MLB_Interface.h, src/modules_io/docs/docs_html/Makefile.am, src/modules_io/docs/docs_html/doc_html.cpp, src/modules_io/docs/docs_html/doc_html.h, src/modules_io/docs/docs_html/doc_svg.cpp, src/modules_io/docs/docs_html/doc_svg.h, src/modules_io/docs/docs_html/docs_html.dsp, src/modules_io/docs/docs_html/docs_html.vcproj, src/modules_io/docs/docs_html/docs_html.vcxproj, src/modules_io/docs/docs_html/docs_html.vcxproj.filters, src/modules_io/docs/docs_html/svg_interactive_map.cpp, src/modules_io/docs/docs_html/svg_interactive_map.h, src/modules_io/docs/docs_pdf/MLB_Interface.cpp, src/modules_io/docs/docs_pdf/MLB_Interface.h, src/modules_io/docs/docs_pdf/Makefile.am, src/modules_io/docs/docs_pdf/Polygon_Clipper.cpp, src/modules_io/docs/docs_pdf/Polygon_Clipper.h, src/modules_io/docs/docs_pdf/Profile_Cross_Sections.cpp, src/modules_io/docs/docs_pdf/Profile_Cross_Sections.h, src/modules_io/docs/docs_pdf/Shapes_Report.cpp, src/modules_io/docs/docs_pdf/Shapes_Report.h, src/modules_io/docs/docs_pdf/Shapes_Summary.cpp, src/modules_io/docs/docs_pdf/Shapes_Summary.h, src/modules_io/docs/docs_pdf/doc_pdf.cpp, src/modules_io/docs/docs_pdf/doc_pdf.h, src/modules_io/docs/docs_pdf/docs_pdf.dsp, src/modules_io/docs/docs_pdf/docs_pdf.vcproj, src/modules_io/docs/docs_pdf/docs_pdf.vcxproj, src/modules_io/docs/docs_pdf/docs_pdf.vcxproj.filters, src/modules_io/esri_e00/Makefile.am, src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.cpp, src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.h, src/modules_io/esri_e00/io_esri_e00/MLB_Interface.cpp, src/modules_io/esri_e00/io_esri_e00/MLB_Interface.h, src/modules_io/esri_e00/io_esri_e00/Makefile.am, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_conv.c, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_conv.h, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_error.c, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_error.h, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_port.h, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_vsi.h, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_vsisimple.c, src/modules_io/esri_e00/io_esri_e00/e00compr/e00compr.h, src/modules_io/esri_e00/io_esri_e00/e00compr/e00read.c, src/modules_io/esri_e00/io_esri_e00/e00compr/e00write.c, src/modules_io/esri_e00/io_esri_e00/io_esri_e00.dsp, src/modules_io/esri_e00/io_esri_e00/io_esri_e00.vcproj, src/modules_io/esri_e00/io_esri_e00/io_esri_e00.vcxproj, src/modules_io/esri_e00/io_esri_e00/io_esri_e00.vcxproj.filters, src/modules_io/gdal/Makefile.am, src/modules_io/gdal/io_gdal/MLB_Interface.cpp, src/modules_io/gdal/io_gdal/MLB_Interface.h, src/modules_io/gdal/io_gdal/Makefile.am, src/modules_io/gdal/io_gdal/gdal_driver.cpp, src/modules_io/gdal/io_gdal/gdal_driver.h, src/modules_io/gdal/io_gdal/gdal_export.cpp, src/modules_io/gdal/io_gdal/gdal_export.h, src/modules_io/gdal/io_gdal/gdal_export_geotiff.cpp, src/modules_io/gdal/io_gdal/gdal_export_geotiff.h, src/modules_io/gdal/io_gdal/gdal_import.cpp, src/modules_io/gdal/io_gdal/gdal_import.h, src/modules_io/gdal/io_gdal/io_gdal.dsp, src/modules_io/gdal/io_gdal/io_gdal.vcproj, src/modules_io/gdal/io_gdal/io_gdal.vcxproj, src/modules_io/gdal/io_gdal/io_gdal.vcxproj.filters, src/modules_io/gdal/io_gdal/ogr_driver.cpp, src/modules_io/gdal/io_gdal/ogr_driver.h, src/modules_io/gdal/io_gdal/ogr_export.cpp, src/modules_io/gdal/io_gdal/ogr_export.h, src/modules_io/gdal/io_gdal/ogr_import.cpp, src/modules_io/gdal/io_gdal/ogr_import.h, src/modules_io/gps/Makefile.am, src/modules_io/gps/io_gps/GPSBabel.cpp, src/modules_io/gps/io_gps/GPSBabel.h, src/modules_io/gps/io_gps/MLB_Interface.cpp, src/modules_io/gps/io_gps/MLB_Interface.h, src/modules_io/gps/io_gps/Makefile.am, src/modules_io/gps/io_gps/gpx2shp.cpp, src/modules_io/gps/io_gps/gpx2shp.h, src/modules_io/gps/io_gps/io_gps.dsp, src/modules_io/gps/io_gps/io_gps.vcproj, src/modules_io/gps/io_gps/io_gps.vcxproj, src/modules_io/gps/io_gps/io_gps.vcxproj.filters, src/modules_io/grid/Makefile.am, src/modules_io/grid/io_grid/MLB_Interface.cpp, src/modules_io/grid/io_grid/MLB_Interface.h, src/modules_io/grid/io_grid/Makefile.am, src/modules_io/grid/io_grid/bmp_export.cpp, src/modules_io/grid/io_grid/bmp_export.h, src/modules_io/grid/io_grid/erdas_lan.cpp, src/modules_io/grid/io_grid/erdas_lan.h, src/modules_io/grid/io_grid/esri_arcinfo.cpp, src/modules_io/grid/io_grid/esri_arcinfo.h, src/modules_io/grid/io_grid/grid_table.cpp, src/modules_io/grid/io_grid/grid_table.h, src/modules_io/grid/io_grid/io_grid.dsp, src/modules_io/grid/io_grid/io_grid.vcproj, src/modules_io/grid/io_grid/io_grid.vcxproj, src/modules_io/grid/io_grid/io_grid.vcxproj.filters, src/modules_io/grid/io_grid/mola.cpp, src/modules_io/grid/io_grid/mola.h, src/modules_io/grid/io_grid/raw.cpp, src/modules_io/grid/io_grid/raw.h, src/modules_io/grid/io_grid/srtm30.cpp, src/modules_io/grid/io_grid/srtm30.h, src/modules_io/grid/io_grid/surfer.cpp, src/modules_io/grid/io_grid/surfer.h, src/modules_io/grid/io_grid/usgs_srtm.cpp, src/modules_io/grid/io_grid/usgs_srtm.h, src/modules_io/grid/io_grid/xyz.cpp, src/modules_io/grid/io_grid/xyz.h, src/modules_io/grid/io_grid_grib2/MLB_Interface.cpp, src/modules_io/grid/io_grid_grib2/MLB_Interface.h, src/modules_io/grid/io_grid_grib2/Makefile.am, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/CHANGES, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/README, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/cmplxpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/compack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/comunpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/dec_jpeg2000.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/dec_png.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/drstemplates.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/drstemplates.h, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/enc_jpeg2000.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/enc_png.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_addfield.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_addgrid.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_addlocal.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_create.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_free.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_getfld.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_gribend.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_info.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_miss.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack1.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack2.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack3.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack4.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack5.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack6.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack7.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/gbits.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/getdim.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/getpoly.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/grib2.h, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/grib2c.doc, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/gridtemplates.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/gridtemplates.h, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/int_power.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/jpcpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/jpcunpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/makefile, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/misspack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/mkieee.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/pack_gp.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/pdstemplates.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/pdstemplates.h, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/pngpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/pngunpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/rdieee.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/reduce.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/seekgb.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/simpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/simunpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/specpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/specunpack.c, src/modules_io/grid/io_grid_grib2/grib2_import.cpp, src/modules_io/grid/io_grid_grib2/grib2_import.h, src/modules_io/grid/io_grid_grib2/io_grid_grib2.dsp, src/modules_io/grid/io_grid_grib2/io_grid_grib2.dsw, src/modules_io/grid/io_grid_grib2/io_grid_grib2.vcproj, src/modules_io/grid/io_grid_grib2/io_grid_grib2.vcxproj, src/modules_io/grid/io_grid_grib2/io_grid_grib2.vcxproj.filters, src/modules_io/grid/io_grid_grib2/io_grid_grib2_x.dsp, src/modules_io/grid/io_grid_image/MLB_Interface.cpp, src/modules_io/grid/io_grid_image/MLB_Interface.h, src/modules_io/grid/io_grid_image/Makefile.am, src/modules_io/grid/io_grid_image/grid_export.cpp, src/modules_io/grid/io_grid_image/grid_export.h, src/modules_io/grid/io_grid_image/grid_import.cpp, src/modules_io/grid/io_grid_image/grid_import.h, src/modules_io/grid/io_grid_image/io_grid_image.dsp, src/modules_io/grid/io_grid_image/io_grid_image.vcproj, src/modules_io/grid/io_grid_image/io_grid_image.vcxproj, src/modules_io/grid/io_grid_image/io_grid_image.vcxproj.filters, src/modules_io/shapes/Makefile.am, src/modules_io/shapes/io_shapes/MLB_Interface.cpp, src/modules_io/shapes/io_shapes/MLB_Interface.h, src/modules_io/shapes/io_shapes/Makefile.am, src/modules_io/shapes/io_shapes/atlas_bna.cpp, src/modules_io/shapes/io_shapes/atlas_bna.h, src/modules_io/shapes/io_shapes/generate.cpp, src/modules_io/shapes/io_shapes/generate.h, src/modules_io/shapes/io_shapes/gpx.cpp, src/modules_io/shapes/io_shapes/gpx.h, src/modules_io/shapes/io_shapes/gstat.cpp, src/modules_io/shapes/io_shapes/gstat.h, src/modules_io/shapes/io_shapes/io_shapes.dsp, src/modules_io/shapes/io_shapes/io_shapes.vcproj, src/modules_io/shapes/io_shapes/io_shapes.vcxproj, src/modules_io/shapes/io_shapes/io_shapes.vcxproj.filters, src/modules_io/shapes/io_shapes/pointcloud_from_file.cpp, src/modules_io/shapes/io_shapes/pointcloud_from_file.h, src/modules_io/shapes/io_shapes/pointcloud_from_text_file.cpp, src/modules_io/shapes/io_shapes/pointcloud_from_text_file.h, src/modules_io/shapes/io_shapes/stl.cpp, src/modules_io/shapes/io_shapes/stl.h, src/modules_io/shapes/io_shapes/surfer_bln.cpp, src/modules_io/shapes/io_shapes/surfer_bln.h, src/modules_io/shapes/io_shapes/svg.cpp, src/modules_io/shapes/io_shapes/svg.h, src/modules_io/shapes/io_shapes/wasp_map.cpp, src/modules_io/shapes/io_shapes/wasp_map.h, src/modules_io/shapes/io_shapes/xyz.cpp, src/modules_io/shapes/io_shapes/xyz.h, src/modules_io/shapes/io_shapes_dxf/MLB_Interface.cpp, src/modules_io/shapes/io_shapes_dxf/MLB_Interface.h, src/modules_io/shapes/io_shapes_dxf/Makefile.am, src/modules_io/shapes/io_shapes_dxf/dxf_import.cpp, src/modules_io/shapes/io_shapes_dxf/dxf_import.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_attributes.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_codes.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_creationadapter.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_creationinterface.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_dxf.cpp, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_dxf.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_entities.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_exception.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_extrusion.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer_ascii.cpp, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer_ascii.h, src/modules_io/shapes/io_shapes_dxf/io_shapes_dxf.dsp, src/modules_io/shapes/io_shapes_dxf/io_shapes_dxf.vcproj, src/modules_io/shapes/io_shapes_dxf/io_shapes_dxf.vcxproj, src/modules_io/shapes/io_shapes_dxf/io_shapes_dxf.vcxproj.filters, src/modules_io/shapes/io_shapes_las/MLB_Interface.cpp, src/modules_io/shapes/io_shapes_las/MLB_Interface.h, src/modules_io/shapes/io_shapes_las/Makefile.am, src/modules_io/shapes/io_shapes_las/io_shapes_las.dsp, src/modules_io/shapes/io_shapes_las/io_shapes_las.vcproj, src/modules_io/shapes/io_shapes_las/io_shapes_las.vcxproj, src/modules_io/shapes/io_shapes_las/io_shapes_las.vcxproj.filters, src/modules_io/shapes/io_shapes_las/las_export.cpp, src/modules_io/shapes/io_shapes_las/las_export.h, src/modules_io/shapes/io_shapes_las/las_import.cpp, src/modules_io/shapes/io_shapes_las/las_import.h, src/modules_io/shapes/io_shapes_las/las_info.cpp, src/modules_io/shapes/io_shapes_las/las_info.h, src/modules_io/table/Makefile.am, src/modules_io/table/io_table/MLB_Interface.cpp, src/modules_io/table/io_table/MLB_Interface.h, src/modules_io/table/io_table/Makefile.am, src/modules_io/table/io_table/io_table.dsp, src/modules_io/table/io_table/io_table.vcproj, src/modules_io/table/io_table/io_table.vcxproj, src/modules_io/table/io_table/io_table.vcxproj.filters, src/modules_io/table/io_table/io_table_txt.cpp, src/modules_io/table/io_table/io_table_txt.h, src/modules_lectures/Makefile.am, src/modules_lectures/lectures/Makefile.am, src/modules_lectures/lectures/lectures_introduction/Exercise_01.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_01.h, src/modules_lectures/lectures/lectures_introduction/Exercise_02.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_02.h, src/modules_lectures/lectures/lectures_introduction/Exercise_03.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_03.h, src/modules_lectures/lectures/lectures_introduction/Exercise_04.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_04.h, src/modules_lectures/lectures/lectures_introduction/Exercise_05.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_05.h, src/modules_lectures/lectures/lectures_introduction/Exercise_06.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_06.h, src/modules_lectures/lectures/lectures_introduction/Exercise_07.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_07.h, src/modules_lectures/lectures/lectures_introduction/Exercise_08.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_08.h, src/modules_lectures/lectures/lectures_introduction/Exercise_09.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_09.h, src/modules_lectures/lectures/lectures_introduction/Exercise_10.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_10.h, src/modules_lectures/lectures/lectures_introduction/Exercise_11.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_11.h, src/modules_lectures/lectures/lectures_introduction/Exercise_12.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_12.h, src/modules_lectures/lectures/lectures_introduction/Exercise_13.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_13.h, src/modules_lectures/lectures/lectures_introduction/Exercise_14.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_14.h, src/modules_lectures/lectures/lectures_introduction/MLB_Interface.cpp, src/modules_lectures/lectures/lectures_introduction/MLB_Interface.h, src/modules_lectures/lectures/lectures_introduction/Makefile.am, src/modules_lectures/lectures/lectures_introduction/lectures_introduction.dsp, src/modules_lectures/lectures/lectures_introduction/lectures_introduction.vcproj, src/modules_lectures/lectures/lectures_introduction/lectures_introduction.vcxproj, src/modules_lectures/lectures/lectures_introduction/lectures_introduction.vcxproj.filters, src/modules_projection/Makefile.am, src/modules_projection/pj_georeference/Makefile.am, src/modules_projection/pj_georeference/pj_georeference/Collect_Points.cpp, src/modules_projection/pj_georeference/pj_georeference/Collect_Points.h, src/modules_projection/pj_georeference/pj_georeference/Georef_Engine.cpp, src/modules_projection/pj_georeference/pj_georeference/Georef_Engine.h, src/modules_projection/pj_georeference/pj_georeference/Georef_Grid.cpp, src/modules_projection/pj_georeference/pj_georeference/Georef_Grid.h, src/modules_projection/pj_georeference/pj_georeference/Georef_Shapes.cpp, src/modules_projection/pj_georeference/pj_georeference/Georef_Shapes.h, src/modules_projection/pj_georeference/pj_georeference/MLB_Interface.cpp, src/modules_projection/pj_georeference/pj_georeference/MLB_Interface.h, src/modules_projection/pj_georeference/pj_georeference/Makefile.am, src/modules_projection/pj_georeference/pj_georeference/cminpak.h, src/modules_projection/pj_georeference/pj_georeference/dpmpar.h, src/modules_projection/pj_georeference/pj_georeference/enorm.c, src/modules_projection/pj_georeference/pj_georeference/fdjac2.c, src/modules_projection/pj_georeference/pj_georeference/georef_grid_move.cpp, src/modules_projection/pj_georeference/pj_georeference/georef_grid_move.h, src/modules_projection/pj_georeference/pj_georeference/lmdif.c, src/modules_projection/pj_georeference/pj_georeference/lmdif0.c, src/modules_projection/pj_georeference/pj_georeference/lmpar.c, src/modules_projection/pj_georeference/pj_georeference/pj_georeference.dsp, src/modules_projection/pj_georeference/pj_georeference/pj_georeference.vcproj, src/modules_projection/pj_georeference/pj_georeference/pj_georeference.vcxproj, src/modules_projection/pj_georeference/pj_georeference/pj_georeference.vcxproj.filters, src/modules_projection/pj_georeference/pj_georeference/qrfac.c, src/modules_projection/pj_georeference/pj_georeference/qrsolv.c, src/modules_projection/pj_geotrans/Makefile.am, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Base.cpp, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Base.h, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Grid.cpp, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Grid.h, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Shapes.cpp, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Shapes.h, src/modules_projection/pj_geotrans/pj_geotrans/MLB_Interface.cpp, src/modules_projection/pj_geotrans/pj_geotrans/MLB_Interface.h, src/modules_projection/pj_geotrans/pj_geotrans/Makefile.am, src/modules_projection/pj_geotrans/pj_geotrans/data/Projection_GeoTRANS_Datum_3.dat, src/modules_projection/pj_geotrans/pj_geotrans/data/Projection_GeoTRANS_Datum_7.dat, src/modules_projection/pj_geotrans/pj_geotrans/data/Projection_GeoTRANS_Ellipsoid.dat, src/modules_projection/pj_geotrans/pj_geotrans/data/Projection_GeoTRANS_Geoid_EGM96.dat, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/albers.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/albers.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/azeq.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/azeq.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/bng.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/bng.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/bonne.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/bonne.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/cassini.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/cassini.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/cyleqa.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/cyleqa.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/datum.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/datum.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eckert4.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eckert4.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eckert6.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eckert6.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/ellipse.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/ellipse.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/engine.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/engine.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eqdcyl.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eqdcyl.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/geocent.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/geocent.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/geoid.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/geoid.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/georef.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/georef.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/geotrans.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/gnomonic.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/gnomonic.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/grinten.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/grinten.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert_1.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert_1.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert_2.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert_2.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/loccart.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/loccart.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mercator.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mercator.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mgrs.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mgrs.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/miller.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/miller.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mollweid.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mollweid.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/neys.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/neys.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/nzmg.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/nzmg.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/omerc.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/omerc.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/orthogr.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/orthogr.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/polarst.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/polarst.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/polycon.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/polycon.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/sinusoid.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/sinusoid.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/stereogr.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/stereogr.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/tranmerc.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/tranmerc.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/trcyleqa.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/trcyleqa.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/ups.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/ups.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/utm.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/utm.h, src/modules_projection/pj_geotrans/pj_geotrans/pj_geotrans.dsp, src/modules_projection/pj_geotrans/pj_geotrans/pj_geotrans.vcproj, src/modules_projection/pj_geotrans/pj_geotrans/pj_geotrans.vcxproj, src/modules_projection/pj_geotrans/pj_geotrans/pj_geotrans.vcxproj.filters, src/modules_projection/pj_proj4/Makefile.am, src/modules_projection/pj_proj4/pj_proj4/MLB_Interface.cpp, src/modules_projection/pj_proj4/pj_proj4/MLB_Interface.h, src/modules_projection/pj_proj4/pj_proj4/Makefile.am, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Base.cpp, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Base.h, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Grid.cpp, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Grid.h, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Shapes.cpp, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Shapes.h, src/modules_projection/pj_proj4/pj_proj4/crs_assign.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_assign.h, src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_base.h, src/modules_projection/pj_proj4/pj_proj4/crs_transform.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_transform.h, src/modules_projection/pj_proj4/pj_proj4/crs_transform_grid.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_transform_grid.h, src/modules_projection/pj_proj4/pj_proj4/crs_transform_shapes.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_transform_shapes.h, src/modules_projection/pj_proj4/pj_proj4/pj_proj4.dsp, src/modules_projection/pj_proj4/pj_proj4/pj_proj4.vcproj, src/modules_projection/pj_proj4/pj_proj4/pj_proj4.vcxproj, src/modules_projection/pj_proj4/pj_proj4/pj_proj4.vcxproj.filters, src/modules_recreations/Makefile.am, src/modules_recreations/recreations/Makefile.am, src/modules_recreations/recreations/recreations_fractals/Bifurcation.cpp, src/modules_recreations/recreations/recreations_fractals/Bifurcation.h, src/modules_recreations/recreations/recreations_fractals/Gaussian_Landscapes.cpp, src/modules_recreations/recreations/recreations_fractals/Gaussian_Landscapes.h, src/modules_recreations/recreations/recreations_fractals/Grid_FractalDimension.cpp, src/modules_recreations/recreations/recreations_fractals/Grid_FractalDimension.h, src/modules_recreations/recreations/recreations_fractals/MLB_Interface.cpp, src/modules_recreations/recreations/recreations_fractals/MLB_Interface.h, src/modules_recreations/recreations/recreations_fractals/Makefile.am, src/modules_recreations/recreations/recreations_fractals/Mandelbrot.cpp, src/modules_recreations/recreations/recreations_fractals/Mandelbrot.h, src/modules_recreations/recreations/recreations_fractals/Newton.cpp, src/modules_recreations/recreations/recreations_fractals/Newton.h, src/modules_recreations/recreations/recreations_fractals/Pythagoras_Tree.cpp, src/modules_recreations/recreations/recreations_fractals/Pythagoras_Tree.h, src/modules_recreations/recreations/recreations_fractals/recreations_fractals.dsp, src/modules_recreations/recreations/recreations_fractals/recreations_fractals.vcproj, src/modules_recreations/recreations/recreations_fractals/recreations_fractals.vcxproj, src/modules_recreations/recreations/recreations_fractals/recreations_fractals.vcxproj.filters, src/modules_recreations/recreations/recreations_games/MLB_Interface.cpp, src/modules_recreations/recreations/recreations_games/MLB_Interface.h, src/modules_recreations/recreations/recreations_games/Makefile.am, src/modules_recreations/recreations/recreations_games/Mine_Sweeper.cpp, src/modules_recreations/recreations/recreations_games/Mine_Sweeper.h, src/modules_recreations/recreations/recreations_games/Mine_Sweeper_Res.cpp, src/modules_recreations/recreations/recreations_games/Sudoku.cpp, src/modules_recreations/recreations/recreations_games/Sudoku.h, src/modules_recreations/recreations/recreations_games/recreations_games.dsp, src/modules_recreations/recreations/recreations_games/recreations_games.vcproj, src/modules_recreations/recreations/recreations_games/recreations_games.vcxproj, src/modules_recreations/recreations/recreations_games/recreations_games.vcxproj.filters, src/modules_simulation/Makefile.am, src/modules_simulation/cellular_automata/Makefile.am, src/modules_simulation/cellular_automata/sim_cellular_automata/Life.cpp, src/modules_simulation/cellular_automata/sim_cellular_automata/Life.h, src/modules_simulation/cellular_automata/sim_cellular_automata/MLB_Interface.cpp, src/modules_simulation/cellular_automata/sim_cellular_automata/MLB_Interface.h, src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile.am, src/modules_simulation/cellular_automata/sim_cellular_automata/Wator.cpp, src/modules_simulation/cellular_automata/sim_cellular_automata/Wator.h, src/modules_simulation/cellular_automata/sim_cellular_automata/sim_cellular_automata.dsp, src/modules_simulation/cellular_automata/sim_cellular_automata/sim_cellular_automata.vcproj, src/modules_simulation/cellular_automata/sim_cellular_automata/sim_cellular_automata.vcxproj, src/modules_simulation/cellular_automata/sim_cellular_automata/sim_cellular_automata.vcxproj.filters, src/modules_simulation/ecosystems/Makefile.am, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_01.cpp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_01.h, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_02.cpp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_02.h, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_03.cpp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_03.h, src/modules_simulation/ecosystems/sim_ecosystems_hugget/MLB_Interface.cpp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/MLB_Interface.h, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile.am, src/modules_simulation/ecosystems/sim_ecosystems_hugget/sim_ecosystems_hugget.dsp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/sim_ecosystems_hugget.vcproj, src/modules_simulation/ecosystems/sim_ecosystems_hugget/sim_ecosystems_hugget.vcxproj, src/modules_simulation/ecosystems/sim_ecosystems_hugget/sim_ecosystems_hugget.vcxproj.filters, src/modules_simulation/fire/Makefile.am, src/modules_simulation/fire/sim_fire_spreading/Forecasting.cpp, src/modules_simulation/fire/sim_fire_spreading/Forecasting.h, src/modules_simulation/fire/sim_fire_spreading/MLB_Interface.cpp, src/modules_simulation/fire/sim_fire_spreading/MLB_Interface.h, src/modules_simulation/fire/sim_fire_spreading/Makefile.am, src/modules_simulation/fire/sim_fire_spreading/Pt.h, src/modules_simulation/fire/sim_fire_spreading/Simulate.cpp, src/modules_simulation/fire/sim_fire_spreading/Simulate.h, src/modules_simulation/fire/sim_fire_spreading/SimulateVariableWind.cpp, src/modules_simulation/fire/sim_fire_spreading/SimulateVariableWind.h, src/modules_simulation/fire/sim_fire_spreading/fireLib.c, src/modules_simulation/fire/sim_fire_spreading/fireLib.h, src/modules_simulation/fire/sim_fire_spreading/sim_fire_spreading.dsp, src/modules_simulation/fire/sim_fire_spreading/sim_fire_spreading.vcproj, src/modules_simulation/fire/sim_fire_spreading/sim_fire_spreading.vcxproj, src/modules_simulation/fire/sim_fire_spreading/sim_fire_spreading.vcxproj.filters, src/modules_simulation/hydrology/Makefile.am, src/modules_simulation/hydrology/sim_hydrology/DVWK_SoilMoisture.cpp, src/modules_simulation/hydrology/sim_hydrology/DVWK_SoilMoisture.h, src/modules_simulation/hydrology/sim_hydrology/KinWav_D8.cpp, src/modules_simulation/hydrology/sim_hydrology/KinWav_D8.h, src/modules_simulation/hydrology/sim_hydrology/MLB_Interface.cpp, src/modules_simulation/hydrology/sim_hydrology/MLB_Interface.h, src/modules_simulation/hydrology/sim_hydrology/Makefile.am, src/modules_simulation/hydrology/sim_hydrology/WaterRetentionCapacity.cpp, src/modules_simulation/hydrology/sim_hydrology/WaterRetentionCapacity.h, src/modules_simulation/hydrology/sim_hydrology/data/dvwk_soil_moisture_climate1981.txt, src/modules_simulation/hydrology/sim_hydrology/data/topmodel_climate.txt, src/modules_simulation/hydrology/sim_hydrology/data/topmodel_grass_input.txt, src/modules_simulation/hydrology/sim_hydrology/data/topmodel_grass_param.txt, src/modules_simulation/hydrology/sim_hydrology/doc/TOPMODEL_GRASS.zip, src/modules_simulation/hydrology/sim_hydrology/doc/TOPMODEL_Lancaster.zip, src/modules_simulation/hydrology/sim_hydrology/idw.cpp, src/modules_simulation/hydrology/sim_hydrology/idw.h, src/modules_simulation/hydrology/sim_hydrology/sim_hydrology.dsp, src/modules_simulation/hydrology/sim_hydrology/sim_hydrology.vcproj, src/modules_simulation/hydrology/sim_hydrology/sim_hydrology.vcxproj, src/modules_simulation/hydrology/sim_hydrology/sim_hydrology.vcxproj.filters, src/modules_simulation/hydrology/sim_hydrology/topmodel.cpp, src/modules_simulation/hydrology/sim_hydrology/topmodel.h, src/modules_simulation/hydrology/sim_hydrology/topmodel_values.cpp, src/modules_simulation/hydrology/sim_hydrology/topmodel_values.h, src/modules_template/template/template/MLB_Interface.cpp, src/modules_template/template/template/MLB_Interface.h, src/modules_template/template/template/Makefile.am, src/modules_template/template/template/Template.bat, src/modules_template/template/template/Template.cpp, src/modules_template/template/template/Template.dsp, src/modules_template/template/template/Template.dsw, src/modules_template/template/template/Template.h, src/modules_template/template/template/Template.sln, src/modules_template/template/template/Template.vc10.sln, src/modules_template/template/template/Template.vcproj, src/modules_template/template/template/Template.vcxproj, src/modules_template/template/template/Template.vcxproj.filters, src/modules_terrain_analysis/Makefile.am, src/modules_terrain_analysis/terrain_analysis/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/Helper.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/Helper.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_channels/Strahler.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/Strahler.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/ta_channels.dsp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ta_channels.vcproj, src/modules_terrain_analysis/terrain_analysis/ta_channels/ta_channels.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_channels/ta_channels.vcxproj.filters, src/modules_terrain_analysis/terrain_analysis/ta_compound/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_compound/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.cpp, src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.h, src/modules_terrain_analysis/terrain_analysis/ta_compound/ta_compound.dsp, src/modules_terrain_analysis/terrain_analysis/ta_compound/ta_compound.vcproj, src/modules_terrain_analysis/terrain_analysis/ta_compound/ta_compound.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_compound/ta_compound.vcxproj.filters, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/BasinGrid.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/BasinGrid.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaDownslope.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaDownslope.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_BRM.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Parallel.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Parallel.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveDown.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveDown.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveUp.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveUp.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFlood.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFlood.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFloodInteractive.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Pt.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_massflux.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_massflux.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_width.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_width.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.dsp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.vcproj, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/ta_hydrology.vcxproj.filters, src/modules_terrain_analysis/terrain_analysis/ta_lighting/HillShade.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/HillShade.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Point.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Point.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/ta_lighting.dsp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/ta_lighting.ger.txt, src/modules_terrain_analysis/terrain_analysis/ta_lighting/ta_lighting.vcproj, src/modules_terrain_analysis/terrain_analysis/ta_lighting/ta_lighting.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_lighting/ta_lighting.vcxproj.filters, src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/view_shed.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/view_shed.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Hypsometry.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Hypsometry.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Morphometry.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Morphometry.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ProtectionIndex.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ProtectionIndex.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/air_flow_height.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/air_flow_height.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/anisotropic_heating.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/anisotropic_heating.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/distance_gradient.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/distance_gradient.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/land_surface_temperature.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/land_surface_temperature.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mass_balance_index.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mass_balance_index.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mrvbf.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mrvbf.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ruggedness.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ruggedness.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.dsp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.vcproj, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ta_morphometry.vcxproj.filters, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/wind_effect.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/wind_effect.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL_XXL.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Flat_Detection.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Flat_Detection.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Eliminator.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Eliminator.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Router.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Router.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/ta_preprocessor.dsp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/ta_preprocessor.vcproj, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/ta_preprocessor.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/ta_preprocessor.vcxproj.filters, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Cross_Profiles.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Cross_Profiles.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Flow_Profile.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Flow_Profile.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Swath_Profile.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Swath_Profile.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile.am, src/modules_terrain_analysis/terrain_analysis/ta_profiles/ta_profiles.dsp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/ta_profiles.vcproj, src/modules_terrain_analysis/terrain_analysis/ta_profiles/ta_profiles.vcxproj, src/modules_terrain_analysis/terrain_analysis/ta_profiles/ta_profiles.vcxproj.filters, src/saga.dsw, src/saga.sln, src/saga.vc10.sln, src/saga_core/Makefile.am, src/saga_core/saga_api/Makefile.am, src/saga_core/saga_api/api_callback.cpp, src/saga_core/saga_api/api_colors.cpp, src/saga_core/saga_api/api_core.cpp, src/saga_core/saga_api/api_core.h, src/saga_core/saga_api/api_file.cpp, src/saga_core/saga_api/api_memory.cpp, src/saga_core/saga_api/api_string.cpp, src/saga_core/saga_api/api_translator.cpp, src/saga_core/saga_api/changes.txt, src/saga_core/saga_api/compatibility.h, src/saga_core/saga_api/dataobject.cpp, src/saga_core/saga_api/dataobject.h, src/saga_core/saga_api/geo_classes.cpp, src/saga_core/saga_api/geo_functions.cpp, src/saga_core/saga_api/geo_tools.h, src/saga_core/saga_api/grid.cpp, src/saga_core/saga_api/grid.h, src/saga_core/saga_api/grid_io.cpp, src/saga_core/saga_api/grid_memory.cpp, src/saga_core/saga_api/grid_operation.cpp, src/saga_core/saga_api/grid_pyramid.cpp, src/saga_core/saga_api/grid_pyramid.h, src/saga_core/saga_api/grid_system.cpp, src/saga_core/saga_api/mat_formula.cpp, src/saga_core/saga_api/mat_grid_radius.cpp, src/saga_core/saga_api/mat_indexing.cpp, src/saga_core/saga_api/mat_matrix.cpp, src/saga_core/saga_api/mat_regression.cpp, src/saga_core/saga_api/mat_regression_multiple.cpp, src/saga_core/saga_api/mat_spline.cpp, src/saga_core/saga_api/mat_tools.cpp, src/saga_core/saga_api/mat_tools.h, src/saga_core/saga_api/mat_trend.cpp, src/saga_core/saga_api/metadata.cpp, src/saga_core/saga_api/metadata.h, src/saga_core/saga_api/module.cpp, src/saga_core/saga_api/module.h, src/saga_core/saga_api/module_grid.cpp, src/saga_core/saga_api/module_grid_interactive.cpp, src/saga_core/saga_api/module_interactive.cpp, src/saga_core/saga_api/module_interactive_base.cpp, src/saga_core/saga_api/module_library.cpp, src/saga_core/saga_api/module_library.h, src/saga_core/saga_api/module_library_interface.cpp, src/saga_core/saga_api/parameter.cpp, src/saga_core/saga_api/parameter_data.cpp, src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_api/parameters.h, src/saga_core/saga_api/pointcloud.cpp, src/saga_core/saga_api/pointcloud.h, src/saga_core/saga_api/projections.cpp, src/saga_core/saga_api/quadtree.cpp, src/saga_core/saga_api/saga_api.cpp, src/saga_core/saga_api/saga_api.dsp, src/saga_core/saga_api/saga_api.h, src/saga_core/saga_api/saga_api.vcproj, src/saga_core/saga_api/saga_api.vcxproj, src/saga_core/saga_api/saga_api.vcxproj.filters, src/saga_core/saga_api/saga_api_to_python_linux.py, src/saga_core/saga_api/saga_api_to_python_linux.sh, src/saga_core/saga_api/saga_api_to_python_win.bat, src/saga_core/saga_api/saga_api_to_python_win.py, src/saga_core/saga_api/shape.cpp, src/saga_core/saga_api/shape_line.cpp, src/saga_core/saga_api/shape_part.cpp, src/saga_core/saga_api/shape_point.cpp, src/saga_core/saga_api/shape_points.cpp, src/saga_core/saga_api/shape_polygon.cpp, src/saga_core/saga_api/shapes.cpp, src/saga_core/saga_api/shapes.h, src/saga_core/saga_api/shapes_io.cpp, src/saga_core/saga_api/shapes_ogis.cpp, src/saga_core/saga_api/shapes_search.cpp, src/saga_core/saga_api/shapes_selection.cpp, src/saga_core/saga_api/table.cpp, src/saga_core/saga_api/table.h, src/saga_core/saga_api/table_dbase.cpp, src/saga_core/saga_api/table_dbase.h, src/saga_core/saga_api/table_io.cpp, src/saga_core/saga_api/table_record.cpp, src/saga_core/saga_api/table_selection.cpp, src/saga_core/saga_api/table_value.h, src/saga_core/saga_api/tin.cpp, src/saga_core/saga_api/tin.h, src/saga_core/saga_api/tin_elements.cpp, src/saga_core/saga_api/tin_triangulation.cpp, src/saga_core/saga_cmd/Makefile.am, src/saga_core/saga_cmd/callback.cpp, src/saga_core/saga_cmd/callback.h, src/saga_core/saga_cmd/man/Makefile.am, src/saga_core/saga_cmd/man/saga_cmd.1, src/saga_core/saga_cmd/module_library.cpp, src/saga_core/saga_cmd/module_library.h, src/saga_core/saga_cmd/saga_cmd.cpp, src/saga_core/saga_cmd/saga_cmd.dsp, src/saga_core/saga_cmd/saga_cmd.vcproj, src/saga_core/saga_cmd/saga_cmd.vcxproj, src/saga_core/saga_cmd/saga_cmd.vcxproj.filters, src/saga_core/saga_gdi/Makefile.am, src/saga_core/saga_gdi/saga_gdi.cpp, src/saga_core/saga_gdi/saga_gdi.dsp, src/saga_core/saga_gdi/saga_gdi.h, src/saga_core/saga_gdi/saga_gdi.vcproj, src/saga_core/saga_gdi/saga_gdi.vcxproj, src/saga_core/saga_gdi/saga_gdi.vcxproj.filters, src/saga_core/saga_gdi/sgdi_diagram.cpp, src/saga_core/saga_gdi/sgdi_diagram.h, src/saga_core/saga_gdi/sgdi_dialog.cpp, src/saga_core/saga_gdi/sgdi_dialog.h, src/saga_core/saga_gdi/sgdi_helper.cpp, src/saga_core/saga_gdi/sgdi_helper.h, src/saga_core/saga_gui/Makefile.am, src/saga_core/saga_gui/active.cpp, src/saga_core/saga_gui/active.h, src/saga_core/saga_gui/active_HTMLExtraInfo.cpp, src/saga_core/saga_gui/active_HTMLExtraInfo.h, src/saga_core/saga_gui/active_attributes.cpp, src/saga_core/saga_gui/active_attributes.h, src/saga_core/saga_gui/active_description.cpp, src/saga_core/saga_gui/active_description.h, src/saga_core/saga_gui/active_history.cpp, src/saga_core/saga_gui/active_history.h, src/saga_core/saga_gui/active_legend.cpp, src/saga_core/saga_gui/active_legend.h, src/saga_core/saga_gui/active_parameters.cpp, src/saga_core/saga_gui/active_parameters.h, src/saga_core/saga_gui/callback.cpp, src/saga_core/saga_gui/callback.h, src/saga_core/saga_gui/dc_helper.cpp, src/saga_core/saga_gui/dc_helper.h, src/saga_core/saga_gui/dlg_about.cpp, src/saga_core/saga_gui/dlg_about.h, src/saga_core/saga_gui/dlg_about_logo.cpp, src/saga_core/saga_gui/dlg_about_logo.h, src/saga_core/saga_gui/dlg_base.cpp, src/saga_core/saga_gui/dlg_base.h, src/saga_core/saga_gui/dlg_colors.cpp, src/saga_core/saga_gui/dlg_colors.h, src/saga_core/saga_gui/dlg_colors_control.cpp, src/saga_core/saga_gui/dlg_colors_control.h, src/saga_core/saga_gui/dlg_list_base.cpp, src/saga_core/saga_gui/dlg_list_base.h, src/saga_core/saga_gui/dlg_list_grid.cpp, src/saga_core/saga_gui/dlg_list_grid.h, src/saga_core/saga_gui/dlg_list_pointcloud.cpp, src/saga_core/saga_gui/dlg_list_pointcloud.h, src/saga_core/saga_gui/dlg_list_shapes.cpp, src/saga_core/saga_gui/dlg_list_shapes.h, src/saga_core/saga_gui/dlg_list_table.cpp, src/saga_core/saga_gui/dlg_list_table.h, src/saga_core/saga_gui/dlg_list_tin.cpp, src/saga_core/saga_gui/dlg_list_tin.h, src/saga_core/saga_gui/dlg_parameters.cpp, src/saga_core/saga_gui/dlg_parameters.h, src/saga_core/saga_gui/dlg_table.cpp, src/saga_core/saga_gui/dlg_table.h, src/saga_core/saga_gui/dlg_text.cpp, src/saga_core/saga_gui/dlg_text.h, src/saga_core/saga_gui/helper.cpp, src/saga_core/saga_gui/helper.h, src/saga_core/saga_gui/info.cpp, src/saga_core/saga_gui/info.h, src/saga_core/saga_gui/info_messages.cpp, src/saga_core/saga_gui/info_messages.h, src/saga_core/saga_gui/man/Makefile.am, src/saga_core/saga_gui/man/saga_gui.1, src/saga_core/saga_gui/parameters_control.cpp, src/saga_core/saga_gui/parameters_control.h, src/saga_core/saga_gui/parameters_properties.cpp, src/saga_core/saga_gui/parameters_properties.h, src/saga_core/saga_gui/project.cpp, src/saga_core/saga_gui/project.h, src/saga_core/saga_gui/res/colours.bmp, src/saga_core/saga_gui/res/resource.h, src/saga_core/saga_gui/res/saga.ger.txt, src/saga_core/saga_gui/res/saga.ico, src/saga_core/saga_gui/res/saga.lng.txt, src/saga_core/saga_gui/res/saga_dic.txt, src/saga_core/saga_gui/res/saga_gui.rc, src/saga_core/saga_gui/res/saga_srs.txt, src/saga_core/saga_gui/res/saga_tip.txt, src/saga_core/saga_gui/res/xpm/crs_edit_point_add.xpm, src/saga_core/saga_gui/res/xpm/crs_edit_point_move.xpm, src/saga_core/saga_gui/res/xpm/crs_hand.xpm, src/saga_core/saga_gui/res/xpm/crs_hand_grap.xpm, src/saga_core/saga_gui/res/xpm/crs_info.xpm, src/saga_core/saga_gui/res/xpm/crs_magnifier.xpm, src/saga_core/saga_gui/res/xpm/crs_select.xpm, src/saga_core/saga_gui/res/xpm/default.xpm, src/saga_core/saga_gui/res/xpm/nb_active_attributes.xpm, src/saga_core/saga_gui/res/xpm/nb_active_description.xpm, src/saga_core/saga_gui/res/xpm/nb_active_htmlextrainfo.xpm, src/saga_core/saga_gui/res/xpm/nb_active_legend.xpm, src/saga_core/saga_gui/res/xpm/nb_active_parameters.xpm, src/saga_core/saga_gui/res/xpm/nb_info_error.xpm, src/saga_core/saga_gui/res/xpm/nb_info_execution.xpm, src/saga_core/saga_gui/res/xpm/nb_info_messages.xpm, src/saga_core/saga_gui/res/xpm/nb_wksp_data.xpm, src/saga_core/saga_gui/res/xpm/nb_wksp_maps.xpm, src/saga_core/saga_gui/res/xpm/nb_wksp_modules.xpm, src/saga_core/saga_gui/res/xpm/nb_wksp_thumbnails.xpm, src/saga_core/saga_gui/res/xpm/nb_wksp_treeview.xpm, src/saga_core/saga_gui/res/xpm/saga_icon_16.xpm, src/saga_core/saga_gui/res/xpm/saga_icon_32.xpm, src/saga_core/saga_gui/res/xpm/saga_splash.xpm, src/saga_core/saga_gui/res/xpm/tb_active.xpm, src/saga_core/saga_gui/res/xpm/tb_delete.xpm, src/saga_core/saga_gui/res/xpm/tb_diagram_parameters.xpm, src/saga_core/saga_gui/res/xpm/tb_edit_shape_add.xpm, src/saga_core/saga_gui/res/xpm/tb_edit_shape_add_part.xpm, src/saga_core/saga_gui/res/xpm/tb_edit_shape_del.xpm, src/saga_core/saga_gui/res/xpm/tb_edit_shape_del_part.xpm, src/saga_core/saga_gui/res/xpm/tb_edit_shape_del_point.xpm, src/saga_core/saga_gui/res/xpm/tb_edit_shape_select.xpm, src/saga_core/saga_gui/res/xpm/tb_help.xpm, src/saga_core/saga_gui/res/xpm/tb_histogram_as_table.xpm, src/saga_core/saga_gui/res/xpm/tb_histogram_cumulative.xpm, src/saga_core/saga_gui/res/xpm/tb_info.xpm, src/saga_core/saga_gui/res/xpm/tb_layout_page_setup.xpm, src/saga_core/saga_gui/res/xpm/tb_layout_print.xpm, src/saga_core/saga_gui/res/xpm/tb_layout_print_preview.xpm, src/saga_core/saga_gui/res/xpm/tb_layout_print_setup.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_central_less.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_central_more.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_exaggerate_less.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_exaggerate_more.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_interpolated.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_properties.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_rotate_x_less.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_rotate_x_more.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_rotate_z_less.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_rotate_z_more.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_shift_x_less.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_shift_x_more.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_shift_y_less.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_shift_y_more.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_shift_z_less.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_shift_z_more.xpm, src/saga_core/saga_gui/res/xpm/tb_map3d_stereo.xpm, src/saga_core/saga_gui/res/xpm/tb_map_3d_show.xpm, src/saga_core/saga_gui/res/xpm/tb_map_layout_show.xpm, src/saga_core/saga_gui/res/xpm/tb_map_legend_horizontal.xpm, src/saga_core/saga_gui/res/xpm/tb_map_legend_vertical.xpm, src/saga_core/saga_gui/res/xpm/tb_map_mode_distance.xpm, src/saga_core/saga_gui/res/xpm/tb_map_mode_pan.xpm, src/saga_core/saga_gui/res/xpm/tb_map_mode_select.xpm, src/saga_core/saga_gui/res/xpm/tb_map_mode_zoom.xpm, src/saga_core/saga_gui/res/xpm/tb_map_synchronize.xpm, src/saga_core/saga_gui/res/xpm/tb_map_zoom_active.xpm, src/saga_core/saga_gui/res/xpm/tb_map_zoom_full.xpm, src/saga_core/saga_gui/res/xpm/tb_map_zoom_last.xpm, src/saga_core/saga_gui/res/xpm/tb_map_zoom_next.xpm, src/saga_core/saga_gui/res/xpm/tb_map_zoom_selection.xpm, src/saga_core/saga_gui/res/xpm/tb_open.xpm, src/saga_core/saga_gui/res/xpm/tb_open_grid.xpm, src/saga_core/saga_gui/res/xpm/tb_open_module.xpm, src/saga_core/saga_gui/res/xpm/tb_open_shapes.xpm, src/saga_core/saga_gui/res/xpm/tb_open_table.xpm, src/saga_core/saga_gui/res/xpm/tb_open_tin.xpm, src/saga_core/saga_gui/res/xpm/tb_save.xpm, src/saga_core/saga_gui/res/xpm/tb_scatterplot_parameters.xpm, src/saga_core/saga_gui/res/xpm/tb_show.xpm, src/saga_core/saga_gui/res/xpm/tb_table_col_add.xpm, src/saga_core/saga_gui/res/xpm/tb_table_col_del.xpm, src/saga_core/saga_gui/res/xpm/tb_table_row_add.xpm, src/saga_core/saga_gui/res/xpm/tb_table_row_del.xpm, src/saga_core/saga_gui/res/xpm/tb_table_row_del_all.xpm, src/saga_core/saga_gui/res/xpm/tb_table_row_ins.xpm, src/saga_core/saga_gui/res/xpm/tb_wksp.xpm, src/saga_core/saga_gui/res/xpm/wksp_data_manager.xpm, src/saga_core/saga_gui/res/xpm/wksp_grid.xpm, src/saga_core/saga_gui/res/xpm/wksp_grid_manager.xpm, src/saga_core/saga_gui/res/xpm/wksp_grid_system.xpm, src/saga_core/saga_gui/res/xpm/wksp_map.xpm, src/saga_core/saga_gui/res/xpm/wksp_map_manager.xpm, src/saga_core/saga_gui/res/xpm/wksp_module.xpm, src/saga_core/saga_gui/res/xpm/wksp_module_library.xpm, src/saga_core/saga_gui/res/xpm/wksp_module_manager.xpm, src/saga_core/saga_gui/res/xpm/wksp_noitems.xpm, src/saga_core/saga_gui/res/xpm/wksp_shapes_line.xpm, src/saga_core/saga_gui/res/xpm/wksp_shapes_manager.xpm, src/saga_core/saga_gui/res/xpm/wksp_shapes_point.xpm, src/saga_core/saga_gui/res/xpm/wksp_shapes_points.xpm, src/saga_core/saga_gui/res/xpm/wksp_shapes_polygon.xpm, src/saga_core/saga_gui/res/xpm/wksp_table.xpm, src/saga_core/saga_gui/res/xpm/wksp_table_manager.xpm, src/saga_core/saga_gui/res/xpm/wksp_tin.xpm, src/saga_core/saga_gui/res/xpm/wksp_tin_manager.xpm, src/saga_core/saga_gui/res/xpm/wnd_diagram.xpm, src/saga_core/saga_gui/res/xpm/wnd_histogram.xpm, src/saga_core/saga_gui/res/xpm/wnd_layout.xpm, src/saga_core/saga_gui/res/xpm/wnd_map.xpm, src/saga_core/saga_gui/res/xpm/wnd_map3d.xpm, src/saga_core/saga_gui/res/xpm/wnd_scatterplot.xpm, src/saga_core/saga_gui/res/xpm/wnd_table.xpm, src/saga_core/saga_gui/res_commands.cpp, src/saga_core/saga_gui/res_commands.h, src/saga_core/saga_gui/res_controls.cpp, src/saga_core/saga_gui/res_controls.h, src/saga_core/saga_gui/res_dialogs.cpp, src/saga_core/saga_gui/res_dialogs.h, src/saga_core/saga_gui/res_images.cpp, src/saga_core/saga_gui/res_images.h, src/saga_core/saga_gui/saga.cpp, src/saga_core/saga_gui/saga.h, src/saga_core/saga_gui/saga_frame.cpp, src/saga_core/saga_gui/saga_frame.h, src/saga_core/saga_gui/saga_frame_droptarget.cpp, src/saga_core/saga_gui/saga_frame_droptarget.h, src/saga_core/saga_gui/saga_gui.dsp, src/saga_core/saga_gui/saga_gui.vcproj, src/saga_core/saga_gui/saga_gui.vcxproj, src/saga_core/saga_gui/saga_gui.vcxproj.filters, src/saga_core/saga_gui/view_base.cpp, src/saga_core/saga_gui/view_base.h, src/saga_core/saga_gui/view_histogram.cpp, src/saga_core/saga_gui/view_histogram.h, src/saga_core/saga_gui/view_layout.cpp, src/saga_core/saga_gui/view_layout.h, src/saga_core/saga_gui/view_layout_control.cpp, src/saga_core/saga_gui/view_layout_control.h, src/saga_core/saga_gui/view_layout_info.cpp, src/saga_core/saga_gui/view_layout_info.h, src/saga_core/saga_gui/view_layout_printout.cpp, src/saga_core/saga_gui/view_layout_printout.h, src/saga_core/saga_gui/view_map.cpp, src/saga_core/saga_gui/view_map.h, src/saga_core/saga_gui/view_map_3d.cpp, src/saga_core/saga_gui/view_map_3d.h, src/saga_core/saga_gui/view_map_3d_image.cpp, src/saga_core/saga_gui/view_map_3d_image.h, src/saga_core/saga_gui/view_map_control.cpp, src/saga_core/saga_gui/view_map_control.h, src/saga_core/saga_gui/view_ruler.cpp, src/saga_core/saga_gui/view_ruler.h, src/saga_core/saga_gui/view_scatterplot.cpp, src/saga_core/saga_gui/view_scatterplot.h, src/saga_core/saga_gui/view_table.cpp, src/saga_core/saga_gui/view_table.h, src/saga_core/saga_gui/view_table_control.cpp, src/saga_core/saga_gui/view_table_control.h, src/saga_core/saga_gui/view_table_diagram.cpp, src/saga_core/saga_gui/view_table_diagram.h, src/saga_core/saga_gui/wksp.cpp, src/saga_core/saga_gui/wksp.h, src/saga_core/saga_gui/wksp_base_control.cpp, src/saga_core/saga_gui/wksp_base_control.h, src/saga_core/saga_gui/wksp_base_item.cpp, src/saga_core/saga_gui/wksp_base_item.h, src/saga_core/saga_gui/wksp_base_manager.cpp, src/saga_core/saga_gui/wksp_base_manager.h, src/saga_core/saga_gui/wksp_data_control.cpp, src/saga_core/saga_gui/wksp_data_control.h, src/saga_core/saga_gui/wksp_data_layers.cpp, src/saga_core/saga_gui/wksp_data_layers.h, src/saga_core/saga_gui/wksp_data_manager.cpp, src/saga_core/saga_gui/wksp_data_manager.h, src/saga_core/saga_gui/wksp_data_menu_file.cpp, src/saga_core/saga_gui/wksp_data_menu_file.h, src/saga_core/saga_gui/wksp_data_menu_files.cpp, src/saga_core/saga_gui/wksp_data_menu_files.h, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_grid.h, src/saga_core/saga_gui/wksp_grid_manager.cpp, src/saga_core/saga_gui/wksp_grid_manager.h, src/saga_core/saga_gui/wksp_grid_system.cpp, src/saga_core/saga_gui/wksp_grid_system.h, src/saga_core/saga_gui/wksp_layer.cpp, src/saga_core/saga_gui/wksp_layer.h, src/saga_core/saga_gui/wksp_layer_classify.cpp, src/saga_core/saga_gui/wksp_layer_classify.h, src/saga_core/saga_gui/wksp_layer_legend.cpp, src/saga_core/saga_gui/wksp_layer_legend.h, src/saga_core/saga_gui/wksp_map.cpp, src/saga_core/saga_gui/wksp_map.h, src/saga_core/saga_gui/wksp_map_buttons.cpp, src/saga_core/saga_gui/wksp_map_buttons.h, src/saga_core/saga_gui/wksp_map_control.cpp, src/saga_core/saga_gui/wksp_map_control.h, src/saga_core/saga_gui/wksp_map_dc.cpp, src/saga_core/saga_gui/wksp_map_dc.h, src/saga_core/saga_gui/wksp_map_layer.cpp, src/saga_core/saga_gui/wksp_map_layer.h, src/saga_core/saga_gui/wksp_map_manager.cpp, src/saga_core/saga_gui/wksp_map_manager.h, src/saga_core/saga_gui/wksp_module.cpp, src/saga_core/saga_gui/wksp_module.h, src/saga_core/saga_gui/wksp_module_control.cpp, src/saga_core/saga_gui/wksp_module_control.h, src/saga_core/saga_gui/wksp_module_library.cpp, src/saga_core/saga_gui/wksp_module_library.h, src/saga_core/saga_gui/wksp_module_manager.cpp, src/saga_core/saga_gui/wksp_module_manager.h, src/saga_core/saga_gui/wksp_module_menu.cpp, src/saga_core/saga_gui/wksp_module_menu.h, src/saga_core/saga_gui/wksp_pointcloud.cpp, src/saga_core/saga_gui/wksp_pointcloud.h, src/saga_core/saga_gui/wksp_pointcloud_manager.cpp, src/saga_core/saga_gui/wksp_pointcloud_manager.h, src/saga_core/saga_gui/wksp_shapes.cpp, src/saga_core/saga_gui/wksp_shapes.h, src/saga_core/saga_gui/wksp_shapes_edit.cpp, src/saga_core/saga_gui/wksp_shapes_line.cpp, src/saga_core/saga_gui/wksp_shapes_line.h, src/saga_core/saga_gui/wksp_shapes_manager.cpp, src/saga_core/saga_gui/wksp_shapes_manager.h, src/saga_core/saga_gui/wksp_shapes_point.cpp, src/saga_core/saga_gui/wksp_shapes_point.h, src/saga_core/saga_gui/wksp_shapes_points.cpp, src/saga_core/saga_gui/wksp_shapes_points.h, src/saga_core/saga_gui/wksp_shapes_polygon.cpp, src/saga_core/saga_gui/wksp_shapes_polygon.h, src/saga_core/saga_gui/wksp_shapes_type.cpp, src/saga_core/saga_gui/wksp_shapes_type.h, src/saga_core/saga_gui/wksp_table.cpp, src/saga_core/saga_gui/wksp_table.h, src/saga_core/saga_gui/wksp_table_manager.cpp, src/saga_core/saga_gui/wksp_table_manager.h, src/saga_core/saga_gui/wksp_tin.cpp, src/saga_core/saga_gui/wksp_tin.h, src/saga_core/saga_gui/wksp_tin_manager.cpp, src/saga_core/saga_gui/wksp_tin_manager.h, src/saga_core/saga_gui/wx/propgrid/advprops.cpp, src/saga_core/saga_gui/wx/propgrid/advprops.h, src/saga_core/saga_gui/wx/propgrid/editors.cpp, src/saga_core/saga_gui/wx/propgrid/editors.h, src/saga_core/saga_gui/wx/propgrid/extras.cpp, src/saga_core/saga_gui/wx/propgrid/extras.h, src/saga_core/saga_gui/wx/propgrid/manager.cpp, src/saga_core/saga_gui/wx/propgrid/manager.h, src/saga_core/saga_gui/wx/propgrid/odcombo.cpp, src/saga_core/saga_gui/wx/propgrid/odcombo.h, src/saga_core/saga_gui/wx/propgrid/propdev.h, src/saga_core/saga_gui/wx/propgrid/propgrid.cpp, src/saga_core/saga_gui/wx/propgrid/propgrid.h, src/saga_core/saga_gui/wx/propgrid/props.cpp, src/saga_core/saga_gui/wx/propgrid/props.h, src/saga_core/saga_odbc/Makefile.am, src/saga_core/saga_odbc/otlv4.h, src/saga_core/saga_odbc/saga_odbc.cpp, src/saga_core/saga_odbc/saga_odbc.dsp, src/saga_core/saga_odbc/saga_odbc.h, src/saga_core/saga_odbc/saga_odbc.vcproj, src/saga_core/saga_odbc/saga_odbc.vcxproj, src/saga_core/saga_odbc/saga_odbc.vcxproj.filters: all .h, .c and .cpp files: svn keywords added and conversion to Unix LF 2011-02-14 15:27 reklov_w * src/dev_tools/MLB_Interface.cpp, src/dev_tools/MLB_Interface.h, src/dev_tools/tl_extract.cpp, src/dev_tools/tl_extract.h, src/dev_tools/tl_merge.cpp, src/dev_tools/tl_merge.h, src/dev_tools/tl_union.cpp, src/dev_tools/tl_union.h, src/modules/grid/grid_analysis/Cost_Anisotropic.cpp, src/modules/grid/grid_analysis/Cost_Anisotropic.h, src/modules/grid/grid_analysis/Cost_Isotropic.cpp, src/modules/grid/grid_analysis/Cost_Isotropic.h, src/modules/grid/grid_analysis/Cost_PolarToRect.cpp, src/modules/grid/grid_analysis/Cost_PolarToRect.h, src/modules/grid/grid_analysis/Cost_RectToPolar.cpp, src/modules/grid/grid_analysis/Cost_RectToPolar.h, src/modules/grid/grid_analysis/CoveredDistance.cpp, src/modules/grid/grid_analysis/CoveredDistance.h, src/modules/grid/grid_analysis/CrossClassification.cpp, src/modules/grid/grid_analysis/CrossClassification.h, src/modules/grid/grid_analysis/Grid_AHP.cpp, src/modules/grid/grid_analysis/Grid_AHP.h, src/modules/grid/grid_analysis/Grid_AggregationIndex.cpp, src/modules/grid/grid_analysis/Grid_AggregationIndex.h, src/modules/grid/grid_analysis/Grid_CVA.cpp, src/modules/grid/grid_analysis/Grid_CVA.h, src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.cpp, src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.h, src/modules/grid/grid_analysis/Grid_Pattern.cpp, src/modules/grid/grid_analysis/Grid_Pattern.h, src/modules/grid/grid_analysis/LeastCostPathProfile.cpp, src/modules/grid/grid_analysis/LeastCostPathProfile.h, src/modules/grid/grid_analysis/LeastCostPathProfile_Points.cpp, src/modules/grid/grid_analysis/LeastCostPathProfile_Points.h, src/modules/grid/grid_analysis/MLB_Interface.cpp, src/modules/grid/grid_analysis/MLB_Interface.h, src/modules/grid/grid_analysis/PointsEx.cpp, src/modules/grid/grid_analysis/PointsEx.h, src/modules/grid/grid_analysis/Soil_Texture.cpp, src/modules/grid/grid_analysis/Soil_Texture.h, src/modules/grid/grid_analysis/fragmentation_base.cpp, src/modules/grid/grid_analysis/fragmentation_base.h, src/modules/grid/grid_analysis/fragmentation_classify.cpp, src/modules/grid/grid_analysis/fragmentation_classify.h, src/modules/grid/grid_analysis/fragmentation_resampling.cpp, src/modules/grid/grid_analysis/fragmentation_resampling.h, src/modules/grid/grid_analysis/fragmentation_standard.cpp, src/modules/grid/grid_analysis/fragmentation_standard.h, src/modules/grid/grid_analysis/owa.cpp, src/modules/grid/grid_analysis/owa.h, src/modules/grid/grid_calculus/Fuzzify.cpp, src/modules/grid/grid_calculus/Fuzzify.h, src/modules/grid/grid_calculus/FuzzyAND.cpp, src/modules/grid/grid_calculus/FuzzyAND.h, src/modules/grid/grid_calculus/FuzzyOR.cpp, src/modules/grid/grid_calculus/FuzzyOR.h, src/modules/grid/grid_calculus/Grid_Calculator.cpp, src/modules/grid/grid_calculus/Grid_Calculator.h, src/modules/grid/grid_calculus/Grid_Geometric_Figures.cpp, src/modules/grid/grid_calculus/Grid_Geometric_Figures.h, src/modules/grid/grid_calculus/Grid_Normalise.cpp, src/modules/grid/grid_calculus/Grid_Normalise.h, src/modules/grid/grid_calculus/Grid_Plotter.cpp, src/modules/grid/grid_calculus/Grid_Plotter.h, src/modules/grid/grid_calculus/Grid_Random_Field.cpp, src/modules/grid/grid_calculus/Grid_Random_Field.h, src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp, src/modules/grid/grid_calculus/Grid_Random_Terrain.h, src/modules/grid/grid_calculus/Grid_Volume.cpp, src/modules/grid/grid_calculus/Grid_Volume.h, src/modules/grid/grid_calculus/MLB_Interface.cpp, src/modules/grid/grid_calculus/MLB_Interface.h, src/modules/grid/grid_calculus/grid_difference.cpp, src/modules/grid/grid_calculus/grid_difference.h, src/modules/grid/grid_calculus_bsl/MLB_Interface.cpp, src/modules/grid/grid_calculus_bsl/MLB_Interface.h, src/modules/grid/grid_calculus_bsl/ausdruck.cpp, src/modules/grid/grid_calculus_bsl/ausdruck.h, src/modules/grid/grid_calculus_bsl/auswert_anweisung.cpp, src/modules/grid/grid_calculus_bsl/auswert_anweisung.h, src/modules/grid/grid_calculus_bsl/auswert_foreach.cpp, src/modules/grid/grid_calculus_bsl/auswert_foreach.h, src/modules/grid/grid_calculus_bsl/auswert_if.cpp, src/modules/grid/grid_calculus_bsl/auswert_if.h, src/modules/grid/grid_calculus_bsl/auswert_zuweisung.cpp, src/modules/grid/grid_calculus_bsl/auswert_zuweisung.h, src/modules/grid/grid_calculus_bsl/basistypen.cpp, src/modules/grid/grid_calculus_bsl/basistypen.h, src/modules/grid/grid_calculus_bsl/bedingung.cpp, src/modules/grid/grid_calculus_bsl/bedingung.h, src/modules/grid/grid_calculus_bsl/bsl_interpreter.cpp, src/modules/grid/grid_calculus_bsl/bsl_interpreter.h, src/modules/grid/grid_calculus_bsl/diverses.cpp, src/modules/grid/grid_calculus_bsl/diverses.h, src/modules/grid/grid_calculus_bsl/foreach.cpp, src/modules/grid/grid_calculus_bsl/foreach.h, src/modules/grid/grid_calculus_bsl/funktion.cpp, src/modules/grid/grid_calculus_bsl/funktion.h, src/modules/grid/grid_calculus_bsl/funktion_numerisch.h, src/modules/grid/grid_calculus_bsl/funktion_statistisch.h, src/modules/grid/grid_calculus_bsl/gr_def.h, src/modules/grid/grid_calculus_bsl/gr_syst.h, src/modules/grid/grid_calculus_bsl/grid_bsl.cpp, src/modules/grid/grid_calculus_bsl/grid_bsl.h, src/modules/grid/grid_calculus_bsl/interpolation.cpp, src/modules/grid/grid_calculus_bsl/interpolation.h, src/modules/grid/grid_calculus_bsl/pars_all.cpp, src/modules/grid/grid_calculus_bsl/pars_all.h, src/modules/grid/grid_calculus_bsl/vector.cpp, src/modules/grid/grid_calculus_bsl/vector.h, src/modules/grid/grid_calculus_bsl/zuweisung.cpp, src/modules/grid/grid_calculus_bsl/zuweisung.h, src/modules/grid/grid_filter/Filter.cpp, src/modules/grid/grid_filter/Filter.h, src/modules/grid/grid_filter/FilterClumps.cpp, src/modules/grid/grid_filter/FilterClumps.h, src/modules/grid/grid_filter/Filter_3x3.cpp, src/modules/grid/grid_filter/Filter_3x3.h, src/modules/grid/grid_filter/Filter_Gauss.cpp, src/modules/grid/grid_filter/Filter_Gauss.h, src/modules/grid/grid_filter/Filter_LoG.cpp, src/modules/grid/grid_filter/Filter_LoG.h, src/modules/grid/grid_filter/Filter_Majority.cpp, src/modules/grid/grid_filter/Filter_Majority.h, src/modules/grid/grid_filter/Filter_Morphology.cpp, src/modules/grid/grid_filter/Filter_Morphology.h, src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.cpp, src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.h, src/modules/grid/grid_filter/Filter_Rank.cpp, src/modules/grid/grid_filter/Filter_Rank.h, src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.cpp, src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.h, src/modules/grid/grid_filter/MLB_Interface.cpp, src/modules/grid/grid_filter/MLB_Interface.h, src/modules/grid/grid_filter/Pt.h, src/modules/grid/grid_gridding/Interpolation.cpp, src/modules/grid/grid_gridding/Interpolation.h, src/modules/grid/grid_gridding/Interpolation_InverseDistance.cpp, src/modules/grid/grid_gridding/Interpolation_InverseDistance.h, src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.cpp, src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.h, src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.cpp, src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.h, src/modules/grid/grid_gridding/Interpolation_Shepard.cpp, src/modules/grid/grid_gridding/Interpolation_Shepard.h, src/modules/grid/grid_gridding/Interpolation_Triangulation.cpp, src/modules/grid/grid_gridding/Interpolation_Triangulation.h, src/modules/grid/grid_gridding/MLB_Interface.cpp, src/modules/grid/grid_gridding/MLB_Interface.h, src/modules/grid/grid_gridding/Shapes2Grid.cpp, src/modules/grid/grid_gridding/Shapes2Grid.h, src/modules/grid/grid_gridding/Shepard.cpp, src/modules/grid/grid_gridding/Shepard.h, src/modules/grid/grid_gridding/kernel_density.cpp, src/modules/grid/grid_gridding/kernel_density.h, src/modules/grid/grid_gridding/nn/delaunay.c, src/modules/grid/grid_gridding/nn/delaunay.h, src/modules/grid/grid_gridding/nn/hash.c, src/modules/grid/grid_gridding/nn/hash.h, src/modules/grid/grid_gridding/nn/istack.c, src/modules/grid/grid_gridding/nn/istack.h, src/modules/grid/grid_gridding/nn/lpi.c, src/modules/grid/grid_gridding/nn/nan.h, src/modules/grid/grid_gridding/nn/nn.h, src/modules/grid/grid_gridding/nn/nnai.c, src/modules/grid/grid_gridding/nn/nncommon.c, src/modules/grid/grid_gridding/nn/nnpi.c, src/modules/grid/grid_gridding/nn/triangle.c, src/modules/grid/grid_gridding/nn/triangle.h, src/modules/grid/grid_gridding/nn/version.h, src/modules/grid/grid_spline/Gridding_Spline_BA.cpp, src/modules/grid/grid_spline/Gridding_Spline_BA.h, src/modules/grid/grid_spline/Gridding_Spline_Base.cpp, src/modules/grid/grid_spline/Gridding_Spline_Base.h, src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp, src/modules/grid/grid_spline/Gridding_Spline_CSA.h, src/modules/grid/grid_spline/Gridding_Spline_MBA.cpp, src/modules/grid/grid_spline/Gridding_Spline_MBA.h, src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.cpp, src/modules/grid/grid_spline/Gridding_Spline_MBA_Grid.h, src/modules/grid/grid_spline/Gridding_Spline_TPS_Global.cpp, src/modules/grid/grid_spline/Gridding_Spline_TPS_Global.h, src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.cpp, src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.h, src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.cpp, src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.h, src/modules/grid/grid_spline/MLB_Interface.cpp, src/modules/grid/grid_spline/MLB_Interface.h, src/modules/grid/grid_spline/csa.c, src/modules/grid/grid_spline/csa.h, src/modules/grid/grid_tools/CreateGridSystem.cpp, src/modules/grid/grid_tools/CreateGridSystem.h, src/modules/grid/grid_tools/Grid_Aggregate.cpp, src/modules/grid/grid_tools/Grid_Aggregate.h, src/modules/grid/grid_tools/Grid_Buffer.cpp, src/modules/grid/grid_tools/Grid_Buffer.h, src/modules/grid/grid_tools/Grid_Buffer_Proximity.cpp, src/modules/grid/grid_tools/Grid_Buffer_Proximity.h, src/modules/grid/grid_tools/Grid_CombineGrids.cpp, src/modules/grid/grid_tools/Grid_CombineGrids.h, src/modules/grid/grid_tools/Grid_Completion.cpp, src/modules/grid/grid_tools/Grid_Completion.h, src/modules/grid/grid_tools/Grid_ConstantGrid.cpp, src/modules/grid/grid_tools/Grid_ConstantGrid.h, src/modules/grid/grid_tools/Grid_CropToData.cpp, src/modules/grid/grid_tools/Grid_CropToData.h, src/modules/grid/grid_tools/Grid_Cut.cpp, src/modules/grid/grid_tools/Grid_Cut.h, src/modules/grid/grid_tools/Grid_Fill.cpp, src/modules/grid/grid_tools/Grid_Fill.h, src/modules/grid/grid_tools/Grid_Gaps.cpp, src/modules/grid/grid_tools/Grid_Gaps.h, src/modules/grid/grid_tools/Grid_Gaps_OneCell.cpp, src/modules/grid/grid_tools/Grid_Gaps_OneCell.h, src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.cpp, src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.h, src/modules/grid/grid_tools/Grid_InvertNoData.cpp, src/modules/grid/grid_tools/Grid_InvertNoData.h, src/modules/grid/grid_tools/Grid_Mask.cpp, src/modules/grid/grid_tools/Grid_Mask.h, src/modules/grid/grid_tools/Grid_Merge.cpp, src/modules/grid/grid_tools/Grid_Merge.h, src/modules/grid/grid_tools/Grid_Orientation.cpp, src/modules/grid/grid_tools/Grid_Orientation.h, src/modules/grid/grid_tools/Grid_Proximity.cpp, src/modules/grid/grid_tools/Grid_Proximity.h, src/modules/grid/grid_tools/Grid_Resample.cpp, src/modules/grid/grid_tools/Grid_Resample.h, src/modules/grid/grid_tools/Grid_SortRaster.cpp, src/modules/grid/grid_tools/Grid_SortRaster.h, src/modules/grid/grid_tools/Grid_ThresholdBuffer.cpp, src/modules/grid/grid_tools/Grid_ThresholdBuffer.h, src/modules/grid/grid_tools/Grid_Tiling.cpp, src/modules/grid/grid_tools/Grid_Tiling.h, src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp, src/modules/grid/grid_tools/Grid_Value_Reclassify.h, src/modules/grid/grid_tools/Grid_Value_Replace.cpp, src/modules/grid/grid_tools/Grid_Value_Replace.h, src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.cpp, src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h, src/modules/grid/grid_tools/Grid_Value_Request.cpp, src/modules/grid/grid_tools/Grid_Value_Request.h, src/modules/grid/grid_tools/Grid_Value_Type.cpp, src/modules/grid/grid_tools/Grid_Value_Type.h, src/modules/grid/grid_tools/GridsFromTableAndGrid.cpp, src/modules/grid/grid_tools/GridsFromTableAndGrid.h, src/modules/grid/grid_tools/MLB_Interface.cpp, src/modules/grid/grid_tools/MLB_Interface.h, src/modules/grid/grid_tools/Pt.h, src/modules/grid/grid_visualisation/Grid_3D_Image.cpp, src/modules/grid/grid_visualisation/Grid_3D_Image.h, src/modules/grid/grid_visualisation/Grid_Color_Blend.cpp, src/modules/grid/grid_visualisation/Grid_Color_Blend.h, src/modules/grid/grid_visualisation/Grid_Color_Rotate.cpp, src/modules/grid/grid_visualisation/Grid_Color_Rotate.h, src/modules/grid/grid_visualisation/Grid_Color_Triangle.cpp, src/modules/grid/grid_visualisation/Grid_Color_Triangle.h, src/modules/grid/grid_visualisation/Grid_Colors_Fit.cpp, src/modules/grid/grid_visualisation/Grid_Colors_Fit.h, src/modules/grid/grid_visualisation/Grid_Histogram_Surface.cpp, src/modules/grid/grid_visualisation/Grid_Histogram_Surface.h, src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp, src/modules/grid/grid_visualisation/Grid_RGB_Composite.h, src/modules/grid/grid_visualisation/MLB_Interface.cpp, src/modules/grid/grid_visualisation/MLB_Interface.h, src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp, src/modules/pointcloud/pointcloud_tools/MLB_Interface.h, src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp, src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.h, src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.cpp, src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.h, src/modules/pointcloud/pointcloud_tools/pc_cut.cpp, src/modules/pointcloud/pointcloud_tools/pc_cut.h, src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.cpp, src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.h, src/modules/pointcloud/pointcloud_tools/pc_from_grid.cpp, src/modules/pointcloud/pointcloud_tools/pc_from_grid.h, src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp, src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h, src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp, src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h, src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.cpp, src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.h, src/modules/pointcloud/pointcloud_tools/pc_to_grid.cpp, src/modules/pointcloud/pointcloud_tools/pc_to_grid.h, src/modules/pointcloud/pointcloud_tools/pc_to_shapes.cpp, src/modules/pointcloud/pointcloud_tools/pc_to_shapes.h, src/modules/pointcloud/pointcloud_tools/pc_transform.cpp, src/modules/pointcloud/pointcloud_tools/pc_transform.h, src/modules/pointcloud/pointcloud_viewer/MLB_Interface.cpp, src/modules/pointcloud/pointcloud_viewer/MLB_Interface.h, src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp, src/modules/pointcloud/pointcloud_viewer/points_view_control.h, src/modules/pointcloud/pointcloud_viewer/points_view_dialog.cpp, src/modules/pointcloud/pointcloud_viewer/points_view_dialog.h, src/modules/pointcloud/pointcloud_viewer/points_view_extent.cpp, src/modules/pointcloud/pointcloud_viewer/points_view_extent.h, src/modules/pointcloud/pointcloud_viewer/points_view_module.cpp, src/modules/pointcloud/pointcloud_viewer/points_view_module.h, src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp, src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.h, src/modules/shapes/shapes_grid/Grid_Polygon_Clip.cpp, src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h, src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.cpp, src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.h, src/modules/shapes/shapes_grid/Grid_To_Contour.cpp, src/modules/shapes/shapes_grid/Grid_To_Contour.h, src/modules/shapes/shapes_grid/Grid_To_Gradient.cpp, src/modules/shapes/shapes_grid/Grid_To_Gradient.h, src/modules/shapes/shapes_grid/Grid_To_Points.cpp, src/modules/shapes/shapes_grid/Grid_To_Points.h, src/modules/shapes/shapes_grid/Grid_To_Points_Random.cpp, src/modules/shapes/shapes_grid/Grid_To_Points_Random.h, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.cpp, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.h, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.cpp, src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.h, src/modules/shapes/shapes_grid/MLB_Interface.cpp, src/modules/shapes/shapes_grid/MLB_Interface.h, src/modules/shapes/shapes_grid/grid_local_extremes_to_points.cpp, src/modules/shapes/shapes_grid/grid_local_extremes_to_points.h, src/modules/shapes/shapes_lines/Lines_From_Points.cpp, src/modules/shapes/shapes_lines/Lines_From_Points.h, src/modules/shapes/shapes_lines/Lines_From_Polygons.cpp, src/modules/shapes/shapes_lines/Lines_From_Polygons.h, src/modules/shapes/shapes_lines/MLB_Interface.cpp, src/modules/shapes/shapes_lines/MLB_Interface.h, src/modules/shapes/shapes_lines/line_dissolve.cpp, src/modules/shapes/shapes_lines/line_dissolve.h, src/modules/shapes/shapes_lines/line_polygon_intersection.cpp, src/modules/shapes/shapes_lines/line_polygon_intersection.h, src/modules/shapes/shapes_lines/line_properties.cpp, src/modules/shapes/shapes_lines/line_properties.h, src/modules/shapes/shapes_lines/line_simplification.cpp, src/modules/shapes/shapes_lines/line_simplification.h, src/modules/shapes/shapes_lines_ex/Containers.h, src/modules/shapes/shapes_lines_ex/DPHull.h, src/modules/shapes/shapes_lines_ex/LineApproximator.h, src/modules/shapes/shapes_lines_ex/MLB_Interface.cpp, src/modules/shapes/shapes_lines_ex/MLB_Interface.h, src/modules/shapes/shapes_lines_ex/PathHull.h, src/modules/shapes/shapes_lines_ex/SimplifyShapes.cpp, src/modules/shapes/shapes_lines_ex/SimplifyShapes.h, src/modules/shapes/shapes_points/AddCoordinates.cpp, src/modules/shapes/shapes_points/AddCoordinates.h, src/modules/shapes/shapes_points/Clip_Points.cpp, src/modules/shapes/shapes_points/Clip_Points.h, src/modules/shapes/shapes_points/CountPoints.cpp, src/modules/shapes/shapes_points/CountPoints.h, src/modules/shapes/shapes_points/CreatePointGrid.cpp, src/modules/shapes/shapes_points/CreatePointGrid.h, src/modules/shapes/shapes_points/DistanceMatrix.cpp, src/modules/shapes/shapes_points/DistanceMatrix.h, src/modules/shapes/shapes_points/FitNPointsToShape.cpp, src/modules/shapes/shapes_points/FitNPointsToShape.h, src/modules/shapes/shapes_points/MLB_Interface.cpp, src/modules/shapes/shapes_points/MLB_Interface.h, src/modules/shapes/shapes_points/Points_From_Lines.cpp, src/modules/shapes/shapes_points/Points_From_Lines.h, src/modules/shapes/shapes_points/Points_From_Table.cpp, src/modules/shapes/shapes_points/Points_From_Table.h, src/modules/shapes/shapes_points/add_polygon_attributes.cpp, src/modules/shapes/shapes_points/add_polygon_attributes.h, src/modules/shapes/shapes_points/remove_duplicates.cpp, src/modules/shapes/shapes_points/remove_duplicates.h, src/modules/shapes/shapes_points/separate_by_direction.cpp, src/modules/shapes/shapes_points/separate_by_direction.h, src/modules/shapes/shapes_polygons/MLB_Interface.cpp, src/modules/shapes/shapes_polygons/MLB_Interface.h, src/modules/shapes/shapes_polygons/Polygon_Centroids.cpp, src/modules/shapes/shapes_polygons/Polygon_Centroids.h, src/modules/shapes/shapes_polygons/Polygon_Clipper.cpp, src/modules/shapes/shapes_polygons/Polygon_Clipper.h, src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp, src/modules/shapes/shapes_polygons/Polygon_Geometrics.h, src/modules/shapes/shapes_polygons/Polygon_Intersection.cpp, src/modules/shapes/shapes_polygons/Polygon_Intersection.h, src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp, src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.h, src/modules/shapes/shapes_polygons/Polygon_Union.cpp, src/modules/shapes/shapes_polygons/Polygon_Union.h, src/modules/shapes/shapes_polygons/Polygons_From_Lines.cpp, src/modules/shapes/shapes_polygons/Polygons_From_Lines.h, src/modules/shapes/shapes_polygons/polygon_to_points.cpp, src/modules/shapes/shapes_polygons/polygon_to_points.h, src/modules/shapes/shapes_polygons/shape_index.cpp, src/modules/shapes/shapes_polygons/shape_index.h, src/modules/shapes/shapes_tools/CreateChartLayer.cpp, src/modules/shapes/shapes_tools/CreateChartLayer.h, src/modules/shapes/shapes_tools/GraticuleBuilder.cpp, src/modules/shapes/shapes_tools/GraticuleBuilder.h, src/modules/shapes/shapes_tools/JoinTables.cpp, src/modules/shapes/shapes_tools/JoinTables.h, src/modules/shapes/shapes_tools/MLB_Interface.cpp, src/modules/shapes/shapes_tools/MLB_Interface.h, src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.cpp, src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h, src/modules/shapes/shapes_tools/Polygon_Clipper.cpp, src/modules/shapes/shapes_tools/Polygon_Clipper.h, src/modules/shapes/shapes_tools/QueryBuilder.cpp, src/modules/shapes/shapes_tools/QueryBuilder.h, src/modules/shapes/shapes_tools/QueryParser.cpp, src/modules/shapes/shapes_tools/QueryParser.h, src/modules/shapes/shapes_tools/SearchInTable.cpp, src/modules/shapes/shapes_tools/SearchInTable.h, src/modules/shapes/shapes_tools/SelectByTheme.cpp, src/modules/shapes/shapes_tools/SelectByTheme.h, src/modules/shapes/shapes_tools/SeparateShapes.cpp, src/modules/shapes/shapes_tools/SeparateShapes.h, src/modules/shapes/shapes_tools/Shapes_Assign_Table.cpp, src/modules/shapes/shapes_tools/Shapes_Assign_Table.h, src/modules/shapes/shapes_tools/Shapes_Create_Empty.cpp, src/modules/shapes/shapes_tools/Shapes_Create_Empty.h, src/modules/shapes/shapes_tools/Shapes_Merge.cpp, src/modules/shapes/shapes_tools/Shapes_Merge.h, src/modules/shapes/shapes_tools/TransformShapes.cpp, src/modules/shapes/shapes_tools/TransformShapes.h, src/modules/shapes/shapes_tools/quadtree_structure.cpp, src/modules/shapes/shapes_tools/quadtree_structure.h, src/modules/shapes/shapes_tools/shapes_buffer.cpp, src/modules/shapes/shapes_tools/shapes_buffer.h, src/modules/shapes/shapes_tools/shapes_cut.cpp, src/modules/shapes/shapes_tools/shapes_cut.h, src/modules/shapes/shapes_tools/shapes_cut_interactive.cpp, src/modules/shapes/shapes_tools/shapes_cut_interactive.h, src/modules/shapes/shapes_tools/shapes_extents.cpp, src/modules/shapes/shapes_tools/shapes_extents.h, src/modules/shapes/shapes_tools/shapes_split.cpp, src/modules/shapes/shapes_tools/shapes_split.h, src/modules/shapes/shapes_tools/shapes_split_by_attribute.cpp, src/modules/shapes/shapes_tools/shapes_split_by_attribute.h, src/modules/shapes/shapes_tools/shapes_split_randomly.cpp, src/modules/shapes/shapes_tools/shapes_split_randomly.h, src/modules/shapes/shapes_transect/MLB_Interface.cpp, src/modules/shapes/shapes_transect/MLB_Interface.h, src/modules/shapes/shapes_transect/Polygon_Transect.cpp, src/modules/shapes/shapes_transect/Polygon_Transect.h, src/modules/table/table_calculus/Fit.cpp, src/modules/table/table_calculus/Fit.h, src/modules/table/table_calculus/LMFit.cpp, src/modules/table/table_calculus/LMFit.h, src/modules/table/table_calculus/MLB_Interface.cpp, src/modules/table/table_calculus/MLB_Interface.h, src/modules/table/table_calculus/Table_Calculator.cpp, src/modules/table/table_calculus/Table_Calculator.h, src/modules/table/table_calculus/Table_CalculatorShapes.cpp, src/modules/table/table_calculus/Table_CalculatorShapes.h, src/modules/table/table_calculus/Table_Trend.cpp, src/modules/table/table_calculus/Table_Trend.h, src/modules/table/table_calculus/table_cluster_analysis.cpp, src/modules/table/table_calculus/table_cluster_analysis.h, src/modules/table/table_calculus/table_pca.cpp, src/modules/table/table_calculus/table_pca.h, src/modules/table/table_calculus/table_running_average.cpp, src/modules/table/table_calculus/table_running_average.h, src/modules/table/table_tools/MLB_Interface.cpp, src/modules/table/table_tools/MLB_Interface.h, src/modules/table/table_tools/Table_Create_Empty.cpp, src/modules/table/table_tools/Table_Create_Empty.h, src/modules/table/table_tools/Table_Enumerate.cpp, src/modules/table/table_tools/Table_Enumerate.h, src/modules/table/table_tools/Table_Rotate.cpp, src/modules/table/table_tools/Table_Rotate.h, src/modules/tin/tin_tools/MLB_Interface.cpp, src/modules/tin/tin_tools/MLB_Interface.h, src/modules/tin/tin_tools/TIN_Flow_Parallel.cpp, src/modules/tin/tin_tools/TIN_Flow_Parallel.h, src/modules/tin/tin_tools/TIN_Flow_Trace.cpp, src/modules/tin/tin_tools/TIN_Flow_Trace.h, src/modules/tin/tin_tools/TIN_From_Grid.cpp, src/modules/tin/tin_tools/TIN_From_Grid.h, src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp, src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.h, src/modules/tin/tin_tools/TIN_From_Shapes.cpp, src/modules/tin/tin_tools/TIN_From_Shapes.h, src/modules/tin/tin_tools/TIN_Gradient.cpp, src/modules/tin/tin_tools/TIN_Gradient.h, src/modules/tin/tin_tools/TIN_To_Shapes.cpp, src/modules/tin/tin_tools/TIN_To_Shapes.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/A1WiTh.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/A1WiTh.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/A2WiTh.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/A2WiTh.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/A3WiTh.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/A3WiTh.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa1.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa1.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa2.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa2.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping1.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping1.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping2.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping2.h, src/modules_contrib/contrib_a_perego/contrib_a_perego/directional1.cpp, src/modules_contrib/contrib_a_perego/contrib_a_perego/directional1.h, src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.cpp, src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.h, src/modules_contrib/contrib_s_liersch/ihacres/convert_sl.cpp, src/modules_contrib/contrib_s_liersch/ihacres/convert_sl.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_basin.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_basin.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_bands.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_bands.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_cal.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_cal.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_eq.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_eq.h, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_v1.cpp, src/modules_contrib/contrib_s_liersch/ihacres/ihacres_v1.h, src/modules_contrib/contrib_s_liersch/ihacres/model_tools.cpp, src/modules_contrib/contrib_s_liersch/ihacres/model_tools.h, src/modules_contrib/contrib_s_liersch/ihacres/snow_module.cpp, src/modules_contrib/contrib_s_liersch/ihacres/snow_module.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/CompleteLinkage.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/CompleteLinkage.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/DebugStream.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/DebugStream.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/GridCalcError.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/GridCalcError.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/MLB_Interface.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/MLB_Interface.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/NoDataValueError.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/NoDataValueError.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/Profiler.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/Profiler.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/rgbOverlay.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/rgbOverlay.h, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/tomaschTool.cpp, src/modules_contrib/contrib_t_wutzler/contrib_t_wutzler/tomaschTool.h, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Directional_Statistics.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Directional_Statistics.h, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.h, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.h, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance.h, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance_Radius.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance_Radius.h, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.h, src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.h, src/modules_geostatistics/geostatistics/geostatistics_grid/fast_representativeness.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/fast_representativeness.h, src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.h, src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.h, src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.cpp, src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary_global.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal_global.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary_global.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal_global.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_universal_global.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.h, src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.cpp, src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.h, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.h, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Pattern_Analysis.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Pattern_Analysis.h, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Semi_Variances.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Semi_Variances.h, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Cloud.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Cloud.h, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Surface.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Variogram_Surface.h, src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.h, src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.h, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression.h, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_grid.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_multi_regression_grid.h, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.h, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression_grid.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression_grid.h, src/modules_geostatistics/geostatistics/geostatistics_regression/point_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_grid_regression.h, src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_multi_grid_regression.h, src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.cpp, src/modules_geostatistics/geostatistics/geostatistics_regression/point_trend_surface.h, src/modules_images/modules_imagery/imagery_classification/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_classification/MLB_Interface.h, src/modules_images/modules_imagery/imagery_classification/change_detection.cpp, src/modules_images/modules_imagery/imagery_classification/change_detection.h, src/modules_images/modules_imagery/imagery_classification/classify_cluster_analysis.cpp, src/modules_images/modules_imagery/imagery_classification/classify_cluster_analysis.h, src/modules_images/modules_imagery/imagery_classification/classify_supervised.cpp, src/modules_images/modules_imagery/imagery_classification/classify_supervised.h, src/modules_images/modules_imagery/imagery_rga/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_rga/MLB_Interface.h, src/modules_images/modules_imagery/imagery_rga/fast_region_growing.cpp, src/modules_images/modules_imagery/imagery_rga/fast_region_growing.h, src/modules_images/modules_imagery/imagery_segmentation/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_segmentation/MLB_Interface.h, src/modules_images/modules_imagery/imagery_segmentation/grid_seeds.cpp, src/modules_images/modules_imagery/imagery_segmentation/grid_seeds.h, src/modules_images/modules_imagery/imagery_segmentation/rga_basic.cpp, src/modules_images/modules_imagery/imagery_segmentation/rga_basic.h, src/modules_images/modules_imagery/imagery_segmentation/skeletonization.cpp, src/modules_images/modules_imagery/imagery_segmentation/skeletonization.h, src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.cpp, src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.h, src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.cpp, src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.h, src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.cpp, src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.h, src/modules_images/modules_imagery/imagery_tools/MLB_Interface.cpp, src/modules_images/modules_imagery/imagery_tools/MLB_Interface.h, src/modules_images/modules_opencv/opencv/MLB_Interface.cpp, src/modules_images/modules_opencv/opencv/MLB_Interface.h, src/modules_images/modules_opencv/opencv/opencv.cpp, src/modules_images/modules_opencv/opencv/opencv.h, src/modules_images/modules_opencv/opencv/opencv_fourier.cpp, src/modules_images/modules_opencv/opencv/opencv_fourier.h, src/modules_images/modules_opencv/opencv/opencv_morphology.cpp, src/modules_images/modules_opencv/opencv/opencv_morphology.h, src/modules_images/modules_opencv/opencv/opencv_svd.cpp, src/modules_images/modules_opencv/opencv/opencv_svd.h, src/modules_images/modules_vigra/vigra/MLB_Interface.cpp, src/modules_images/modules_vigra/vigra/MLB_Interface.h, src/modules_images/modules_vigra/vigra/vigra.cpp, src/modules_images/modules_vigra/vigra/vigra.h, src/modules_images/modules_vigra/vigra/vigra_distance.cpp, src/modules_images/modules_vigra/vigra/vigra_distance.h, src/modules_images/modules_vigra/vigra/vigra_edges.cpp, src/modules_images/modules_vigra/vigra/vigra_edges.h, src/modules_images/modules_vigra/vigra/vigra_fft.cpp, src/modules_images/modules_vigra/vigra/vigra_fft.h, src/modules_images/modules_vigra/vigra/vigra_morphology.cpp, src/modules_images/modules_vigra/vigra/vigra_morphology.h, src/modules_images/modules_vigra/vigra/vigra_smoothing.cpp, src/modules_images/modules_vigra/vigra/vigra_smoothing.h, src/modules_images/modules_vigra/vigra/vigra_watershed.cpp, src/modules_images/modules_vigra/vigra/vigra_watershed.h, src/modules_io/db/io_db_mysql/Get_Table.cpp, src/modules_io/db/io_db_mysql/Get_Table.h, src/modules_io/db/io_db_mysql/MLB_Interface.cpp, src/modules_io/db/io_db_mysql/MLB_Interface.h, src/modules_io/db/io_odbc/MLB_Interface.cpp, src/modules_io/db/io_odbc/MLB_Interface.h, src/modules_io/db/io_odbc/get_connection.cpp, src/modules_io/db/io_odbc/get_connection.h, src/modules_io/db/io_odbc/pgis_shapes.cpp, src/modules_io/db/io_odbc/pgis_shapes.h, src/modules_io/db/io_odbc/shapes.cpp, src/modules_io/db/io_odbc/shapes.h, src/modules_io/db/io_odbc/table.cpp, src/modules_io/db/io_odbc/table.h, src/modules_io/docs/docs_html/CreateWebContent.cpp, src/modules_io/docs/docs_html/CreateWebContent.h, src/modules_io/docs/docs_html/MLB_Interface.cpp, src/modules_io/docs/docs_html/MLB_Interface.h, src/modules_io/docs/docs_html/doc_html.cpp, src/modules_io/docs/docs_html/doc_html.h, src/modules_io/docs/docs_html/doc_svg.cpp, src/modules_io/docs/docs_html/doc_svg.h, src/modules_io/docs/docs_html/svg_interactive_map.cpp, src/modules_io/docs/docs_html/svg_interactive_map.h, src/modules_io/docs/docs_pdf/MLB_Interface.cpp, src/modules_io/docs/docs_pdf/MLB_Interface.h, src/modules_io/docs/docs_pdf/Polygon_Clipper.cpp, src/modules_io/docs/docs_pdf/Polygon_Clipper.h, src/modules_io/docs/docs_pdf/Profile_Cross_Sections.cpp, src/modules_io/docs/docs_pdf/Profile_Cross_Sections.h, src/modules_io/docs/docs_pdf/Shapes_Report.cpp, src/modules_io/docs/docs_pdf/Shapes_Report.h, src/modules_io/docs/docs_pdf/Shapes_Summary.cpp, src/modules_io/docs/docs_pdf/Shapes_Summary.h, src/modules_io/docs/docs_pdf/doc_pdf.cpp, src/modules_io/docs/docs_pdf/doc_pdf.h, src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.cpp, src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.h, src/modules_io/esri_e00/io_esri_e00/MLB_Interface.cpp, src/modules_io/esri_e00/io_esri_e00/MLB_Interface.h, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_conv.c, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_conv.h, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_error.c, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_error.h, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_port.h, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_vsi.h, src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_vsisimple.c, src/modules_io/esri_e00/io_esri_e00/e00compr/e00compr.h, src/modules_io/esri_e00/io_esri_e00/e00compr/e00read.c, src/modules_io/esri_e00/io_esri_e00/e00compr/e00write.c, src/modules_io/gdal/io_gdal/MLB_Interface.cpp, src/modules_io/gdal/io_gdal/MLB_Interface.h, src/modules_io/gdal/io_gdal/gdal_driver.cpp, src/modules_io/gdal/io_gdal/gdal_driver.h, src/modules_io/gdal/io_gdal/gdal_export.cpp, src/modules_io/gdal/io_gdal/gdal_export.h, src/modules_io/gdal/io_gdal/gdal_export_geotiff.cpp, src/modules_io/gdal/io_gdal/gdal_export_geotiff.h, src/modules_io/gdal/io_gdal/gdal_import.cpp, src/modules_io/gdal/io_gdal/gdal_import.h, src/modules_io/gdal/io_gdal/ogr_driver.cpp, src/modules_io/gdal/io_gdal/ogr_driver.h, src/modules_io/gdal/io_gdal/ogr_export.cpp, src/modules_io/gdal/io_gdal/ogr_export.h, src/modules_io/gdal/io_gdal/ogr_import.cpp, src/modules_io/gdal/io_gdal/ogr_import.h, src/modules_io/gps/io_gps/GPSBabel.cpp, src/modules_io/gps/io_gps/GPSBabel.h, src/modules_io/gps/io_gps/MLB_Interface.cpp, src/modules_io/gps/io_gps/MLB_Interface.h, src/modules_io/gps/io_gps/gpx2shp.cpp, src/modules_io/gps/io_gps/gpx2shp.h, src/modules_io/grid/io_grid/MLB_Interface.cpp, src/modules_io/grid/io_grid/MLB_Interface.h, src/modules_io/grid/io_grid/bmp_export.cpp, src/modules_io/grid/io_grid/bmp_export.h, src/modules_io/grid/io_grid/erdas_lan.cpp, src/modules_io/grid/io_grid/erdas_lan.h, src/modules_io/grid/io_grid/esri_arcinfo.cpp, src/modules_io/grid/io_grid/esri_arcinfo.h, src/modules_io/grid/io_grid/grid_table.cpp, src/modules_io/grid/io_grid/grid_table.h, src/modules_io/grid/io_grid/mola.cpp, src/modules_io/grid/io_grid/mola.h, src/modules_io/grid/io_grid/raw.cpp, src/modules_io/grid/io_grid/raw.h, src/modules_io/grid/io_grid/srtm30.cpp, src/modules_io/grid/io_grid/srtm30.h, src/modules_io/grid/io_grid/surfer.cpp, src/modules_io/grid/io_grid/surfer.h, src/modules_io/grid/io_grid/usgs_srtm.cpp, src/modules_io/grid/io_grid/usgs_srtm.h, src/modules_io/grid/io_grid/xyz.cpp, src/modules_io/grid/io_grid/xyz.h, src/modules_io/grid/io_grid_grib2/MLB_Interface.cpp, src/modules_io/grid/io_grid_grib2/MLB_Interface.h, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/cmplxpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/compack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/comunpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/dec_jpeg2000.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/dec_png.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/drstemplates.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/drstemplates.h, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/enc_jpeg2000.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/enc_png.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_addfield.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_addgrid.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_addlocal.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_create.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_free.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_getfld.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_gribend.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_info.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_miss.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack1.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack2.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack3.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack4.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack5.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack6.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/g2_unpack7.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/gbits.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/getdim.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/getpoly.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/grib2.h, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/gridtemplates.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/gridtemplates.h, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/int_power.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/jpcpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/jpcunpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/misspack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/mkieee.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/pack_gp.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/pdstemplates.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/pdstemplates.h, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/pngpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/pngunpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/rdieee.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/reduce.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/seekgb.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/simpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/simunpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/specpack.c, src/modules_io/grid/io_grid_grib2/g2clib-1.0.4/specunpack.c, src/modules_io/grid/io_grid_grib2/grib2_import.cpp, src/modules_io/grid/io_grid_grib2/grib2_import.h, src/modules_io/grid/io_grid_image/MLB_Interface.cpp, src/modules_io/grid/io_grid_image/MLB_Interface.h, src/modules_io/grid/io_grid_image/grid_export.cpp, src/modules_io/grid/io_grid_image/grid_export.h, src/modules_io/grid/io_grid_image/grid_import.cpp, src/modules_io/grid/io_grid_image/grid_import.h, src/modules_io/shapes/io_shapes/MLB_Interface.cpp, src/modules_io/shapes/io_shapes/MLB_Interface.h, src/modules_io/shapes/io_shapes/atlas_bna.cpp, src/modules_io/shapes/io_shapes/atlas_bna.h, src/modules_io/shapes/io_shapes/generate.cpp, src/modules_io/shapes/io_shapes/generate.h, src/modules_io/shapes/io_shapes/gpx.cpp, src/modules_io/shapes/io_shapes/gpx.h, src/modules_io/shapes/io_shapes/gstat.cpp, src/modules_io/shapes/io_shapes/gstat.h, src/modules_io/shapes/io_shapes/pointcloud_from_file.cpp, src/modules_io/shapes/io_shapes/pointcloud_from_file.h, src/modules_io/shapes/io_shapes/pointcloud_from_text_file.cpp, src/modules_io/shapes/io_shapes/pointcloud_from_text_file.h, src/modules_io/shapes/io_shapes/stl.cpp, src/modules_io/shapes/io_shapes/stl.h, src/modules_io/shapes/io_shapes/surfer_bln.cpp, src/modules_io/shapes/io_shapes/surfer_bln.h, src/modules_io/shapes/io_shapes/svg.cpp, src/modules_io/shapes/io_shapes/svg.h, src/modules_io/shapes/io_shapes/wasp_map.cpp, src/modules_io/shapes/io_shapes/wasp_map.h, src/modules_io/shapes/io_shapes/xyz.cpp, src/modules_io/shapes/io_shapes/xyz.h, src/modules_io/shapes/io_shapes_dxf/MLB_Interface.cpp, src/modules_io/shapes/io_shapes_dxf/MLB_Interface.h, src/modules_io/shapes/io_shapes_dxf/dxf_import.cpp, src/modules_io/shapes/io_shapes_dxf/dxf_import.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_attributes.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_codes.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_creationadapter.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_creationinterface.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_dxf.cpp, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_dxf.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_entities.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_exception.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_extrusion.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer.h, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer_ascii.cpp, src/modules_io/shapes/io_shapes_dxf/dxflib/dl_writer_ascii.h, src/modules_io/shapes/io_shapes_las/MLB_Interface.cpp, src/modules_io/shapes/io_shapes_las/MLB_Interface.h, src/modules_io/shapes/io_shapes_las/las_export.cpp, src/modules_io/shapes/io_shapes_las/las_export.h, src/modules_io/shapes/io_shapes_las/las_import.cpp, src/modules_io/shapes/io_shapes_las/las_import.h, src/modules_io/shapes/io_shapes_las/las_info.cpp, src/modules_io/shapes/io_shapes_las/las_info.h, src/modules_io/table/io_table/MLB_Interface.cpp, src/modules_io/table/io_table/MLB_Interface.h, src/modules_io/table/io_table/io_table_txt.cpp, src/modules_io/table/io_table/io_table_txt.h, src/modules_lectures/lectures/lectures_introduction/Exercise_01.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_01.h, src/modules_lectures/lectures/lectures_introduction/Exercise_02.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_02.h, src/modules_lectures/lectures/lectures_introduction/Exercise_03.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_03.h, src/modules_lectures/lectures/lectures_introduction/Exercise_04.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_04.h, src/modules_lectures/lectures/lectures_introduction/Exercise_05.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_05.h, src/modules_lectures/lectures/lectures_introduction/Exercise_06.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_06.h, src/modules_lectures/lectures/lectures_introduction/Exercise_07.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_07.h, src/modules_lectures/lectures/lectures_introduction/Exercise_08.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_08.h, src/modules_lectures/lectures/lectures_introduction/Exercise_09.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_09.h, src/modules_lectures/lectures/lectures_introduction/Exercise_10.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_10.h, src/modules_lectures/lectures/lectures_introduction/Exercise_11.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_11.h, src/modules_lectures/lectures/lectures_introduction/Exercise_12.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_12.h, src/modules_lectures/lectures/lectures_introduction/Exercise_13.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_13.h, src/modules_lectures/lectures/lectures_introduction/Exercise_14.cpp, src/modules_lectures/lectures/lectures_introduction/Exercise_14.h, src/modules_lectures/lectures/lectures_introduction/MLB_Interface.cpp, src/modules_lectures/lectures/lectures_introduction/MLB_Interface.h, src/modules_projection/pj_georeference/pj_georeference/Collect_Points.cpp, src/modules_projection/pj_georeference/pj_georeference/Collect_Points.h, src/modules_projection/pj_georeference/pj_georeference/Georef_Engine.cpp, src/modules_projection/pj_georeference/pj_georeference/Georef_Engine.h, src/modules_projection/pj_georeference/pj_georeference/Georef_Grid.cpp, src/modules_projection/pj_georeference/pj_georeference/Georef_Grid.h, src/modules_projection/pj_georeference/pj_georeference/Georef_Shapes.cpp, src/modules_projection/pj_georeference/pj_georeference/Georef_Shapes.h, src/modules_projection/pj_georeference/pj_georeference/MLB_Interface.cpp, src/modules_projection/pj_georeference/pj_georeference/MLB_Interface.h, src/modules_projection/pj_georeference/pj_georeference/cminpak.h, src/modules_projection/pj_georeference/pj_georeference/dpmpar.h, src/modules_projection/pj_georeference/pj_georeference/enorm.c, src/modules_projection/pj_georeference/pj_georeference/fdjac2.c, src/modules_projection/pj_georeference/pj_georeference/georef_grid_move.cpp, src/modules_projection/pj_georeference/pj_georeference/georef_grid_move.h, src/modules_projection/pj_georeference/pj_georeference/lmdif.c, src/modules_projection/pj_georeference/pj_georeference/lmdif0.c, src/modules_projection/pj_georeference/pj_georeference/lmpar.c, src/modules_projection/pj_georeference/pj_georeference/qrfac.c, src/modules_projection/pj_georeference/pj_georeference/qrsolv.c, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Base.cpp, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Base.h, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Grid.cpp, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Grid.h, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Shapes.cpp, src/modules_projection/pj_geotrans/pj_geotrans/GEOTRANS_Shapes.h, src/modules_projection/pj_geotrans/pj_geotrans/MLB_Interface.cpp, src/modules_projection/pj_geotrans/pj_geotrans/MLB_Interface.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/albers.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/albers.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/azeq.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/azeq.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/bng.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/bng.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/bonne.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/bonne.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/cassini.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/cassini.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/cyleqa.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/cyleqa.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/datum.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/datum.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eckert4.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eckert4.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eckert6.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eckert6.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/ellipse.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/ellipse.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/engine.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/engine.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eqdcyl.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/eqdcyl.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/geocent.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/geocent.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/geoid.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/geoid.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/georef.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/georef.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/geotrans.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/gnomonic.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/gnomonic.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/grinten.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/grinten.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert_1.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert_1.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert_2.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/lambert_2.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/loccart.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/loccart.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mercator.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mercator.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mgrs.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mgrs.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/miller.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/miller.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mollweid.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/mollweid.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/neys.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/neys.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/nzmg.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/nzmg.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/omerc.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/omerc.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/orthogr.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/orthogr.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/polarst.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/polarst.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/polycon.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/polycon.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/sinusoid.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/sinusoid.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/stereogr.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/stereogr.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/tranmerc.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/tranmerc.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/trcyleqa.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/trcyleqa.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/ups.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/ups.h, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/utm.c, src/modules_projection/pj_geotrans/pj_geotrans/geotrans/utm.h, src/modules_projection/pj_proj4/pj_proj4/MLB_Interface.cpp, src/modules_projection/pj_proj4/pj_proj4/MLB_Interface.h, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Base.cpp, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Base.h, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Grid.cpp, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Grid.h, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Shapes.cpp, src/modules_projection/pj_proj4/pj_proj4/PROJ4_Shapes.h, src/modules_projection/pj_proj4/pj_proj4/crs_assign.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_assign.h, src/modules_projection/pj_proj4/pj_proj4/crs_base.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_base.h, src/modules_projection/pj_proj4/pj_proj4/crs_transform.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_transform.h, src/modules_projection/pj_proj4/pj_proj4/crs_transform_grid.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_transform_grid.h, src/modules_projection/pj_proj4/pj_proj4/crs_transform_shapes.cpp, src/modules_projection/pj_proj4/pj_proj4/crs_transform_shapes.h, src/modules_recreations/recreations/recreations_fractals/Bifurcation.cpp, src/modules_recreations/recreations/recreations_fractals/Bifurcation.h, src/modules_recreations/recreations/recreations_fractals/Gaussian_Landscapes.cpp, src/modules_recreations/recreations/recreations_fractals/Gaussian_Landscapes.h, src/modules_recreations/recreations/recreations_fractals/Grid_FractalDimension.cpp, src/modules_recreations/recreations/recreations_fractals/Grid_FractalDimension.h, src/modules_recreations/recreations/recreations_fractals/MLB_Interface.cpp, src/modules_recreations/recreations/recreations_fractals/MLB_Interface.h, src/modules_recreations/recreations/recreations_fractals/Mandelbrot.cpp, src/modules_recreations/recreations/recreations_fractals/Mandelbrot.h, src/modules_recreations/recreations/recreations_fractals/Newton.cpp, src/modules_recreations/recreations/recreations_fractals/Newton.h, src/modules_recreations/recreations/recreations_fractals/Pythagoras_Tree.cpp, src/modules_recreations/recreations/recreations_fractals/Pythagoras_Tree.h, src/modules_recreations/recreations/recreations_games/MLB_Interface.cpp, src/modules_recreations/recreations/recreations_games/MLB_Interface.h, src/modules_recreations/recreations/recreations_games/Mine_Sweeper.cpp, src/modules_recreations/recreations/recreations_games/Mine_Sweeper.h, src/modules_recreations/recreations/recreations_games/Mine_Sweeper_Res.cpp, src/modules_recreations/recreations/recreations_games/Sudoku.cpp, src/modules_recreations/recreations/recreations_games/Sudoku.h, src/modules_simulation/cellular_automata/sim_cellular_automata/Life.cpp, src/modules_simulation/cellular_automata/sim_cellular_automata/Life.h, src/modules_simulation/cellular_automata/sim_cellular_automata/MLB_Interface.cpp, src/modules_simulation/cellular_automata/sim_cellular_automata/MLB_Interface.h, src/modules_simulation/cellular_automata/sim_cellular_automata/Wator.cpp, src/modules_simulation/cellular_automata/sim_cellular_automata/Wator.h, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_01.cpp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_01.h, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_02.cpp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_02.h, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_03.cpp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/Hugget_03.h, src/modules_simulation/ecosystems/sim_ecosystems_hugget/MLB_Interface.cpp, src/modules_simulation/ecosystems/sim_ecosystems_hugget/MLB_Interface.h, src/modules_simulation/fire/sim_fire_spreading/Forecasting.cpp, src/modules_simulation/fire/sim_fire_spreading/Forecasting.h, src/modules_simulation/fire/sim_fire_spreading/MLB_Interface.cpp, src/modules_simulation/fire/sim_fire_spreading/MLB_Interface.h, src/modules_simulation/fire/sim_fire_spreading/Pt.h, src/modules_simulation/fire/sim_fire_spreading/Simulate.cpp, src/modules_simulation/fire/sim_fire_spreading/Simulate.h, src/modules_simulation/fire/sim_fire_spreading/SimulateVariableWind.cpp, src/modules_simulation/fire/sim_fire_spreading/SimulateVariableWind.h, src/modules_simulation/fire/sim_fire_spreading/fireLib.c, src/modules_simulation/fire/sim_fire_spreading/fireLib.h, src/modules_simulation/hydrology/sim_hydrology/DVWK_SoilMoisture.cpp, src/modules_simulation/hydrology/sim_hydrology/DVWK_SoilMoisture.h, src/modules_simulation/hydrology/sim_hydrology/KinWav_D8.cpp, src/modules_simulation/hydrology/sim_hydrology/KinWav_D8.h, src/modules_simulation/hydrology/sim_hydrology/MLB_Interface.cpp, src/modules_simulation/hydrology/sim_hydrology/MLB_Interface.h, src/modules_simulation/hydrology/sim_hydrology/WaterRetentionCapacity.cpp, src/modules_simulation/hydrology/sim_hydrology/WaterRetentionCapacity.h, src/modules_simulation/hydrology/sim_hydrology/idw.cpp, src/modules_simulation/hydrology/sim_hydrology/idw.h, src/modules_simulation/hydrology/sim_hydrology/topmodel.cpp, src/modules_simulation/hydrology/sim_hydrology/topmodel.h, src/modules_simulation/hydrology/sim_hydrology/topmodel_values.cpp, src/modules_simulation/hydrology/sim_hydrology/topmodel_values.h, src/modules_template/template/template/MLB_Interface.cpp, src/modules_template/template/template/MLB_Interface.h, src/modules_template/template/template/Template.cpp, src/modules_template/template/template/Template.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Altitude.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/ChannelNetwork_Distance.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/D8_Flow_Analysis.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/Helper.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/Helper.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/Strahler.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/Strahler.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds.h, src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.cpp, src/modules_terrain_analysis/terrain_analysis/ta_channels/Watersheds_ext.h, src/modules_terrain_analysis/terrain_analysis/ta_compound/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_compound/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.cpp, src/modules_terrain_analysis/terrain_analysis/ta_compound/TA_Standard.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/BasinGrid.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/BasinGrid.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/CellBalance.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/EdgeContamination.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/FlowDepth.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaDownslope.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaDownslope.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_AreaUpslope.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_BRM.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Distance.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Parallel.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_Parallel.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveDown.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveDown.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveUp.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Flow_RecursiveUp.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Helper.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesConst.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/IsochronesVar.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFlood.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFlood.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/LakeFloodInteractive.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Pt.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SAGA_Wetness_Index.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Sinuosity.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/SlopeLength.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/TopographicIndices.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_massflux.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_massflux.h, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_width.cpp, src/modules_terrain_analysis/terrain_analysis/ta_hydrology/flow_width.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/HillShade.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/HillShade.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/SolarRadiation.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Point.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/Visibility_Point.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/topographic_correction.h, src/modules_terrain_analysis/terrain_analysis/ta_lighting/view_shed.cpp, src/modules_terrain_analysis/terrain_analysis/ta_lighting/view_shed.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Convergence_Radius.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Curvature_Classification.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Hypsometry.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Hypsometry.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Morphometry.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Morphometry.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ProtectionIndex.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ProtectionIndex.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/RealArea.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/SurfaceSpecificPoints.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/air_flow_height.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/air_flow_height.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/anisotropic_heating.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/anisotropic_heating.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/distance_gradient.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/distance_gradient.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/land_surface_temperature.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/land_surface_temperature.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mass_balance_index.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mass_balance_index.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mrvbf.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/mrvbf.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/relative_heights.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ruggedness.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/ruggedness.h, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/wind_effect.cpp, src/modules_terrain_analysis/terrain_analysis/ta_morphometry/wind_effect.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/FillSinks_WL_XXL.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Flat_Detection.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Flat_Detection.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/MLB_Interface.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Eliminator.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Eliminator.h, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Router.cpp, src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Pit_Router.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Cross_Profiles.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Cross_Profiles.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Flow_Profile.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Flow_Profile.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_ProfileFromPoints.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Profile_From_Lines.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Swath_Profile.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/Grid_Swath_Profile.h, src/modules_terrain_analysis/terrain_analysis/ta_profiles/MLB_Interface.cpp, src/modules_terrain_analysis/terrain_analysis/ta_profiles/MLB_Interface.h, src/saga_core/saga_api/api_callback.cpp, src/saga_core/saga_api/api_colors.cpp, src/saga_core/saga_api/api_core.cpp, src/saga_core/saga_api/api_core.h, src/saga_core/saga_api/api_file.cpp, src/saga_core/saga_api/api_memory.cpp, src/saga_core/saga_api/api_string.cpp, src/saga_core/saga_api/api_translator.cpp, src/saga_core/saga_api/compatibility.h, src/saga_core/saga_api/dataobject.cpp, src/saga_core/saga_api/dataobject.h, src/saga_core/saga_api/geo_classes.cpp, src/saga_core/saga_api/geo_functions.cpp, src/saga_core/saga_api/geo_tools.h, src/saga_core/saga_api/grid.cpp, src/saga_core/saga_api/grid.h, src/saga_core/saga_api/grid_io.cpp, src/saga_core/saga_api/grid_memory.cpp, src/saga_core/saga_api/grid_operation.cpp, src/saga_core/saga_api/grid_pyramid.cpp, src/saga_core/saga_api/grid_pyramid.h, src/saga_core/saga_api/grid_system.cpp, src/saga_core/saga_api/mat_formula.cpp, src/saga_core/saga_api/mat_grid_radius.cpp, src/saga_core/saga_api/mat_indexing.cpp, src/saga_core/saga_api/mat_matrix.cpp, src/saga_core/saga_api/mat_regression.cpp, src/saga_core/saga_api/mat_regression_multiple.cpp, src/saga_core/saga_api/mat_spline.cpp, src/saga_core/saga_api/mat_tools.cpp, src/saga_core/saga_api/mat_tools.h, src/saga_core/saga_api/mat_trend.cpp, src/saga_core/saga_api/metadata.cpp, src/saga_core/saga_api/metadata.h, src/saga_core/saga_api/module.cpp, src/saga_core/saga_api/module.h, src/saga_core/saga_api/module_grid.cpp, src/saga_core/saga_api/module_grid_interactive.cpp, src/saga_core/saga_api/module_interactive.cpp, src/saga_core/saga_api/module_interactive_base.cpp, src/saga_core/saga_api/module_library.cpp, src/saga_core/saga_api/module_library.h, src/saga_core/saga_api/module_library_interface.cpp, src/saga_core/saga_api/parameter.cpp, src/saga_core/saga_api/parameter_data.cpp, src/saga_core/saga_api/parameters.cpp, src/saga_core/saga_api/parameters.h, src/saga_core/saga_api/pointcloud.cpp, src/saga_core/saga_api/pointcloud.h, src/saga_core/saga_api/projections.cpp, src/saga_core/saga_api/quadtree.cpp, src/saga_core/saga_api/saga_api.cpp, src/saga_core/saga_api/saga_api.h, src/saga_core/saga_api/shape.cpp, src/saga_core/saga_api/shape_line.cpp, src/saga_core/saga_api/shape_part.cpp, src/saga_core/saga_api/shape_point.cpp, src/saga_core/saga_api/shape_points.cpp, src/saga_core/saga_api/shape_polygon.cpp, src/saga_core/saga_api/shapes.cpp, src/saga_core/saga_api/shapes.h, src/saga_core/saga_api/shapes_io.cpp, src/saga_core/saga_api/shapes_ogis.cpp, src/saga_core/saga_api/shapes_search.cpp, src/saga_core/saga_api/shapes_selection.cpp, src/saga_core/saga_api/table.cpp, src/saga_core/saga_api/table.h, src/saga_core/saga_api/table_dbase.cpp, src/saga_core/saga_api/table_dbase.h, src/saga_core/saga_api/table_io.cpp, src/saga_core/saga_api/table_record.cpp, src/saga_core/saga_api/table_selection.cpp, src/saga_core/saga_api/table_value.h, src/saga_core/saga_api/tin.cpp, src/saga_core/saga_api/tin.h, src/saga_core/saga_api/tin_elements.cpp, src/saga_core/saga_api/tin_triangulation.cpp, src/saga_core/saga_cmd/callback.cpp, src/saga_core/saga_cmd/callback.h, src/saga_core/saga_cmd/module_library.cpp, src/saga_core/saga_cmd/module_library.h, src/saga_core/saga_cmd/saga_cmd.cpp, src/saga_core/saga_gdi/saga_gdi.cpp, src/saga_core/saga_gdi/saga_gdi.h, src/saga_core/saga_gdi/sgdi_diagram.cpp, src/saga_core/saga_gdi/sgdi_diagram.h, src/saga_core/saga_gdi/sgdi_dialog.cpp, src/saga_core/saga_gdi/sgdi_dialog.h, src/saga_core/saga_gdi/sgdi_helper.cpp, src/saga_core/saga_gdi/sgdi_helper.h, src/saga_core/saga_gui/active.cpp, src/saga_core/saga_gui/active.h, src/saga_core/saga_gui/active_HTMLExtraInfo.cpp, src/saga_core/saga_gui/active_HTMLExtraInfo.h, src/saga_core/saga_gui/active_attributes.cpp, src/saga_core/saga_gui/active_attributes.h, src/saga_core/saga_gui/active_description.cpp, src/saga_core/saga_gui/active_description.h, src/saga_core/saga_gui/active_history.cpp, src/saga_core/saga_gui/active_history.h, src/saga_core/saga_gui/active_legend.cpp, src/saga_core/saga_gui/active_legend.h, src/saga_core/saga_gui/active_parameters.cpp, src/saga_core/saga_gui/active_parameters.h, src/saga_core/saga_gui/callback.cpp, src/saga_core/saga_gui/callback.h, src/saga_core/saga_gui/dc_helper.cpp, src/saga_core/saga_gui/dc_helper.h, src/saga_core/saga_gui/dlg_about.cpp, src/saga_core/saga_gui/dlg_about.h, src/saga_core/saga_gui/dlg_about_logo.cpp, src/saga_core/saga_gui/dlg_about_logo.h, src/saga_core/saga_gui/dlg_base.cpp, src/saga_core/saga_gui/dlg_base.h, src/saga_core/saga_gui/dlg_colors.cpp, src/saga_core/saga_gui/dlg_colors.h, src/saga_core/saga_gui/dlg_colors_control.cpp, src/saga_core/saga_gui/dlg_colors_control.h, src/saga_core/saga_gui/dlg_list_base.cpp, src/saga_core/saga_gui/dlg_list_base.h, src/saga_core/saga_gui/dlg_list_grid.cpp, src/saga_core/saga_gui/dlg_list_grid.h, src/saga_core/saga_gui/dlg_list_pointcloud.cpp, src/saga_core/saga_gui/dlg_list_pointcloud.h, src/saga_core/saga_gui/dlg_list_shapes.cpp, src/saga_core/saga_gui/dlg_list_shapes.h, src/saga_core/saga_gui/dlg_list_table.cpp, src/saga_core/saga_gui/dlg_list_table.h, src/saga_core/saga_gui/dlg_list_tin.cpp, src/saga_core/saga_gui/dlg_list_tin.h, src/saga_core/saga_gui/dlg_parameters.cpp, src/saga_core/saga_gui/dlg_parameters.h, src/saga_core/saga_gui/dlg_table.cpp, src/saga_core/saga_gui/dlg_table.h, src/saga_core/saga_gui/dlg_text.cpp, src/saga_core/saga_gui/dlg_text.h, src/saga_core/saga_gui/helper.cpp, src/saga_core/saga_gui/helper.h, src/saga_core/saga_gui/info.cpp, src/saga_core/saga_gui/info.h, src/saga_core/saga_gui/info_messages.cpp, src/saga_core/saga_gui/info_messages.h, src/saga_core/saga_gui/parameters_control.cpp, src/saga_core/saga_gui/parameters_control.h, src/saga_core/saga_gui/parameters_properties.cpp, src/saga_core/saga_gui/parameters_properties.h, src/saga_core/saga_gui/project.cpp, src/saga_core/saga_gui/project.h, src/saga_core/saga_gui/res/resource.h, src/saga_core/saga_gui/res_commands.cpp, src/saga_core/saga_gui/res_commands.h, src/saga_core/saga_gui/res_controls.cpp, src/saga_core/saga_gui/res_controls.h, src/saga_core/saga_gui/res_dialogs.cpp, src/saga_core/saga_gui/res_dialogs.h, src/saga_core/saga_gui/res_images.cpp, src/saga_core/saga_gui/res_images.h, src/saga_core/saga_gui/saga.cpp, src/saga_core/saga_gui/saga.h, src/saga_core/saga_gui/saga_frame.cpp, src/saga_core/saga_gui/saga_frame.h, src/saga_core/saga_gui/saga_frame_droptarget.cpp, src/saga_core/saga_gui/saga_frame_droptarget.h, src/saga_core/saga_gui/view_base.cpp, src/saga_core/saga_gui/view_base.h, src/saga_core/saga_gui/view_histogram.cpp, src/saga_core/saga_gui/view_histogram.h, src/saga_core/saga_gui/view_layout.cpp, src/saga_core/saga_gui/view_layout.h, src/saga_core/saga_gui/view_layout_control.cpp, src/saga_core/saga_gui/view_layout_control.h, src/saga_core/saga_gui/view_layout_info.cpp, src/saga_core/saga_gui/view_layout_info.h, src/saga_core/saga_gui/view_layout_printout.cpp, src/saga_core/saga_gui/view_layout_printout.h, src/saga_core/saga_gui/view_map.cpp, src/saga_core/saga_gui/view_map.h, src/saga_core/saga_gui/view_map_3d.cpp, src/saga_core/saga_gui/view_map_3d.h, src/saga_core/saga_gui/view_map_3d_image.cpp, src/saga_core/saga_gui/view_map_3d_image.h, src/saga_core/saga_gui/view_map_control.cpp, src/saga_core/saga_gui/view_map_control.h, src/saga_core/saga_gui/view_ruler.cpp, src/saga_core/saga_gui/view_ruler.h, src/saga_core/saga_gui/view_scatterplot.cpp, src/saga_core/saga_gui/view_scatterplot.h, src/saga_core/saga_gui/view_table.cpp, src/saga_core/saga_gui/view_table.h, src/saga_core/saga_gui/view_table_control.cpp, src/saga_core/saga_gui/view_table_control.h, src/saga_core/saga_gui/view_table_diagram.cpp, src/saga_core/saga_gui/view_table_diagram.h, src/saga_core/saga_gui/wksp.cpp, src/saga_core/saga_gui/wksp.h, src/saga_core/saga_gui/wksp_base_control.cpp, src/saga_core/saga_gui/wksp_base_control.h, src/saga_core/saga_gui/wksp_base_item.cpp, src/saga_core/saga_gui/wksp_base_item.h, src/saga_core/saga_gui/wksp_base_manager.cpp, src/saga_core/saga_gui/wksp_base_manager.h, src/saga_core/saga_gui/wksp_data_control.cpp, src/saga_core/saga_gui/wksp_data_control.h, src/saga_core/saga_gui/wksp_data_layers.cpp, src/saga_core/saga_gui/wksp_data_layers.h, src/saga_core/saga_gui/wksp_data_manager.cpp, src/saga_core/saga_gui/wksp_data_manager.h, src/saga_core/saga_gui/wksp_data_menu_file.cpp, src/saga_core/saga_gui/wksp_data_menu_file.h, src/saga_core/saga_gui/wksp_data_menu_files.cpp, src/saga_core/saga_gui/wksp_data_menu_files.h, src/saga_core/saga_gui/wksp_grid.cpp, src/saga_core/saga_gui/wksp_grid.h, src/saga_core/saga_gui/wksp_grid_manager.cpp, src/saga_core/saga_gui/wksp_grid_manager.h, src/saga_core/saga_gui/wksp_grid_system.cpp, src/saga_core/saga_gui/wksp_grid_system.h, src/saga_core/saga_gui/wksp_layer.cpp, src/saga_core/saga_gui/wksp_layer.h, src/saga_core/saga_gui/wksp_layer_classify.cpp, src/saga_core/saga_gui/wksp_layer_classify.h, src/saga_core/saga_gui/wksp_layer_legend.cpp, src/saga_core/saga_gui/wksp_layer_legend.h, src/saga_core/saga_gui/wksp_map.cpp, src/saga_core/saga_gui/wksp_map.h, src/saga_core/saga_gui/wksp_map_buttons.cpp, src/saga_core/saga_gui/wksp_map_buttons.h, src/saga_core/saga_gui/wksp_map_control.cpp, src/saga_core/saga_gui/wksp_map_control.h, src/saga_core/saga_gui/wksp_map_dc.cpp, src/saga_core/saga_gui/wksp_map_dc.h, src/saga_core/saga_gui/wksp_map_layer.cpp, src/saga_core/saga_gui/wksp_map_layer.h, src/saga_core/saga_gui/wksp_map_manager.cpp, src/saga_core/saga_gui/wksp_map_manager.h, src/saga_core/saga_gui/wksp_module.cpp, src/saga_core/saga_gui/wksp_module.h, src/saga_core/saga_gui/wksp_module_control.cpp, src/saga_core/saga_gui/wksp_module_control.h, src/saga_core/saga_gui/wksp_module_library.cpp, src/saga_core/saga_gui/wksp_module_library.h, src/saga_core/saga_gui/wksp_module_manager.cpp, src/saga_core/saga_gui/wksp_module_manager.h, src/saga_core/saga_gui/wksp_module_menu.cpp, src/saga_core/saga_gui/wksp_module_menu.h, src/saga_core/saga_gui/wksp_pointcloud.cpp, src/saga_core/saga_gui/wksp_pointcloud.h, src/saga_core/saga_gui/wksp_pointcloud_manager.cpp, src/saga_core/saga_gui/wksp_pointcloud_manager.h, src/saga_core/saga_gui/wksp_shapes.cpp, src/saga_core/saga_gui/wksp_shapes.h, src/saga_core/saga_gui/wksp_shapes_edit.cpp, src/saga_core/saga_gui/wksp_shapes_line.cpp, src/saga_core/saga_gui/wksp_shapes_line.h, src/saga_core/saga_gui/wksp_shapes_manager.cpp, src/saga_core/saga_gui/wksp_shapes_manager.h, src/saga_core/saga_gui/wksp_shapes_point.cpp, src/saga_core/saga_gui/wksp_shapes_point.h, src/saga_core/saga_gui/wksp_shapes_points.cpp, src/saga_core/saga_gui/wksp_shapes_points.h, src/saga_core/saga_gui/wksp_shapes_polygon.cpp, src/saga_core/saga_gui/wksp_shapes_polygon.h, src/saga_core/saga_gui/wksp_shapes_type.cpp, src/saga_core/saga_gui/wksp_shapes_type.h, src/saga_core/saga_gui/wksp_table.cpp, src/saga_core/saga_gui/wksp_table.h, src/saga_core/saga_gui/wksp_table_manager.cpp, src/saga_core/saga_gui/wksp_table_manager.h, src/saga_core/saga_gui/wksp_tin.cpp, src/saga_core/saga_gui/wksp_tin.h, src/saga_core/saga_gui/wksp_tin_manager.cpp, src/saga_core/saga_gui/wksp_tin_manager.h, src/saga_core/saga_gui/wx/propgrid/advprops.cpp, src/saga_core/saga_gui/wx/propgrid/advprops.h, src/saga_core/saga_gui/wx/propgrid/editors.cpp, src/saga_core/saga_gui/wx/propgrid/editors.h, src/saga_core/saga_gui/wx/propgrid/extras.cpp, src/saga_core/saga_gui/wx/propgrid/extras.h, src/saga_core/saga_gui/wx/propgrid/manager.cpp, src/saga_core/saga_gui/wx/propgrid/manager.h, src/saga_core/saga_gui/wx/propgrid/odcombo.cpp, src/saga_core/saga_gui/wx/propgrid/odcombo.h, src/saga_core/saga_gui/wx/propgrid/propdev.h, src/saga_core/saga_gui/wx/propgrid/propgrid.cpp, src/saga_core/saga_gui/wx/propgrid/propgrid.h, src/saga_core/saga_gui/wx/propgrid/props.cpp, src/saga_core/saga_gui/wx/propgrid/props.h, src/saga_core/saga_odbc/otlv4.h, src/saga_core/saga_odbc/saga_odbc.cpp, src/saga_core/saga_odbc/saga_odbc.h: all .h, .c and .cpp files: svn keywords added and conversion to Unix LF 2011-02-14 13:51 reklov_w * .: directory saga_2 renamed to saga-gis 2011-02-14 12:03 oconrad * various changes made when cvs server at sf was down (hack attack) 2011-01-24 15:08 oconrad * vc9 project maintainence 2011-01-24 15:01 oconrad * pointer assignment bug fix 2011-01-24 14:53 oconrad * vc6 project maintainence 2011-01-24 14:50 oconrad * segmentation tools moved from grid_discretisation library 2011-01-24 14:23 oconrad * stl compile error (gcc) fixed 2011-01-24 13:47 oconrad * adjusted menu path 2011-01-24 13:46 oconrad * allow classification for just one class 2011-01-24 13:13 oconrad * imagery_classification, imagery_rga, imagery_tools added; grid_discretisation removed 2011-01-24 13:11 oconrad * optimisation for grid/shapes related spatial joins 2011-01-24 11:57 oconrad * optimisation and no-data support 2011-01-24 11:56 oconrad * look-up table classification: minor enhancement 2011-01-24 11:55 oconrad * code comments/structuring/readability (no change of functionality) 2011-01-24 11:53 oconrad * no data value support 2011-01-24 11:53 oconrad * multiple input grids and selection of output parameters enabled 2011-01-24 11:50 oconrad * update changed input grid 2011-01-24 11:46 oconrad * support for multiple input files (i.e. e00, e01, e02 ...) 2011-01-24 11:44 oconrad * does not belong here... 2011-01-24 11:43 oconrad * 'fast region growing algorithm' moved to separate library due to stl compile con... 2011-01-24 11:41 oconrad * new libraries: imagery_classification, imagery_rga, imagery_tools 2011-01-24 11:40 oconrad * 'fast region growing algorithm' moved to separate library due to stl compile conflicts (gcc) 2011-01-24 11:37 oconrad * grid_discretisation tools moved to imagery_classification and imagery_segmentation libraries 2011-01-24 11:35 oconrad * fuzzy set and vegetation index tools moved to grid_calculus/imagery_tools libraries 2011-01-24 11:34 oconrad * fuzzy set tools moved from grid_analysis library 2011-01-24 11:33 oconrad * vegetation index tools moved from grid_analysis library 2011-01-24 11:32 oconrad * image segmentation tools moved from discarded grid_discretisation library 2011-01-24 11:30 oconrad * image classification tools moved from discarded grid_discretisation library 2011-01-22 15:25 reklov_w * fixes LUT min/max comparison to match GUI behavior 2011-01-18 22:05 reklov_w * parameter and code added to handle 8bit coded color values; rescaling of R,G,B values to SAGA RGB refined 2011-01-14 01:33 reklov_w * added LUT coloring for command line; module name updated to reflect all output formats 2011-01-04 13:47 reklov_w * fix for wrong 'condition ? value : value' statements 2011-01-03 22:35 reklov_w * added missing operator 2011-01-03 21:56 reklov_w * table_pca sources added 2011-01-03 21:32 reklov_w * enhancement: if output is no set, the attribute is dropped from the input 2011-01-03 15:42 oconrad * unicode compilation error fixed 2011-01-03 15:42 oconrad * las_info module added 2011-01-03 15:36 oconrad * eigen reduction for matrices added 2011-01-03 15:35 oconrad * improved principal components analysis for grids 2011-01-03 15:34 oconrad * principal components analysis for tables added 2010-12-27 12:53 reklov_w * 'las info' module added 2010-12-22 14:13 reklov_w * Principle Components Analysis module added 2010-12-21 17:24 oconrad * labels trimmed (white space removed) before drawing 2010-12-21 17:23 oconrad * principal componets analysis (for grids) added 2010-12-17 13:14 reklov_w * bug fix NoData handling (bug item 3139011) 2010-12-17 13:04 reklov_w * postbuild copy of *.lng.txt files removed 2010-12-15 10:18 reklov_w * morphology and ranks filter sources added 2010-12-14 17:41 oconrad * support for last, first, min, max, mean calculation if more than one shapes is assoc. with a cell 2010-12-14 17:40 oconrad * bug fix: statistics invalidated when a value has changed 2010-12-14 17:39 oconrad * bug fix 2010-12-10 11:00 oconrad * improved scatterplot performance 2010-12-10 10:56 oconrad * fast segmentation replaced by watershed segmentation (grid_segmentation.cpp/h) 2010-12-10 10:54 oconrad * morphology and rank filter added 2010-12-08 19:00 oconrad * significally improved performance 2010-12-08 18:59 oconrad * stronglly improved and renamed to 'watershed segmentation' 2010-12-08 18:57 oconrad * alternative slope/aspect calculation added 2010-12-07 13:56 reklov_w * bug fix attribute handling 2010-11-30 11:36 oconrad * history related enhancements 2010-11-30 11:36 oconrad * delete children: bug fix and delete 'level of detail' added 2010-11-30 11:35 oconrad * context menu enabled for legend and history 2010-11-30 11:26 oconrad * target grid name inherited from source grid name 2010-11-26 14:40 oconrad * long string (_TW() macro) enabled 2010-11-26 14:40 oconrad * improved translations 2010-11-26 13:31 oconrad * collection of helpful tools for saga development. currently only tools for translation dictionary creation. 2010-11-26 13:23 oconrad * new translation system uses updated dictionary files (template and german) 2010-11-26 13:07 oconrad * new translation system uses only one single dictionary file removed: post-build copying) 2010-11-26 12:58 oconrad * unnecessary translatables removed, critical translatables replaced 2010-11-26 12:56 oconrad * removed 2010-11-26 12:55 oconrad * language dictionary file can be chosen from saga_gui 2010-11-26 12:53 oconrad * no need to include explicitly (stdlib.h is sufficient) 2010-11-26 12:51 oconrad * new translation system uses only one single dictionary file 2010-11-26 12:45 oconrad * replaced by io_odbc (wxODBC will be removed with wxWidgets v3(v2.9)) 2010-11-26 11:33 reklov_w * fix postbuild - projection files added 2010-11-25 00:33 reklov_w * fix wrong boolean return on module execution with method 'height' 2010-11-23 13:22 oconrad * arrow style option added; works on surface grid or directional components (x, y) 2010-11-23 13:20 oconrad * no data and statistics support for export 2010-11-21 15:26 reklov_w * fix data object handling 2010-11-18 12:46 reklov_w * updated for 2.0.6 release 2010-11-18 12:12 oconrad * proj4 and geotrans lib sources removed (geotrans sources are now integrated and proj4 works well with the official distribution) 2010-11-18 12:08 oconrad * interpolation target grid needs to be of floating pointt type (optional) 2010-11-18 11:54 oconrad * bug fix: missing 'return( true )' on csg_grid::create(csg_grid *p, ...) 2010-11-17 17:21 oconrad * no data set for duration 2010-11-17 16:43 oconrad * removed tooltip flickering (windows7) 2010-11-16 16:29 oconrad * first fix for msw vista/7 problems with wxTreeCtrl (multi-select deletion), but there might be more to be done... 2010-11-16 16:27 oconrad * Set_NoData_Value(double) now only implemented in CSG_Data_Object, avoids swig/java conflicts 2010-11-16 11:47 oconrad * BSD portability: not included if __BSD__ is defined 2010-11-16 11:26 oconrad * sado_solarradiation removed 2010-11-16 11:25 oconrad * cluster_analysis added 2010-11-16 11:25 oconrad * doc_html.h, doc_pdf.h, doc_svg.h removed from swig includes 2010-11-16 10:37 oconrad * sado_solarradiation removed. bug fixes in solarradiation 2010-11-15 17:20 oconrad * completely overworked insolation module (sado_solarradiation is now obsolete) 2010-11-15 17:19 oconrad * removed unnecassary processing on addition/multiplication 2010-11-09 22:12 johanvdw * Only check for python/swig on --enable-python 2010-11-09 22:01 johanvdw * Fix minor memory leak (Grid Pattern) 2010-11-09 10:26 oconrad * msvc10 x64 unicode build targets 2010-11-09 10:24 oconrad * C exit() removed 2010-11-09 10:21 oconrad * input data will now be saved automatically if modified by module 2010-11-09 10:19 oconrad * no data support for dbase files (read/write) 2010-11-09 10:19 oconrad * floating point precision fitted to value (currently up to 16 decimals) 2010-11-08 11:34 reklov_w * bug fix for memory leak in case of multiple seed cells in non-interactive version; enhancements: allow multiple seed cells, allow seeds to be local water depth or absolute water level, output water depth and surface, incremetal flooding with interactive version 2010-11-08 09:20 johanvdw * Disable libharu in python (when not available) 2010-11-08 09:19 johanvdw * Remove saga_api_wrap.cxx on make clean 2010-11-08 08:45 oconrad * 'load tin' via file menu now enabled (loads any shapefile and converts it to tin) 2010-11-06 22:34 reklov_w * updated to current cvs 2010-11-06 15:51 reklov_w * EXPORTS preprocessor defines added for x64 targets 2010-11-06 15:20 reklov_w * cluster analysis for shapes/table attributes added 2010-11-06 15:16 johanvdw * Only build module if libharu is found 2010-11-06 11:59 johanvdw * Update autotools to build python bindings 2010-11-06 11:55 johanvdw * Enable swig unicode build 2010-11-06 11:51 johanvdw * Fix some memory leaks 2010-11-05 14:59 oconrad * simple tools added for sum and product calculation 2010-11-05 14:58 oconrad * cluster analysis now also allowed to work on one single feature 2010-11-05 14:56 oconrad * improvements and bug fixes for fuzzy set analysis 2010-11-05 14:55 oconrad * improved output grid naming 2010-11-05 14:53 oconrad * old linux and mingw makefiles have been removed 2010-11-05 14:51 oconrad * cluster analysis for shapes/table attributes added 2010-11-03 19:32 oconrad * improved gdal/ogr import via gui (adds to recent files list) 2010-11-03 19:31 oconrad * csg_cluster_analysis: optimisation and used for grids 2010-11-03 11:11 oconrad * cluster analysis class added 2010-11-02 12:56 oconrad * morain's i calculation added 2010-11-02 12:55 oconrad * vc6 project missed io_gdal_EXPORTS define 2010-11-02 12:54 oconrad * vc6 compiler error fixed 2010-11-02 12:26 oconrad * getting prepared for 2.0.6 release 2010-11-02 11:04 oconrad * pointcloud points selection and interactive deletion enabled 2010-11-02 11:03 oconrad * typing error caused missing las_export.h in make dist target 2010-11-02 11:00 oconrad * rounding error 2010-11-02 10:59 oconrad * unicode bug fix in csg_ui_parameter class 2010-11-02 10:58 oconrad * simple moran's i for grids 2010-10-29 15:48 oconrad * kernel density estimation: module added 2010-10-29 15:43 oconrad * suppress progress bar flickering 2010-10-29 10:18 oconrad * numbering of data set objects (number of leading zeros now user defined) 2010-10-29 10:17 oconrad * enhanced pointcloud/shapes conformity, test case proj4 for shapes 2010-10-27 09:37 oconrad * peucker-douglas algorithm for line simplification added 2010-10-27 09:30 oconrad * bug fix: possible crash when accessing tree item after closing associated data set 2010-10-27 09:29 oconrad * bug fix: possible crash with field names containing % characters 2010-10-27 09:27 oconrad * peucker-douglas algorithm for line simplification added 2010-10-25 15:24 oconrad * docs_html, docs_pdf moved to separate libraries 2010-10-22 15:20 oconrad * Triangular Multiple Flow Direction added/updated 2010-10-22 14:48 oconrad * menu path and name 2010-10-22 14:47 oconrad * typing error fixed 2010-10-22 14:46 oconrad * svg map export added 2010-10-22 12:05 oconrad * shapes_tools project included (was forgotten) 2010-10-22 12:03 oconrad * pdf/svg/html doc support moved from api to new module library 2010-10-22 09:15 oconrad * pdf/svg/html doc support moved from api to new module library 2010-10-22 09:08 oconrad * no need for maintaining old mingw makefiles 2010-10-22 09:05 oconrad * no need for maintaining old gcc (linux) makefiles 2010-10-22 09:05 oconrad * no need for maintaining old gcc (linux) makefiles 2010-10-20 08:20 oconrad * linux gcc compatibility 2010-10-20 08:19 oconrad * vc10 solution added (loads *.vcxproj files) 2010-10-19 15:53 oconrad * safe 64bit pointers in callback function arguments 2010-10-19 15:52 oconrad * target area (polygon) now optional (caused problems with infinite projections) 2010-10-19 15:50 oconrad * vc10 projects 2010-10-19 08:05 johanvdw * Add makefiles for modules_imagery 2010-10-19 07:55 johanvdw * Complete check for liblas 2010-10-18 14:45 oconrad * updated msvc10 projects 2010-10-18 14:30 oconrad * saving of nodes without content now permitted 2010-10-18 14:29 oconrad * vc10 project; debug settings corrected 2010-10-18 13:29 oconrad * msvc10 solution & project files (including 64bit targets) 2010-10-18 13:12 oconrad * platform info (x86/x64), windows only 2010-10-18 13:11 oconrad * unicode compatibility 2010-10-18 11:08 oconrad * x64 type conversion warnings removed (not all of them yet) 2010-10-18 11:07 oconrad * dependency to ta_morphology removed 2010-10-18 11:04 oconrad * io_gdal: name/descrription bug fixed 2010-10-18 11:03 oconrad * geotrans: sources now built-in (not linked to external library) 2010-10-15 14:14 johanvdw * Make sure image modules are added to disttarget 2010-10-15 11:57 reklov_w * change output format of datalists, now always four digits (filename_0000 instead of filename_00) 2010-10-15 11:55 reklov_w * fix typo in module parameters 2010-10-14 09:54 reklov_w * preprocessor define "io_gdal_EXPORTS" added 2010-10-13 17:49 oconrad * projection enhancements 2010-10-13 17:49 oconrad * csg_metadata: potential crash 2010-10-13 17:48 oconrad * api callback; progressbar flickering when progressbar should be suppressed 2010-10-12 14:56 oconrad * gdal import 2010-10-12 14:55 oconrad * output parameter lists now automatically cleaned from invalid items 2010-10-12 14:54 oconrad * improved metadata and projection inheritage 2010-10-12 14:52 oconrad * gcc compiler error fixed 2010-10-11 16:06 oconrad * gdal/ogr dll interface - gdal support in gui 2010-10-08 14:53 oconrad * gdal - improved wrapper for dll-export (coming next) 2010-10-08 12:05 oconrad * wksp_layer - get_name() function moved to base class 2010-10-08 12:04 oconrad * bug fix 2010-10-08 12:04 oconrad * gdal - user break, metadata 2010-10-08 12:03 oconrad * proj4 - grid to points, target from loaded rdata set 2010-10-07 19:53 johanvdw * Add opencv/vigra modules to autotools 2010-10-07 16:01 johanvdw * Various fixes to compile using gcc 4.4 2010-10-07 13:57 johanvdw * Build LAS module if detected - update Makefile as well 2010-10-07 13:54 johanvdw * Build LAS import module if its library is detected 2010-10-07 13:49 johanvdw * Use const char* instead of char* for return string 2010-10-07 13:47 johanvdw * Mark all images as const chars Fixes a very large number of compiler warnings in gcc. May be slightly more efficient. 2010-09-20 16:22 oconrad * projections: built-in proj4/wkt dictionary now included 2010-09-20 16:20 oconrad * svg export module (missing project bindings) 2010-09-17 16:23 oconrad * no message 2010-09-17 16:20 oconrad * now also saves entries only with parameters (but no child, no content) 2010-09-15 17:07 oconrad * no message 2010-09-14 15:55 oconrad * no message 2010-09-13 16:17 oconrad * grid to image: drawing bug 2010-09-13 14:38 reklov_w * new ASCII import options: output grid data type selection and optional user defined NoData value to write instead of that found in the file 2010-09-13 13:49 reklov_w * allow for larger numbers than max_int in SG_Get_Significant_Decimals() 2010-09-11 17:02 reklov_w * bug fix in rect_to_polar to recognize quadrant, new option on how to measure direction; noData support for polar_to_rect 2010-09-11 01:00 reklov_w * forgot to add the new files for the least cost path points module 2010-09-11 00:07 reklov_w * new module for least cost path search from point(s) shapefile added 2010-09-09 16:54 oconrad * no message 2010-09-08 14:29 oconrad * no message 2010-09-08 09:02 reklov_w * new interactive modules can use middle mouse button in map mode select 2010-09-07 15:59 oconrad * projection issues: reached beta stage 2010-09-03 15:48 oconrad * crs & projection support (not fully completed) 2010-09-02 21:21 reklov_w * fixed typo 2010-08-30 16:25 oconrad * modules: stop_execution-callback without dialog prompt enabled 2010-08-29 15:53 johanvdw * Fix non-unicode autotools build 2010-08-28 15:48 reklov_w * fix color attribute setting 2010-08-28 15:47 reklov_w * new stepping for SG_ARRAY_GROWTH, and faster growing for point clouds 2010-08-27 07:54 oconrad * no message 2010-08-25 16:17 oconrad * projection support: if defined data object's CRS will be inherited. 2010-08-24 23:02 reklov_w * oops, my configure.in contained to build the las import module; removed 2010-08-24 22:58 reklov_w * reverted to build ta_compond library on linux by default because the change does not work (segfaults with saga_cmd,strange behaviour in the GUI; seems like the module libs the module depends on do not get loaded correctly 2010-08-22 23:02 reklov_w * fix kernel bug (not all cells processed) and optimization 2010-08-13 08:08 johanvdw * Add support for MacOSX dylib dynamic libraries 2010-08-10 14:32 reklov_w * export xyz: added the possibility to exclude NoData cells from the output 2010-07-30 08:20 johanvdw * Add module description (from Sextante) 2010-07-22 12:47 johanvdw * Changes to enable building dist target 2010-07-19 15:43 oconrad * no message 2010-07-13 16:08 oconrad * no message 2010-07-13 13:56 oconrad * modules: seeds & region growing algorithm (obia) 2010-07-08 15:08 johanvdw * Add manfiles for saga_gui and saga_cmd Remove unused version numbers from modules - continued 2010-07-08 15:06 johanvdw * Add manfiles for saga_gui and saga_cmd 2010-07-08 14:53 johanvdw * Update module search path for automake builds 2010-07-08 14:23 johanvdw * Update module description formatting 2010-07-08 14:21 johanvdw * Change workspace location to Shapes - Transect 2010-07-08 14:18 johanvdw * Add ruggedness to Makefile.am 2010-07-08 14:11 johanvdw * Remove unused so-versioning from modules By adding -avoid-version to ldflags 2010-07-06 13:01 oconrad * mainly first macos patches 2010-07-05 08:07 oconrad * plascencia fixes & ruggedness modules added 2010-07-04 13:54 reklov_w * bug fix and updates for import/export module (offset is already handled with liblas in case header info is correct) 2010-07-03 21:11 reklov_w * new LAS export module and updates for las import (now offset and scale is recognized and it is possible to skip the isValid() check that may fail with large scan angles (e.g. from MLS data) 2010-07-01 10:03 reklov_w * progress bar added 2010-06-29 03:25 johanvdw * Fix module html generation on unix 2010-06-28 23:22 johanvdw * Build using libharu if it is available in the system directories 2010-06-28 23:17 johanvdw * Build opencv-module on unix 2010-06-24 12:25 oconrad * no message 2010-06-24 10:16 reklov_w * bug fix for LUT classes fit 2010-06-22 11:03 reklov_w * bug fix (multiple module runs now correctly reset seleted attributes, LUT min/max now correctly set) 2010-06-20 15:35 reklov_w * new module 'cluster analysis for point clouds' added 2010-06-18 12:11 reklov_w * added new module 'Point Cloud Attribute Calculator' to makefiles 2010-06-18 11:23 reklov_w * added new module 'Point Cloud Attribute Calculator' 2010-06-17 15:45 oconrad * no message 2010-06-15 13:16 oconrad * CSG_String::asDouble() works now also on not null terminated number strings 2010-06-10 18:59 johanvdw * contrib_t_wutzler: various fixes to compile with gcc 4.4 2010-06-10 16:33 oconrad * no message 2010-06-08 15:04 johanvdw * Add version number to shared library sonames 2010-06-04 15:24 oconrad * no message 2010-05-31 13:05 oconrad * saga_cmd: mlb_interface is recognised again 2010-05-28 16:49 oconrad * no message 2010-05-28 09:18 oconrad * csg_pointcloud: load/save bug fix geogr. weighted regression: support for no data table values saga_cmd: general flags (silent mode etc.); module path detection 2010-05-26 08:34 oconrad * saga_gui/parameters_control.cpp: gcc compilation error fixed 2010-05-21 14:46 oconrad * various modules: recognising table's no-data values gui: search for attributes api: point cloud selection (alpha stage) odbc: improvements (constraints have still to be added) 2010-05-19 13:46 reklov_w * revert last change 2010-05-19 13:36 reklov_w * wx2.8.11 with msvc9 unicode compilation (64-bit) 2010-05-19 13:17 reklov_w * fix day2month conversion 2010-05-19 08:41 reklov_w * fix access violation with method "absolute" if stddev grid is not created 2010-05-18 11:32 oconrad * no message 2010-05-18 11:31 oconrad * wx2.8.11 with msvc9 unicode compilation (32-bit) 2010-05-12 12:54 oconrad * csg_pointcloud::del_point() bug fix 2010-05-10 13:26 oconrad * no message 2010-05-07 14:27 oconrad * no message 2010-05-06 13:41 reklov_w * fixing unicode string handling in module library description 2010-05-06 12:56 oconrad * no message 2010-05-06 07:47 reklov_w * enabled build of ta_compound by default (linux) 2010-04-29 16:06 oconrad * no message 2010-04-28 23:32 reklov_w * language files updated to match cvs 2010-04-28 15:27 reklov_w * added classification support (min/max, stddev) for pointclouds 2010-04-28 14:23 reklov_w * added Display Color Classification Type RGB for pointclouds 2010-04-28 13:07 reklov_w * moved dialog parameters for "AREA" from constructor to on_execute to fix "invalid parameter" bug in non-interactive version 2010-04-27 08:51 reklov_w * activated ODBC support on linux; this adds a new dependency on unixODBC 2010-04-26 07:37 oconrad * no message 2010-04-26 07:18 oconrad * no message 2010-04-23 22:13 reklov_w * fix R,G,B, datatypes (now SG_DATATYPE_Int) to prevent overflow 2010-04-21 08:58 reklov_w * fix to support point cloud export correctly (before fix, x and y were written twice to the table) 2010-04-20 16:21 oconrad * no message 2010-04-20 10:50 oconrad * no message 2010-04-20 10:49 oconrad * improved triangulation algorithm (stl import, interpolation) 2010-04-20 07:46 johanvdw * Update Protection Index description Based on input from a discussion on: http://sourceforge.net/projects/saga-gis/forums/forum/790705/topic/3674186 2010-04-19 07:27 reklov_w * new module pc thinning (simple) added 2010-04-18 18:26 reklov_w * fix Del_Point(), bug caused heap corruption in _Dec_Array() 2010-04-16 20:27 reklov_w * fix wrong 64bit build configurations, corrected _SAGA_ODBC_EXPORTS 2010-04-16 16:08 oconrad * no message 2010-04-16 15:33 reklov_w * fix wrong 64bit build configurations 2010-04-15 09:14 oconrad * saga grid ascii import: bug fixed 2010-04-14 19:45 reklov_w * SAGA treats xmin/ymin as "pixel-as-point" and not as "pixel-as-area" 2010-04-14 13:07 oconrad * no message 2010-04-06 19:27 reklov_w * fix bug in aspect calculation 2010-03-26 12:09 oconrad * no message 2010-03-26 11:43 oconrad * no message 2010-03-25 16:47 oconrad * no message 2010-03-25 16:37 oconrad * no message 2010-03-25 16:36 oconrad * saga_odbc: new additional api library for database (via odbc) access changed io_odbc module library (previous name io_odbc_otl) 2010-03-25 09:23 johanvdw * Update modules/shapefiles to include shapes transect 2010-03-25 09:20 johanvdw * New module: Create transect through polygons map Transect for lines and polygon shapefiles The goal of this module is to create a transect along a line through a polygon map. Eg |____ST1_____!_ST2_!__ST1__!_______ST#_____| (Soil type 1 etc...) This is done by creating a table with the ID of each line, the distance to the starting point and the different transects: | line_id | start | end | code/field | | 0 | 0 | 124 | ST1 | | 0 | 124 | 300 | ST2 | | 0 | 300 | 1223 | ST1 | | 0 | 1223 | 2504 | ST3 | | 1 | 0 | 200 | ST4 | | ... | ... | ... | ... | The module requires an input shape with all the line transects [Transect_Line] and a polygon theme [Theme]. You also have to select which field you want to have in the resulting table [Transect_Result]. This can be an ID of the polygon theme if you want to link the tables later on, or any other field [Theme_Field]. 2010-03-24 08:24 oconrad * saga_api serious bug fix: csg_string::printf() used without argument list leads potentially to program crash 2010-03-24 08:22 oconrad * saga_gui bug fix: deep map window zoom freezes saga lectures_introduction bug fix: choices list gridsfromtableandgrid module enhanced gsgrid_zonal_statistics: field names optionally with full length 2010-03-24 08:18 oconrad * flat_detection module added 2010-03-22 10:14 johanvdw * Update SG_FPRINTF to work with gcc unicode Before the fix running saga_cmd without arguments and without library directory would yield: e:n afterwards: error: no valid module library found in path [...] this error started after the silent mode was introduced (11-1-2010) 2010-03-18 10:03 oconrad * io_gdal/io_grid_image: rotation/scaling support 2010-03-17 19:38 oconrad * no message 2010-03-16 16:10 oconrad * saga_api: projections support (not finished yet) io_grid_image: world file scaling/rotation support 2010-03-16 09:47 oconrad * module added to grid_tools: proximity grid calculation 2010-03-16 09:21 reklov_w * added error checking for formula and fixed bugs (pointer to uninitialized vector) 2010-03-15 17:04 oconrad * csg_grid index creation error not properly handled in catchment area calculation 2010-03-15 15:21 oconrad * serious bug fix: dbase string fields must have a size > 0 on initialisation 2010-03-15 15:19 oconrad * missing implementation of csg_file::set_unicodemode() (caused error in swig/python build) 2010-03-15 15:16 oconrad * no message 2010-03-15 12:51 reklov_w * added x64 build targets to visual studio projects 2010-03-15 12:47 reklov_w * added visual studio solution file and x64 build targets to zip 2010-03-14 17:11 oconrad * no message 2010-03-11 14:38 reklov_w * add point clouds to all recognized types on load 2010-03-09 22:43 reklov_w * fix previous change "Fix memory leak" 2010-03-05 19:46 johanvdw * Fix memory leak 2010-03-04 16:17 oconrad * file: case sensitvity problem 2010-03-04 15:35 oconrad * api: serious bug in csg_table_record::assign fixed api: csg_table_value_binary added minor bug fixes and enhancements: io_db_otl, geostatistics_regression... 2010-03-03 19:11 oconrad * api: csg_bytes (helper class for byte array handling) api: csg_shapes_ogis_convert (conversion from/to opengis wkb/wkt) module library: io_db_odbc added (replaces wxodbc based modules, alpha) 2010-03-02 10:07 johanvdw * Fix Tip of the day for Automake installations 2010-03-01 16:46 oconrad * no message 2010-02-25 17:16 oconrad * no message 2010-02-23 17:00 oconrad * no message 2010-02-22 16:22 oconrad * modules for variogram analysis minor bug fixes (xyz import, spline filled gaps, table view) 2010-02-18 08:36 reklov_w * applied Patches item #2953685 provided by Johan Van de Wauw fixing missing duplicate of start and end point 2010-02-17 13:27 oconrad * grid tool modules added: - grid_mask - close gaps with spline 2010-02-15 16:51 oconrad * modules added: geographically weighted regression (multi/grid support) 2010-02-13 22:38 reklov_w * DTM Filter (slope-based) module added 2010-02-12 16:39 oconrad * no message 2010-02-11 17:21 oconrad * added module: geographically weighted regression 2010-02-11 17:19 oconrad * module bug: pit_eliminator improved: geographically weighted regression 2010-02-09 17:02 oconrad * simplified and unified grid target selector helper class for parameters 2010-02-03 18:07 oconrad * 2 statistic modules added; supervised classification improved/added functions sink filling minimum slope saga_cmd point cloud support saga_api csg_table::add_field java compatibility 2010-01-29 11:51 oconrad * no message 2010-01-29 09:18 oconrad * no conio.h under linux 2010-01-28 09:28 oconrad * saga_cmd: silent mode saga_api: thin plate spline saga_gui: middle mouse pan in zoom mode, 3d view focus 2010-01-25 15:50 oconrad * grid: dynamic rgb overlay; esri ascii export 2010-01-19 14:49 oconrad * grid history, imagery lib removed from linux am (temporarily), majority filter added 2010-01-18 17:14 oconrad * grid (sort, no data values), parameter & gui 2010-01-18 08:27 oconrad * 3d shapefile import 2010-01-15 15:09 oconrad * no message 2010-01-15 08:37 reklov_w * interactive version now allows to digitize polygon, both versions support inverse selection 2010-01-15 08:36 reklov_w * added transform point cloud module 2010-01-08 13:46 oconrad * no message 2010-01-07 15:11 reklov_w * modules 'drop attribute' and 'reclass/extract' added 2010-01-06 08:35 oconrad * linux unicode problem when saving esri ascii grid 2010-01-06 08:33 oconrad * gcc compiler error fixed 2009-12-16 13:07 oconrad * no message 2009-12-16 10:29 oconrad * no message 2009-12-15 16:52 oconrad * no message 2009-12-11 14:52 oconrad * no message 2009-12-11 14:15 oconrad * no message 2009-12-11 14:09 oconrad * no message 2009-12-11 13:54 oconrad * no message 2009-12-09 09:31 reklov_w * added 2009-12-04 15:57 oconrad * no message 2009-11-30 10:13 reklov_w * fix wrong parameter identifier (and thus access violation) 2009-11-27 15:26 oconrad * no message 2009-11-27 08:06 reklov_w * fix for linux unicode support 2009-11-26 15:42 oconrad * no message 2009-11-26 08:29 reklov_w * finish support of comma as decimal separator in esri ascii import 2009-11-25 08:53 oconrad * no message 2009-11-24 14:04 oconrad * no message 2009-11-24 10:27 oconrad * no message 2009-11-24 09:53 reklov_w * fix naming when saving sequence 2009-11-23 16:55 oconrad * no message 2009-11-23 16:36 oconrad * no message 2009-11-21 14:49 reklov_w * updated Get_Shape() to return point 2009-11-21 14:48 reklov_w * updated Get_Value() to report z-values 2009-11-20 07:23 reklov_w * fix to compile with gcc (typecast added) 2009-11-18 18:13 oconrad * no message 2009-11-18 16:31 reklov_w * updated _Set_Table_Field() for point cloud support 2009-11-18 16:30 reklov_w * updated Add_Table_Field() for point cloud support 2009-11-18 15:27 reklov_w * option to calculate statistics on aspect grid added 2009-11-17 10:24 oconrad * no message 2009-11-17 09:23 reklov_w * fix esri ascci export "zero precision" problem with negative numbers and xmin/ymin precision in header 2009-11-17 08:45 reklov_w * remove unneccessary line 2009-11-17 08:27 oconrad * no message 2009-11-17 08:03 reklov_w * bug fix (nodata) 2009-11-16 15:24 reklov_w * limit output table field names to 10 characters to match dxf 2009-11-16 14:31 reklov_w * fix for file selection parameter 2009-11-16 11:22 reklov_w * pointcloud from text file module added 2009-11-13 15:36 oconrad * no message 2009-11-06 13:35 oconrad * no message 2009-11-06 12:24 oconrad * no message 2009-11-05 16:40 reklov_w * fixed get_attribute_count and others to omit x,y,z fields 2009-11-01 11:37 reklov_w * bug fix: variance was calculated instead of devdev and percentile was calculated with n-1 instead of n 2009-10-29 20:22 reklov_w * fixed missing link to liblas 2009-10-29 19:46 reklov_w * fixed to compile on linux 2009-10-27 12:42 reklov_w * if saga_gui.ini and .cfg can't be written to startup dir, they're now placed into the user directory 2009-10-20 07:41 oconrad * no message 2009-10-08 16:37 oconrad * no message 2009-10-06 15:33 oconrad * no message 2009-10-02 15:21 oconrad * no message 2009-10-02 15:07 oconrad * no message 2009-10-02 11:48 oconrad * no message 2009-10-02 09:48 oconrad * no message 2009-10-02 07:58 oconrad * no message 2009-10-01 16:18 oconrad * no message 2009-10-01 15:50 oconrad * no message 2009-10-01 14:01 oconrad * no message 2009-09-30 18:00 oconrad * no message 2009-09-25 15:47 oconrad * no message 2009-09-25 12:02 oconrad * no message 2009-09-24 16:23 oconrad * no message 2009-09-23 09:10 reklov_w * datatype definition updates 2009-09-23 09:10 reklov_w * removed obsolete file 2009-09-22 16:19 oconrad * no message 2009-09-21 15:42 reklov_w * module description updated 2009-09-21 15:40 reklov_w * changes to use liblas c++ api and other stuff 2009-09-21 15:40 reklov_w * changes to reflect liblas build from mercurial/trunk 2009-09-18 14:14 oconrad * no message 2009-09-16 12:11 oconrad * no message 2009-09-15 16:51 oconrad * no message 2009-09-15 14:50 reklov_w * fix typo in SWIG #def 2009-09-14 11:15 reklov_w * remove old/add new files to reflect module updates 2009-09-11 15:22 oconrad * no message 2009-09-10 16:17 oconrad * no message 2009-09-09 17:13 oconrad * no message 2009-09-08 15:45 oconrad * no message 2009-09-08 14:32 oconrad * no message 2009-09-07 13:55 oconrad * no message 2009-09-07 09:39 oconrad * no message 2009-09-02 15:20 oconrad * no message 2009-09-01 14:47 oconrad * no message 2009-09-01 14:15 oconrad * no message 2009-09-01 14:07 oconrad * no message 2009-08-28 15:30 oconrad * no message 2009-08-28 15:21 oconrad * no message 2009-08-28 15:13 oconrad * no message 2009-08-27 15:57 oconrad * no message 2009-08-26 15:15 oconrad * no message 2009-08-25 14:36 oconrad * no message 2009-08-24 16:28 oconrad * no message 2009-08-21 16:03 oconrad * no message 2009-08-20 17:36 reklov_w * updates for better nodata handling 2009-08-20 17:18 reklov_w * bug fixes for wrong parameter query and computations 2009-08-19 16:58 oconrad * no message 2009-08-18 08:11 oconrad * no message 2009-08-17 13:15 oconrad * no message 2009-08-17 13:03 oconrad * no message 2009-08-17 13:01 oconrad * no message 2009-08-14 11:11 reklov_w * added support to use only selected polygons for clipping 2009-08-06 07:33 oconrad * no message 2009-07-24 13:03 oconrad * no message 2009-07-23 15:54 oconrad * no message 2009-07-20 12:34 reklov_w * update swig for pointcloud.h 2009-07-19 19:04 reklov_w * now calculates true mean of overlapping grids 2009-07-19 19:02 reklov_w * now allows to set the value with which the dummy grid is initialized 2009-07-19 13:11 reklov_w * hack for Name on linux unicode 2009-07-19 12:49 reklov_w * removed backslash 2009-07-19 12:47 reklov_w * adaptions for linux 2009-07-19 12:44 reklov_w * adaption for linux 2009-07-19 12:41 reklov_w * added pointcloud 2009-07-19 12:34 reklov_w * removed io_table_odbc 2009-07-19 12:32 reklov_w * pointcloud_from_file added 2009-07-19 12:29 reklov_w * updated for las 2009-07-19 12:25 reklov_w * added io_shapes_las 2009-07-19 12:23 reklov_w * added io_shapes_las and removed io_table_odbc 2009-07-17 10:52 oconrad * no message 2009-07-16 17:00 oconrad * no message 2009-07-03 20:14 reklov_w * bugfix for TTVI calculation 2009-07-02 07:56 reklov_w * changes from Johan Van de Wauw to make it compile under linux 2009-06-24 14:58 oconrad * no message 2009-06-11 16:18 oconrad * no message 2009-06-11 13:08 oconrad * no message 2009-06-10 17:11 oconrad * no message 2009-06-05 12:00 oconrad * no message 2009-05-28 13:08 oconrad * no message 2009-05-27 17:31 oconrad * no message 2009-05-27 16:01 oconrad * no message 2009-05-20 13:42 oconrad * no message 2009-05-15 12:17 oconrad * no message 2009-05-14 15:51 oconrad * no message 2009-05-14 13:26 oconrad * no message 2009-05-14 12:37 reklov_w * optionally allow to flood nodata 2009-05-13 15:26 oconrad * no message 2009-04-29 14:32 oconrad * no message 2009-04-29 14:01 oconrad * no message 2009-04-28 16:31 oconrad * no message 2009-04-07 20:08 reklov_w * allows now the setting of a palette when used without GUI 2009-04-07 13:47 oconrad * no message 2009-04-02 11:12 oconrad * no message 2009-04-01 14:34 oconrad * no message 2009-03-31 10:40 oconrad * no message 2009-03-30 14:00 oconrad * no message 2009-03-27 17:16 oconrad * no message 2009-03-27 13:39 oconrad * no message 2009-03-25 10:37 oconrad * no message 2009-03-24 16:37 oconrad * no message 2009-03-17 12:32 reklov_w * typo fixed to make quadtree_structure compile on linux 2009-03-15 11:49 reklov_w * update for correct postbuild *.lng copy 2009-03-13 16:24 oconrad * no message 2009-03-11 15:28 oconrad * no message 2009-03-11 15:08 oconrad * no message 2009-03-04 09:16 reklov_w * optionally grid only selected shapes 2009-03-02 11:27 oconrad * no message 2009-02-25 17:26 oconrad * no message 2009-02-16 16:40 oconrad * no message 2009-02-13 15:50 reklov_w * cut off file extension (.sgrd) in field names of output shape 2009-02-10 16:11 reklov_w * print out module usage when no module parameters are provided 2009-02-06 17:00 oconrad * no message 2009-02-06 16:24 oconrad * no message 2009-02-06 16:08 oconrad * no message 2009-02-04 12:52 reklov_w * io_table module added 2009-02-04 12:51 reklov_w * added 2009-02-04 10:35 reklov_w * postbuild copy of language files added 2009-02-03 13:00 oconrad * no message 2009-01-30 16:33 oconrad * no message 2009-01-30 10:37 oconrad * no message 2009-01-29 15:44 oconrad * no message 2009-01-28 09:48 oconrad * no message 2009-01-27 16:00 oconrad * no message 2009-01-27 15:29 oconrad * no message 2009-01-27 13:56 oconrad * no message 2009-01-26 20:23 reklov_w * typecast long to int 2009-01-26 16:06 oconrad * no message 2009-01-26 15:59 oconrad * no message 2009-01-26 15:29 oconrad * no message 2009-01-19 14:01 oconrad * no message 2009-01-19 12:50 oconrad * no message 2009-01-19 11:01 oconrad * no message 2009-01-16 14:18 oconrad * no message 2009-01-13 16:15 oconrad * no message 2009-01-12 17:13 oconrad * no message 2009-01-12 15:22 oconrad * no message 2009-01-12 12:47 oconrad * no message 2009-01-12 12:47 oconrad * patch for quantile calculation by K.Stricker 2009-01-05 16:52 oconrad * no message 2008-12-29 02:47 reklov_w * cut off grid file extension when used as attribute field name 2008-12-29 02:45 reklov_w * print warning if field type is string and uids are generated 2008-12-18 15:44 oconrad * no message 2008-12-17 17:18 oconrad * no message 2008-12-17 10:02 oconrad * no message 2008-12-15 14:22 oconrad * no message 2008-12-08 00:42 reklov_w * unicode fixes 2008-12-07 23:48 reklov_w * wxGTK/linux fixes 2008-12-05 16:48 oconrad * no message 2008-12-02 14:10 reklov_w * vc8 project update 2008-12-02 14:09 reklov_w * module parameter updates 2008-12-01 13:51 oconrad * no message 2008-11-30 14:52 reklov_w * unicode fixes 2008-11-29 14:45 reklov_w * unicode fixes 2008-11-29 13:09 reklov_w * unicode fixes 2008-11-29 11:49 reklov_w * GDALGetDriverByName uses Description not Metaname 2008-11-24 10:36 oconrad * topographic correction for satellite imagery 2008-11-18 13:56 oconrad * no message 2008-11-15 16:31 reklov_w * contact updated 2008-11-15 16:28 reklov_w * bug with doubly inserted zone ids solved, table cleanup before writing 2008-10-14 16:05 oconrad * no message 2008-10-14 10:55 oconrad * no message 2008-10-09 21:16 reklov_w * option added to optionally save the changes to the input shapefile 2008-10-09 15:48 oconrad * no message 2008-10-07 11:34 oconrad * no message 2008-09-30 14:41 oconrad * no message 2008-09-30 13:34 oconrad * no message 2008-09-26 14:43 oconrad * no message 2008-09-26 11:28 oconrad * no message 2008-09-26 08:53 oconrad * no message 2008-09-25 14:12 oconrad * no message 2008-09-25 13:44 oconrad * no message 2008-09-23 15:37 oconrad * no message 2008-09-22 15:19 oconrad * no message 2008-09-19 14:01 oconrad * no message 2008-09-18 15:14 oconrad * no message 2008-09-17 12:22 oconrad * no message 2008-09-15 15:16 oconrad * no message 2008-09-15 10:48 oconrad * no message 2008-09-12 09:49 oconrad * no message 2008-09-11 15:23 oconrad * no message 2008-09-10 16:08 oconrad * no message 2008-09-09 10:37 oconrad * no message 2008-09-08 22:40 reklov_w * saga_cmd -help text updated 2008-09-08 13:57 oconrad * no message 2008-09-04 13:16 oconrad * no message 2008-09-03 15:29 oconrad * no message 2008-09-03 13:29 oconrad * no message 2008-08-21 10:29 oconrad * no message 2008-08-19 10:00 oconrad * no message 2008-07-25 13:55 oconrad * no message 2008-07-24 12:10 oconrad * no message 2008-07-24 11:53 oconrad * no message 2008-07-23 17:12 oconrad * *** empty log message *** 2008-07-23 16:55 oconrad * *** empty log message *** 2008-07-22 10:42 oconrad * no message 2008-07-21 10:12 oconrad * no message 2008-07-21 09:44 oconrad * no message 2008-07-21 09:31 oconrad * no message 2008-07-18 13:11 oconrad * no message 2008-07-18 12:12 oconrad * no message 2008-07-16 12:07 oconrad * no message 2008-07-16 11:50 oconrad * no message 2008-07-16 11:47 oconrad * no message 2008-07-15 14:57 oconrad * *** empty log message *** 2008-07-09 12:17 oconrad * *** empty log message *** 2008-06-26 13:18 oconrad * no message 2008-06-06 10:02 oconrad * no message 2008-06-06 08:37 oconrad * *** empty log message *** 2008-06-06 08:18 oconrad * *** empty log message *** 2008-06-06 08:10 oconrad * *** empty log message *** 2008-06-05 16:05 oconrad * no message 2008-06-05 15:57 oconrad * no message 2008-06-05 15:46 oconrad * no message 2008-06-05 09:05 oconrad * no message 2008-05-30 15:50 oconrad * no message 2008-05-29 13:15 oconrad * no message 2008-05-28 15:33 oconrad * no message 2008-05-28 15:22 oconrad * no message 2008-05-26 11:12 oconrad * no message 2008-05-23 10:13 oconrad * no message 2008-05-22 15:34 oconrad * no message 2008-05-22 14:48 oconrad * no message 2008-05-22 13:34 oconrad * no message 2008-05-22 12:19 oconrad * no message 2008-05-21 13:49 oconrad * no message 2008-05-21 12:35 oconrad * no message 2008-05-21 12:15 oconrad * no message 2008-05-21 10:46 oconrad * no message 2008-05-21 10:19 oconrad * no message 2008-05-14 10:47 oconrad * no message 2008-05-14 09:14 oconrad * no message 2008-05-13 21:58 oconrad * no message 2008-05-13 09:08 oconrad * no message 2008-05-09 15:20 oconrad * *** empty log message *** 2008-05-09 08:41 oconrad * no message 2008-05-06 16:35 oconrad * no message 2008-05-05 15:28 oconrad * no message 2008-04-24 16:04 oconrad * no message 2008-04-24 11:07 oconrad * no message 2008-04-22 09:44 oconrad * no message 2008-04-18 14:49 oconrad * no message 2008-04-18 14:40 oconrad * no message 2008-04-16 16:23 oconrad * no message 2008-04-09 16:28 oconrad * no message 2008-04-04 15:29 oconrad * no message 2008-04-03 10:57 oconrad * no message 2008-03-12 12:56 oconrad * no message 2008-03-12 12:23 oconrad * no message 2008-03-10 11:41 oconrad * no message 2008-03-07 17:19 oconrad * no message 2008-03-07 16:59 oconrad * no message 2008-03-07 16:36 oconrad * no message 2008-03-07 15:48 oconrad * no message 2008-03-07 15:31 oconrad * no message 2008-03-07 15:24 oconrad * no message 2008-03-07 15:17 oconrad * no message 2008-03-07 14:38 oconrad * no message 2008-03-07 14:32 oconrad * no message 2008-03-06 16:26 oconrad * no message 2008-03-06 15:47 oconrad * no message 2008-03-05 09:42 oconrad * *** empty log message *** 2008-03-05 09:28 oconrad * *** empty log message *** 2008-02-28 16:19 oconrad * no message 2008-02-27 17:05 oconrad * no message 2008-02-26 16:39 oconrad * no message 2008-02-26 14:31 oconrad * *** empty log message *** 2008-02-25 15:42 oconrad * no message 2008-02-22 15:31 oconrad * no message 2008-02-15 14:37 oconrad * no message 2008-02-12 16:19 oconrad * no message 2008-02-06 11:24 oconrad * no message 2008-02-01 14:33 oconrad * no message 2008-01-30 16:02 oconrad * no message 2008-01-30 09:52 oconrad * no message 2008-01-29 16:19 oconrad * no message 2008-01-28 16:38 oconrad * no message 2008-01-25 17:03 oconrad * no message 2008-01-24 16:16 oconrad * no message 2008-01-22 16:54 oconrad * no message 2008-01-22 15:55 oconrad * no message 2008-01-22 10:56 oconrad * no message 2008-01-21 15:39 oconrad * no message 2008-01-21 08:48 oconrad * no message 2008-01-18 15:26 oconrad * no message 2008-01-18 15:19 oconrad * no message 2008-01-18 15:07 oconrad * no message 2008-01-18 14:26 oconrad * no message 2008-01-18 14:10 oconrad * no message 2008-01-18 13:55 oconrad * no message 2008-01-16 10:12 oconrad * no message 2008-01-15 10:46 oconrad * no message 2008-01-14 15:32 oconrad * no message 2008-01-11 14:19 oconrad * no message 2008-01-11 12:37 oconrad * no message 2008-01-10 16:48 oconrad * no message 2008-01-09 17:23 oconrad * no message 2008-01-08 16:47 oconrad * no message 2008-01-07 17:09 oconrad * no message 2008-01-04 15:27 oconrad * no message 2008-01-03 09:45 oconrad * no message 2007-11-21 17:16 oconrad * no message 2007-11-14 11:54 oconrad * no message 2007-11-13 17:26 oconrad * no message 2007-11-08 10:53 oconrad * no message 2007-11-06 15:52 oconrad * no message 2007-10-31 11:44 oconrad * no message 2007-10-24 10:25 oconrad * no message 2007-10-23 13:23 oconrad * *** empty log message *** 2007-10-23 11:12 oconrad * *** empty log message *** 2007-10-19 13:03 oconrad * no message 2007-10-12 13:54 oconrad * no message 2007-10-10 15:53 oconrad * no message 2007-10-08 15:31 oconrad * no message 2007-10-04 14:15 oconrad * no message 2007-10-02 14:59 oconrad * no message 2007-10-02 13:14 oconrad * no message 2007-10-02 11:50 oconrad * no message 2007-10-02 10:34 oconrad * no message 2007-10-01 11:24 oconrad * no message 2007-09-25 14:19 oconrad * no message 2007-09-25 14:12 oconrad * no message 2007-09-25 14:04 oconrad * no message 2007-09-24 15:22 oconrad * no message 2007-09-22 11:34 reklov_w * no message 2007-09-20 15:50 oconrad * *** empty log message *** 2007-09-20 15:09 oconrad * no message 2007-09-20 14:41 oconrad * no message 2007-09-18 11:49 tschorr * added initial grib2 import 2007-08-27 10:49 oconrad * no message 2007-08-03 11:37 oconrad * no message 2007-08-01 13:59 oconrad * no message 2007-08-01 13:46 oconrad * no message 2007-08-01 09:42 oconrad * no message 2007-07-31 13:06 oconrad * no message 2007-07-30 07:29 oconrad * no message 2007-07-24 12:18 oconrad * no message 2007-07-09 14:37 oconrad * no message 2007-07-06 11:17 tschorr * removed dependency to libgrid_tools.so 2007-07-06 10:07 tschorr * cleanup 2007-07-06 08:46 tschorr * fixed modules menu (bug #1743837) 2007-07-06 08:14 tschorr * fixed modules menu (bug #1743837) 2007-07-03 10:30 tschorr * fixed bug #1742774 2007-07-03 10:20 tschorr * fixed bug #1737698 2007-06-27 14:20 oconrad * no message 2007-06-08 13:02 oconrad * no message 2007-06-06 14:15 oconrad * no message 2007-05-23 09:04 tschorr * changed version to 2.0 2007-05-18 09:55 oconrad * no message 2007-05-11 12:40 oconrad * no message 2007-05-08 08:28 oconrad * no message 2007-05-08 08:21 oconrad * no message 2007-05-04 14:50 oconrad * no message 2007-05-04 11:54 oconrad * no message 2007-05-04 10:34 oconrad * no message 2007-04-27 12:50 oconrad * no message 2007-04-23 14:38 oconrad * no message 2007-04-17 10:34 oconrad * no message 2007-04-16 15:29 oconrad * no message 2007-03-27 14:50 oconrad * no message 2007-03-27 10:55 oconrad * no message 2007-03-23 15:32 oconrad * no message 2007-03-23 10:49 oconrad * no message 2007-03-22 17:01 oconrad * no message 2007-03-22 14:24 oconrad * no message 2007-03-22 10:37 oconrad * no message 2007-03-12 11:13 oconrad * no message 2007-03-08 15:59 oconrad * no message 2007-03-07 16:48 oconrad * no message 2007-03-01 15:31 oconrad * no message 2007-02-28 16:44 oconrad * no message 2007-02-27 14:36 oconrad * no message 2007-02-27 13:46 oconrad * no message 2007-02-27 13:35 oconrad * no message 2007-02-27 11:46 oconrad * no message 2007-02-26 17:48 oconrad * no message 2007-02-23 16:02 oconrad * no message 2007-02-22 14:40 oconrad * no message 2007-02-13 13:08 tschorr * *** empty log message *** 2007-02-13 12:59 tschorr * *** empty log message *** 2007-02-13 12:49 tschorr * *** empty log message *** 2007-02-13 09:58 tschorr * added -fPIC compiler flag 2007-02-12 15:57 tschorr * removed -fpermissive for x86_64 2007-02-12 15:43 tschorr * removed -fpermissive for x86_64 2007-02-12 15:39 tschorr * *** empty log message *** 2007-02-12 15:35 tschorr * removed -fpermissive for x86_64 2007-02-12 14:16 tschorr * fixed issue 1650599 2007-02-09 13:03 oconrad * no message 2007-02-08 14:59 oconrad * no message 2007-02-07 15:25 oconrad * no message 2007-02-07 12:32 tschorr * fixed definition of DWORD for x86_64 2007-02-06 13:12 oconrad * no message 2007-02-06 12:42 oconrad * no message 2007-01-23 12:53 reklov_w * no message 2007-01-22 13:00 oconrad * no message 2007-01-22 11:38 oconrad * no message 2007-01-19 11:12 oconrad * no message 2007-01-17 06:27 tschorr * Makefile.am 2007-01-16 19:52 tschorr * fixed AM_LDFLAGS for saga_cmd, saga_gui 2007-01-16 15:52 tschorr * fixed unicode=no for LDFLAGS 2007-01-11 17:58 oconrad * no message 2007-01-11 14:05 tschorr * --enable-unicode, --enable-debug support in configure 2007-01-11 08:50 tschorr * *** empty log message *** 2007-01-11 08:43 tschorr * *** empty log message *** 2007-01-10 16:11 oconrad * no message 2007-01-10 13:20 oconrad * no message 2007-01-09 15:06 oconrad * no message 2007-01-09 11:41 oconrad * no message 2007-01-08 14:56 oconrad * no message 2007-01-08 13:13 oconrad * no message 2007-01-08 07:43 tschorr * more wxGTK unicode fixes 2007-01-05 16:39 tschorr * fixed some wxGTK unicode issues 2006-12-28 15:59 oconrad * no message 2006-12-21 17:09 oconrad * no message 2006-12-13 17:36 oconrad * no message 2006-12-13 15:34 oconrad * no message 2006-12-12 17:16 oconrad * no message 2006-12-12 13:57 oconrad * no message 2006-12-12 13:17 oconrad * no message 2006-12-12 11:25 oconrad * no message 2006-12-11 17:00 oconrad * no message 2006-12-08 09:50 oconrad * UNICODE support 2006-12-08 09:42 oconrad * UNICODE support 2006-12-08 09:29 oconrad * UNICODE support 2006-12-04 09:56 oconrad * no message 2006-11-30 12:29 oconrad * no message 2006-11-30 09:11 tschorr * fixed gcc 4.1.1 extra qualification 'A::' on member 'A' error 2006-11-29 13:39 tschorr * changed some Makefile.ams to fix make dist 2006-11-29 12:54 oconrad * no message 2006-11-27 17:22 oconrad * no message 2006-11-27 15:44 oconrad * no message 2006-11-24 16:26 oconrad * no message 2006-11-24 16:21 oconrad * no message 2006-11-23 13:50 oconrad * no message 2006-11-22 18:48 oconrad * no message 2006-11-22 17:49 oconrad * no message 2006-11-21 14:53 oconrad * no message 2006-11-21 10:53 oconrad * no message 2006-11-20 18:43 oconrad * no message 2006-11-20 15:18 oconrad * no message 2006-11-20 11:23 oconrad * no message 2006-11-17 15:18 oconrad * no message 2006-11-17 10:58 oconrad * no message 2006-11-16 16:34 oconrad * no message 2006-11-16 15:25 oconrad * no message 2006-11-15 20:04 oconrad * no message 2006-11-15 15:55 oconrad * no message 2006-11-14 14:41 oconrad * no message 2006-11-13 19:49 oconrad * no message 2006-11-10 17:11 oconrad * no message 2006-11-09 16:03 oconrad * no message 2006-11-08 14:03 oconrad * no message 2006-11-01 19:19 oconrad * no message 2006-10-31 13:33 oconrad * no message 2006-10-30 17:42 oconrad * no message 2006-10-29 18:07 oconrad * no message 2006-10-27 18:35 oconrad * no message 2006-10-27 16:30 oconrad * no message 2006-10-26 15:38 oconrad * no message 2006-10-26 10:37 oconrad * no message 2006-10-24 08:33 oconrad * no message 2006-10-23 18:21 oconrad * no message 2006-10-23 13:57 oconrad * no message 2006-10-23 13:38 oconrad * no message 2006-10-20 15:22 oconrad * no message 2006-10-19 18:13 oconrad * no message 2006-10-17 13:16 oconrad * no message 2006-10-16 16:00 oconrad * no message 2006-10-16 10:57 oconrad * no message 2006-09-30 14:28 oconrad * no message 2006-09-27 14:17 oconrad * no message 2006-09-09 12:17 oconrad * no message 2006-09-08 17:04 oconrad * no message 2006-09-04 18:06 oconrad * no message 2006-08-24 17:39 oconrad * no message 2006-08-24 14:18 oconrad * no message 2006-08-23 11:56 oconrad * no message 2006-08-21 17:13 oconrad * no message 2006-08-19 18:38 oconrad * no message 2006-08-19 14:21 oconrad * no message 2006-08-16 18:27 oconrad * no message 2006-08-06 13:27 oconrad * no message 2006-07-29 13:17 oconrad * no message 2006-07-29 12:57 oconrad * no message 2006-07-29 11:37 oconrad * no message 2006-07-28 16:02 oconrad * no message 2006-07-27 16:17 oconrad * no message 2006-07-24 14:40 oconrad * no message 2006-07-24 12:45 oconrad * no message 2006-07-24 12:37 oconrad * no message 2006-07-22 22:17 oconrad * no message 2006-07-22 21:56 oconrad * no message 2006-07-21 19:51 oconrad * no message 2006-07-21 19:03 oconrad * no message 2006-07-13 19:13 oconrad * no message 2006-07-12 18:51 oconrad * no message 2006-07-11 14:01 oconrad * no message 2006-07-10 17:36 oconrad * no message 2006-07-10 12:03 oconrad * no message 2006-07-10 08:53 oconrad * no message 2006-06-30 12:43 oconrad * no message 2006-06-29 17:45 oconrad * no message 2006-06-29 15:19 oconrad * no message 2006-06-28 14:11 oconrad * no message 2006-06-28 13:51 oconrad * no message 2006-06-26 15:43 oconrad * no message saga-2.1.0+dfsg/INSTALL000066400000000000000000000363321224124640700144060ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 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. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' 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 bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /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. saga-2.1.0+dfsg/Makefile.am000066400000000000000000000001641224124640700154030ustar00rootroot00000000000000SUBDIRS = . src if DEBUG AM_CFLAGS = -g -DDEBUG AM_CXXFLAGS = -g -DDEBUG $(GOMPFLAGS) endif ACLOCAL_AMFLAGS = -I m4 saga-2.1.0+dfsg/Makefile.in000066400000000000000000000556411224124640700154260ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ config.guess config.sub depcomp install-sh ltmain.sh missing \ py-compile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(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 distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 @DEBUG_TRUE@AM_CFLAGS = -g -DDEBUG @DEBUG_TRUE@AM_CXXFLAGS = -g -DDEBUG $(GOMPFLAGS) ACLOCAL_AMFLAGS = -I m4 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: 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 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi 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 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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 \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__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.lzma*) \ lzma -dc $(distdir).tar.lzma | $(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 mkdir $(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 \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(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__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: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { 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 config.h installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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 mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am # 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: saga-2.1.0+dfsg/NEWS000066400000000000000000000005561224124640700140530ustar00rootroot00000000000000_______________________________________________________________________________ SAGA 2.0 - System for Automated Geoscientific Analyses _______________________________________________________________________________ NEWS _______________________________________________________________________________ * May, 15th 2007 - release of SAGA 2.0 saga-2.1.0+dfsg/README000066400000000000000000000014541224124640700142320ustar00rootroot00000000000000_______________________________________________________________________________ SAGA 2.0.9 - System for Automated Geoscientific Analyses _______________________________________________________________________________ * Introduction SAGA - System for Automated Geoscientific Analyses - is a Free Open Source Software for the analysis of spatial data. * Internet - www.saga-gis.org - sourceforge.net/projects/saga-gis * Supported Platforms - Windows (Microsoft Visual C++ 10.0) - Linux (gcc) * Required Libraries - wxWidgets 2.9.2 - GDAL 1.8.0 - Proj4 - Haru Free PDF Library (optional) - libLAS 1.2 (optional) - opencv (optional) - vigra (optional) _______________________________________________________________________________ Date: December, 20th 2011 saga-2.1.0+dfsg/aclocal.m4000066400000000000000000001255161224124640700152200ustar00rootroot00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, [m4_warning([this file was generated for autoconf 2.63. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file 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. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file 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. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file 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. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file 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. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file 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. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 # Free Software Foundation, Inc. # # This file 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. # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To # install modules, copy them to $(pythondir), using the python_PYTHON # automake variable. To install a package with the same name as the # automake package, install to $(pkgpythondir), or use the # pkgpython_PYTHON automake variable. # # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as # locations to install python extension modules (shared libraries). # Another macro is required to find the appropriate flags to compile # extension modules. # # If your package is configured with a different prefix to python, # users will have to add the install directory to the PYTHONPATH # environment variable, or create a .pth file (see the python # documentation for details). # # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will # cause an error if the version of python installed on the system # doesn't meet the requirement. MINIMUM-VERSION should consist of # numbers and dots only. AC_DEFUN([AM_PATH_PYTHON], [ dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl python2.1 python2.0]) m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. if test -z "$PYTHON"; then AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) fi am_display_PYTHON=python ], [ dnl A version check is needed. if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. AC_MSG_CHECKING([whether $PYTHON version >= $1]) AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], [AC_MSG_RESULT(yes)], [AC_MSG_ERROR(too old)]) am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. AC_CACHE_CHECK([for a Python interpreter with version >= $1], [am_cv_pathless_PYTHON],[ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do test "$am_cv_pathless_PYTHON" = none && break AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) done]) # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) fi am_display_PYTHON=$am_cv_pathless_PYTHON fi ]) if test "$PYTHON" = :; then dnl Run any user-specified action, or abort. m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) else dnl Query Python for its version number. Getting [:3] seems to be dnl the best way to do this; it's what "site.py" does in the standard dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made dnl distinct variables so they can be overridden if need be. However, dnl general consensus is that you shouldn't need this ability. AC_SUBST([PYTHON_PREFIX], ['${prefix}']) AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) dnl At times (like when building shared libraries) you may want dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) dnl Set up 4 directories: dnl pythondir -- where to install python scripts. This is the dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behavior dnl is more consistent with lispdir.m4 for example. dnl Query distutils for this directory. distutils does not exist in dnl Python 1.5, so we fall back to the hardcoded directory if it dnl doesn't work. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], [if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is dnl more consistent with the rest of automake. AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) dnl pyexecdir -- directory for installing python extension modules dnl (shared libraries) dnl Query distutils for this directory. distutils does not exist in dnl Python 1.5, so we fall back to the hardcoded directory if it dnl doesn't work. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], [if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) dnl Run any user-specified action. $2 fi ]) # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------------------------- # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. # Run ACTION-IF-FALSE otherwise. # This test uses sys.hexversion instead of the string equivalent (first # word of sys.version), in order to cope with versions such as 2.2c1. # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). AC_DEFUN([AM_PYTHON_CHECK_VERSION], [prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_pkg_swig.m4]) m4_include([m4/ax_python_devel.m4]) m4_include([m4/ax_swig_enable_cxx.m4]) m4_include([m4/ax_swig_python.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) saga-2.1.0+dfsg/config.guess000077500000000000000000001276151224124640700157020ustar00rootroot00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-11-20' # This file 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. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # 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 Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: saga-2.1.0+dfsg/config.h.in000066400000000000000000000112601224124640700153710ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the `floor' function. */ #undef HAVE_FLOOR /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `geotrans' library (-lgeotrans). */ #undef HAVE_LIBGEOTRANS /* 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 header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `modf' function. */ #undef HAVE_MODF /* Define to 1 if you have the `pow' function. */ #undef HAVE_POW /* If available, contains the Python version number currently in use. */ #undef HAVE_PYTHON /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `sqrt' function. */ #undef HAVE_SQRT /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* "built with GUI and interactive modules" */ #undef WITH_GUI /* "built with ODBC support" */ #undef WITH_ODBC /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* 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 /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t saga-2.1.0+dfsg/config.sub000077500000000000000000001031671224124640700153410ustar00rootroot00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-11-20' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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. # # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # 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. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: saga-2.1.0+dfsg/configure000077500000000000000000025576261224124640700153040ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for saga 2.1.0. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF $* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='saga' PACKAGE_TARNAME='saga' PACKAGE_VERSION='2.1.0' PACKAGE_STRING='saga 2.1.0' PACKAGE_BUGREPORT='BUG-REPORT-ADDRESS' ac_unique_file="src/saga_core/saga_gui/wksp_data_menu_files.cpp" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS AX_SWIG_PYTHON_CPPFLAGS AX_SWIG_PYTHON_OPT SWIG_LIB SWIG PYTHON_EXTRA_LDFLAGS PYTHON_EXTRA_LIBS PYTHON_SITE_PKG PYTHON_LDFLAGS PYTHON_CPPFLAGS pkgpyexecdir pyexecdir pkgpythondir pythondir PYTHON_PLATFORM PYTHON_EXEC_PREFIX PYTHON_PREFIX PYTHON_VERSION PYTHON SAGA_PYTHON_FALSE SAGA_PYTHON_TRUE DISABLELIBHARU HARU_LIB HAVE_HARU_FALSE HAVE_HARU_TRUE HAVE_VIGRA_FALSE HAVE_VIGRA_TRUE HAVE_LLAS_FALSE HAVE_LLAS_TRUE HAVE_CV_FALSE HAVE_CV_TRUE GOMPFLAGS OPENMP_FALSE OPENMP_TRUE WITH_ODBC_FALSE WITH_ODBC_TRUE WITH_GUI_FALSE WITH_GUI_TRUE DEBUG_FALSE DEBUG_TRUE SAGA_UNICODE_FALSE SAGA_UNICODE_TRUE LOCAL_INCS LOCAL_LIBS POW_LIB LIBOBJS CXXCPP CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL lt_ECHO RANLIB AR OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld enable_libtool_lock with_local enable_debug enable_gui enable_odbc enable_openmp enable_python ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS CPP CXXCPP PYTHON_VERSION' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures saga 2.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/saga] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of saga 2.1.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug Turn on debugging --disable-gui Do not build GUI and interactive modules --disable-odbc Build without ODBC support --disable-openmp Build without OpenMP support --enable-python Build python bindings for the saga api Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-local=dir search /usr/local or other directory for includes and libs Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CPP C preprocessor CXXCPP C++ preprocessor PYTHON_VERSION The installed Python version to use, for example '2.3'. This string will be appended to the Python interpreter canonical name. Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF saga configure 2.1.0 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by saga $as_me 2.1.0, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5 $as_echo "$as_me: error: unsafe absolute working directory name" >&2;} { (exit 1); exit 1; }; };; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5 $as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;} { (exit 1); exit 1; }; };; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=saga VERSION=2.1.0beta cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='saga' VERSION='2.1.0' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} { $as_echo "$as_me:$LINENO: checking how to create a ustar tar archive" >&5 $as_echo_n "checking how to create a ustar tar archive... " >&6; } # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' _am_tools=${am_cv_prog_tar_ustar-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if test "${am_cv_prog_tar_ustar+set}" = set; then $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi { $as_echo "$as_me:$LINENO: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } # Checks for programs. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:$LINENO: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C++ compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: C++ compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' case `pwd` in *\ * | *\ *) { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.2.6b' macro_revision='1.3017' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 $as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed $as_unset ac_script || ac_script= if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$LINENO: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if test "${ac_cv_path_FGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test "${lt_cv_path_NM+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if test "${lt_cv_nm_interface+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:5436: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:5439: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:5442: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:$LINENO: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:$LINENO: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:$LINENO: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:$LINENO: result: ok" >&5 $as_echo "ok" >&6; } fi # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 6648 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_cv_cc_needs_belf=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LIPO+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:$LINENO: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL64+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_cv_ld_exported_symbols_list=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_ld_exported_symbols_list=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:$LINENO: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} _lt_caught_CXX_error=yes; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:$LINENO: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:$LINENO: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:9370: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:9374: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:9709: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:9713: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:9814: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:9818: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:9869: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:9873: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat >conftest.$ac_ext <<_ACEOF int foo(void) {} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then shlibpath_overrides_runpath=yes fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 $as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 $as_echo "$ac_cv_func_shl_load" >&6; } if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 $as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 $as_echo "$ac_cv_func_dlopen" >&6; } if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_svld_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_dld_link=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 12672 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 12768 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5]* | *pgcpp\ [1-5]*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 $as_echo "$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14788: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:14792: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14887: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14891: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14939: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14943: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 $as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then shlibpath_overrides_runpath=yes fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: # Checks for libraries. { $as_echo "$as_me:$LINENO: checking for cvGetRows in -lcv" >&5 $as_echo_n "checking for cvGetRows in -lcv... " >&6; } if test "${ac_cv_lib_cv_cvGetRows+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cvGetRows (); int main () { return cvGetRows (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_cv_cvGetRows=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cv_cvGetRows=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cv_cvGetRows" >&5 $as_echo "$ac_cv_lib_cv_cvGetRows" >&6; } if test "x$ac_cv_lib_cv_cvGetRows" = x""yes; then CVFOUND=1 fi { $as_echo "$as_me:$LINENO: checking for Set_Mercator_Coordinates in -lgeotrans" >&5 $as_echo_n "checking for Set_Mercator_Coordinates in -lgeotrans... " >&6; } if test "${ac_cv_lib_geotrans_Set_Mercator_Coordinates+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgeotrans $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char Set_Mercator_Coordinates (); int main () { return Set_Mercator_Coordinates (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_geotrans_Set_Mercator_Coordinates=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_geotrans_Set_Mercator_Coordinates=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_geotrans_Set_Mercator_Coordinates" >&5 $as_echo "$ac_cv_lib_geotrans_Set_Mercator_Coordinates" >&6; } if test "x$ac_cv_lib_geotrans_Set_Mercator_Coordinates" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGEOTRANS 1 _ACEOF LIBS="-lgeotrans $LIBS" fi { $as_echo "$as_me:$LINENO: checking for fftw_execute in -lfftw3" >&5 $as_echo_n "checking for fftw_execute in -lfftw3... " >&6; } if test "${ac_cv_lib_fftw3_fftw_execute+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw3 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fftw_execute (); int main () { return fftw_execute (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_fftw3_fftw_execute=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fftw3_fftw_execute=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_fftw3_fftw_execute" >&5 $as_echo "$ac_cv_lib_fftw3_fftw_execute" >&6; } if test "x$ac_cv_lib_fftw3_fftw_execute" = x""yes; then FFTWFOUND=1 fi { $as_echo "$as_me:$LINENO: checking for jas_calloc in -ljasper" >&5 $as_echo_n "checking for jas_calloc in -ljasper... " >&6; } if test "${ac_cv_lib_jasper_jas_calloc+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljasper $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jas_calloc (); int main () { return jas_calloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_jasper_jas_calloc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_jasper_jas_calloc=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_jasper_jas_calloc" >&5 $as_echo "$ac_cv_lib_jasper_jas_calloc" >&6; } if test "x$ac_cv_lib_jasper_jas_calloc" = x""yes; then JASPERFOUND=1 fi { $as_echo "$as_me:$LINENO: checking for LAS_GetVersion in -llas" >&5 $as_echo_n "checking for LAS_GetVersion in -llas... " >&6; } if test "${ac_cv_lib_las_LAS_GetVersion+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llas $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char LAS_GetVersion (); int main () { return LAS_GetVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_las_LAS_GetVersion=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_las_LAS_GetVersion=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_las_LAS_GetVersion" >&5 $as_echo "$ac_cv_lib_las_LAS_GetVersion" >&6; } if test "x$ac_cv_lib_las_LAS_GetVersion" = x""yes; then LASFOUND=1 fi { $as_echo "$as_me:$LINENO: checking for HPDF_Pages_New in -lhpdf" >&5 $as_echo_n "checking for HPDF_Pages_New in -lhpdf... " >&6; } if test "${ac_cv_lib_hpdf_HPDF_Pages_New+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhpdf $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char HPDF_Pages_New (); int main () { return HPDF_Pages_New (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_hpdf_HPDF_Pages_New=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_hpdf_HPDF_Pages_New=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_hpdf_HPDF_Pages_New" >&5 $as_echo "$ac_cv_lib_hpdf_HPDF_Pages_New" >&6; } if test "x$ac_cv_lib_hpdf_HPDF_Pages_New" = x""yes; then HARUFOUND=1 fi { $as_echo "$as_me:$LINENO: checking for SQLFetch in -lodbc" >&5 $as_echo_n "checking for SQLFetch in -lodbc... " >&6; } if test "${ac_cv_lib_odbc_SQLFetch+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodbc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SQLFetch (); int main () { return SQLFetch (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_odbc_SQLFetch=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_odbc_SQLFetch=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_odbc_SQLFetch" >&5 $as_echo "$ac_cv_lib_odbc_SQLFetch" >&6; } if test "x$ac_cv_lib_odbc_SQLFetch" = x""yes; then ODBCFOUND=1 else ODBC \(libodbc\) library not found fi { $as_echo "$as_me:$LINENO: checking for pj_is_latlong in -lproj" >&5 $as_echo_n "checking for pj_is_latlong in -lproj... " >&6; } if test "${ac_cv_lib_proj_pj_is_latlong+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lproj $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pj_is_latlong (); int main () { return pj_is_latlong (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_proj_pj_is_latlong=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_proj_pj_is_latlong=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_proj_pj_is_latlong" >&5 $as_echo "$ac_cv_lib_proj_pj_is_latlong" >&6; } if test "x$ac_cv_lib_proj_pj_is_latlong" = x""yes; then PROJFOUND=1 fi { $as_echo "$as_me:$LINENO: checking for VIGRA_RGBE_ReadPixels_Raw in -lvigraimpex" >&5 $as_echo_n "checking for VIGRA_RGBE_ReadPixels_Raw in -lvigraimpex... " >&6; } if test "${ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lvigraimpex $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char VIGRA_RGBE_ReadPixels_Raw (); int main () { return VIGRA_RGBE_ReadPixels_Raw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw" >&5 $as_echo "$ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw" >&6; } if test "x$ac_cv_lib_vigraimpex_VIGRA_RGBE_ReadPixels_Raw" = x""yes; then VIGRAFOUND=1 fi { $as_echo "$as_me:$LINENO: checking for omp_get_num_threads in -lgomp" >&5 $as_echo_n "checking for omp_get_num_threads in -lgomp... " >&6; } if test "${ac_cv_lib_gomp_omp_get_num_threads+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgomp $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char omp_get_num_threads (); int main () { return omp_get_num_threads (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_gomp_omp_get_num_threads=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gomp_omp_get_num_threads=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gomp_omp_get_num_threads" >&5 $as_echo "$ac_cv_lib_gomp_omp_get_num_threads" >&6; } if test "x$ac_cv_lib_gomp_omp_get_num_threads" = x""yes; then GOMPFOUND=1 fi # Checks for header files. { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in float.h malloc.h memory.h stdlib.h string.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to BUG-REPORT-ADDRESS ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in wchar.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to BUG-REPORT-ADDRESS ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done #todo: check for headers of the libraries above # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; # if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a runtime test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); # endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdbool_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } { $as_echo "$as_me:$LINENO: checking for _Bool" >&5 $as_echo_n "checking for _Bool... " >&6; } if test "${ac_cv_type__Bool+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type__Bool=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (_Bool)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((_Bool))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 $as_echo "$ac_cv_type__Bool" >&6; } if test "x$ac_cv_type__Bool" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const /**/ _ACEOF fi { $as_echo "$as_me:$LINENO: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:$LINENO: checking for size_t" >&5 $as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_size_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((size_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 $as_echo "$ac_cv_type_size_t" >&6; } if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi # Checks for platform characteristics. { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # Check for potential -arch flags. It is not universal unless # there are some -arch flags. Note that *ppc* also matches # ppc64. This check is also rather less than ideal. case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; esac else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to _BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then # Try to guess by grepping values from an object file. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; #( no) ;; #( universal) cat >>confdefs.h <<\_ACEOF #define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF ;; #( *) { { $as_echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 $as_echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac # Checks for library functions. for ac_header in stdlib.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to BUG-REPORT-ADDRESS ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi { $as_echo "$as_me:$LINENO: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if test "${ac_cv_func_memcmp_working+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in stdlib.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to BUG-REPORT-ADDRESS ## ## --------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_realloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_realloc_0_nonnull=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_realloc_0_nonnull=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 0 _ACEOF case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define realloc rpl_realloc _ACEOF fi { $as_echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 $as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; } if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then $as_echo_n "(cached) " >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then ac_cv_func_lstat_dereferences_slashed_symlink=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; /* Linux will dereference the symlink and fail. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_lstat_dereferences_slashed_symlink=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 $as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac fi { $as_echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 $as_echo_n "checking whether stat accepts an empty string... " >&6; } if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_stat_empty_string_bug=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; return stat ("", &sbuf) == 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_stat_empty_string_bug=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_stat_empty_string_bug=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 $as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } if test $ac_cv_func_stat_empty_string_bug = yes; then case " $LIBOBJS " in *" stat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; esac cat >>confdefs.h <<_ACEOF #define HAVE_STAT_EMPTY_STRING_BUG 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for working strtod" >&5 $as_echo_n "checking for working strtod... " >&6; } if test "${ac_cv_func_strtod+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_strtod=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #ifndef strtod double strtod (); #endif int main() { { /* Some versions of Linux strtod mis-parse strings with leading '+'. */ char *string = " +69"; char *term; double value; value = strtod (string, &term); if (value != 69 || term != (string + 4)) return 1; } { /* Under Solaris 2.4, strtod returns the wrong value for the terminating character under some conditions. */ char *string = "NaN"; char *term; strtod (string, &term); if (term != string && *(term - 1) == 0) return 1; } return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strtod=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_strtod=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5 $as_echo "$ac_cv_func_strtod" >&6; } if test $ac_cv_func_strtod = no; then case " $LIBOBJS " in *" strtod.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;; esac { $as_echo "$as_me:$LINENO: checking for pow" >&5 $as_echo_n "checking for pow... " >&6; } if test "${ac_cv_func_pow+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define pow to an innocuous variant, in case declares pow. For example, HP-UX 11i declares gettimeofday. */ #define pow innocuous_pow /* System header to define __stub macros and hopefully few prototypes, which can conflict with char pow (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef pow /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pow (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_pow || defined __stub___pow choke me #endif int main () { return pow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_pow=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_pow=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5 $as_echo "$ac_cv_func_pow" >&6; } if test $ac_cv_func_pow = no; then { $as_echo "$as_me:$LINENO: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } if test "${ac_cv_lib_m_pow+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pow (); int main () { return pow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_m_pow=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_pow=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = x""yes; then POW_LIB=-lm else { $as_echo "$as_me:$LINENO: WARNING: cannot find library containing definition of pow" >&5 $as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi fi fi for ac_func in vprintf do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF { $as_echo "$as_me:$LINENO: checking for _doprnt" >&5 $as_echo_n "checking for _doprnt... " >&6; } if test "${ac_cv_func__doprnt+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define _doprnt to an innocuous variant, in case declares _doprnt. For example, HP-UX 11i declares gettimeofday. */ #define _doprnt innocuous__doprnt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef _doprnt /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _doprnt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub__doprnt || defined __stub____doprnt choke me #endif int main () { return _doprnt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func__doprnt=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 $as_echo "$ac_cv_func__doprnt" >&6; } if test "x$ac_cv_func__doprnt" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in floor memmove memset modf pow sqrt strchr strdup strerror strrchr strstr strtol do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # add a local directory as base for libs and include files { $as_echo "$as_me:$LINENO: checking for local include/lib path" >&5 $as_echo_n "checking for local include/lib path... " >&6; } # Check whether --with-local was given. if test "${with_local+set}" = set; then withval=$with_local; fi if test "$with_local" != "no" -a "$with_local" != "" ; then if test "$with_local" = "yes" ; then ADD_PREFIX=/usr/local else ADD_PREFIX=$with_local fi { $as_echo "$as_me:$LINENO: result: adding $ADD_PREFIX" >&5 $as_echo "adding $ADD_PREFIX" >&6; } LOCAL_LIBS="-L$ADD_PREFIX/lib" LOCAL_INCS="-I$ADD_PREFIX/include" LOCAL_LIBS=$LOCAL_LIBS LOCAL_INCS=$LOCAL_INCS else { $as_echo "$as_me:$LINENO: result: none" >&5 $as_echo "none" >&6; } fi # conditionals # the test could be extended to check for wx-config --version too if test "`wx-config --list | grep unicode`" != "" ; then if true; then SAGA_UNICODE_TRUE= SAGA_UNICODE_FALSE='#' else SAGA_UNICODE_TRUE='#' SAGA_UNICODE_FALSE= fi else { { $as_echo "$as_me:$LINENO: error: SAGA requires a unicode build of wxGTK" >&5 $as_echo "$as_me: error: SAGA requires a unicode build of wxGTK" >&2;} { (exit 1); exit 1; }; } exit fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; case "${enableval}" in yes) debug=true ;; no) debug=false ;; *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-debug" >&5 $as_echo "$as_me: error: bad value ${enableval} for --enable-debug" >&2;} { (exit 1); exit 1; }; } ;; esac else debug=false fi if test x$debug = xtrue; then DEBUG_TRUE= DEBUG_FALSE='#' else DEBUG_TRUE='#' DEBUG_FALSE= fi # Check whether --enable-gui was given. if test "${enable_gui+set}" = set; then enableval=$enable_gui; case "${enableval}" in yes) gui=true ;; no) gui=false ;; *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --disable-gui" >&5 $as_echo "$as_me: error: bad value ${enableval} for --disable-gui" >&2;} { (exit 1); exit 1; }; } ;; esac else gui=true fi if test x$gui = xtrue; then WITH_GUI_TRUE= WITH_GUI_FALSE='#' else WITH_GUI_TRUE='#' WITH_GUI_FALSE= fi if test $gui = "false" ; then { $as_echo "$as_me:$LINENO: result: GUI and interactive modules will NOT be built" >&5 $as_echo " GUI and interactive modules will NOT be built" >&6; } else cat >>confdefs.h <<\_ACEOF #define WITH_GUI 1 _ACEOF { $as_echo "$as_me:$LINENO: result: GUI and interactive modules will be built" >&5 $as_echo " GUI and interactive modules will be built" >&6; } fi # Check whether --enable-odbc was given. if test "${enable_odbc+set}" = set; then enableval=$enable_odbc; case "${enableval}" in yes) odbc=true ;; no) odbc=false ;; *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --disable-odbc" >&5 $as_echo "$as_me: error: bad value ${enableval} for --disable-odbc" >&2;} { (exit 1); exit 1; }; } ;; esac else odbc=true fi if test x$odbc = xtrue; then WITH_ODBC_TRUE= WITH_ODBC_FALSE='#' else WITH_ODBC_TRUE='#' WITH_ODBC_FALSE= fi if test $odbc = "false" ; then { $as_echo "$as_me:$LINENO: result: ODBC support will NOT be built" >&5 $as_echo " ODBC support will NOT be built" >&6; } else cat >>confdefs.h <<\_ACEOF #define WITH_ODBC 1 _ACEOF { $as_echo "$as_me:$LINENO: result: ODBC support will be built" >&5 $as_echo " ODBC support will be built" >&6; } fi # Check whether --enable-openmp was given. if test "${enable_openmp+set}" = set; then enableval=$enable_openmp; case "${enableval}" in yes) openmp=true ;; no) openmp=false ;; *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --disable-openmp" >&5 $as_echo "$as_me: error: bad value ${enableval} for --disable-openmp" >&2;} { (exit 1); exit 1; }; } ;; esac else openmp=true fi if test x$openmp = xtrue; then OPENMP_TRUE= OPENMP_FALSE='#' else OPENMP_TRUE='#' OPENMP_FALSE= fi if test $openmp = "false" ; then { $as_echo "$as_me:$LINENO: result: OpenMP support disabled" >&5 $as_echo " OpenMP support disabled" >&6; } GOMPFLAGS="" else if test -n "$GOMPFOUND" ; then { $as_echo "$as_me:$LINENO: result: Building with OpenMP support using libgomp" >&5 $as_echo " Building with OpenMP support using libgomp" >&6; } GOMPFLAGS="-fopenmp" else { $as_echo "$as_me:$LINENO: result: libgomp not found, OpenMP support disabled" >&5 $as_echo " libgomp not found, OpenMP support disabled" >&6; } GOMPFLAGS="" fi fi #AM_CONDITIONAL(X86_64, test "`uname -m`" = "x86_64") if test -n "$CVFOUND"; then HAVE_CV_TRUE= HAVE_CV_FALSE='#' else HAVE_CV_TRUE='#' HAVE_CV_FALSE= fi if test -n "$LASFOUND"; then HAVE_LLAS_TRUE= HAVE_LLAS_FALSE='#' else HAVE_LLAS_TRUE='#' HAVE_LLAS_FALSE= fi if test -n "$VIGRAFOUND" -a -n "$FFTWFOUND"; then HAVE_VIGRA_TRUE= HAVE_VIGRA_FALSE='#' else HAVE_VIGRA_TRUE='#' HAVE_VIGRA_FALSE= fi if test -n "$HARUFOUND"; then HAVE_HARU_TRUE= HAVE_HARU_FALSE='#' else HAVE_HARU_TRUE='#' HAVE_HARU_FALSE= fi if test -n "$HARUFOUND" ; then { $as_echo "$as_me:$LINENO: result: using lhpdf (libharu) from system libs." >&5 $as_echo " using lhpdf (libharu) from system libs." >&6; } DISABLELIBHARU="" HARU_LIB="-lhpdf" else { $as_echo "$as_me:$LINENO: result: libharu was not found, pdf creation will be disabled" >&5 $as_echo " libharu was not found, pdf creation will be disabled" >&6; } DISABLELIBHARU="-D_SAGA_DONOTUSE_HARU" HARU_LIB="" fi # Check whether --enable-python was given. if test "${enable_python+set}" = set; then enableval=$enable_python; case "${enableval}" in yes) python=true ;; no) python=false ;; *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-python" >&5 $as_echo "$as_me: error: bad value ${enableval} for --enable-python" >&2;} { (exit 1); exit 1; }; } ;; esac else python=false fi if test x$python = xtrue; then SAGA_PYTHON_TRUE= SAGA_PYTHON_FALSE='#' else SAGA_PYTHON_TRUE='#' SAGA_PYTHON_FALSE= fi if test x$python = xtrue; then # Find any Python interpreter. if test -z "$PYTHON"; then for ac_prog in python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PYTHON+set}" = set; then $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:$LINENO: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PYTHON" && break done test -n "$PYTHON" || PYTHON=":" fi am_display_PYTHON=python if test "$PYTHON" = :; then { { $as_echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5 $as_echo "$as_me: error: no suitable Python interpreter found" >&2;} { (exit 1); exit 1; }; } else { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if test "${am_cv_python_version+set}" = set; then $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` fi { $as_echo "$as_me:$LINENO: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version PYTHON_PREFIX='${prefix}' PYTHON_EXEC_PREFIX='${exec_prefix}' { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if test "${am_cv_python_platform+set}" = set; then $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi { $as_echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5 $as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } if test "${am_cv_python_pythondir+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 $as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir pkgpythondir=\${pythondir}/$PACKAGE { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } if test "${am_cv_python_pyexecdir+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 $as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir pkgpyexecdir=\${pyexecdir}/$PACKAGE fi # PYTHON_EXTRA_LIBS='-lgomp' # PYTHON_EXTRA_LDFLAGS='-lgomp' # # Allow the use of a (user set) custom python version # # Extract the first word of "python[$PYTHON_VERSION]", so it can be a program name with args. set dummy python$PYTHON_VERSION; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PYTHON+set}" = set; then $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:$LINENO: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$PYTHON"; then { { $as_echo "$as_me:$LINENO: error: Cannot find python$PYTHON_VERSION in your system path" >&5 $as_echo "$as_me: error: Cannot find python$PYTHON_VERSION in your system path" >&2;} { (exit 1); exit 1; }; } PYTHON_VERSION="" fi # # Check for a version of Python >= 2.1.0 # { $as_echo "$as_me:$LINENO: checking for a version of Python >= '2.1.0'" >&5 $as_echo_n "checking for a version of Python >= '2.1.0'... " >&6; } ac_supports_python_ver=`$PYTHON -c "import sys; \ ver = sys.version.split ()[0]; \ print (ver >= '2.1.0')"` if test "$ac_supports_python_ver" != "True"; then if test -z "$PYTHON_NOVERSIONCHECK"; then { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: This version of the AC_PYTHON_DEVEL macro doesn't work properly with versions of Python before 2.1.0. You may need to re-run configure, setting the variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. Moreover, to disable this check, set PYTHON_NOVERSIONCHECK to something else than an empty string. See \`config.log' for more details." >&5 $as_echo "$as_me: error: This version of the AC_PYTHON_DEVEL macro doesn't work properly with versions of Python before 2.1.0. You may need to re-run configure, setting the variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. Moreover, to disable this check, set PYTHON_NOVERSIONCHECK to something else than an empty string. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else { $as_echo "$as_me:$LINENO: result: skip at user request" >&5 $as_echo "skip at user request" >&6; } fi else { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } fi # # if the macro parameter ``version'' is set, honour it # if test -n ""; then { $as_echo "$as_me:$LINENO: checking for a version of Python " >&5 $as_echo_n "checking for a version of Python ... " >&6; } ac_supports_python_ver=`$PYTHON -c "import sys; \ ver = sys.version.split ()[0]; \ print (ver )"` if test "$ac_supports_python_ver" = "True"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: this package requires Python . If you have it installed, but it isn't the default Python interpreter in your system path, please pass the PYTHON_VERSION variable to configure. See \`\`configure --help'' for reference. " >&5 $as_echo "$as_me: error: this package requires Python . If you have it installed, but it isn't the default Python interpreter in your system path, please pass the PYTHON_VERSION variable to configure. See \`\`configure --help'' for reference. " >&2;} { (exit 1); exit 1; }; } PYTHON_VERSION="" fi fi # # Check if you have distutils, else fail # { $as_echo "$as_me:$LINENO: checking for the distutils Python package" >&5 $as_echo_n "checking for the distutils Python package... " >&6; } ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` if test -z "$ac_distutils_result"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: cannot import Python module \"distutils\". Please check your Python installation. The error was: $ac_distutils_result" >&5 $as_echo "$as_me: error: cannot import Python module \"distutils\". Please check your Python installation. The error was: $ac_distutils_result" >&2;} { (exit 1); exit 1; }; } PYTHON_VERSION="" fi # # Check for Python include path # { $as_echo "$as_me:$LINENO: checking for Python include path" >&5 $as_echo_n "checking for Python include path... " >&6; } if test -z "$PYTHON_CPPFLAGS"; then python_path=`$PYTHON -c "import distutils.sysconfig; \ print (distutils.sysconfig.get_python_inc ());"` if test -n "${python_path}"; then python_path="-I$python_path" fi PYTHON_CPPFLAGS=$python_path fi { $as_echo "$as_me:$LINENO: result: $PYTHON_CPPFLAGS" >&5 $as_echo "$PYTHON_CPPFLAGS" >&6; } # # Check for Python library path # { $as_echo "$as_me:$LINENO: checking for Python library path" >&5 $as_echo_n "checking for Python library path... " >&6; } if test -z "$PYTHON_LDFLAGS"; then # (makes two attempts to ensure we've got a version number # from the interpreter) ac_python_version=`cat<>confdefs.h <<_ACEOF #define HAVE_PYTHON "$ac_python_version" _ACEOF # First, the library directory: ac_python_libdir=`cat<&5 $as_echo "$as_me: error: Cannot determine location of your Python DSO. Please check it was installed with dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand. " >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $PYTHON_LDFLAGS" >&5 $as_echo "$PYTHON_LDFLAGS" >&6; } # # Check for site packages # { $as_echo "$as_me:$LINENO: checking for Python site-packages path" >&5 $as_echo_n "checking for Python site-packages path... " >&6; } if test -z "$PYTHON_SITE_PKG"; then PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ print (distutils.sysconfig.get_python_lib(0,0));"` fi { $as_echo "$as_me:$LINENO: result: $PYTHON_SITE_PKG" >&5 $as_echo "$PYTHON_SITE_PKG" >&6; } # # libraries which must be linked in when embedding # { $as_echo "$as_me:$LINENO: checking python extra libraries" >&5 $as_echo_n "checking python extra libraries... " >&6; } if test -z "$PYTHON_EXTRA_LIBS"; then PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ conf = distutils.sysconfig.get_config_var; \ print (conf('LOCALMODLIBS') + ' ' + conf('LIBS'))"` fi { $as_echo "$as_me:$LINENO: result: $PYTHON_EXTRA_LIBS" >&5 $as_echo "$PYTHON_EXTRA_LIBS" >&6; } # # linking flags needed when embedding # { $as_echo "$as_me:$LINENO: checking python extra linking flags" >&5 $as_echo_n "checking python extra linking flags... " >&6; } if test -z "$PYTHON_EXTRA_LDFLAGS"; then PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ conf = distutils.sysconfig.get_config_var; \ print (conf('LINKFORSHARED'))"` fi { $as_echo "$as_me:$LINENO: result: $PYTHON_EXTRA_LDFLAGS" >&5 $as_echo "$PYTHON_EXTRA_LDFLAGS" >&6; } # # final check to see if everything compiles alright # { $as_echo "$as_me:$LINENO: checking consistency of all components of python development environment" >&5 $as_echo_n "checking consistency of all components of python development environment... " >&6; } # save current global flags ac_save_LIBS="$LIBS" ac_save_CPPFLAGS="$CPPFLAGS" LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS" CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { Py_Initialize(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then pythonexists=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 pythonexists=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # turn back to default flags CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" { $as_echo "$as_me:$LINENO: result: $pythonexists" >&5 $as_echo "$pythonexists" >&6; } if test ! "x$pythonexists" = "xyes"; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: Could not link test program to Python. Maybe the main Python library has been installed in some non-standard library path. If so, pass it to configure, via the LDFLAGS environment variable. Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\" ============================================================================ ERROR! You probably have to install the development version of the Python package for your distribution. The exact name of this package varies among them. ============================================================================ See \`config.log' for more details." >&5 $as_echo "$as_me: error: Could not link test program to Python. Maybe the main Python library has been installed in some non-standard library path. If so, pass it to configure, via the LDFLAGS environment variable. Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\" ============================================================================ ERROR! You probably have to install the development version of the Python package for your distribution. The exact name of this package varies among them. ============================================================================ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } PYTHON_VERSION="" fi # # all done! # # Extract the first word of "swig", so it can be a program name with args. set dummy swig; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SWIG+set}" = set; then $as_echo_n "(cached) " >&6 else case $SWIG in [\\/]* | ?:[\\/]*) ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi SWIG=$ac_cv_path_SWIG if test -n "$SWIG"; then { $as_echo "$as_me:$LINENO: result: $SWIG" >&5 $as_echo "$SWIG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$SWIG" ; then : elif test -n "1.3.17" ; then { $as_echo "$as_me:$LINENO: checking SWIG version" >&5 $as_echo_n "checking SWIG version... " >&6; } swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'` { $as_echo "$as_me:$LINENO: result: $swig_version" >&5 $as_echo "$swig_version" >&6; } if test -n "$swig_version" ; then # Calculate the required version number components required=1.3.17 required_major=`echo $required | sed 's/[^0-9].*//'` if test -z "$required_major" ; then required_major=0 fi required=`echo $required | sed 's/[0-9]*[^0-9]//'` required_minor=`echo $required | sed 's/[^0-9].*//'` if test -z "$required_minor" ; then required_minor=0 fi required=`echo $required | sed 's/[0-9]*[^0-9]//'` required_patch=`echo $required | sed 's/[^0-9].*//'` if test -z "$required_patch" ; then required_patch=0 fi # Calculate the available version number components available=$swig_version available_major=`echo $available | sed 's/[^0-9].*//'` if test -z "$available_major" ; then available_major=0 fi available=`echo $available | sed 's/[0-9]*[^0-9]//'` available_minor=`echo $available | sed 's/[^0-9].*//'` if test -z "$available_minor" ; then available_minor=0 fi available=`echo $available | sed 's/[0-9]*[^0-9]//'` available_patch=`echo $available | sed 's/[^0-9].*//'` if test -z "$available_patch" ; then available_patch=0 fi # Convert the version tuple into a single number for easier comparison. # Using base 100 should be safe since SWIG internally uses BCD values # to encode its version number. required_swig_vernum=`expr $required_major \* 10000 \ \+ $required_minor \* 100 \+ $required_patch` available_swig_vernum=`expr $available_major \* 10000 \ \+ $available_minor \* 100 \+ $available_patch` if test $available_swig_vernum -lt $required_swig_vernum; then { $as_echo "$as_me:$LINENO: WARNING: SWIG version >= 1.3.17 is required. You have $swig_version." >&5 $as_echo "$as_me: WARNING: SWIG version >= 1.3.17 is required. You have $swig_version." >&2;} SWIG='' else { $as_echo "$as_me:$LINENO: checking for SWIG library" >&5 $as_echo_n "checking for SWIG library... " >&6; } SWIG_LIB=`$SWIG -swiglib` { $as_echo "$as_me:$LINENO: result: $SWIG_LIB" >&5 $as_echo "$SWIG_LIB" >&6; } fi else { $as_echo "$as_me:$LINENO: WARNING: cannot determine SWIG version" >&5 $as_echo "$as_me: WARNING: cannot determine SWIG version" >&2;} SWIG='' fi fi SWIG="$SWIG -c++" test "x" != "xno" || swig_shadow=" -noproxy" AX_SWIG_PYTHON_OPT=-python$swig_shadow AX_SWIG_PYTHON_CPPFLAGS=$PYTHON_CPPFLAGS fi #AC_CONFIG_FILES([Makefile]) ac_config_files="$ac_config_files Makefile src/Makefile src/saga_core/Makefile src/saga_core/saga_api/Makefile src/saga_core/saga_gdi/Makefile src/saga_core/saga_gui/Makefile src/saga_core/saga_gui/man/Makefile src/saga_core/saga_odbc/Makefile src/saga_core/saga_cmd/Makefile src/saga_core/saga_cmd/man/Makefile src/modules/Makefile src/modules/climate/Makefile src/modules/climate/climate_tools/Makefile src/modules/grid/Makefile src/modules/grid/grid_analysis/Makefile src/modules/grid/grid_calculus/Makefile src/modules/grid/grid_calculus_bsl/Makefile src/modules/grid/grid_filter/Makefile src/modules/grid/grid_gridding/Makefile src/modules/grid/grid_spline/Makefile src/modules/grid/grid_tools/Makefile src/modules/grid/grid_visualisation/Makefile src/modules/pointcloud/Makefile src/modules/pointcloud/pointcloud_tools/Makefile src/modules/pointcloud/pointcloud_viewer/Makefile src/modules/shapes/Makefile src/modules/shapes/shapes_grid/Makefile src/modules/shapes/shapes_lines/Makefile src/modules/shapes/shapes_points/Makefile src/modules/shapes/shapes_polygons/Makefile src/modules/shapes/shapes_tools/Makefile src/modules/shapes/shapes_transect/Makefile src/modules/table/Makefile src/modules/table/table_calculus/Makefile src/modules/table/table_tools/Makefile src/modules/tin/Makefile src/modules/tin/tin_tools/Makefile src/modules/tin/tin_viewer/Makefile src/modules_contrib/Makefile src/modules_contrib/contrib_a_perego/Makefile src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile src/modules_contrib/contrib_s_liersch/Makefile src/modules_contrib/contrib_s_liersch/ihacres/Makefile src/modules_contrib/garden/Makefile src/modules_contrib/garden/garden_3d_viewer/Makefile src/modules_contrib/garden/garden_webservices/Makefile src/modules_geostatistics/Makefile src/modules_geostatistics/geostatistics/Makefile src/modules_geostatistics/geostatistics/geostatistics_points/Makefile src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile src/modules_images/Makefile src/modules_images/modules_imagery/Makefile src/modules_images/modules_imagery/imagery_classification/Makefile src/modules_images/modules_imagery/imagery_rga/Makefile src/modules_images/modules_imagery/imagery_segmentation/Makefile src/modules_images/modules_imagery/imagery_svm/Makefile src/modules_images/modules_imagery/imagery_tools/Makefile src/modules_images/modules_opencv/Makefile src/modules_images/modules_opencv/opencv/Makefile src/modules_images/modules_vigra/Makefile src/modules_images/modules_vigra/vigra/Makefile src/modules_io/Makefile src/modules_io/esri_e00/Makefile src/modules_io/esri_e00/io_esri_e00/Makefile src/modules_io/db/Makefile src/modules_io/db/io_odbc/Makefile src/modules_io/docs/Makefile src/modules_io/docs/docs_html/Makefile src/modules_io/docs/docs_pdf/Makefile src/modules_io/gdal/Makefile src/modules_io/gdal/io_gdal/Makefile src/modules_io/grid/Makefile src/modules_io/grid/io_grid/Makefile src/modules_io/grid/io_grid_image/Makefile src/modules_io/grid/io_grid_grib2/Makefile src/modules_io/gps/Makefile src/modules_io/gps/io_gps/Makefile src/modules_io/shapes/Makefile src/modules_io/shapes/io_shapes/Makefile src/modules_io/shapes/io_shapes_dxf/Makefile src/modules_io/shapes/io_shapes_las/Makefile src/modules_io/table/Makefile src/modules_io/table/io_table/Makefile src/modules_lectures/Makefile src/modules_lectures/lectures/Makefile src/modules_lectures/lectures/lectures_introduction/Makefile src/modules_projection/Makefile src/modules_projection/pj_georeference/Makefile src/modules_projection/pj_georeference/pj_georeference/Makefile src/modules_projection/pj_proj4/Makefile src/modules_projection/pj_proj4/pj_proj4/Makefile src/modules_recreations/Makefile src/modules_recreations/recreations/Makefile src/modules_recreations/recreations/recreations_fractals/Makefile src/modules_recreations/recreations/recreations_games/Makefile src/modules_simulation/Makefile src/modules_simulation/erosion/Makefile src/modules_simulation/erosion/sim_erosion/Makefile src/modules_simulation/hydrology/Makefile src/modules_simulation/hydrology/sim_hydrology/Makefile src/modules_simulation/cellular_automata/Makefile src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile src/modules_simulation/ecosystems/Makefile src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile src/modules_simulation/fire/Makefile src/modules_simulation/fire/sim_fire_spreading/Makefile src/modules_terrain_analysis/Makefile src/modules_terrain_analysis/terrain_analysis/Makefile src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SAGA_UNICODE_TRUE}" && test -z "${SAGA_UNICODE_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"SAGA_UNICODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"SAGA_UNICODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITH_GUI_TRUE}" && test -z "${WITH_GUI_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"WITH_GUI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"WITH_GUI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITH_ODBC_TRUE}" && test -z "${WITH_ODBC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"WITH_ODBC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"WITH_ODBC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${OPENMP_TRUE}" && test -z "${OPENMP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"OPENMP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"OPENMP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_CV_TRUE}" && test -z "${HAVE_CV_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_CV\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_CV\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_LLAS_TRUE}" && test -z "${HAVE_LLAS_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_LLAS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_LLAS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_VIGRA_TRUE}" && test -z "${HAVE_VIGRA_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_VIGRA\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_VIGRA\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_HARU_TRUE}" && test -z "${HAVE_HARU_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_HARU\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_HARU\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SAGA_PYTHON_TRUE}" && test -z "${SAGA_PYTHON_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"SAGA_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"SAGA_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by saga $as_me 2.1.0, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ saga config.status 2.1.0 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ SHELL \ ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` ;; esac ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/saga_core/Makefile") CONFIG_FILES="$CONFIG_FILES src/saga_core/Makefile" ;; "src/saga_core/saga_api/Makefile") CONFIG_FILES="$CONFIG_FILES src/saga_core/saga_api/Makefile" ;; "src/saga_core/saga_gdi/Makefile") CONFIG_FILES="$CONFIG_FILES src/saga_core/saga_gdi/Makefile" ;; "src/saga_core/saga_gui/Makefile") CONFIG_FILES="$CONFIG_FILES src/saga_core/saga_gui/Makefile" ;; "src/saga_core/saga_gui/man/Makefile") CONFIG_FILES="$CONFIG_FILES src/saga_core/saga_gui/man/Makefile" ;; "src/saga_core/saga_odbc/Makefile") CONFIG_FILES="$CONFIG_FILES src/saga_core/saga_odbc/Makefile" ;; "src/saga_core/saga_cmd/Makefile") CONFIG_FILES="$CONFIG_FILES src/saga_core/saga_cmd/Makefile" ;; "src/saga_core/saga_cmd/man/Makefile") CONFIG_FILES="$CONFIG_FILES src/saga_core/saga_cmd/man/Makefile" ;; "src/modules/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/Makefile" ;; "src/modules/climate/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/climate/Makefile" ;; "src/modules/climate/climate_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/climate/climate_tools/Makefile" ;; "src/modules/grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/Makefile" ;; "src/modules/grid/grid_analysis/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_analysis/Makefile" ;; "src/modules/grid/grid_calculus/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_calculus/Makefile" ;; "src/modules/grid/grid_calculus_bsl/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_calculus_bsl/Makefile" ;; "src/modules/grid/grid_filter/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_filter/Makefile" ;; "src/modules/grid/grid_gridding/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_gridding/Makefile" ;; "src/modules/grid/grid_spline/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_spline/Makefile" ;; "src/modules/grid/grid_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_tools/Makefile" ;; "src/modules/grid/grid_visualisation/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/grid/grid_visualisation/Makefile" ;; "src/modules/pointcloud/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/pointcloud/Makefile" ;; "src/modules/pointcloud/pointcloud_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/pointcloud/pointcloud_tools/Makefile" ;; "src/modules/pointcloud/pointcloud_viewer/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/pointcloud/pointcloud_viewer/Makefile" ;; "src/modules/shapes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/Makefile" ;; "src/modules/shapes/shapes_grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/shapes_grid/Makefile" ;; "src/modules/shapes/shapes_lines/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/shapes_lines/Makefile" ;; "src/modules/shapes/shapes_points/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/shapes_points/Makefile" ;; "src/modules/shapes/shapes_polygons/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/shapes_polygons/Makefile" ;; "src/modules/shapes/shapes_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/shapes_tools/Makefile" ;; "src/modules/shapes/shapes_transect/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/shapes/shapes_transect/Makefile" ;; "src/modules/table/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/table/Makefile" ;; "src/modules/table/table_calculus/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/table/table_calculus/Makefile" ;; "src/modules/table/table_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/table/table_tools/Makefile" ;; "src/modules/tin/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/tin/Makefile" ;; "src/modules/tin/tin_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/tin/tin_tools/Makefile" ;; "src/modules/tin/tin_viewer/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/tin/tin_viewer/Makefile" ;; "src/modules_contrib/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/Makefile" ;; "src/modules_contrib/contrib_a_perego/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/contrib_a_perego/Makefile" ;; "src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile" ;; "src/modules_contrib/contrib_s_liersch/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/contrib_s_liersch/Makefile" ;; "src/modules_contrib/contrib_s_liersch/ihacres/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/contrib_s_liersch/ihacres/Makefile" ;; "src/modules_contrib/garden/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/garden/Makefile" ;; "src/modules_contrib/garden/garden_3d_viewer/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/garden/garden_3d_viewer/Makefile" ;; "src/modules_contrib/garden/garden_webservices/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_contrib/garden/garden_webservices/Makefile" ;; "src/modules_geostatistics/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/Makefile" ;; "src/modules_geostatistics/geostatistics/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/geostatistics/Makefile" ;; "src/modules_geostatistics/geostatistics/geostatistics_points/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/geostatistics/geostatistics_points/Makefile" ;; "src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile" ;; "src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile" ;; "src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile" ;; "src/modules_images/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/Makefile" ;; "src/modules_images/modules_imagery/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/Makefile" ;; "src/modules_images/modules_imagery/imagery_classification/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/imagery_classification/Makefile" ;; "src/modules_images/modules_imagery/imagery_rga/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/imagery_rga/Makefile" ;; "src/modules_images/modules_imagery/imagery_segmentation/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/imagery_segmentation/Makefile" ;; "src/modules_images/modules_imagery/imagery_svm/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/imagery_svm/Makefile" ;; "src/modules_images/modules_imagery/imagery_tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_imagery/imagery_tools/Makefile" ;; "src/modules_images/modules_opencv/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_opencv/Makefile" ;; "src/modules_images/modules_opencv/opencv/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_opencv/opencv/Makefile" ;; "src/modules_images/modules_vigra/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_vigra/Makefile" ;; "src/modules_images/modules_vigra/vigra/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_images/modules_vigra/vigra/Makefile" ;; "src/modules_io/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/Makefile" ;; "src/modules_io/esri_e00/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/esri_e00/Makefile" ;; "src/modules_io/esri_e00/io_esri_e00/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/esri_e00/io_esri_e00/Makefile" ;; "src/modules_io/db/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/db/Makefile" ;; "src/modules_io/db/io_odbc/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/db/io_odbc/Makefile" ;; "src/modules_io/docs/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/docs/Makefile" ;; "src/modules_io/docs/docs_html/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/docs/docs_html/Makefile" ;; "src/modules_io/docs/docs_pdf/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/docs/docs_pdf/Makefile" ;; "src/modules_io/gdal/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/gdal/Makefile" ;; "src/modules_io/gdal/io_gdal/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/gdal/io_gdal/Makefile" ;; "src/modules_io/grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/grid/Makefile" ;; "src/modules_io/grid/io_grid/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/grid/io_grid/Makefile" ;; "src/modules_io/grid/io_grid_image/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/grid/io_grid_image/Makefile" ;; "src/modules_io/grid/io_grid_grib2/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/grid/io_grid_grib2/Makefile" ;; "src/modules_io/gps/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/gps/Makefile" ;; "src/modules_io/gps/io_gps/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/gps/io_gps/Makefile" ;; "src/modules_io/shapes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/shapes/Makefile" ;; "src/modules_io/shapes/io_shapes/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/shapes/io_shapes/Makefile" ;; "src/modules_io/shapes/io_shapes_dxf/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/shapes/io_shapes_dxf/Makefile" ;; "src/modules_io/shapes/io_shapes_las/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/shapes/io_shapes_las/Makefile" ;; "src/modules_io/table/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/table/Makefile" ;; "src/modules_io/table/io_table/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_io/table/io_table/Makefile" ;; "src/modules_lectures/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_lectures/Makefile" ;; "src/modules_lectures/lectures/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_lectures/lectures/Makefile" ;; "src/modules_lectures/lectures/lectures_introduction/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_lectures/lectures/lectures_introduction/Makefile" ;; "src/modules_projection/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_projection/Makefile" ;; "src/modules_projection/pj_georeference/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_projection/pj_georeference/Makefile" ;; "src/modules_projection/pj_georeference/pj_georeference/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_projection/pj_georeference/pj_georeference/Makefile" ;; "src/modules_projection/pj_proj4/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_projection/pj_proj4/Makefile" ;; "src/modules_projection/pj_proj4/pj_proj4/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_projection/pj_proj4/pj_proj4/Makefile" ;; "src/modules_recreations/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_recreations/Makefile" ;; "src/modules_recreations/recreations/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_recreations/recreations/Makefile" ;; "src/modules_recreations/recreations/recreations_fractals/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_recreations/recreations/recreations_fractals/Makefile" ;; "src/modules_recreations/recreations/recreations_games/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_recreations/recreations/recreations_games/Makefile" ;; "src/modules_simulation/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/Makefile" ;; "src/modules_simulation/erosion/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/erosion/Makefile" ;; "src/modules_simulation/erosion/sim_erosion/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/erosion/sim_erosion/Makefile" ;; "src/modules_simulation/hydrology/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/hydrology/Makefile" ;; "src/modules_simulation/hydrology/sim_hydrology/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/hydrology/sim_hydrology/Makefile" ;; "src/modules_simulation/cellular_automata/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/cellular_automata/Makefile" ;; "src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile" ;; "src/modules_simulation/ecosystems/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/ecosystems/Makefile" ;; "src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile" ;; "src/modules_simulation/fire/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/fire/Makefile" ;; "src/modules_simulation/fire/sim_fire_spreading/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_simulation/fire/sim_fire_spreading/Makefile" ;; "src/modules_terrain_analysis/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/Makefile" ;; "src/modules_terrain_analysis/terrain_analysis/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/Makefile" ;; "src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile" ;; "src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile" ;; "src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile" ;; "src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile" ;; "src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile" ;; "src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile" ;; "src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name of the directory that contains temporary libtool files. objdir=$objdir # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that does not interpret backslashes. ECHO=$lt_ECHO # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi saga-2.1.0+dfsg/configure.in000077500000000000000000000260321224124640700156650ustar00rootroot00000000000000# $Id: configure.in 1580 2012-12-26 15:31:58Z reklov_w $ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(saga, 2.1.0, BUG-REPORT-ADDRESS) AC_CONFIG_SRCDIR([src/saga_core/saga_gui/wksp_data_menu_files.cpp]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE(saga, 2.1.0beta) AM_INIT_AUTOMAKE(tar-ustar) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL # Checks for libraries. AC_CHECK_LIB([cv], [cvGetRows], CVFOUND=1,,) AC_CHECK_LIB([geotrans], [Set_Mercator_Coordinates]) AC_CHECK_LIB([fftw3],[fftw_execute],FFTWFOUND=1,) AC_CHECK_LIB([jasper], [jas_calloc],JASPERFOUND=1,,) AC_CHECK_LIB([las], [LAS_GetVersion], LASFOUND=1,,) AC_CHECK_LIB(hpdf, HPDF_Pages_New, HARUFOUND=1,,) AC_CHECK_LIB([odbc], [SQLFetch], ODBCFOUND=1,[ODBC \(libodbc\) library not found]) AC_CHECK_LIB([proj], [pj_is_latlong], PROJFOUND=1,,) AC_CHECK_LIB([vigraimpex], [VIGRA_RGBE_ReadPixels_Raw],VIGRAFOUND=1,) AC_CHECK_LIB([gomp], [omp_get_num_threads], GOMPFOUND=1,,) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([float.h malloc.h memory.h stdlib.h string.h unistd.h]) AC_CHECK_HEADERS([wchar.h]) #todo: check for headers of the libraries above # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_STRUCT_TM # Checks for platform characteristics. AC_C_BIGENDIAN # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_REALLOC AC_FUNC_STAT AC_FUNC_STRTOD AC_FUNC_VPRINTF AC_CHECK_FUNCS([floor memmove memset modf pow sqrt strchr strdup strerror strrchr strstr strtol]) # add a local directory as base for libs and include files AC_MSG_CHECKING([for local include/lib path]) AC_ARG_WITH(local,[ --with-local[=dir] search /usr/local or other directory for includes and libs],,) if test "$with_local" != "no" -a "$with_local" != "" ; then if test "$with_local" = "yes" ; then ADD_PREFIX=/usr/local else ADD_PREFIX=$with_local fi AC_MSG_RESULT(adding $ADD_PREFIX) LOCAL_LIBS="-L$ADD_PREFIX/lib" LOCAL_INCS="-I$ADD_PREFIX/include" AC_SUBST(LOCAL_LIBS,$LOCAL_LIBS) AC_SUBST(LOCAL_INCS,$LOCAL_INCS) else AC_MSG_RESULT([none]) fi # conditionals # the test could be extended to check for wx-config --version too if test "`wx-config --list | grep unicode`" != "" ; then AM_CONDITIONAL(SAGA_UNICODE, true) else AC_MSG_ERROR(SAGA requires a unicode build of wxGTK) exit fi AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging], [case "${enableval}" in yes) debug=true ;; no) debug=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac],[debug=false]) AM_CONDITIONAL(DEBUG, test x$debug = xtrue) AC_ARG_ENABLE(gui, [ --disable-gui Do not build GUI and interactive modules], [case "${enableval}" in yes) gui=true ;; no) gui=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --disable-gui) ;; esac],[gui=true]) AM_CONDITIONAL(WITH_GUI, test x$gui = xtrue) if test $gui = "false" ; then AC_MSG_RESULT([ GUI and interactive modules will NOT be built]) else AC_DEFINE([WITH_GUI], [1], ["built with GUI and interactive modules"]) AC_MSG_RESULT([ GUI and interactive modules will be built]) fi AC_ARG_ENABLE(odbc, [ --disable-odbc Build without ODBC support], [case "${enableval}" in yes) odbc=true ;; no) odbc=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --disable-odbc) ;; esac],[odbc=true]) AM_CONDITIONAL(WITH_ODBC, test x$odbc = xtrue) if test $odbc = "false" ; then AC_MSG_RESULT([ ODBC support will NOT be built]) else AC_DEFINE([WITH_ODBC], [1], ["built with ODBC support"]) AC_MSG_RESULT([ ODBC support will be built]) fi AC_ARG_ENABLE(openmp, [ --disable-openmp Build without OpenMP support], [case "${enableval}" in yes) openmp=true ;; no) openmp=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --disable-openmp) ;; esac],[openmp=true]) AM_CONDITIONAL(OPENMP, test x$openmp = xtrue) if test $openmp = "false" ; then AC_MSG_RESULT([ OpenMP support disabled]) GOMPFLAGS="" else if test -n "$GOMPFOUND" ; then AC_MSG_RESULT([ Building with OpenMP support using libgomp]) GOMPFLAGS="-fopenmp" else AC_MSG_RESULT([ libgomp not found, OpenMP support disabled]) GOMPFLAGS="" fi fi AC_SUBST(GOMPFLAGS) #AM_CONDITIONAL(X86_64, test "`uname -m`" = "x86_64") AM_CONDITIONAL(HAVE_CV, test -n "$CVFOUND") AM_CONDITIONAL(HAVE_LLAS, test -n "$LASFOUND") AM_CONDITIONAL(HAVE_VIGRA, test -n "$VIGRAFOUND" -a -n "$FFTWFOUND") AM_CONDITIONAL(HAVE_HARU, test -n "$HARUFOUND") if test -n "$HARUFOUND" ; then AC_MSG_RESULT([ using lhpdf (libharu) from system libs.]) DISABLELIBHARU="" HARU_LIB="-lhpdf" else AC_MSG_RESULT([ libharu was not found, pdf creation will be disabled]) DISABLELIBHARU="-D_SAGA_DONOTUSE_HARU" HARU_LIB="" fi AC_SUBST(HARU_LIB) AC_SUBST(DISABLELIBHARU) AC_CONFIG_MACRO_DIR([m4]) AC_ARG_ENABLE(python, [ --enable-python Build python bindings for the saga api], [case "${enableval}" in yes) python=true ;; no) python=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;; esac],[python=false]) AM_CONDITIONAL(SAGA_PYTHON, test x$python = xtrue) if test x$python = xtrue; then AM_PATH_PYTHON # PYTHON_EXTRA_LIBS='-lgomp' # PYTHON_EXTRA_LDFLAGS='-lgomp' AX_PYTHON_DEVEL([]) AX_PKG_SWIG(1.3.17,[],[]) AX_SWIG_ENABLE_CXX AX_SWIG_PYTHON fi #AC_CONFIG_FILES([Makefile]) AC_OUTPUT(Makefile \ src/Makefile \ src/saga_core/Makefile \ src/saga_core/saga_api/Makefile \ src/saga_core/saga_gdi/Makefile \ src/saga_core/saga_gui/Makefile \ src/saga_core/saga_gui/man/Makefile \ src/saga_core/saga_odbc/Makefile \ src/saga_core/saga_cmd/Makefile \ src/saga_core/saga_cmd/man/Makefile \ src/modules/Makefile \ src/modules/climate/Makefile \ src/modules/climate/climate_tools/Makefile \ src/modules/grid/Makefile \ src/modules/grid/grid_analysis/Makefile \ src/modules/grid/grid_calculus/Makefile \ src/modules/grid/grid_calculus_bsl/Makefile \ src/modules/grid/grid_filter/Makefile \ src/modules/grid/grid_gridding/Makefile \ src/modules/grid/grid_spline/Makefile \ src/modules/grid/grid_tools/Makefile \ src/modules/grid/grid_visualisation/Makefile \ src/modules/pointcloud/Makefile \ src/modules/pointcloud/pointcloud_tools/Makefile \ src/modules/pointcloud/pointcloud_viewer/Makefile \ src/modules/shapes/Makefile \ src/modules/shapes/shapes_grid/Makefile \ src/modules/shapes/shapes_lines/Makefile \ src/modules/shapes/shapes_points/Makefile \ src/modules/shapes/shapes_polygons/Makefile \ src/modules/shapes/shapes_tools/Makefile \ src/modules/shapes/shapes_transect/Makefile \ src/modules/table/Makefile \ src/modules/table/table_calculus/Makefile \ src/modules/table/table_tools/Makefile \ src/modules/tin/Makefile \ src/modules/tin/tin_tools/Makefile \ src/modules/tin/tin_viewer/Makefile \ src/modules_contrib/Makefile \ src/modules_contrib/contrib_a_perego/Makefile \ src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile \ src/modules_contrib/contrib_s_liersch/Makefile \ src/modules_contrib/contrib_s_liersch/ihacres/Makefile \ src/modules_contrib/garden/Makefile \ src/modules_contrib/garden/garden_3d_viewer/Makefile \ src/modules_contrib/garden/garden_webservices/Makefile \ src/modules_geostatistics/Makefile \ src/modules_geostatistics/geostatistics/Makefile \ src/modules_geostatistics/geostatistics/geostatistics_points/Makefile \ src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile \ src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile \ src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile \ src/modules_images/Makefile \ src/modules_images/modules_imagery/Makefile \ src/modules_images/modules_imagery/imagery_classification/Makefile \ src/modules_images/modules_imagery/imagery_rga/Makefile \ src/modules_images/modules_imagery/imagery_segmentation/Makefile \ src/modules_images/modules_imagery/imagery_svm/Makefile \ src/modules_images/modules_imagery/imagery_tools/Makefile \ src/modules_images/modules_opencv/Makefile \ src/modules_images/modules_opencv/opencv/Makefile \ src/modules_images/modules_vigra/Makefile \ src/modules_images/modules_vigra/vigra/Makefile \ src/modules_io/Makefile \ src/modules_io/esri_e00/Makefile \ src/modules_io/esri_e00/io_esri_e00/Makefile \ src/modules_io/db/Makefile \ src/modules_io/db/io_odbc/Makefile \ src/modules_io/docs/Makefile \ src/modules_io/docs/docs_html/Makefile \ src/modules_io/docs/docs_pdf/Makefile \ src/modules_io/gdal/Makefile \ src/modules_io/gdal/io_gdal/Makefile \ src/modules_io/grid/Makefile \ src/modules_io/grid/io_grid/Makefile \ src/modules_io/grid/io_grid_image/Makefile \ src/modules_io/grid/io_grid_grib2/Makefile \ src/modules_io/gps/Makefile \ src/modules_io/gps/io_gps/Makefile \ src/modules_io/shapes/Makefile \ src/modules_io/shapes/io_shapes/Makefile \ src/modules_io/shapes/io_shapes_dxf/Makefile \ src/modules_io/shapes/io_shapes_las/Makefile \ src/modules_io/table/Makefile \ src/modules_io/table/io_table/Makefile \ src/modules_lectures/Makefile \ src/modules_lectures/lectures/Makefile \ src/modules_lectures/lectures/lectures_introduction/Makefile \ src/modules_projection/Makefile \ src/modules_projection/pj_georeference/Makefile \ src/modules_projection/pj_georeference/pj_georeference/Makefile \ src/modules_projection/pj_proj4/Makefile \ src/modules_projection/pj_proj4/pj_proj4/Makefile \ src/modules_recreations/Makefile \ src/modules_recreations/recreations/Makefile \ src/modules_recreations/recreations/recreations_fractals/Makefile \ src/modules_recreations/recreations/recreations_games/Makefile \ src/modules_simulation/Makefile \ src/modules_simulation/erosion/Makefile \ src/modules_simulation/erosion/sim_erosion/Makefile \ src/modules_simulation/hydrology/Makefile \ src/modules_simulation/hydrology/sim_hydrology/Makefile \ src/modules_simulation/cellular_automata/Makefile \ src/modules_simulation/cellular_automata/sim_cellular_automata/Makefile \ src/modules_simulation/ecosystems/Makefile \ src/modules_simulation/ecosystems/sim_ecosystems_hugget/Makefile \ src/modules_simulation/fire/Makefile \ src/modules_simulation/fire/sim_fire_spreading/Makefile \ src/modules_terrain_analysis/Makefile \ src/modules_terrain_analysis/terrain_analysis/Makefile \ src/modules_terrain_analysis/terrain_analysis/ta_channels/Makefile \ src/modules_terrain_analysis/terrain_analysis/ta_compound/Makefile \ src/modules_terrain_analysis/terrain_analysis/ta_hydrology/Makefile \ src/modules_terrain_analysis/terrain_analysis/ta_lighting/Makefile \ src/modules_terrain_analysis/terrain_analysis/ta_morphometry/Makefile \ src/modules_terrain_analysis/terrain_analysis/ta_preprocessor/Makefile \ src/modules_terrain_analysis/terrain_analysis/ta_profiles/Makefile \ ) saga-2.1.0+dfsg/depcomp000077500000000000000000000442671224124640700147400ustar00rootroot00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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 . # 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 . 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 outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac 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" # 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 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## 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). ## - 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## 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. tr ' ' ' ' < "$tmpdepfile" | ## 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. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -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 -eq 0; then : else 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 ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; 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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 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 -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else 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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 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 -eq 0; then : else 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,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # 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.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #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:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. 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" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. 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:: \1 \\:p' >> "$depfile" echo " " >> "$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: saga-2.1.0+dfsg/install-sh000077500000000000000000000325371224124640700153640ustar00rootroot00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # 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. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # 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_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' 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 no_target_directory= 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 *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done 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 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 trap '(exit $?); exit' 1 2 13 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 starting with `-'. 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 # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # 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 -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` 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-writeable 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 eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && 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` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob 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: saga-2.1.0+dfsg/ltmain.sh000077500000000000000000007330601224124640700152020ustar00rootroot00000000000000# Generated from ltmain.m4sh. # ltmain.sh (GNU libtool) 2.2.6b # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print informational messages (default) # --version print version information # -h, --help print short or long help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.2.6b # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool VERSION=2.2.6b TIMESTAMP="" package_revision=1.3017 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done $lt_unset CDPATH : ${CP="cp -f"} : ${ECHO="echo"} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # Generated shell functions inserted here. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: # In the unlikely event $progname began with a '-', it would play havoc with # func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result case $progname in -*) progname=./$progname ;; esac # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` done my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "X$my_tmpdir" | $Xsed } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "X$1" | $Xsed \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_version # Echo version message to standard output and exit. func_version () { $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help # Echo long help message to standard output and exit. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" exit $? } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1" exit_cmd=exit } exit_cmd=: # Check that we have a working $ECHO. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 in # Valid mode arguments: clean) ;; compile) ;; execute) ;; finish) ;; install) ;; link) ;; relink) ;; uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } ## ----------- ## ## Main. ## ## ----------- ## $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$mode' for more information." } # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case "$@ " in " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T <?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$mode'" ;; esac $ECHO $ECHO "Try \`$progname --help' for more information about other modes." exit $? } # Now that we've collected a possible --mode arg, show help if necessary $opt_help && func_mode_help # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_quote_for_eval "$file" args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" $ECHO "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS $ECHO "X----------------------------------------------------------------------" | $Xsed $ECHO "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done $ECHO $ECHO "If you ever happen to want to link against installed libraries" $ECHO "in a given directory, LIBDIR, you must either use libtool, and" $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" $ECHO "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" $ECHO " during execution" fi if test -n "$runpath_var"; then $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" $ECHO " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $ECHO $ECHO "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" $ECHO "pages." ;; *) $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac $ECHO "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $ECHO "X$nonopt" | $GREP shtool >/dev/null; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" fi $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; " case $host in *cygwin* | *mingw* | *cegcc* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) symtab_cflags="$symtab_cflags $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper_part1 [arg=no] # # Emit the first part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part1 () { func_emit_wrapper_part1_arg1=no if test -n "$1" ; then func_emit_wrapper_part1_arg1=$1 fi $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then ECHO=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else # Restart under the correct shell, and then maybe \$ECHO will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $ECHO "\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done " } # end: func_emit_wrapper_part1 # func_emit_wrapper_part2 [arg=no] # # Emit the second part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part2 () { func_emit_wrapper_part2_arg1=no if test -n "$1" ; then func_emit_wrapper_part2_arg1=$1 fi $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # end: func_emit_wrapper_part2 # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=no if test -n "$1" ; then func_emit_wrapper_arg1=$1 fi # split this up so that func_emit_cwrapperexe_src # can call each part independently. func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" } # func_to_host_path arg # # Convert paths to host format when used with build tools. # Intended for use with "native" mingw (where libtool itself # is running under the msys shell), or in the following cross- # build environments: # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # where wine is equipped with the `winepath' executable. # In the native mingw case, the (msys) shell automatically # converts paths for any non-msys applications it launches, # but that facility isn't available from inside the cwrapper. # Similar accommodations are necessary for $host mingw and # $build cygwin. Calling this function does no harm for other # $host/$build combinations not listed above. # # ARG is the path (on $build) that should be converted to # the proper representation for $host. The result is stored # in $func_to_host_path_result. func_to_host_path () { func_to_host_path_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' case $build in *mingw* ) # actually, msys # awkward: cmd appends spaces to result lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_path_tmp1=`( cmd //c echo "$1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_path_tmp1=`cygpath -w "$1"` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # Unfortunately, winepath does not exit with a non-zero # error code, so we are forced to check the contents of # stdout. On the other hand, if the command is not # found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both # error code of zero AND non-empty stdout, which explains # the odd construction: func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` else # Allow warning below. func_to_host_path_result="" fi ;; esac if test -z "$func_to_host_path_result" ; then func_error "Could not determine host path corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_path_result="$1" fi ;; esac fi } # end: func_to_host_path # func_to_host_pathlist arg # # Convert pathlists to host format when used with build tools. # See func_to_host_path(), above. This function supports the # following $build/$host combinations (but does no harm for # combinations not listed here): # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # # Path separators are also converted from $build format to # $host format. If ARG begins or ends with a path separator # character, it is preserved (but converted to $host format) # on output. # # ARG is a pathlist (on $build) that should be converted to # the proper representation on $host. The result is stored # in $func_to_host_pathlist_result. func_to_host_pathlist () { func_to_host_pathlist_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_to_host_pathlist_tmp2="$1" # Once set for this call, this variable should not be # reassigned. It is used in tha fallback case. func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e 's|^:*||' -e 's|:*$||'` case $build in *mingw* ) # Actually, msys. # Awkward: cmd appends spaces to result. lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # unfortunately, winepath doesn't convert pathlists func_to_host_pathlist_result="" func_to_host_pathlist_oldIFS=$IFS IFS=: for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do IFS=$func_to_host_pathlist_oldIFS if test -n "$func_to_host_pathlist_f" ; then func_to_host_path "$func_to_host_pathlist_f" if test -n "$func_to_host_path_result" ; then if test -z "$func_to_host_pathlist_result" ; then func_to_host_pathlist_result="$func_to_host_path_result" else func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" fi fi fi IFS=: done IFS=$func_to_host_pathlist_oldIFS ;; esac if test -z "$func_to_host_pathlist_result" ; then func_error "Could not determine the host path(s) corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This may break if $1 contains DOS-style drive # specifications. The fix is not to complicate the expression # below, but for the user to provide a working wine installation # with winepath so that path translation in the cross-to-mingw # case works properly. lt_replace_pathsep_nix_to_dos="s|:|;|g" func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_replace_pathsep_nix_to_dos"` fi # Now, add the leading and trailing path separators back case "$1" in :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ;; esac case "$1" in *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" ;; esac ;; esac fi } # end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include # define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include # define HAVE_SETENV # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif # endif #endif #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_opt_process_env_set (const char *arg); void lt_opt_process_env_prepend (const char *arg); void lt_opt_process_env_append (const char *arg); int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); static const char *script_text_part1 = EOF func_emit_wrapper_part1 yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ "/' -e 's/$/\\n"/' echo ";" cat <"))); for (i = 0; i < newargc; i++) { LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF case $host_os in mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; EOF ;; *) cat <<"EOF" execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ EOF ;; esac cat <<"EOF" } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } void lt_setenv (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", (name ? name : ""), (value ? value : ""))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } int lt_split_name_value (const char *arg, char** name, char** value) { const char *p; int len; if (!arg || !*arg) return 1; p = strchr (arg, (int)'='); if (!p) return 1; *value = xstrdup (++p); len = strlen (arg) - strlen (*value); *name = XMALLOC (char, len); strncpy (*name, arg, len-1); (*name)[len - 1] = '\0'; return 0; } void lt_opt_process_env_set (const char *arg) { char *name = NULL; char *value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); } lt_setenv (name, value); XFREE (name); XFREE (value); } void lt_opt_process_env_prepend (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); } new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_opt_process_env_append (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); } new_value = lt_extend_str (getenv (name), value, 1); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_update_exe_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF } # end: func_emit_cwrapperexe_src # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result if test -z "$dir"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$deplibs $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $ECHO $ECHO "*** Warning: Trying to link with static lib archive $deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because the file extensions .$libext of this argument makes me believe" $ECHO "*** that it is just a static archive that I should not use here." else $ECHO $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) temp_rpath="$temp_rpath$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then $ECHO if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $ECHO $ECHO "*** And there doesn't seem to be a static archive available" $ECHO "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $ECHO $ECHO "*** Warning: This system can not link to static lib archive $lib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $ECHO "*** But as you try to build a module library, libtool will still create " $ECHO "*** a static module, that should work as long as the dlopening application" $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) func_dirname "$deplib" "" "." dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else $ECHO $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | $GREP . >/dev/null; then $ECHO if test "X$deplibs_check_method" = "Xnone"; then $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $ECHO $ECHO "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" $ECHO "*** a static module, that should work as long as the dlopening" $ECHO "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $ECHO "*** The inter-library dependencies that have been dropped here will be" $ECHO "*** automatically added whenever a program is linked with this library" $ECHO "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $ECHO $ECHO "*** Since this library must not contain undefined symbols," $ECHO "*** because either the platform does not support them or" $ECHO "*** it was explicitly requested with -no-undefined," $ECHO "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" delfiles="$delfiles $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" $ECHO 'INPUT (' > $output for obj in $save_libobjs do $ECHO "$obj" >> $output done $ECHO ')' >> $output delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=$obj func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$delfiles $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *cegcc) # Disable wrappers for cegcc, we are cross compiling anyway. wrappers_required=no ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $ECHO for shipping. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else $ECHO "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 saga-2.1.0+dfsg/m4/000077500000000000000000000000001224124640700136665ustar00rootroot00000000000000saga-2.1.0+dfsg/m4/ax_pkg_swig.m4000066400000000000000000000150431224124640700164350ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html # =========================================================================== # # SYNOPSIS # # AX_PKG_SWIG([major.minor.micro], [action-if-found], [action-if-not-found]) # # DESCRIPTION # # This macro searches for a SWIG installation on your system. If found, # then SWIG is AC_SUBST'd; if not found, then $SWIG is empty. If SWIG is # found, then SWIG_LIB is set to the SWIG library path, and AC_SUBST'd. # # You can use the optional first argument to check if the version of the # available SWIG is greater than or equal to the value of the argument. It # should have the format: N[.N[.N]] (N is a number between 0 and 999. Only # the first N is mandatory.) If the version argument is given (e.g. # 1.3.17), AX_PKG_SWIG checks that the swig package is this version number # or higher. # # As usual, action-if-found is executed if SWIG is found, otherwise # action-if-not-found is executed. # # In configure.in, use as: # # AX_PKG_SWIG(1.3.17, [], [ AC_MSG_ERROR([SWIG is required to build..]) ]) # AX_SWIG_ENABLE_CXX # AX_SWIG_MULTI_MODULE_SUPPORT # AX_SWIG_PYTHON # # LICENSE # # Copyright (c) 2008 Sebastian Huber # Copyright (c) 2008 Alan W. Irwin # Copyright (c) 2008 Rafael Laboissiere # Copyright (c) 2008 Andrew Collier # # 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. # # 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 . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 7 AC_DEFUN([AX_PKG_SWIG],[ AC_PATH_PROG([SWIG],[swig]) if test -z "$SWIG" ; then m4_ifval([$3],[$3],[:]) elif test -n "$1" ; then AC_MSG_CHECKING([SWIG version]) [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] AC_MSG_RESULT([$swig_version]) if test -n "$swig_version" ; then # Calculate the required version number components [required=$1] [required_major=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_major" ; then [required_major=0] fi [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] [required_minor=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_minor" ; then [required_minor=0] fi [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] [required_patch=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_patch" ; then [required_patch=0] fi # Calculate the available version number components [available=$swig_version] [available_major=`echo $available | sed 's/[^0-9].*//'`] if test -z "$available_major" ; then [available_major=0] fi [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] [available_minor=`echo $available | sed 's/[^0-9].*//'`] if test -z "$available_minor" ; then [available_minor=0] fi [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] [available_patch=`echo $available | sed 's/[^0-9].*//'`] if test -z "$available_patch" ; then [available_patch=0] fi # Convert the version tuple into a single number for easier comparison. # Using base 100 should be safe since SWIG internally uses BCD values # to encode its version number. required_swig_vernum=`expr $required_major \* 10000 \ \+ $required_minor \* 100 \+ $required_patch` available_swig_vernum=`expr $available_major \* 10000 \ \+ $available_minor \* 100 \+ $available_patch` if test $available_swig_vernum -lt $required_swig_vernum; then AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version.]) SWIG='' m4_ifval([$3],[$3],[]) else AC_MSG_CHECKING([for SWIG library]) SWIG_LIB=`$SWIG -swiglib` AC_MSG_RESULT([$SWIG_LIB]) m4_ifval([$2],[$2],[]) fi else AC_MSG_WARN([cannot determine SWIG version]) SWIG='' m4_ifval([$3],[$3],[]) fi fi AC_SUBST([SWIG_LIB]) ]) saga-2.1.0+dfsg/m4/ax_python_devel.m4000066400000000000000000000261321224124640700173240ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_python_devel.html # =========================================================================== # # SYNOPSIS # # AX_PYTHON_DEVEL([version]) # # DESCRIPTION # # Note: Defines as a precious variable "PYTHON_VERSION". Don't override it # in your configure.ac. # # This macro checks for Python and tries to get the include path to # 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) # output variables. It also exports $(PYTHON_EXTRA_LIBS) and # $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code. # # You can search for some particular version of Python by passing a # parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please # note that you *have* to pass also an operator along with the version to # match, and pay special attention to the single quotes surrounding the # version number. Don't use "PYTHON_VERSION" for this: that environment # variable is declared as precious and thus reserved for the end-user. # # This macro should work for all versions of Python >= 2.1.0. As an end # user, you can disable the check for the python version by setting the # PYTHON_NOVERSIONCHECK environment variable to something else than the # empty string. # # If you need to use this macro for an older Python version, please # contact the authors. We're always open for feedback. # # LICENSE # # Copyright (c) 2009 Sebastian Huber # Copyright (c) 2009 Alan W. Irwin # Copyright (c) 2009 Rafael Laboissiere # Copyright (c) 2009 Andrew Collier # Copyright (c) 2009 Matteo Settenvini # Copyright (c) 2009 Horst Knorr # # 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 . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 8 AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) AC_DEFUN([AX_PYTHON_DEVEL],[ # # Allow the use of a (user set) custom python version # AC_ARG_VAR([PYTHON_VERSION],[The installed Python version to use, for example '2.3'. This string will be appended to the Python interpreter canonical name.]) AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) if test -z "$PYTHON"; then AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) PYTHON_VERSION="" fi # # Check for a version of Python >= 2.1.0 # AC_MSG_CHECKING([for a version of Python >= '2.1.0']) ac_supports_python_ver=`$PYTHON -c "import sys; \ ver = sys.version.split ()[[0]]; \ print (ver >= '2.1.0')"` if test "$ac_supports_python_ver" != "True"; then if test -z "$PYTHON_NOVERSIONCHECK"; then AC_MSG_RESULT([no]) AC_MSG_FAILURE([ This version of the AC@&t@_PYTHON_DEVEL macro doesn't work properly with versions of Python before 2.1.0. You may need to re-run configure, setting the variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. Moreover, to disable this check, set PYTHON_NOVERSIONCHECK to something else than an empty string. ]) else AC_MSG_RESULT([skip at user request]) fi else AC_MSG_RESULT([yes]) fi # # if the macro parameter ``version'' is set, honour it # if test -n "$1"; then AC_MSG_CHECKING([for a version of Python $1]) ac_supports_python_ver=`$PYTHON -c "import sys; \ ver = sys.version.split ()[[0]]; \ print (ver $1)"` if test "$ac_supports_python_ver" = "True"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_MSG_ERROR([this package requires Python $1. If you have it installed, but it isn't the default Python interpreter in your system path, please pass the PYTHON_VERSION variable to configure. See ``configure --help'' for reference. ]) PYTHON_VERSION="" fi fi # # Check if you have distutils, else fail # AC_MSG_CHECKING([for the distutils Python package]) ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` if test -z "$ac_distutils_result"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_MSG_ERROR([cannot import Python module "distutils". Please check your Python installation. The error was: $ac_distutils_result]) PYTHON_VERSION="" fi # # Check for Python include path # AC_MSG_CHECKING([for Python include path]) if test -z "$PYTHON_CPPFLAGS"; then python_path=`$PYTHON -c "import distutils.sysconfig; \ print (distutils.sysconfig.get_python_inc ());"` if test -n "${python_path}"; then python_path="-I$python_path" fi PYTHON_CPPFLAGS=$python_path fi AC_MSG_RESULT([$PYTHON_CPPFLAGS]) AC_SUBST([PYTHON_CPPFLAGS]) # # Check for Python library path # AC_MSG_CHECKING([for Python library path]) if test -z "$PYTHON_LDFLAGS"; then # (makes two attempts to ensure we've got a version number # from the interpreter) ac_python_version=`cat<]], [[Py_Initialize();]]) ],[pythonexists=yes],[pythonexists=no]) AC_LANG_POP([C]) # turn back to default flags CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" AC_MSG_RESULT([$pythonexists]) if test ! "x$pythonexists" = "xyes"; then AC_MSG_FAILURE([ Could not link test program to Python. Maybe the main Python library has been installed in some non-standard library path. If so, pass it to configure, via the LDFLAGS environment variable. Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" ============================================================================ ERROR! You probably have to install the development version of the Python package for your distribution. The exact name of this package varies among them. ============================================================================ ]) PYTHON_VERSION="" fi # # all done! # ]) saga-2.1.0+dfsg/m4/ax_swig_enable_cxx.m4000066400000000000000000000043561224124640700177710ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_swig_enable_cxx.html # =========================================================================== # # SYNOPSIS # # AX_SWIG_ENABLE_CXX # # DESCRIPTION # # Enable SWIG C++ support. This affects all invocations of $(SWIG). # # LICENSE # # Copyright (c) 2008 Sebastian Huber # Copyright (c) 2008 Alan W. Irwin # Copyright (c) 2008 Rafael Laboissiere # Copyright (c) 2008 Andrew Collier # # 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. # # 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 . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 6 AU_ALIAS([SWIG_ENABLE_CXX], [AX_SWIG_ENABLE_CXX]) AC_DEFUN([AX_SWIG_ENABLE_CXX],[ AC_REQUIRE([AX_PKG_SWIG]) AC_REQUIRE([AC_PROG_CXX]) SWIG="$SWIG -c++" ]) saga-2.1.0+dfsg/m4/ax_swig_python.m4000066400000000000000000000056241224124640700172010ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_swig_python.html # =========================================================================== # # SYNOPSIS # # AX_SWIG_PYTHON([use-shadow-classes = {no, yes}]) # # DESCRIPTION # # Checks for Python and provides the $(AX_SWIG_PYTHON_CPPFLAGS), and # $(AX_SWIG_PYTHON_OPT) output variables. # # $(AX_SWIG_PYTHON_OPT) contains all necessary SWIG options to generate # code for Python. Shadow classes are enabled unless the value of the # optional first argument is exactly 'no'. If you need multi module # support (provided by the AX_SWIG_MULTI_MODULE_SUPPORT macro) use # $(AX_SWIG_PYTHON_LIBS) to link against the appropriate library. It # contains the SWIG Python runtime library that is needed by the type # check system for example. # # LICENSE # # Copyright (c) 2008 Sebastian Huber # Copyright (c) 2008 Alan W. Irwin # Copyright (c) 2008 Rafael Laboissiere # Copyright (c) 2008 Andrew Collier # # 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. # # 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 . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 7 AU_ALIAS([SWIG_PYTHON], [AX_SWIG_PYTHON]) AC_DEFUN([AX_SWIG_PYTHON],[ AC_REQUIRE([AX_PKG_SWIG]) AC_REQUIRE([AX_PYTHON_DEVEL]) test "x$1" != "xno" || swig_shadow=" -noproxy" AC_SUBST([AX_SWIG_PYTHON_OPT],[-python$swig_shadow]) AC_SUBST([AX_SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS]) ]) saga-2.1.0+dfsg/m4/libtool.m4000066400000000000000000007734111224124640700156110ustar00rootroot00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 56 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl _LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_INIT ]) # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. if test "$no_create" != yes; then lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) fi ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX # ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then _LT_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${FC-"f95"} compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) saga-2.1.0+dfsg/m4/ltoptions.m4000066400000000000000000000272421224124640700161720ustar00rootroot00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) saga-2.1.0+dfsg/m4/ltsugar.m4000066400000000000000000000104241224124640700156120ustar00rootroot00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) saga-2.1.0+dfsg/m4/ltversion.m4000066400000000000000000000012771224124640700161640ustar00rootroot00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file 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. # Generated from ltversion.in. # serial 3017 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.6b]) m4_define([LT_PACKAGE_REVISION], [1.3017]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6b' macro_revision='1.3017' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) saga-2.1.0+dfsg/m4/lt~obsolete.m4000066400000000000000000000131131224124640700165010ustar00rootroot00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file 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. # serial 4 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) saga-2.1.0+dfsg/missing000077500000000000000000000262331224124640700147530ustar00rootroot00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 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 . # 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 run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." 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 # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # 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: saga-2.1.0+dfsg/py-compile000077500000000000000000000101351224124640700153520ustar00rootroot00000000000000#!/bin/sh # py-compile - Compile a Python program scriptversion=2009-04-28.21; # UTC # Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009 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 . # 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 or send patches to # . if [ -z "$PYTHON" ]; then PYTHON=python fi basedir= destdir= files= while test $# -ne 0; do case "$1" in --basedir) basedir=$2 if test -z "$basedir"; then echo "$0: Missing argument to --basedir." 1>&2 exit 1 fi shift ;; --destdir) destdir=$2 if test -z "$destdir"; then echo "$0: Missing argument to --destdir." 1>&2 exit 1 fi shift ;; -h|--h*) cat <<\EOF Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..." Byte compile some python scripts FILES. Use --destdir to specify any leading directory path to the FILES that you don't want to include in the byte compiled file. Specify --basedir for any additional path information you do want to be shown in the byte compiled file. Example: py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py Report bugs to . EOF exit $? ;; -v|--v*) echo "py-compile $scriptversion" exit $? ;; *) files="$files $1" ;; esac shift done if test -z "$files"; then echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 fi # if basedir was given, then it should be prepended to filenames before # byte compilation. if [ -z "$basedir" ]; then pathtrans="path = file" else pathtrans="path = os.path.join('$basedir', file)" fi # if destdir was given, then it needs to be prepended to the filename to # byte compile but not go into the compiled file. if [ -z "$destdir" ]; then filetrans="filepath = path" else filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" fi $PYTHON -c " import sys, os, py_compile files = '''$files''' sys.stdout.write('Byte-compiling python modules...\n') for file in files.split(): $pathtrans $filetrans if not os.path.exists(filepath) or not (len(filepath) >= 3 and filepath[-3:] == '.py'): continue sys.stdout.write(file) sys.stdout.flush() py_compile.compile(filepath, filepath + 'c', path) sys.stdout.write('\n')" || exit $? # this will fail for python < 1.5, but that doesn't matter ... $PYTHON -O -c " import sys, os, py_compile files = '''$files''' sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n') for file in files.split(): $pathtrans $filetrans if not os.path.exists(filepath) or not (len(filepath) >= 3 and filepath[-3:] == '.py'): continue sys.stdout.write(file) sys.stdout.flush() py_compile.compile(filepath, filepath + 'o', path) sys.stdout.write('\n')" 2>/dev/null || : # 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: saga-2.1.0+dfsg/src/000077500000000000000000000000001224124640700141355ustar00rootroot00000000000000saga-2.1.0+dfsg/src/Makefile.am000066400000000000000000000003011224124640700161630ustar00rootroot00000000000000SUBDIRS = saga_core modules modules_contrib modules_geostatistics modules_images modules_io modules_projection modules_recreations modules_simulation modules_terrain_analysis modules_lectures saga-2.1.0+dfsg/src/Makefile.in000066400000000000000000000426311224124640700162100ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = saga_core modules modules_contrib modules_geostatistics modules_images modules_io modules_projection modules_recreations modules_simulation modules_terrain_analysis modules_lectures all: all-recursive .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) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules/000077500000000000000000000000001224124640700156055ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/Makefile.am000066400000000000000000000000641224124640700176410ustar00rootroot00000000000000SUBDIRS = tin table shapes pointcloud grid climate saga-2.1.0+dfsg/src/modules/Makefile.in000066400000000000000000000424441224124640700176620ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = tin table shapes pointcloud grid climate all: all-recursive .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) --gnu src/modules/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules/climate/000077500000000000000000000000001224124640700172235ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/climate/Makefile.am000066400000000000000000000000311224124640700212510ustar00rootroot00000000000000SUBDIRS = climate_tools saga-2.1.0+dfsg/src/modules/climate/Makefile.in000066400000000000000000000424411224124640700212750ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/climate DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = climate_tools all: all-recursive .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) --gnu src/modules/climate/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/climate/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules/climate/climate_tools/000077500000000000000000000000001224124640700220615ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/climate/climate_tools/MLB_Interface.cpp000066400000000000000000000116271224124640700251660ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1383 2012-04-26 15:44:11Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // climate_tools // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Climate - Tools") ); case MLB_INFO_Author: return( SG_T("O.Conrad (c) 2012") ); case MLB_INFO_Description: return( _TL("Tools for weather and climate data.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Climate") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "grid_levels_interpolation.h" #include "milankovic.h" #include "etp_hargreave.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CGrid_Levels_to_Surface ); case 1: return( new CGrid_Levels_to_Points ); case 2: return( new CMilankovic ); case 3: return( new CMilankovic_SR_Location ); case 4: return( new CMilankovic_SR_Day_Location ); case 5: return( new CMilankovic_SR_Monthly_Global ); case 6: return( new CETP_Hargreave ); case 7: return( new CETP_Day_To_Hour ); //----------------------------------------------------- case 10: return( NULL ); default: return( MLB_INTERFACE_SKIP_MODULE ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/climate/climate_tools/MLB_Interface.h000066400000000000000000000075411224124640700246330ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // climate_tools // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__climate_tools_H #define HEADER_INCLUDED__climate_tools_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef climate_tools_EXPORTS #define climate_tools_EXPORT _SAGA_DLL_EXPORT #else #define climate_tools_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__climate_tools_H saga-2.1.0+dfsg/src/modules/climate/climate_tools/Makefile.am000066400000000000000000000013151224124640700241150ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libclimate_tools.la libclimate_tools_la_SOURCES =\ etp_hargreave.cpp\ grid_levels_interpolation.cpp\ milankovic.cpp\ MLB_Interface.cpp\ etp_hargreave.h\ grid_levels_interpolation.h\ milankovic.h\ MLB_Interface.h libclimate_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/climate/climate_tools/Makefile.in000066400000000000000000000447151224124640700241410ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/climate/climate_tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libclimate_tools_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libclimate_tools_la_OBJECTS = etp_hargreave.lo \ grid_levels_interpolation.lo milankovic.lo MLB_Interface.lo libclimate_tools_la_OBJECTS = $(am_libclimate_tools_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libclimate_tools_la_SOURCES) DIST_SOURCES = $(libclimate_tools_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libclimate_tools.la libclimate_tools_la_SOURCES = \ etp_hargreave.cpp\ grid_levels_interpolation.cpp\ milankovic.cpp\ MLB_Interface.cpp\ etp_hargreave.h\ grid_levels_interpolation.h\ milankovic.h\ MLB_Interface.h libclimate_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/climate/climate_tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/climate/climate_tools/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libclimate_tools.la: $(libclimate_tools_la_OBJECTS) $(libclimate_tools_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libclimate_tools_la_OBJECTS) $(libclimate_tools_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/etp_hargreave.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_levels_interpolation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/milankovic.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/climate/climate_tools/etp_hargreave.cpp000066400000000000000000000271731224124640700254130ustar00rootroot00000000000000/********************************************************** * Version $Id: etp_hargreave.cpp 911 2011-11-11 11:11:11Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // climate_tools // // // //-------------------------------------------------------// // // // etp_hargreave.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "etp_hargreave.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CETP_Hargreave::CETP_Hargreave(void) { CSG_Parameter *pNode; //----------------------------------------------------- // 1. Info... Set_Name (_TL("PET (after Hargreave)")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Estimation of daily potential evapotranspiration from daily average, minimum and maximum temperatures " "using Hargreave's empirical equation. In order to estimate extraterrestrial net radiation " "geographic latitude of observation and Julian day have to be supplied too. " "\nReferences:\n" "- Ambikadevi, K.M. (2004): Simulation of Evapotranspiration and Rainfall-runoff for the Stillwater River Watershed in Central Massachusetts. " "Environmental & Water Resources Engineering Masters Projects, University of Massachusetts, Amherst " "online\n" "- Hargraeves, G.H., Samani, Z.A. (1985): Reference crop evapotranspiration from ambient air temperatures. " "Paper presented in ASAE Regional Meeting, Grand Junction, Colorado. " "online\n" )); //----------------------------------------------------- // 2. Parameters... pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Data"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "JD" , _TL("Julian Day"), _TL("") ); Parameters.Add_Table_Field( pNode , "T" , _TL("Average Temperature"), _TL("") ); Parameters.Add_Table_Field( pNode , "T_MIN" , _TL("Minimum Temperature"), _TL("") ); Parameters.Add_Table_Field( pNode , "T_MAX" , _TL("Maximum Temperature"), _TL("") ); Parameters.Add_Value( pNode , "LAT" , _TL("Latitude"), _TL(""), PARAMETER_TYPE_Double, 53.0, -90.0, true, 90.0, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CETP_Hargreave::On_Execute(void) { int fJD, fT, fTmin, fTmax, fET; double sinLat, cosLat, tanLat; CSG_Table *pTable; //----------------------------------------------------- pTable = Parameters("TABLE") ->asTable(); fJD = Parameters("JD") ->asInt(); fT = Parameters("T") ->asInt(); fTmin = Parameters("T_MIN") ->asInt(); fTmax = Parameters("T_MAX") ->asInt(); sinLat = sin(Parameters("LAT") ->asDouble() * M_DEG_TO_RAD); cosLat = cos(Parameters("LAT") ->asDouble() * M_DEG_TO_RAD); tanLat = tan(Parameters("LAT") ->asDouble() * M_DEG_TO_RAD); fET = pTable->Get_Field_Count(); pTable->Add_Field(SG_T("ET"), SG_DATATYPE_Double); //----------------------------------------------------- for(int iRecord=0; iRecordGet_Count() && Set_Progress(iRecord, pTable->Get_Count()); iRecord++) { CSG_Table_Record *pRecord = pTable->Get_Record(iRecord); if( pRecord->is_NoData(fJD) || pRecord->is_NoData(fTmin) || pRecord->is_NoData(fTmax) ) { pRecord->Set_NoData(fET); } else { int JD; double T, Tmin, Tmax, dR, SunDir, SunHgt, S0, ET; JD = pRecord->asInt (fJD ); T = pRecord->asDouble(fT ); Tmin = pRecord->asDouble(fTmin); Tmax = pRecord->asDouble(fTmax); // relative distance between sun and earth on any Julian day dR = 1 + 0.033 * cos(JD * 2.0 * M_PI / 365.0); // solar declination in radians SunHgt = 0.4093 * sin(JD * 2.0 * M_PI / 365.0 - 1.405); // sunset hour angle SunDir = acos(-tanLat * tan(SunHgt)); // water equivalent of extraterrestrial radiation (mm/day) S0 = 15.392 * dR * (SunDir * sinLat * sin(SunHgt) + cosLat * cos(SunHgt) * sin(SunDir)); ET = 0.0023 * S0 * sqrt(Tmax - Tmin) * (T + 17.8); pRecord->Set_Value(fET, ET); } } //----------------------------------------------------- DataObject_Update(pTable); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CETP_Day_To_Hour::CETP_Day_To_Hour(void) { CSG_Parameter *pNode; //----------------------------------------------------- // 1. Info... Set_Name (_TL("Daily to Hourly PET")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Derive hourly from daily evapotranspiration using sinusoidal distribution. " "\nReferences:\n" "- Ambikadevi, K.M. (2004): Simulation of Evapotranspiration and Rainfall-runoff for the Stillwater River Watershed in Central Massachusetts. " "Environmental & Water Resources Engineering Masters Projects, University of Massachusetts, Amherst " "online\n" )); //----------------------------------------------------- // 2. Parameters... pNode = Parameters.Add_Table( NULL , "DAYS" , _TL("Daily Data"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "JD" , _TL("Julian Day"), _TL("") ); Parameters.Add_Table_Field( pNode , "ET" , _TL("Evapotranspiration"), _TL("") ); Parameters.Add_Table_Field( pNode , "P" , _TL("Precipitation"), _TL(""), true ); Parameters.Add_Table( NULL , "HOURS" , _TL("Hourly Data"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( pNode , "LAT" , _TL("Latitude"), _TL(""), PARAMETER_TYPE_Double, 53.0, -90.0, true, 90.0, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CETP_Day_To_Hour::On_Execute(void) { int fJD, fET, fP; double sinLat, cosLat, sinHgt; CSG_Table *pDays, *pHours; //----------------------------------------------------- pDays = Parameters("DAYS") ->asTable(); pHours = Parameters("HOURS") ->asTable(); fJD = Parameters("JD") ->asInt(); fET = Parameters("ET") ->asInt(); fP = Parameters("P") ->asInt(); sinLat = sin(Parameters("LAT") ->asDouble() * M_DEG_TO_RAD); cosLat = cos(Parameters("LAT") ->asDouble() * M_DEG_TO_RAD); sinHgt = 0.0; // -0.0145; // >> -50'' desired height of horizon pHours->Destroy(); pHours->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pDays->Get_Name(), _TL("h"))); pHours->Add_Field(SG_T("JULIAN_DAY") , SG_DATATYPE_Int); pHours->Add_Field(SG_T("HOUR") , SG_DATATYPE_Int); pHours->Add_Field(SG_T("ET") , SG_DATATYPE_Double); if( fP >= 0 ) { pHours->Add_Field(SG_T("P") , SG_DATATYPE_Double); } //----------------------------------------------------- for(int iDay=0; iDayGet_Count() && Set_Progress(iDay, pDays->Get_Count()); iDay++) { CSG_Table_Record *pDay = pDays->Get_Record(iDay); int JD; double P, ET, D, dT, fT, sRise, sSet; JD = pDay->asInt (fJD); ET = pDay->asDouble(fET); if( fP >= 0 ) { P = pDay->asDouble(fP ); } D = 0.40954 * sin(0.0172 * (JD - 79.349740)); // sun's declination dT = 12.0 * acos((sinHgt - sinLat * sin(D)) / (cosLat * cos(D))) / M_PI; fT = -0.1752 * sin(0.033430 * JD + 0.5474) - 0.1340 * sin(0.018234 * JD - 0.1939); sRise = 12.0 - dT - fT; sSet = 12.0 + dT - fT; for(int iHour=0; iHour<24; iHour++) { CSG_Table_Record *pHour = pHours->Add_Record(); pHour->Set_Value(0, JD); pHour->Set_Value(1, iHour); if( fP >= 0 ) { pHour->Set_Value(3, P / 24.0); } if( sRise <= iHour && iHour <= sSet ) { pHour->Set_Value(2, ET * (1.0 - cos(2.0 * M_PI * (iHour - sRise) / (sSet - sRise))) / 2.0); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/climate/climate_tools/etp_hargreave.h000066400000000000000000000115001224124640700250430ustar00rootroot00000000000000/********************************************************** * Version $Id: etp_hargreave.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // climate_tools // // // //-------------------------------------------------------// // // // etp_hargreave.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__etp_hargreave_H #define HEADER_INCLUDED__etp_hargreave_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CETP_Hargreave : public CSG_Module { public: CETP_Hargreave(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Evapotranspiration") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CETP_Day_To_Hour : public CSG_Module { public: CETP_Day_To_Hour(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Evapotranspiration") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__etp_hargreave_H saga-2.1.0+dfsg/src/modules/climate/climate_tools/grid_levels_interpolation.cpp000066400000000000000000000514151224124640700300410ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Level_Interpolation.cpp 1380 2012-04-26 12:02:19Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // climate_tools // // // //-------------------------------------------------------// // // // Grid_Level_Interpolation.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_levels_interpolation.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Levels_Interpolation::CGrid_Levels_Interpolation(void) { //----------------------------------------------------- Set_Author (SG_T("O.Conrad (c) 2012")); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "VARIABLE" , _TL("Variable"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Choice( NULL , "X_SOURCE" , _TL("Get Heights from ..."), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("table"), _TL("grid list") ), 1 ); Parameters.Add_Grid_List( NULL , "X_GRIDS" , _TL("Level Heights"), _TL(""), PARAMETER_INPUT_OPTIONAL ); // Parameters.Add_Grid( // NULL , "X_GRIDS_CHECK" , _TL("Minimum Height"), // _TL("if set, only values with level heights above DEM will be used"), // PARAMETER_INPUT_OPTIONAL, true // ); Parameters.Add_FixedTable( NULL , "X_TABLE" , _TL("Level Heights"), _TL("") )->asTable()->Add_Field(_TL("Height"), SG_DATATYPE_Double); Parameters.Add_Choice( NULL , "H_METHOD" , _TL("Horizontal Interpolation Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 4 ); Parameters.Add_Choice( NULL , "V_METHOD" , _TL("Vertical Interpolation Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("linear"), _TL("spline"), _TL("polynomial trend") ), 0 ); Parameters.Add_Value( NULL , "LINEAR_SORTED" , _TL("Sorted Levels"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "SPLINE_ALL" , _TL("Pre-analyze"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "TREND_ORDER" , _TL("Polynomial Order"), _TL(""), PARAMETER_TYPE_Int, 3, 1, true ); //----------------------------------------------------- for(int i=0; i<10; i++) { Parameters("X_TABLE")->asTable()->Add_Record()->Set_Value(0, i + 1); } Add_Parameters("INTERNAL", "", ""); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGrid_Levels_Interpolation::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("V_METHOD")) ) { pParameters->Get_Parameter("LINEAR_SORTED")->Set_Enabled(pParameter->asInt() == 0); pParameters->Get_Parameter("SPLINE_ALL" )->Set_Enabled(pParameter->asInt() == 1); pParameters->Get_Parameter("TREND_ORDER" )->Set_Enabled(pParameter->asInt() == 2); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("X_SOURCE")) ) { pParameters->Get_Parameter("X_TABLE" )->Set_Enabled(pParameter->asInt() == 0); pParameters->Get_Parameter("X_GRIDS" )->Set_Enabled(pParameter->asInt() == 1); // pParameters->Get_Parameter("X_GRIDS_CHECK")->Set_Enabled(pParameter->asInt() == 1); } return( 1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Levels_Interpolation::Initialize(const CSG_Rect &Extent) { //----------------------------------------------------- m_pVariables = Parameters("VARIABLE" )->asGridList(); m_pXGrids = Parameters("X_GRIDS" )->asGridList(); m_pXTable = Parameters("X_TABLE" )->asTable(); m_xSource = Parameters("X_SOURCE" )->asInt(); m_hMethod = Parameters("H_METHOD" )->asInt(); m_vMethod = Parameters("V_METHOD" )->asInt(); m_Linear_bSorted = Parameters("LINEAR_SORTED")->asBool(); m_Spline_bAll = Parameters("SPLINE_ALL" )->asBool() == false; m_Trend_Order = Parameters("TREND_ORDER" )->asInt(); //----------------------------------------------------- if( m_pVariables->Get_Count() != (m_xSource == 0 ? m_pXTable->Get_Count() : m_pXGrids->Get_Count()) ) { Error_Set(_TL("variable and height levels have to be of same number")); return( false ); } if( m_vMethod == 1 && m_pVariables->Get_Count() <= m_Trend_Order ) { Error_Set(_TL("fitting a polynom of ith order needs at least i + 1 samples")); return( false ); } if( !Extent.Intersects(Get_System()->Get_Extent(true)) ) { Error_Set(_TL("target area is distinct from levels area ")); return( false ); } //----------------------------------------------------- CSG_Grid *pHeight_Min = m_xSource == 1 && Parameters("X_GRIDS_CHECK") ? Parameters("X_GRIDS_CHECK")->asGrid() : NULL; if( pHeight_Min ) { if( !Get_Parameters("INTERNAL")->Get_Parameter("X_GRIDS") ) { Get_Parameters("INTERNAL")->Add_Grid_List(NULL, "X_GRIDS", "", "", PARAMETER_INPUT_OPTIONAL); } CSG_Parameter_Grid_List *pXGrids = Get_Parameters("INTERNAL")->Get_Parameter("X_GRIDS")->asGridList(); for(int i=0; iGet_Count(); i++) { CSG_Grid *pHeight = SG_Create_Grid(*m_pXGrids->asGrid(i)); #pragma omp parallel for for(int y=0; yasDouble(x, y) < pHeight_Min->asDouble(x, y) ) { pHeight->Set_NoData(x, y); } } } pXGrids->Add_Item(pHeight); } m_pXGrids = pXGrids; } //----------------------------------------------------- return( true ); } //--------------------------------------------------------- bool CGrid_Levels_Interpolation::Finalize(void) { if( Get_Parameters("INTERNAL")->Get_Parameter("X_GRIDS") && Get_Parameters("INTERNAL")->Get_Parameter("X_GRIDS")->asGridList() == m_pXGrids ) { for(int i=0; iGet_Count(); i++) { delete(m_pXGrids->asGrid(i)); } m_pXGrids->Del_Items(); } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline double CGrid_Levels_Interpolation::Get_Variable(double x, double y, int iLevel) { return( m_pVariables->asGrid(iLevel)->Get_Value(x, y, m_hMethod) ); } //--------------------------------------------------------- inline bool CGrid_Levels_Interpolation::Get_Variable(double x, double y, int iLevel, double &Variable) { return( m_pVariables->asGrid(iLevel)->Get_Value(x, y, Variable, m_hMethod) ); } //--------------------------------------------------------- inline double CGrid_Levels_Interpolation::Get_Height(double x, double y, int iLevel) { if( m_xSource == 0 ) { return( m_pXTable->Get_Record(iLevel)->asDouble(0) ); } return( m_pXGrids->asGrid(iLevel)->Get_Value(x, y, m_hMethod) ); } //--------------------------------------------------------- inline bool CGrid_Levels_Interpolation::Get_Height(double x, double y, int iLevel, double &Height) { if( m_xSource == 0 ) { Height = m_pXTable->Get_Record(iLevel)->asDouble(0); return( true ); } return( m_pXGrids->asGrid(iLevel)->Get_Value(x, y, Height, m_hMethod) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Levels_Interpolation::Get_Values(double x, double y, double z, int &iLevel, CSG_Table &Values) { Values.Destroy(); Values.Add_Field("h", SG_DATATYPE_Double); Values.Add_Field("v", SG_DATATYPE_Double); for(int i=0; iGet_Count(); i++) { double Height, Variable; if( Get_Height(x, y, i, Height) && Get_Variable(x, y, i, Variable) ) { CSG_Table_Record *pRecord = Values.Add_Record(); pRecord->Set_Value(0, Height); pRecord->Set_Value(1, Variable); } } if( Values.Get_Count() < 2 || !Values.Set_Index(0, TABLE_INDEX_Ascending) ) { return( false ); } for(iLevel=1; iLevel z ) { return( true ); } } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline bool CGrid_Levels_Interpolation::Get_Value(double x, double y, double z, double &Value) { switch( m_vMethod ) { default: case 0: // linear if( m_Linear_bSorted ) { return( Get_Linear_Sorted(x, y, z, Value) ); } return( Get_Linear(x, y, z, Value) ); case 1: // spline if( m_Spline_bAll ) { return( Get_Spline_All(x, y, z, Value) ); } return( Get_Spline(x, y, z, Value) ); case 2: // polynomial trend return( Get_Trend(x, y, z, Value) ); } } //--------------------------------------------------------- inline bool CGrid_Levels_Interpolation::Get_Value(const TSG_Point &p, double z, double &Value) { return( Get_Value(p.x, p.y, z, Value) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Levels_Interpolation::Get_Linear_Sorted(double x, double y, double z, double &Value) { int iLevel; for(iLevel=1; iLevelGet_Count()-1; iLevel++) { if( Get_Height(x, y, iLevel) > z ) { break; } } //----------------------------------------------------- double z0 = Get_Height(x, y, iLevel - 1); double z1 = Get_Height(x, y, iLevel ); if( z0 < z1 ) { double v0 = Get_Variable(x, y, iLevel - 1); double v1 = Get_Variable(x, y, iLevel ); Value = v0 + (z - z0) * (v1 - v0) / (z1 - z0); return( true ); } return( false ); } //--------------------------------------------------------- bool CGrid_Levels_Interpolation::Get_Linear(double x, double y, double z, double &Value) { int iLevel; CSG_Table Values; if( !Get_Values(x, y, z, iLevel, Values) ) { return( false ); } //----------------------------------------------------- double z0 = Values[iLevel - 1][0]; double z1 = Values[iLevel ][0]; if( z0 < z1 ) { double v0 = Values[iLevel - 1][1]; double v1 = Values[iLevel ][1]; Value = v0 + (z - z0) * (v1 - v0) / (z1 - z0); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Levels_Interpolation::Get_Spline_All(double x, double y, double z, double &Value) { CSG_Spline Spline; for(int i=0; iGet_Count(); i++) { double Height, Variable; if( Get_Height(x, y, i, Height) && Get_Variable(x, y, i, Variable) ) { Spline.Add(Height, Variable); } } if( Spline.Get_Value(z, Value) ) { return( true ); } return( false ); } //--------------------------------------------------------- bool CGrid_Levels_Interpolation::Get_Spline(double x, double y, double z, double &Value) { int iLevel; CSG_Table Values; if( !Get_Values(x, y, z, iLevel, Values) ) { return( false ); } if( Values.Get_Count() < 3 ) { return( Get_Linear(x, y, z, Value) ); } if( iLevel >= Values.Get_Count() - 1 ) { iLevel--; } CSG_Spline Spline; if( iLevel > 1 ) { Spline.Add(Values[iLevel - 2][0], Values[iLevel - 2][1]); } Spline.Add(Values[iLevel - 1][0], Values[iLevel - 1][1]); Spline.Add(Values[iLevel ][0], Values[iLevel ][1]); Spline.Add(Values[iLevel + 1][0], Values[iLevel + 1][1]); return( Spline.Get_Value(z, Value) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Levels_Interpolation::Get_Trend(double x, double y, double z, double &Value) { CSG_Trend_Polynom Trend; Trend.Set_Order(m_Trend_Order); for(int i=0; iGet_Count(); i++) { double Height, Variable; if( Get_Height(x, y, i, Height) && Get_Variable(x, y, i, Variable) ) { Trend.Add_Data(Height, Variable); } } if( Trend.Get_Trend() ) { Value = Trend.Get_Value(z); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Levels_to_Surface::CGrid_Levels_to_Surface(void) { //----------------------------------------------------- Set_Name (_TL("Multi Level to Surface Interpolation")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "" )); //----------------------------------------------------- CSG_Parameter *pNode = Parameters.Add_Grid_System( NULL , "SYSTEM" , _TL("Grid system"), _TL("") ); Parameters.Add_Grid( pNode , "SURFACE" , _TL("Surface"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( pNode , "RESULT" , _TL("Interpolation"), _TL(""), PARAMETER_OUTPUT ); } //--------------------------------------------------------- bool CGrid_Levels_to_Surface::On_Execute(void) { //----------------------------------------------------- CSG_Grid *pSurface = Parameters("SURFACE")->asGrid(); CSG_Grid *pResult = Parameters("RESULT" )->asGrid(); if( !(pSurface->Get_System() == pResult->Get_System()) ) { Error_Set(_TL("surface and result grids have to share the same grid system")); return( false ); } if( !Initialize(pSurface->Get_Extent()) ) { Finalize(); return( false ); } //----------------------------------------------------- for(int y=0; yGet_NY() && Set_Progress(y, pSurface->Get_NY()); y++) { double p_y = pSurface->Get_YMin() + y * pSurface->Get_Cellsize(); #pragma omp parallel for for(int x=0; xGet_NX(); x++) { double Value; if( !pSurface->is_NoData(x, y) && Get_Value(pSurface->Get_XMin() + x * pSurface->Get_Cellsize(), p_y, pSurface->asDouble(x, y), Value) ) { pResult->Set_Value(x, y, Value); } else { pResult->Set_NoData(x, y); } } } //----------------------------------------------------- Finalize(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Levels_to_Points::CGrid_Levels_to_Points(void) { //----------------------------------------------------- Set_Name (_TL("Multi Level to Points Interpolation")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "" )); //----------------------------------------------------- CSG_Parameter *pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "ZFIELD" , _TL("Height"), _TL("") ); Parameters.Add_Shapes( pNode , "RESULT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); Parameters.Add_String( NULL , "NAME" , _TL("Field Name"), _TL(""), _TL("Variable") ); } //--------------------------------------------------------- bool CGrid_Levels_to_Points::On_Execute(void) { //----------------------------------------------------- CSG_Shapes *pPoints = Parameters("POINTS")->asShapes(); if( !Initialize(pPoints->Get_Extent()) ) { Finalize(); return( false ); } //----------------------------------------------------- if( Parameters("RESULT")->asShapes() && Parameters("RESULT")->asShapes() != pPoints ) { Parameters("RESULT")->asShapes()->Create(*pPoints); pPoints = Parameters("RESULT")->asShapes(); } //----------------------------------------------------- int zField = Parameters("ZFIELD")->asInt(); int vField = pPoints->Get_Field_Count(); CSG_String Name = Parameters("NAME")->asString(); if( Name.is_Empty() ) Name = _TL("Variable"); pPoints->Add_Field(Name, SG_DATATYPE_Double); //----------------------------------------------------- // #pragma omp parallel for for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { CSG_Shape *pPoint = pPoints->Get_Shape(iPoint); double Value; if( !pPoint->is_NoData(zField) && Get_Value(pPoint->Get_Point(0), pPoint->asDouble(zField), Value) ) { pPoint->Set_Value(vField, Value); } else { pPoint->Set_NoData(vField); } } //----------------------------------------------------- if( Parameters("RESULT")->asShapes() == NULL ) { DataObject_Update(pPoints); } Finalize(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/climate/climate_tools/grid_levels_interpolation.h000066400000000000000000000140651224124640700275060ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_Levels_interpolation.h 1380 2012-04-26 12:02:19Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // climate_tools // // // //-------------------------------------------------------// // // // grid_Levels_interpolation.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_Levels_interpolation_H #define HEADER_INCLUDED__grid_Levels_interpolation_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Levels_Interpolation : public CSG_Module_Grid { public: CGrid_Levels_Interpolation(void); // virtual CSG_String Get_MenuPath (void) { return( _TL("R:Tools") ); } protected: virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); bool Initialize (const CSG_Rect &Extent); bool Finalize (void); bool Get_Value (double x, double y, double z, double &Value); bool Get_Value (const TSG_Point &p, double z, double &Value); private: bool m_Linear_bSorted, m_Spline_bAll; int m_xSource, m_hMethod, m_vMethod, m_Trend_Order; CSG_Table *m_pXTable; CSG_Parameter_Grid_List *m_pXGrids, *m_pVariables; double Get_Variable (double x, double y, int iLevel); bool Get_Variable (double x, double y, int iLevel, double &Variable); double Get_Height (double x, double y, int iLevel); bool Get_Height (double x, double y, int iLevel, double &Height); bool Get_Values (double x, double y, double z, int &iLevel, CSG_Table &Values); bool Get_Linear_Sorted (double x, double y, double z, double &Value); bool Get_Linear (double x, double y, double z, double &Value); bool Get_Spline_All (double x, double y, double z, double &Value); bool Get_Spline (double x, double y, double z, double &Value); bool Get_Trend (double x, double y, double z, double &Value); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Levels_to_Surface : public CGrid_Levels_Interpolation { public: CGrid_Levels_to_Surface(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Levels_to_Points : public CGrid_Levels_Interpolation { public: CGrid_Levels_to_Points(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_Levels_interpolation_H saga-2.1.0+dfsg/src/modules/climate/climate_tools/milankovic.cpp000066400000000000000000001156271224124640700247350ustar00rootroot00000000000000/********************************************************** * Version $Id: milankovic.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Lectures // // // //-------------------------------------------------------// // // // milankovic.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "milankovic.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define SG_NINT(x) ((int)(x < 0.0 ? x - 0.5 : x + 0.5)) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSG_Solar_Position { public: CSG_Solar_Position(void); CSG_Solar_Position(long Year); static bool Get_Orbital_Parameters (int Year, double &Eccentricity, double &Obliquity, double &Perihelion); bool Get_Orbital_Position (double Day, double &SIND, double &COSD, double &SUNDIS, double &SUNLON, double &SUNLAT, double &EQTIME); bool Set_Solar_Constant (double SolarConst); double Get_Solar_Constant (void) { return( m_SolarConst ); } bool Set_Year (int Year); int Get_Year (void) { return( m_Year ); } bool Set_Day (double Day); double Get_Day (void) { return( m_Day ); } double Get_Sun_Distance (void) { return( m_SunDist ); } double Get_Sun_Lon (void) { return( m_SunLon ); } double Get_Sun_Lat (void) { return( m_SunLat ); } double Get_Zenith (void) { return( asin(m_sinDec) ); } double Get_Daily_Radiation (double Latitude); bool Get_CosZenith (double RLAT, double SIND, double COSD, double &COSZT, double &COSZS); private: int m_Year; double m_Day; double m_Eccentricity, m_Obliquity, m_Perihelion, m_SolarConst, m_sinDec, m_cosDec, m_SunDist, m_SunLon, m_SunLat, m_EqTime; }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Solar_Position::CSG_Solar_Position(void) { m_SolarConst = 1367.0; m_Year = 2000; m_Day = 0.0; Get_Orbital_Parameters(m_Year, m_Eccentricity, m_Obliquity, m_Perihelion); Get_Orbital_Position (m_Day, m_sinDec, m_cosDec, m_SunDist, m_SunLon, m_SunLat, m_EqTime); } //--------------------------------------------------------- CSG_Solar_Position::CSG_Solar_Position(long Year) { m_SolarConst = 1367.0; m_Year = Year; m_Day = 0.0; Get_Orbital_Parameters(m_Year, m_Eccentricity, m_Obliquity, m_Perihelion); Get_Orbital_Position (m_Day, m_sinDec, m_cosDec, m_SunDist, m_SunLon, m_SunLat, m_EqTime); } //--------------------------------------------------------- bool CSG_Solar_Position::Set_Year(int Year) { if( m_Year != Year ) { m_Year = Year; return( Get_Orbital_Parameters(m_Year, m_Eccentricity, m_Obliquity, m_Perihelion) ); } return( true ); } //--------------------------------------------------------- bool CSG_Solar_Position::Set_Day(double Day) { if( m_Day != Day ) { m_Day = Day; return( Get_Orbital_Position(m_Day, m_sinDec, m_cosDec, m_SunDist, m_SunLon, m_SunLat, m_EqTime) ); } return( true ); } //--------------------------------------------------------- double CSG_Solar_Position::Get_Daily_Radiation(double Latitude) { double cosZT, cosZS; Get_CosZenith(Latitude, m_sinDec, m_cosDec, cosZT, cosZS); return( Get_Solar_Constant() * cosZT / (m_SunDist*m_SunDist) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // ORBPAR calculates the three orbital parameters as a function of // YEAR. The source of these calculations is: Andre L. Berger, // 1978, "Long-Term Variations of Daily Insolation and Quaternary // Climatic Changes", JAS, v.35, p.2362. Also useful is: Andre L. // Berger, May 1978, "A Simple Algorithm to Compute Long Term // Variations of Daily Insolation", published by Institut // D'Astronomie de Geophysique, Universite Catholique de Louvain, // Louvain-la Neuve, No. 18. // // Tables and equations refer to the first reference (JAS). The // corresponding table or equation in the second reference is // enclosed in parentheses. The coefficients used in this // subroutine are slightly more precise than those used in either // of the references. The generated orbital parameters are precise // within plus or minus 1000000 years from present. // // Input: YEAR = years A.D. are positive, B.C. are negative // Output: ECCEN = eccentricity of orbital ellipse // OBLIQ = latitude of Tropic of Cancer in radians // OMEGVP = longitude of perihelion = // = spatial angle from vernal equinox to perihelion // in radians with sun as angle vertex // //--------------------------------------------------------- bool CSG_Solar_Position::Get_Orbital_Parameters(int YEAR, double &ECCEN, double &OBLIQ, double &OMEGVP) { // Table 1 (2). Obliquity relative to mean ecliptic of date: OBLIQD const double TABLE1[47][3] = { { -2462.2214466, 31.609974, 251.9025 }, { -857.3232075, 32.620504, 280.8325 }, { -629.3231835, 24.172203, 128.3057 }, { -414.2804924, 31.983787, 292.7252 }, { -311.7632587, 44.828336, 15.3747 }, { 308.9408604, 30.973257, 263.7951 }, { -162.5533601, 43.668246, 308.4258 }, { -116.1077911, 32.246691, 240.0099 }, { 101.1189923, 30.599444, 222.9725 }, { -67.6856209, 42.681324, 268.7809 }, { 24.9079067, 43.836462, 316.7998 }, { 22.5811241, 47.439436, 319.6024 }, { -21.1648355, 63.219948, 143.8050 }, { -15.6549876, 64.230478, 172.7351 }, { 15.3936813, 1.010530, 28.9300 }, { 14.6660938, 7.437771, 123.5968 }, { -11.7273029, 55.782177, 20.2082 }, { 10.2742696, .373813, 40.8226 }, { 6.4914588, 13.218362, 123.4722 }, { 5.8539148, 62.583231, 155.6977 }, { -5.4872205, 63.593761, 184.6277 }, { -5.4290191, 76.438310, 267.2772 }, { 5.1609570, 45.815258, 55.0196 }, { 5.0786314, 8.448301, 152.5268 }, { -4.0735782, 56.792707, 49.1382 }, { 3.7227167, 49.747842, 204.6609 }, { 3.3971932, 12.058272, 56.5233 }, { -2.8347004, 75.278220, 200.3284 }, { -2.6550721, 65.241008, 201.6651 }, { -2.5717867, 64.604291, 213.5577 }, { -2.4712188, 1.647247, 17.0374 }, { 2.4625410, 7.811584, 164.4194 }, { 2.2464112, 12.207832, 94.5422 }, { -2.0755511, 63.856665, 131.9124 }, { -1.9713669, 56.155990, 61.0309 }, { -1.8813061, 77.448840, 296.2073 }, { -1.8468785, 6.801054, 135.4894 }, { 1.8186742, 62.209418, 114.8750 }, { 1.7601888, 20.656133, 247.0691 }, { -1.5428851, 48.344406, 256.6114 }, { 1.4738838, 55.145460, 32.1008 }, { -1.4593669, 69.000539, 143.6804 }, { 1.4192259, 11.071350, 16.8784 }, { -1.1818980, 74.291298, 160.6835 }, { 1.1756474, 11.047742, 27.5932 }, { -1.1316126, 0.636717, 348.1074 }, { 1.0896928, 12.844549, 82.6496 } }; // Table 4 (1). Fundamental elements of the ecliptic: ECCEN sin(pi) const double TABLE4[19][3] = { { .01860798, 4.207205, 28.620089 }, { .01627522, 7.346091, 193.788772 }, { -.01300660, 17.857263, 308.307024 }, { .00988829, 17.220546, 320.199637 }, { -.00336700, 16.846733, 279.376984 }, { .00333077, 5.199079, 87.195000 }, { -.00235400, 18.231076, 349.129677 }, { .00140015, 26.216758, 128.443387 }, { .00100700, 6.359169, 154.143880 }, { .00085700, 16.210016, 291.269597 }, { .00064990, 3.065181, 114.860583 }, { .00059900, 16.583829, 332.092251 }, { .00037800, 18.493980, 296.414411 }, { -.00033700, 6.190953, 145.769910 }, { .00027600, 18.867793, 337.237063 }, { .00018200, 17.425567, 152.092288 }, { -.00017400, 6.186001, 126.839891 }, { -.00012400, 18.417441, 210.667199 }, { .00001250, 0.667863, 72.108838 } }; // Table 5 (3). General precession in longitude: psi const double TABLE5[78][3] = { { 7391.0225890, 31.609974, 251.9025 }, { 2555.1526947, 32.620504, 280.8325 }, { 2022.7629188, 24.172203, 128.3057 }, { -1973.6517951, 0.636717, 348.1074 }, { 1240.2321818, 31.983787, 292.7252 }, { 953.8679112, 3.138886, 165.1686 }, { -931.7537108, 30.973257, 263.7951 }, { 872.3795383, 44.828336, 15.3747 }, { 606.3544732, 0.991874, 58.5749 }, { -496.0274038, 0.373813, 40.8226 }, { 456.9608039, 43.668246, 308.4258 }, { 346.9462320, 32.246691, 240.0099 }, { -305.8412902, 30.599444, 222.9725 }, { 249.6173246, 2.147012, 106.5937 }, { -199.1027200, 10.511172, 114.5182 }, { 191.0560889, 42.681324, 268.7809 }, { -175.2936572, 13.650058, 279.6869 }, { 165.9068833, 0.986922, 39.6448 }, { 161.1285917, 9.874455, 126.4108 }, { 139.7878093, 13.013341, 291.5795 }, { -133.5228399, 0.262904, 307.2848 }, { 117.0673811, 0.004952, 18.9300 }, { 104.6907281, 1.142024, 273.7596 }, { 95.3227476, 63.219948, 143.8050 }, { 86.7824524, 0.205021, 191.8927 }, { 86.0857729, 2.151964, 125.5237 }, { 70.5893698, 64.230478, 172.7351 }, { -69.9719343, 43.836462, 316.7998 }, { -62.5817473, 47.439436, 319.6024 }, { 61.5450059, 1.384343, 69.7526 }, { -57.9364011, 7.437771, 123.5968 }, { 57.1899832, 18.829299, 217.6432 }, { -57.0236109, 9.500642, 85.5882 }, { -54.2119253, 0.431696, 156.2147 }, { 53.2834147, 1.160090, 66.9489 }, { 52.1223575, 55.782177, 20.2082 }, { -49.0059908, 12.639528, 250.7568 }, { -48.3118757, 1.155138, 48.0188 }, { -45.4191685, 0.168216, 8.3739 }, { -42.2357920, 1.647247, 17.0374 }, { -34.7971099, 10.884985, 155.3409 }, { 34.4623613, 5.610937, 94.1709 }, { -33.8356643, 12.658184, 221.1120 }, { 33.6689362, 1.010530, 28.9300 }, { -31.2521586, 1.983748, 117.1498 }, { -30.8798701, 14.023871, 320.5095 }, { 28.4640769, 0.560178, 262.3602 }, { -27.1960802, 1.273434, 336.2148 }, { 27.0860736, 12.021467, 233.0046 }, { -26.3437456, 62.583231, 155.6977 }, { 24.7253740, 63.593761, 184.6277 }, { 24.6732126, 76.438310, 267.2772 }, { 24.4272733, 4.280910, 78.9281 }, { 24.0127327, 13.218362, 123.4722 }, { 21.7150294, 17.818769, 188.7132 }, { -21.5375347, 8.359495, 180.1364 }, { 18.1148363, 56.792707, 49.1382 }, { -16.9603104, 8.448301, 152.5268 }, { -16.1765215, 1.978796, 98.2198 }, { 15.5567653, 8.863925, 97.4808 }, { 15.4846529, 0.186365, 221.5376 }, { 15.2150632, 8.996212, 168.2438 }, { 14.5047426, 6.771027, 161.1199 }, { -14.3873316, 45.815258, 55.0196 }, { 13.1351419, 12.002811, 262.6495 }, { 12.8776311, 75.278220, 200.3284 }, { 11.9867234, 65.241008, 201.6651 }, { 11.9385578, 18.870667, 294.6547 }, { 11.7030822, 22.009553, 99.8233 }, { 11.6018181, 64.604291, 213.5577 }, { -11.2617293, 11.498094, 154.1631 }, { -10.4664199, 0.578834, 232.7153 }, { 10.4333970, 9.237738, 138.3034 }, { -10.2377466, 49.747842, 204.6609 }, { 10.1934446, 2.147012, 106.5938 }, { -10.1280191, 1.196895, 250.4676 }, { 10.0289441, 2.133898, 332.3345 }, { -10.0034259, 0.173168, 27.3039 } }; int YM1950 = YEAR - 1950; int i; double ARG; //----------------------------------------------------- // Obliquity from Table 1 (2): // OBLIQ# = 23.320556 (degrees) Equation 5.5 (15) // OBLIQD = OBLIQ# + sum[A cos(ft+delta)] Equation 1 (5) double SUMC = 0; for(i=0; i<47; i++) // Do 110 I=1,47 { ARG = M_DEG_TO_RAD * (YM1950 * TABLE1[i][1] / 3600 + TABLE1[i][2]); SUMC = SUMC + TABLE1[i][0] * cos(ARG); } // OBLIQD = 23.320556 + SUMC / 3600; OBLIQ = M_DEG_TO_RAD * (23.320556 + SUMC / 3600); //----------------------------------------------------- // Eccentricity from Table 4 (1): // ECCEN sin(pi) = sum[M sin(gt+beta)] Equation 4 (1) // ECCEN cos(pi) = sum[M cos(gt+beta)] Equation 4 (1) // ECCEN = ECCEN sqrt[sin(pi)^2 + cos(pi)^2] double ESINPI = 0; double ECOSPI = 0; for(i=0; i<19; i++) // Do 210 I=1,19 { ARG = M_DEG_TO_RAD * (YM1950 * TABLE4[i][1] / 3600 + TABLE4[i][2]); ESINPI = ESINPI + TABLE4[i][0] * sin(ARG); ECOSPI = ECOSPI + TABLE4[i][0] * cos(ARG); } ECCEN = sqrt(ESINPI*ESINPI + ECOSPI*ECOSPI); //----------------------------------------------------- // Perihelion from Equation 4,6,7 (9) and Table 4,5 (1,3): // PSI# = 50.439273 (seconds of degree) Equation 7.5 (16) // ZETA = 3.392506 (degrees) Equation 7.5 (17) // PSI = PSI# t + ZETA + sum[F sin(ft+delta)] Equation 7 (9) // PIE = atan[ECCEN sin(pi) / ECCEN cos(pi)] // OMEGVP = PIE + PSI + 3.14159 Equation 6 (4.5) double PIE = atan2(ESINPI, ECOSPI); double FSINFD = 0; for(i=0; i<78; i++) // Do 310 I=1,78 { ARG = M_DEG_TO_RAD * (YM1950 * TABLE5[i][1] / 3600 + TABLE5[i][2]); FSINFD = FSINFD + TABLE5[i][0] * sin(ARG); } double PSI = M_DEG_TO_RAD*(3.392506 + (YM1950 * 50.439273 + FSINFD) / 3600); OMEGVP = fmod(PIE + PSI + .5 * M_PI_360, M_PI_360); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // ORBIT receives orbital parameters and time of year, and returns // distance from Sun, declination angle, and Sun's overhead position. // Reference for following calculations is: V.M.Blanco and // S.W.McCuskey, 1961, "Basic Physics of the Solar System", pages // 135 - 151. Existence of Moon and heavenly bodies other than // Earth and Sun are ignored. Earth is assumed to be spherical. // // Program author: Gary L. Russell 2008/09/22 // Angles, longitude and latitude are measured in radians. // // Input: ECCEN = eccentricity of the orbital ellipse // OBLIQ = latitude of Tropic of Cancer // OMEGVP = longitude of perihelion (sometimes Pi is added) = // = spatial angle from vernal equinox to perihelion // with Sun as angle vertex // DAY = days measured since 2000 January 1, hour 0 // // Constants: EDAYzY = tropical year = Earth days per year = 365.2425 // VE2000 = days from 2000 January 1, hour 0 until vernal // equinox of year 2000 = 31 + 29 + 19 + 7.5/24 // // Intermediate quantities: // BSEMI = semi minor axis in units of semi major axis // PERIHE = perihelion in days since 2000 January 1, hour 0 // in its annual revolution about Sun // TA = true anomaly = spatial angle from perihelion to // current location with Sun as angle vertex // EA = eccentric anomaly = spatial angle measured along // eccentric circle (that circumscribes Earth's orbit) // from perihelion to point above (or below) Earth's // absisca (where absisca is directed from center of // eccentric circle to perihelion) // MA = mean anomaly = temporal angle from perihelion to // current time in units of 2*Pi per tropical year // TAofVE = TA(VE) = true anomaly of vernal equinox = - OMEGVP // EAofVE = EA(VE) = eccentric anomaly of vernal equinox // MAofVE = MA(VE) = mean anomaly of vernal equinox // SLNORO = longitude of Sun in Earth's nonrotating reference frame // VEQLON = longitude of Greenwich Meridion in Earth's nonrotating // reference frame at vernal equinox // ROTATE = change in longitude in Earth's nonrotating reference // frame from point's location on vernal equinox to its // current location where point is fixed on rotating Earth // SLMEAN = longitude of fictitious mean Sun in Earth's rotating // reference frame (normal longitude and latitude) // // Output: SIND = sin(SUNLAT) = sine of declination angle // COSD = cos(SUNLAT) = cosine of the declination angle // SUNDIS = distance to Sun in units of semi major axis // SUNLON = longitude of point on Earth directly beneath Sun // SUNLAT = latitude of point on Earth directly beneath Sun // EQTIME = Equation of Time = // = longitude of fictitious mean Sun minus SUNLON // // From the above reference: // (4-54): [1 - ECCEN*cos(EA)]*[1 + ECCEN*cos(TA)] = (1 - ECCEN^2) // (4-55): tan(TA/2) = sqrt[(1+ECCEN)/(1-ECCEN)]*tan(EA/2) // Yield: tan(EA) = sin(TA)*sqrt(1-ECCEN^2) / [cos(TA) + ECCEN] // or: tan(TA) = sin(EA)*sqrt(1-ECCEN^2) / [cos(EA) - ECCEN] // //--------------------------------------------------------- bool CSG_Solar_Position::Get_Orbital_Position(double DAY, double &SIND, double &COSD, double &SUNDIS, double &SUNLON, double &SUNLAT, double &EQTIME) { const double EDAYzY = 365.2425; const double VE2000 = 79.3125; double ECCEN = m_Eccentricity; double OBLIQ = m_Obliquity; double OMEGVP = m_Perihelion; //----------------------------------------------------- // Determine EAofVE from geometry: tan(EA) = b*sin(TA) / [e+cos(TA)] // Determine MAofVE from Kepler's equation: MA = EA - e*sin(EA) // Determine MA knowing time from vernal equinox to current day double BSEMI, TAofVE, EAofVE, MAofVE, MA; BSEMI = sqrt(1.0 - ECCEN*ECCEN); TAofVE = -OMEGVP; EAofVE = atan2(BSEMI*sin(TAofVE), ECCEN+cos(TAofVE)); MAofVE = EAofVE - ECCEN*sin(EAofVE); // PERIHE = VE2000 - MAofVE*EDAYzY/M_PI_360 MA = fmod(M_PI_360*(DAY-VE2000)/EDAYzY + MAofVE, M_PI_360); //----------------------------------------------------- // Numerically invert Kepler's equation: MA = EA - e*sin(EA) double dEA, EA = MA + ECCEN*(sin(MA) + ECCEN*sin(2*MA)/2); do { EA += (dEA = (MA - EA + ECCEN * sin(EA)) / (1.0 - ECCEN * cos(EA))); } while( fabs(dEA) > 0.1 ); // 1.0e-10 ); // 1d-10 ); //----------------------------------------------------- // Calculate distance to Sun and true anomaly SUNDIS = 1.0 - ECCEN * cos(EA); double TA = atan2(BSEMI * sin(EA), cos(EA) - ECCEN); //----------------------------------------------------- // Change reference frame to be nonrotating reference frame, angles // fixed according to stars, with Earth at center and positive x // axis be ray from Earth to Sun were Earth at vernal equinox, and // x-y plane be Earth's equatorial plane. Distance from current Sun // to this x axis is SUNDIS sin(TA-TAofVE). At vernal equinox, Sun // is located at (SUNDIS,0,0). At other times, Sun is located at: // // SUN = (SUNDIS cos(TA-TAofVE), // SUNDIS sin(TA-TAofVE) cos(OBLIQ), // SUNDIS sin(TA-TAofVE) sin(OBLIQ)) double SUNX, SUNY, SLNORO; SIND = sin(TA - TAofVE) * sin(OBLIQ); COSD = sqrt(1 - SIND*SIND); SUNX = cos(TA - TAofVE); SUNY = sin(TA - TAofVE) * cos(OBLIQ); SLNORO = atan2(SUNY, SUNX); //----------------------------------------------------- // Determine Sun location in Earth's rotating reference frame // (normal longitude and latitude) double VEQLON, ROTATE; VEQLON = M_PI_360 * VE2000 - M_PI_180 + MAofVE - TAofVE; // ! modulo 2*Pi; ROTATE = M_PI_360 * (DAY-VE2000)*(EDAYzY+1)/EDAYzY; SUNLON = fmod(SLNORO - ROTATE - VEQLON, M_PI_360); if( SUNLON > M_PI_180 ) SUNLON = SUNLON - M_PI_360; SUNLAT = asin(sin(TA - TAofVE) * sin(OBLIQ)); //----------------------------------------------------- // Determine longitude of fictitious mean Sun // Calculate Equation of Time double SLMEAN; SLMEAN = M_PI_180 - M_PI_360*(DAY - floor(DAY)); EQTIME = fmod(SLMEAN - SUNLON, M_PI_360); if( EQTIME > M_PI_180 ) EQTIME = EQTIME - M_PI_360; //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // COSZIJ calculates the daily average cosine of the zenith angle // weighted by time and weighted by sunlight. // // Input: RLAT = latitude (degrees) // SIND,COSD = sine and cosine of the declination angle // // Output: COSZT = sum(cosZ*dT) / sum(dT) // COSZS = sum(cosZ*cosZ*dT) / sum(cosZ*dT) // // Intern: DAWN = time of DAWN (temporal radians) at mean local time // DUSK = time of DUSK (temporal radians) at mean local time // //--------------------------------------------------------- bool CSG_Solar_Position::Get_CosZenith(double RLAT, double SIND, double COSD, double &COSZT, double &COSZS) { if( 0 ) // bDegree { RLAT *= M_DEG_TO_RAD; } double SINJ = sin(RLAT); double COSJ = cos(RLAT); double SJSD = SINJ*SIND; double CJCD = COSJ*COSD; if( SJSD+CJCD <= 0.0 ) { // Constant nightime at this latitude // DAWN = 999999; // DUSK = 999999; COSZT = 0.0; COSZS = 0.0; } else if( SJSD-CJCD >= 0.0 ) { // Constant daylight at this latitude double ECOSZ, QCOSZ; // DAWN = -999999; // DUSK = -999999; ECOSZ = SJSD*M_PI_360; QCOSZ = SJSD*ECOSZ + .5*CJCD*CJCD*M_PI_360; COSZT = SJSD; // ! = ECOSZ/M_PI_360 COSZS = QCOSZ/ECOSZ; } else { // Compute DAWN and DUSK (at local time) and their sines double CDUSK, DUSK, SDUSK, S2DUSK; CDUSK = -SJSD/CJCD; DUSK = acos(CDUSK); SDUSK = sqrt(CJCD*CJCD-SJSD*SJSD) / CJCD; S2DUSK = 2*SDUSK*CDUSK; // DAWN = -DUSK; // SDAWN = -SDUSK; // S2DAWN = -S2DUSK; // Nightime at initial and final times with daylight in between double ECOSZ, QCOSZ; ECOSZ = SJSD*(2*DUSK) + CJCD*(2*SDUSK); QCOSZ = SJSD*ECOSZ + CJCD*(SJSD*(2*SDUSK) + .5*CJCD*(2*DUSK + .5*(2*S2DUSK))); COSZT = ECOSZ/M_PI_360; COSZS = QCOSZ/ECOSZ; } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// #define DESC_SOURCE "Orbital parameters used here are based on the work of Andre L. Berger "\ "and its implementation from the NASA Goddard Institute for Space Studies (GISS). "\ "Berger's orbital parameters are considered to be valid for approximately 1 million years.\n"\ "References:\n"\ "- Berger, A.L. (1978): Long Term Variations of Daily Insolation and Quaternary Climatic Changes. Journal of the Atmospheric Sciences, volume 35(12), 2362-2367.\n"\ "- Berger, A.L. (1978): A Simple Algorithm to Compute Long Term Variations of Daily or Monthly Insolation. Institut d'Astronomie et de Geophysique, Universite Catholique de Louvain, Louvain-la-Neuve, No. 18.\n"\ "- NASA/GISS' implementation can be found as part of an Atmosphere-Ocean Model at "\ "Determination of the Earth's Orbital Parameters" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CMilankovic::CMilankovic(void) { //----------------------------------------------------- Set_Name (_TL("Earth's Orbital Parameters")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( DESC_SOURCE )); //----------------------------------------------------- Parameters.Add_Table( NULL, "ORBPAR" , _TL("Earth's Orbital Parameters"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL, "START" , _TL("Start [ka]"), _TL(""), PARAMETER_TYPE_Double, -200 ); Parameters.Add_Value( NULL, "STOP" , _TL("Stop [ka]"), _TL(""), PARAMETER_TYPE_Double, 2 ); Parameters.Add_Value( NULL, "STEP" , _TL("Step [ka]"), _TL(""), PARAMETER_TYPE_Double, 1, 0.001, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CMilankovic::On_Execute(void) { //----------------------------------------------------- int Start = (int)(Parameters("START")->asDouble() * 1000.0); int Stop = (int)(Parameters("STOP" )->asDouble() * 1000.0); int Step = (int)(Parameters("STEP" )->asDouble() * 1000.0); CSG_Table *pOrbit = Parameters("ORBPAR")->asTable(); pOrbit->Destroy(); pOrbit->Set_Name(_TL("Earth's Orbital Parameters")); pOrbit->Set_NoData_Value(-9999999); pOrbit->Add_Field(_TL("Year") , SG_DATATYPE_Int); pOrbit->Add_Field(_TL("Eccentricity") , SG_DATATYPE_Double); pOrbit->Add_Field(_TL("Obliquity") , SG_DATATYPE_Double); pOrbit->Add_Field(_TL("Perihelion") , SG_DATATYPE_Double); pOrbit->Add_Field(_TL("Climatic Precession"), SG_DATATYPE_Double); //----------------------------------------------------- for(int year=Start; year<=Stop && Set_Progress(year - Start, Stop - Start); year+=Step) { double eccentricity, obliquity, perihelion; if( CSG_Solar_Position::Get_Orbital_Parameters(year, eccentricity, obliquity, perihelion) ) { CSG_Table_Record *pRecord = pOrbit->Add_Record(); pRecord->Set_Value(0, year); pRecord->Set_Value(1, eccentricity); pRecord->Set_Value(2, obliquity); pRecord->Set_Value(3, perihelion); pRecord->Set_Value(4, -eccentricity * sin(perihelion)); } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CMilankovic_SR_Location::CMilankovic_SR_Location(void) { //----------------------------------------------------- Set_Name (_TL("Annual Course of Daily Insolation")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( DESC_SOURCE )); //----------------------------------------------------- Parameters.Add_Table( NULL , "SOLARRAD" , _TL("Solar Radiation"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "START" , _TL("Start [ka]"), _TL(""), PARAMETER_TYPE_Double, -200 ); Parameters.Add_Value( NULL , "STOP" , _TL("Stop [ka]"), _TL(""), PARAMETER_TYPE_Double, 2 ); Parameters.Add_Value( NULL , "STEP" , _TL("Step [ka]"), _TL(""), PARAMETER_TYPE_Double, 1, 0.001, true ); Parameters.Add_Value( NULL , "LAT" , _TL("Latitude [Degree]"), _TL(""), PARAMETER_TYPE_Double, 53.0, -90.0, true, 90.0, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CMilankovic_SR_Location::On_Execute(void) { //----------------------------------------------------- int Start = (int)(Parameters("START")->asDouble() * 1000.0); int Stop = (int)(Parameters("STOP" )->asDouble() * 1000.0); int Step = (int)(Parameters("STEP" )->asDouble() * 1000.0); double Lat = Parameters("LAT")->asDouble() * M_DEG_TO_RAD; CSG_Table *pRadiation = Parameters("SOLARRAD")->asTable(); pRadiation->Destroy(); pRadiation->Set_Name(_TL("Annual Course of Daily Insolation")); pRadiation->Set_NoData_Value(-9999999); pRadiation->Add_Field(_TL("Day") , SG_DATATYPE_Int); pRadiation->Add_Field(_TL("Zenith") , SG_DATATYPE_Double); pRadiation->Add_Field(_TL("Culmination"), SG_DATATYPE_Double); pRadiation->Add_Field(_TL("Radiation") , SG_DATATYPE_Double); //----------------------------------------------------- for(int year=Start; year<=Stop && Set_Progress(year - Start, Stop - Start); year+=Step) { Process_Set_Text(CSG_String::Format(SG_T("%s: %d"), _TL("Year"), year)); CSG_Solar_Position Position(year); pRadiation->Del_Records(); for(int day=1; day<=365 && Process_Get_Okay(); day++) { if( Position.Set_Day(day) ) { CSG_Table_Record *pRecord = pRadiation->Add_Record(); pRecord->Set_Value(0, day); pRecord->Set_Value(1, Position.Get_Zenith() * M_RAD_TO_DEG); pRecord->Set_Value(2, 90 - fabs(Lat - Position.Get_Zenith()) * M_RAD_TO_DEG); pRecord->Set_Value(3, Position.Get_Daily_Radiation(Lat)); } } DataObject_Update(pRadiation); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CMilankovic_SR_Day_Location::CMilankovic_SR_Day_Location(void) { //----------------------------------------------------- Set_Name (_TL("Daily Insolation over Latitude")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( DESC_SOURCE )); //----------------------------------------------------- Parameters.Add_Table( NULL , "SOLARRAD" , _TL("Solar Radiation"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "START" , _TL("Start [ka]"), _TL(""), PARAMETER_TYPE_Double, -200 ); Parameters.Add_Value( NULL , "STOP" , _TL("Stop [ka]"), _TL(""), PARAMETER_TYPE_Double, 2 ); Parameters.Add_Value( NULL , "STEP" , _TL("Step [ka]"), _TL(""), PARAMETER_TYPE_Double, 1, 0.001, true ); Parameters.Add_Value( NULL , "DLAT" , _TL("Latitude Increment [Degree]"), _TL(""), PARAMETER_TYPE_Int, 5, 1, true, 90, true ); Parameters.Add_Value( NULL , "DAY" , _TL("Day of Year"), _TL(""), PARAMETER_TYPE_Int, 181, 0, true, 366, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CMilankovic_SR_Day_Location::On_Execute(void) { int iLat, nLat; //----------------------------------------------------- int Start = (int)(Parameters("START")->asDouble() * 1000.0); int Stop = (int)(Parameters("STOP" )->asDouble() * 1000.0); int Step = (int)(Parameters("STEP" )->asDouble() * 1000.0); int Day = Parameters("DAY")->asInt(); double dLat = Parameters("DLAT")->asDouble() * M_DEG_TO_RAD; CSG_Table *pRadiation = Parameters("SOLARRAD")->asTable(); pRadiation->Destroy(); pRadiation->Set_NoData_Value(-9999999); pRadiation->Add_Field(_TL("Year") , SG_DATATYPE_Int); nLat = (int)(M_PI_180 / dLat); for(iLat=0; iLat<=nLat; iLat++) { pRadiation->Add_Field(CSG_String::Format(SG_T("LAT_%.1f"), -90.0 + iLat * M_RAD_TO_DEG * dLat), SG_DATATYPE_Double); } //----------------------------------------------------- for(int year=Start; year<=Stop && Set_Progress(year - Start, Stop - Start); year+=Step) { Process_Set_Text(CSG_String::Format(SG_T("%s: %d"), _TL("Year"), year)); CSG_Solar_Position Position(year); double sinDec, cosDec, Distance, SunLon, SunLat, EqTime, cosZT, cosZS; if( Position.Get_Orbital_Position(Day, sinDec, cosDec, Distance, SunLon, SunLat, EqTime) ) { CSG_Table_Record *pRecord = pRadiation->Add_Record(); pRecord->Set_Value(0, year); for(iLat=0; iLat<=nLat; iLat++) { Position.Get_CosZenith(-M_PI_090 + iLat * dLat, sinDec, cosDec, cosZT, cosZS); pRecord->Set_Value(1 + iLat, 1367 * cosZT / (Distance*Distance)); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CMilankovic_SR_Monthly_Global::CMilankovic_SR_Monthly_Global(void) { //----------------------------------------------------- Set_Name (_TL("Monthly Global by Latitude")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( DESC_SOURCE )); //----------------------------------------------------- Parameters.Add_Table( NULL , "SOLARRAD" , _TL("Solar Radiation"), _TL(""), PARAMETER_OUTPUT ); CSG_Parameter *pNode = Parameters.Add_Table( NULL , "ALBEDO" , _TL("Albedo"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Field"), _TL("") ); Parameters.Add_Value( NULL , "YEAR" , _TL("Year [ka]"), _TL(""), PARAMETER_TYPE_Double, 2 ); Parameters.Add_Value( NULL , "DLAT" , _TL("Latitude Increment [Degree]"), _TL(""), PARAMETER_TYPE_Int, 5, 1, true, 90, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CMilankovic_SR_Monthly_Global::On_Execute(void) { const int nDays[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; const char *Month[12] = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" }; int iMonth, iDay, aDay, bDay, iLat, Lat; //----------------------------------------------------- int Year = (int)(Parameters("YEAR")->asDouble() * 1000.0); int dLat = Parameters("DLAT")->asInt(); CSG_Matrix SR(12, 181); CSG_Vector SRYear(181), SRGlobal(12), Area(181); // , Albedo(181); //----------------------------------------------------- CSG_Table *pAlbedo = Parameters("ALBEDO")->asTable(); int fAlbedo = Parameters("FIELD") ->asInt(); if( pAlbedo && pAlbedo->Get_Record_Count() != 181 ) { Message_Add(_TL("warning: albedo is ignored")); pAlbedo = NULL; } //----------------------------------------------------- for(iLat=0, Lat=-90; iLat<=180; iLat++, Lat++) { double LATN = iLat == 180 ? M_PI / 2.0 : (Lat + 0.5) * M_DEG_TO_RAD; double LATS = iLat == 0 ? -M_PI / 2.0 : (Lat - 0.5) * M_DEG_TO_RAD; Area[iLat] = 0.5 * (sin(LATN) - sin(LATS)); } //----------------------------------------------------- CSG_Solar_Position Position(Year); for(iMonth=0, bDay=1; iMonth<12; iMonth++) { aDay = bDay; bDay += nDays[iMonth]; for(iDay=aDay; iDayGet_Record(iLat)->asDouble(fAlbedo)); } SR[iLat][iMonth] += s; } } for(iLat=0; iLat<=180; iLat++) { SR[iLat][iMonth] /= nDays[iMonth]; SRGlobal[iMonth] += SR[iLat][iMonth] * Area[iLat]; SRYear[iLat] += SR[iLat][iMonth]; } } //----------------------------------------------------- CSG_Table *pRadiation = Parameters("SOLARRAD")->asTable(); CSG_Table_Record *pRecord; pRadiation->Destroy(); pRadiation->Set_Name(CSG_String::Format(SG_T("%s [%d]"), _TL("Global Irradiation"), Year)); pRadiation->Set_NoData_Value(-9999999); pRadiation->Add_Field(_TL("Lat"), SG_DATATYPE_String); for(iMonth=0; iMonth<12; iMonth++) { pRadiation->Add_Field(Month[iMonth], SG_DATATYPE_Double); } pRadiation->Add_Field(_TL("Annual"), SG_DATATYPE_Double); for(iLat=0, Lat=-90; iLat<=180; iLat+=dLat, Lat+=dLat) { pRecord = pRadiation->Add_Record(); pRecord->Set_Value(0, Lat); for(iMonth=0; iMonth<12; iMonth++) { pRecord->Set_Value(1 + iMonth, SR[iLat][iMonth]); } pRecord->Set_Value(1 + 12, SRYear[iLat] / 12.0); } pRecord = pRadiation->Add_Record(); pRecord->Set_Value(0, SG_T("global")); double SRGLAN = 0.0; for(iMonth=0; iMonth<12; iMonth++) { pRecord->Set_Value(1 + iMonth, SRGlobal[iMonth]); SRGLAN += SRGlobal[iMonth]; } pRecord->Set_Value(1 + 12, SRGLAN / 12.0); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/climate/climate_tools/milankovic.h000066400000000000000000000134151224124640700243720ustar00rootroot00000000000000/********************************************************** * Version $Id: milankovic.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Lectures // // // //-------------------------------------------------------// // // // milankovic.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__milankovic_H #define HEADER_INCLUDED__milankovic_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CMilankovic : public CSG_Module { public: CMilankovic(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Earth's Orbital Parameters") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CMilankovic_SR_Location : public CSG_Module { public: CMilankovic_SR_Location(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Earth's Orbital Parameters") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CMilankovic_SR_Day_Location : public CSG_Module { public: CMilankovic_SR_Day_Location(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Earth's Orbital Parameters") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CMilankovic_SR_Monthly_Global : public CSG_Module { public: CMilankovic_SR_Monthly_Global(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Earth's Orbital Parameters") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__milankovic_H saga-2.1.0+dfsg/src/modules/grid/000077500000000000000000000000001224124640700165325ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/grid/Makefile.am000066400000000000000000000001751224124640700205710ustar00rootroot00000000000000SUBDIRS = grid_visualisation grid_tools grid_spline grid_gridding grid_filter grid_calculus grid_calculus_bsl grid_analysis saga-2.1.0+dfsg/src/modules/grid/Makefile.in000066400000000000000000000425741224124640700206130ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/grid DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = grid_visualisation grid_tools grid_spline grid_gridding grid_filter grid_calculus grid_calculus_bsl grid_analysis all: all-recursive .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) --gnu src/modules/grid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/grid/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules/grid/grid_analysis/000077500000000000000000000000001224124640700213625ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Cost_Anisotropic.cpp000066400000000000000000000123401224124640700253500ustar00rootroot00000000000000/********************************************************** * Version $Id: Cost_Anisotropic.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* Cost_Anisotropic.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Cost_Anisotropic.h" #define NO_DATA -1. CCost_Anisotropic::CCost_Anisotropic(void) { Set_Name(_TL("Accumulated Cost (Anisotropic)")); Set_Author(_TL("Copyrights (c) 2004 by Victor Olaya")); Set_Description (_TW( "(c) 2004 by Victor Olaya. Calculate Accumulated Cost (Anisotropic)" )); Parameters.Add_Grid(NULL, "COST", _TL("Cost Grid"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "DIRECTION", _TL("Direction of max cost"), _TL("Direction of max cost for each cell. In degrees"), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "POINTS", _TL("Destination Points"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "ACCCOST", _TL("Accumulated Cost"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Double); Parameters.Add_Value(NULL, "K", _TL("k factor"), _TL("Efective friction = stated friction ^f , where f = cos(DifAngle)^k."), PARAMETER_TYPE_Double, 2); Parameters.Add_Value(NULL, "THRESHOLD", _TL("Threshold for different route"), _TL(""), PARAMETER_TYPE_Double, 0.); } CCost_Anisotropic::~CCost_Anisotropic(void) {} bool CCost_Anisotropic::On_Execute(void) { m_pAccCostGrid = Parameters("ACCCOST")->asGrid(); m_pCostGrid = Parameters("COST")->asGrid(); m_pPointsGrid = Parameters("POINTS")->asGrid(); m_pDirectionGrid = Parameters("DIRECTION")->asGrid(); m_dK = Parameters("K")->asDouble(); m_dThreshold = Parameters("THRESHOLD")->asDouble(); m_pAccCostGrid->Assign(NO_DATA); m_CentralPoints.Clear(); m_AdjPoints.Clear(); m_CentralPoints.Clear(); for(int y=0; yis_NoData(x,y)){ m_CentralPoints.Add(x,y); m_pAccCostGrid->Set_Value(x,y,0.0); }//if }//for }//for CalculateCost(); m_pAccCostGrid->Set_NoData_Value(NO_DATA); return true; }//method void CCost_Anisotropic::CalculateCost(){ double dCost=0;; int iX,iY; int iUsedCells=0; int iTotalCells=Get_NX()*Get_NY(); while (m_CentralPoints.Get_Count()!=0){ for (int iPt=0; iPtis_InGrid(iX+i,iY+j)){ if (m_pCostGrid->is_NoData(iX,iY) || m_pCostGrid->is_NoData(iX+i,iY+j)){ }//if else{ double dPartialCost=CalculateCostInDirection(iX,iY,i,j); dCost = m_pAccCostGrid->asDouble(iX,iY) + dPartialCost* M_GET_LENGTH(i, j); if (m_pAccCostGrid->asDouble(iX+i,iY+j)==NO_DATA){ iUsedCells++; m_pAccCostGrid->Set_Value(iX+i,iY+j,dCost); m_AdjPoints.Add(iX+i,iY+j); }//if else if (m_pAccCostGrid->asDouble(iX+i,iY+j)> dCost + m_dThreshold){ m_pAccCostGrid->Set_Value(iX+i,iY+j,dCost); m_AdjPoints.Add(iX+i,iY+j); }//if }//else }//if }// for }// for }//for m_CentralPoints.Clear(); for (int i=0; iasDouble(iX,iY)-dAngle); double dDifAngle2 = fabs(m_pDirectionGrid->asDouble(iX+iH,iY+iV)-dAngle); dDifAngle1 = dDifAngle1/360.0 * 2.0 * PI; dDifAngle2 = dDifAngle2/360.0 * 2.0 * PI; double dCost1 = pow(cos(dDifAngle1),m_dK)/2; double dCost2 = pow(cos(dDifAngle2),m_dK)/2; return dCost1+dCost2; }//method saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Cost_Anisotropic.h000066400000000000000000000035461224124640700250250ustar00rootroot00000000000000/********************************************************** * Version $Id: Cost_Anisotropic.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Cost_Anisotropic.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #ifndef HEADER_INCLUDED__Cost_Anisotropic_H #define HEADER_INCLUDED__Cost_Anisotropic_H #include "MLB_Interface.h" class CCost_Anisotropic : public CSG_Module_Grid { public: CCost_Anisotropic(void); virtual ~CCost_Anisotropic(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Cost Analysis") ); } protected: bool On_Execute (void); private: double m_dK; double m_dThreshold; CSG_Points_Int m_CentralPoints; CSG_Points_Int m_AdjPoints; CSG_Grid *m_pCostGrid; CSG_Grid *m_pDirectionGrid; CSG_Grid *m_pPointsGrid; CSG_Grid *m_pAccCostGrid; void CalculateCost (void); double CalculateCostInDirection (int,int,int,int); }; #endif // #ifndef HEADER_INCLUDED__Cost_Anisotropic_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Cost_Isotropic.cpp000066400000000000000000000111701224124640700250310ustar00rootroot00000000000000/********************************************************** * Version $Id: Cost_Isotropic.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* Cost_Isotropic.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Cost_Isotropic.h" #define NO_DATA -1. CCost_Isotropic::CCost_Isotropic(void) { Set_Name (_TL("Accumulated Cost (Isotropic)")); Set_Author (_TL("Copyrights (c) 2004 by Victor Olaya")); Set_Description (_TW( "(c) 2004 by Victor Olaya. Calculate Accumulated Cost (Isotropic)")); Parameters.Add_Grid(NULL, "COST", _TL("Cost Grid"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "POINTS", _TL("Destination Points"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "ACCCOST", _TL("Accumulated Cost"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Double); Parameters.Add_Grid(NULL, "CLOSESTPT", _TL("Closest Point"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Int); Parameters.Add_Value(NULL, "THRESHOLD", _TL("Threshold for different route"), _TL(""), PARAMETER_TYPE_Double, 0.); } CCost_Isotropic::~CCost_Isotropic(void) {} bool CCost_Isotropic::On_Execute(void) { int iPoint = 1; m_dThreshold = Parameters("THRESHOLD")->asDouble(); m_pAccCostGrid = Parameters("ACCCOST")->asGrid(); m_pCostGrid = Parameters("COST")->asGrid(); m_pClosestPtGrid = Parameters("CLOSESTPT")->asGrid(); m_pPointsGrid = Parameters("POINTS")->asGrid(); m_pAccCostGrid->Assign(NO_DATA); m_pClosestPtGrid->Assign(NO_DATA); m_pAccCostGrid->Set_NoData_Value(NO_DATA); m_pClosestPtGrid->Set_NoData_Value(NO_DATA); m_CentralPoints.Clear(); m_AdjPoints.Clear(); m_CentralPoints.Clear(); for(int y=0; yis_NoData(x,y)){ m_CentralPoints.Add(x,y,iPoint); m_pAccCostGrid->Set_Value(x,y,0.0); m_pClosestPtGrid->Set_Value(x,y,iPoint); iPoint++; }//if }//for }//for CalculateCost(); return true; }//method void CCost_Isotropic::CalculateCost(){ double dCost=0; int iPoint; int iX,iY; int iUsedCells=0; int iTotalCells=Get_NX()*Get_NY(); while (m_CentralPoints.Get_Count()!=0){ for (int iPt=0; iPtis_InGrid(iX+i,iY+j)){ if (m_pCostGrid->is_NoData(iX,iY) || m_pCostGrid->is_NoData(iX+i,iY+j)){ }//if else{ double dPartialCost=(m_pCostGrid->asDouble(iX,iY)+m_pCostGrid->asDouble(iX+i,iY+j))/2.0; dCost = m_pAccCostGrid->asDouble(iX,iY) + dPartialCost * M_GET_LENGTH(i, j); if (m_pAccCostGrid->asDouble(iX+i,iY+j)==NO_DATA || m_pAccCostGrid->asDouble(iX+i,iY+j)>dCost + m_dThreshold){ m_pAccCostGrid->Set_Value(iX+i,iY+j,dCost); m_pClosestPtGrid->Set_Value(iX+i,iY+j,iPoint); m_AdjPoints.Add(iX+i,iY+j,iPoint); iUsedCells++; }//if }//else }//if }// for }// for }//for m_CentralPoints.Clear(); for (int i=0; iasGridList(); CSG_Grid *pResult = Parameters("RESULT") ->asGrid(); pResult->Assign(0.0); for(int y=0; yGet_Count() && !bNoData; i++, j++) { if( pGrids->asGrid(i)->is_NoData(x, y) || pGrids->asGrid(j)->is_NoData(x, y) ) { bNoData = true; } else { dDifSum += fabs(pGrids->asGrid(i)->asDouble(x, y) - pGrids->asGrid(j)->asDouble(x, y)); } }//for if( bNoData ) { pResult->Set_NoData(x, y); } else { pResult->Set_Value(x, y, dDifSum); } }//for }//for return true; } saga-2.1.0+dfsg/src/modules/grid/grid_analysis/CoveredDistance.h000066400000000000000000000025071224124640700246010ustar00rootroot00000000000000/********************************************************** * Version $Id: CoveredDistance.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CoveredDistance.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CCoveredDistance : public CSG_Module_Grid { public: CCoveredDistance(void); protected: virtual bool On_Execute(void); };saga-2.1.0+dfsg/src/modules/grid/grid_analysis/CrossClassification.cpp000066400000000000000000000077101224124640700260400ustar00rootroot00000000000000/********************************************************** * Version $Id: CrossClassification.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CrossClassification.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "CrossClassification.h" CCrossClassification::CCrossClassification(void){ Parameters.Set_Name(_TL("Cross-Classification and Tabulation")); Parameters.Set_Description(_TW( "(c) 2004 by Victor Olaya. Cross-Classification and Tabulation")); Parameters.Add_Grid(NULL, "INPUT", _TL("Input Grid 1"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "INPUT2", _TL("Input Grid 2"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RESULTGRID", _TL("Cross-Classification Grid"), _TL(""), PARAMETER_OUTPUT); Parameters.Add_Table(NULL, "RESULTTABLE", _TL("Cross-Tabulation Table"), _TL(""), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "MAXNUMCLASS", _TL("Max. Number of Classes"), _TL("Maximum number of classes in the entire grid."), PARAMETER_TYPE_Int, 10); }//constructor CCrossClassification::~CCrossClassification(void){} bool CCrossClassification::On_Execute(void){ CSG_Grid* pInput = Parameters("INPUT")->asGrid(); CSG_Grid* pInput2 = Parameters("INPUT2")->asGrid(); CSG_Grid* pOutput = Parameters("RESULTGRID")->asGrid(); CSG_Table* pTable = Parameters("RESULTTABLE")->asTable(); CSG_Table_Record* pRecord; int iNumClasses = Parameters("MAXNUMCLASS")->asInt(); int iClass, iClass2; int iNewClass; int i,j; int x,y; int **pTabulation = new int* [iNumClasses]; int *pTotal, iTotal; pTable->Create((CSG_Table*)NULL); pTable->Set_Name(_TL("Cross-Tabulation")); for (i = 0; i < iNumClasses; i++){ pTable->Add_Field(SG_Get_String(i+1,0).c_str(), SG_DATATYPE_Int); pTabulation[i] = new int[iNumClasses]; for(j=0; j < iNumClasses; j++){ pTabulation[i][j] = 0; }//for }//for pTable->Add_Field(_TL("Total"), SG_DATATYPE_Int); for(y=0; yis_NoData(x,y) && !pInput2->is_NoData(x,y)){ iClass = pInput->asInt(x,y)-1; iClass2 = pInput2->asInt(x,y)-1; if (iClass < iNumClasses && iClass >= 0 && iClass2 < iNumClasses && iClass2 >= 0){ pTabulation[iClass][iClass2]++; }//if iNewClass = iClass * iNumClasses + iClass2; pOutput->Set_Value(x,y,iNewClass); }//if }//for }//for pTotal = new int[iNumClasses]; for(i=0; iAdd_Record(); iTotal = 0; for(j=0; jSet_Value(j, pTabulation[i][j]); iTotal += pTabulation[i][j]; pTotal[j] += pTabulation[i][j]; }//for pRecord->Set_Value(j, iTotal); }//for pRecord = pTable->Add_Record(); for(i=0; iSet_Value(i, pTotal[i]); }//for for (i = 0; i < iNumClasses; i++){ delete [] pTabulation[i]; }//for delete [] pTabulation; delete [] pTotal; return true; }//methodsaga-2.1.0+dfsg/src/modules/grid/grid_analysis/CrossClassification.h000066400000000000000000000026071224124640700255050ustar00rootroot00000000000000/********************************************************** * Version $Id: CrossClassification.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CrossClassification.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CCrossClassification : public CSG_Module_Grid { public: CCrossClassification(void); virtual ~CCrossClassification(void); private: protected: virtual bool On_Execute(void); };saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_AHP.cpp000066400000000000000000000074601224124640700234520ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_AHP.cpp 1407 2012-05-24 06:55:09Z manfred-e $ *********************************************************/ /******************************************************************************* AHP.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Grid_AHP.h" CAHP::CAHP(void){ Parameters.Set_Name(_TL("Analytical Hierarchy Process")); Parameters.Set_Description(_TW( "(c) 2004 by Victor Olaya. Analytical Hierarchy Process")); Parameters.Add_Grid_List(NULL, "GRIDS", _TL("Input Grids"), _TL("Input Grids"), PARAMETER_INPUT); Parameters.Add_Table(NULL, "TABLE", _TL("Pairwise Comparisons Table "), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "OUTPUT", _TL("Output Grid"), _TL(""), PARAMETER_OUTPUT); }//constructor CAHP::~CAHP(void){} bool CAHP::On_Execute(void){ int i,j; int x,y; float *pCoefs; float fValue; float **pMatrix; float fSum; CSG_Grid *pOutputGrid; CSG_Grid **pGrids; CSG_Table_Record *pRecord; CSG_Table *pTable; CSG_Parameter_Grid_List* pGridsList; CSG_String sMessage; pTable = Parameters("TABLE")->asTable(); pOutputGrid = Parameters("OUTPUT")->asGrid(); if( (pGridsList = (CSG_Parameter_Grid_List *)Parameters("GRIDS")->Get_Data()) != NULL && pGridsList->Get_Count() > 0 ){ if (pTable->Get_Field_Count() != pGridsList->Get_Count() || pTable->Get_Record_Count() < pGridsList->Get_Count()){ Message_Add(_TL("Error : Wrong table. Check table dimensions")); return false; }//if pMatrix = new float*[pGridsList->Get_Count()]; for (i = 0; iGet_Count(); i++){ pMatrix[i] = new float[pGridsList->Get_Count()]; pRecord = pTable->Get_Record(i); for (j = 0; jGet_Count(); j++){ pMatrix[i][j] = pRecord->asFloat(j); }//for }//for for (i = 0; iGet_Count(); i++){ fSum = 0; for (j = 0; jGet_Count(); j++){ fSum += pMatrix[j][i]; }//for for (j = 0; jGet_Count(); j++){ pMatrix[j][i] /= fSum; }//for }//for pCoefs = new float[pGridsList->Get_Count()]; for (i = 0; iGet_Count(); i++){ fSum = 0; for (j = 0; jGet_Count(); j++){ fSum += pMatrix[i][j]; }//for pCoefs[i] = fSum / (float) pGridsList->Get_Count(); sMessage = _TL("Weight for grid ") + SG_Get_String(i,0) + " = " + SG_Get_String(pCoefs[i]); Message_Add(sMessage.c_str()); }//for pGrids = new CSG_Grid* [pGridsList->Get_Count()]; for (i = 0; iGet_Count(); i++){ pGrids[i] = pGridsList->asGrid(i); }//for for(y=0; yGet_Count(); i++){ fValue += pCoefs[i] * pGrids[i]->asFloat(x,y); }//for pOutputGrid->Set_Value(x,y,fValue); }//for }//for delete[] pCoefs; }//if for (i = 0; iGet_Count(); i++){ delete [] pMatrix[i]; }//for delete []pMatrix; return true; }//method saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_AHP.h000066400000000000000000000024741224124640700231170ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_AHP.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* AHP.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CAHP : public CSG_Module_Grid { public: CAHP(void); virtual ~CAHP(void); private: protected: virtual bool On_Execute(void); };saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.cpp000066400000000000000000000332221224124640700275110ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Accumulation_Functions.cpp 1458 2012-08-15 16:23:30Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // AccumulationFunctions.cpp // // // // Copyright (C) 2009 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Accumulation_Functions.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //----------------------------------------------------------- CGrid_Accumulation_Functions::CGrid_Accumulation_Functions(void) { Parameters.Set_Name(_TL("Accumulation Functions")); Set_Author(SG_T("Copyrights (c) 2009 by Volker Wichmann")); Parameters.Set_Description(_TW( "Provides \"accumulation functions\" that can be used to e.g. move material over a \"local " "drain direction\" (LDD) network. The LDD net is computed for the supplied surface by MFD " "and D8 flow-routing algorithms. It is possible to switch from MFD to D8 as soon as a " "threshold is exceeded.\n" "The input to each cell on the grid can be supplied from e.g. time series and the material " "can be moved over the net in several ways. All of these, except the \"accuflux\" operation, " "compute both the flux and the state for a given cell. For time series modelling (batch " "processing), the state of each cell at time t can be initialized with the previous state t - 1.\n" "The capacity, fraction, threshold and trigger operations compute the fluxes and cell states " "at time t + 1 according to cell-specific parameters that control the way the flux is computed. " "The capacity function limits the cell-to-cell flux by a (channel) capacity control; the fraction " "function transports only a given proportion of material from cell to cell, the threshold " "function transports material only once a given threshold has been exceeded, and the trigger " "function transports nothing until a trigger value has been exceeded (at which point all " "accumulated material in the state of the cell is discharged to its downstream neighbour(s)).\n\n" "The following operations are supported:\n\n" "\t* ACCUFLUX: The accuflux function computes the new state of the attributes for the cell " "as the sum of the input cell values plus the cumulative sum of all upstream elements " "draining through the cell.\n\n" "\t* ACCUCAPACITYFLUX / STATE: The operation modifies the accumulation of flow over the " "network by a limiting transport capacity given in absolute values.\n\n" "\t* ACCUFRACTIONFLUX / STATE: The operation limits the flow over the network by a " "parameter which controls the proportion (0-1) of the material that can flow through each cell.\n\n" "\t* ACCUTHRESHOLDFLUX / STATE: The operation modifies the accummulation of flow over " "the network by limiting transport to values greater than a minimum threshold value " "per cell. No flow occurs if the threshold is not exceeded.\n\n" "\t* ACCUTRIGGERFLUX / STATE: The operation only allows transport (flux) to occur if " "a trigger value is exceeded, otherwise no transport occurs and storage accumulates.\n\n" "References:\n" "BURROUGH, P.A. (1998): Dynamic Modelling and Geocomputation.- In: LONGLEY, P.A., BROOKS, S.M., " "MCDONNELL, R. & B. MACMILLAN [Eds.]: Geocomputation: A Primer. John Wiley & Sons, pp. 165-191.\r\n" )); Parameters.Add_Grid( NULL, "SURFACE", _TL("Surface"), _TL("Surface used to derive the LDD network, e.g. a DTM."), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "INPUT", _TL("Input"), _TL("Grid with the input values to accumulate."), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "STATE_IN", _TL("State t"), _TL("Grid describing the state of each cell at timestep t."), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "CONTROL", _TL("Operation Control"), _TL("Depending on mode of operation either transport capacity, transport fraction, threshold value or trigger value."), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( Parameters("LINEAR"), "CTRL_LINEAR", _TL("Linear Flow Control Grid"), _TL("The values of this grid are checked against the linear flow threshold to decide on the flow-routing algorithm."), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "FLUX", _TL("Flux"), _TL("Flux out of each cell, i.e. everything accumulated so far."), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL, "STATE_OUT", _TL("State t + 1"), _TL("Grid describing the state of each cell at timestep t + 1."), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL, "OPERATION", _TL("Operation"), _TL("Select a mode of operation"), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("accuflux"), _TL("accucapacityflux / state"), _TL("accufractionflux / state"), _TL("accuthresholdflux / state"), _TL("accutriggerflux / state") ), 0 ); Parameters.Add_Value( NULL, "LINEAR", _TL("Switch to Linear Flow"), _TL("Switch from MFD8 to D8 if linear flow threshold is crossed."), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( Parameters("LINEAR"), "THRES_LINEAR", _TL("Threshold Linear Flow"), _TL("Threshold for linear flow, if exceeded D8 is used."), PARAMETER_TYPE_Double, 0.0 ); } //--------------------------------------------------------- CGrid_Accumulation_Functions::~CGrid_Accumulation_Functions(void) { } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// bool CGrid_Accumulation_Functions::On_Execute(void) { CSG_Grid *pSurface, *pInput, *pFlux, *pControl, *pStateIn, *pStateOut, *pLinearCtrl; int x, y, ix, iy; double z, d, dz[8], dzSum, gradient, maxGrad, thresLinear; const double Convergence = 1.1; // convergence factor MFD after FREEMAN (1991) int steepestN; int operation; bool bLinearFlow; double flux, d_flux, control, state, linearCtrl; pSurface = Parameters("SURFACE")->asGrid(); pInput = Parameters("INPUT")->asGrid(); pStateIn = Parameters("STATE_IN")->asGrid(); pStateOut = Parameters("STATE_OUT")->asGrid(); pControl = Parameters("CONTROL")->asGrid(); pFlux = Parameters("FLUX")->asGrid(); pLinearCtrl = Parameters("CTRL_LINEAR")->asGrid(); operation = Parameters("OPERATION")->asInt(); bLinearFlow = Parameters("LINEAR")->asBool(); thresLinear = Parameters("THRES_LINEAR")->asDouble(); if( operation != 0 && pControl == NULL ) { Message_Add(CSG_String::Format(_TL("You need to specify a operation control grid as input!\n"))); return (false); } if( pStateIn == NULL ) pFlux->Assign(0.0); else pFlux->Assign(pStateIn); if( operation != 0 && pStateOut == NULL ) { pStateOut = SG_Create_Grid(pInput, SG_DATATYPE_Double); Parameters("STATE_OUT")->Set_Value(pStateOut); pStateOut->Set_Name(SG_T("State (t)")); } for(long n=0; nGet_Sorted(n, x, y, true); if( pSurface->is_NoData(x, y) || pInput->is_NoData(x, y) || (operation != 0 && pControl->is_NoData(x, y)) ) { pFlux->Set_NoData(x, y); if( pStateOut != NULL ) pStateOut->Set_NoData(x, y); } else { if( operation != 0 ) control = pControl->asDouble(x, y); flux = pInput->asDouble(x, y) + pFlux->asDouble(x, y); switch(operation) { case 0: // accuflux default: break; case 1: // accucapacityflux/state if( flux > control ) { state = flux - control; flux = control; } else state = 0.0; break; case 2: // accufractionflux/state state = flux * (1.0 - control); flux *= control; break; case 3: // accuthresholdflux/state if( flux > control ) { state = control; flux -= control; } else { state = flux; flux = 0.0; } break; case 4: // accutriggerflux/state if( flux > control ) state = 0.0; else { state = flux; flux = 0.0; } break; } z = pSurface->asDouble(x, y); dzSum = 0.0; maxGrad = 0.0; bool bBorder = false; // get successor cells //----------------------------------------------------- if( pLinearCtrl != NULL ) linearCtrl = pLinearCtrl->asDouble(x, y); else linearCtrl = flux; for(int i=0; i<8; i++) { ix = Get_xTo(i, x); iy = Get_yTo(i, y); if( is_InGrid(ix, iy) ) { if( !pSurface->is_NoData(ix, iy) && (d = pSurface->asDouble(ix, iy)) < z ) { if( bLinearFlow && linearCtrl > thresLinear ) // D8 { dzSum = (z - d) / Get_Length(i); if( maxGrad < dzSum ) { maxGrad = dzSum; steepestN = i; } } else // MFD Freeman 1991 { gradient = (z - d) / Get_Length(i); dzSum += (dz[i] = pow(gradient, Convergence)); } } else { dz[i] = 0.0; } } else bBorder = true; } // routing //----------------------------------------------------- if( dzSum > 0.0 && !bBorder ) { if( bLinearFlow && linearCtrl > thresLinear ) { ix = Get_xTo(steepestN, x); iy = Get_yTo(steepestN, y); pFlux->Add_Value(ix, iy, flux); } else { d_flux = flux / dzSum; for(int i=0; i<8; i++) { if( dz[i] > 0.0 ) { ix = Get_xTo(i, x); iy = Get_yTo(i, y); pFlux->Add_Value(ix, iy, d_flux * dz[i]); } } } } pFlux->Set_Value(x, y, flux); if( operation != 0 ) pStateOut->Set_Value(x, y, state); }// NoData }// for DataObject_Set_Colors(pFlux, 100, SG_COLORS_WHITE_BLUE); if( pStateOut != NULL ) DataObject_Set_Colors(pStateOut, 100, SG_COLORS_WHITE_RED); //----------------------------------------------------- return( true ); } //--------------------------------------------------------- int CGrid_Accumulation_Functions::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("OPERATION")) ) { int iValue = pParameter->asInt(); pParameters->Get_Parameter("CONTROL")->Set_Enabled(iValue > 0); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("LINEAR")) ) { bool bValue = pParameter->asBool(); pParameters->Get_Parameter("THRES_LINEAR" )->Set_Enabled(bValue); pParameters->Get_Parameter("CTRL_LINEAR" )->Set_Enabled(bValue); } //----------------------------------------------------- return (1); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_Accumulation_Functions.h000066400000000000000000000104451224124640700271600ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Accumulation_Functions.h 1457 2012-08-15 16:08:39Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // Grid_Accumulation_Functions.h // // // // Copyright (C) 2009 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Accumulation_Functions_H #define HEADER_INCLUDED__Grid_Accumulation_Functions_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //--------------------------------------------------------- class CGrid_Accumulation_Functions : public CSG_Module_Grid { public: CGrid_Accumulation_Functions(void); virtual ~CGrid_Accumulation_Functions(void); protected: virtual bool On_Execute(void); virtual int On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Accumulation_Functions_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_AggregationIndex.cpp000066400000000000000000000101041224124640700262460ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_AggregationIndex.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* AggregationIndex.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Grid_AggregationIndex.h" CAggregationIndex::CAggregationIndex(void){ Set_Name (_TL("Aggregation Index")); Set_Description (_TW( "(c) 2004 by Victor Olaya. Aggregation Index\r\n" "References:\r\n" "1. Hong S. He, et al. An aggregation index to quantify spatial patterns of landscapes, Landscape Ecology 15, 591-601,2000\r\n" )); Parameters.Add_Grid(NULL, "INPUT", _TL("Input Grid"), _TL(""), PARAMETER_INPUT); Parameters.Add_Value(NULL, "MAXNUMCLASS", _TL("Max. Number of Classes"), _TL("Maximum number of classes in the entire grid."), PARAMETER_TYPE_Int, 10); Parameters.Add_Table(NULL, "RESULT", _TL("Result"), _TL(""), PARAMETER_OUTPUT); }//constructor CAggregationIndex::~CAggregationIndex(void){} bool CAggregationIndex::On_Execute(void){ int i; int iClass; int iXOffset[] = {-1,0,0,1}; int iYOffset[] = {0,-1,1,0}; int iTotalArea = 0; int iLargestInt; int iMaxEii; int iRemainder; int iNumClasses = Parameters("MAXNUMCLASS")->asInt(); CSG_Grid* pInput = Parameters("INPUT")->asGrid(); CSG_Table* pTable = Parameters("RESULT")->asTable(); CSG_Table_Record* pRecord; float** pData = new float*[iNumClasses]; for (i = 0; i < iNumClasses; i++){ pData[i] = new float[2]; pData[i][0] = 0; pData[i][1] = 0; }//for pTable->Create((CSG_Table*)NULL); pTable->Set_Name(_TL("Aggregation Index")); pTable->Add_Field(_TL("Class"), SG_DATATYPE_Int); pTable->Add_Field(_TL("Area"), SG_DATATYPE_Double); pTable->Add_Field(_TL("Area[%]"), SG_DATATYPE_Double); pTable->Add_Field(_TL("Aggregation Index"), SG_DATATYPE_Double); for(int y=1; yis_NoData(x,y)){ iClass = pInput->asInt(x,y); if (iClass <= iNumClasses && iClass > 0){ iTotalArea++; pData[iClass-1][0]++; for (i=0; i<4; i++){ if (pInput->asInt(x + iXOffset[i],y + iYOffset[i]) == iClass){ pData[iClass-1][1]++; }//if }//for }//if }//if }//for }//for for(i=0; iAdd_Record(); pRecord->Set_Value(0, i + 1); pRecord->Set_Value(1, pData[i][0]); if (pData[i][0]){ pRecord->Set_Value(2, (float) pData[i][0] / (float) iTotalArea * 100.0); iLargestInt = (int) floor(sqrt(pData[i][0])); iRemainder = (int) (pData[i][0] - (iLargestInt * iLargestInt)); if (iRemainder){ if (iRemainder < iLargestInt){ iMaxEii = 2 * iLargestInt * (iLargestInt - 1) + 2 * iRemainder - 1; }//if else{ iMaxEii = 2 * iLargestInt * (iLargestInt - 1) + 2 * iRemainder - 2; }//else }//if else{ iMaxEii = 2 * iLargestInt * (iLargestInt - 1); }//else pRecord->Set_Value(3, (float) pData[i][1] / (float) iMaxEii / 2.0); }//if else{ pRecord->Set_Value(2, 0.0); pRecord->Set_Value(3, 0.0); }//else }//for for (i = 0; i < iNumClasses; i++){ delete [] pData[i]; }//for delete [] pData; return true; }//method saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_AggregationIndex.h000066400000000000000000000025751224124640700257300ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_AggregationIndex.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* AggregationIndex.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CAggregationIndex : public CSG_Module_Grid { public: CAggregationIndex(void); virtual ~CAggregationIndex(void); private: protected: virtual bool On_Execute(void); };saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_CVA.cpp000066400000000000000000000205431224124640700234500ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_CVA.cpp 1594 2013-01-25 14:15:15Z oconrad $ *********************************************************/ /******************************************************************************* Grid_CVA.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_CVA.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_CVA::CGrid_CVA(void) { Set_Name (_TL("Change Vector Analysis")); Set_Author (SG_T("V.Olaya (c) 2004, O.Conrad (c) 2012")); Set_Description (_TW( "This module performs a change vector analysis (CVA) for the given input features. " "Input features are supplied as grid lists for initial and final state. " "In both lists features have to be given in the same order. " "Distance is measured as Euclidean distance in features space. When analyzing two features " "direction is calculated as angle (radians) by default. Otherwise direction is coded as " "the quadrant it points to in terms of feature space. " )); Parameters.Add_Grid_List( NULL , "A" , _TL("Initial State"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "B" , _TL("Final State"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "DIST" , _TL("Distance"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "DIR" , _TL("Direction"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "ANGLE" , _TL("Angle Calculation"), _TL("angle calculation is only available when exact two features are compared"), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( NULL , "C_OUT" , _TL("Output of Change Vector"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Grid_List( NULL , "C" , _TL("Change Vector"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGrid_CVA::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("A")) || !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("B")) ) { pParameters->Get_Parameter("ANGLE")->Set_Enabled( pParameters->Get_Parameter("A")->asInt() == 2 && pParameters->Get_Parameter("B")->asInt() == 2 ); } //----------------------------------------------------- return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_CVA::On_Execute(void) { //----------------------------------------------------- CSG_Parameter_Grid_List *pA = Parameters("A")->asGridList(); CSG_Parameter_Grid_List *pB = Parameters("B")->asGridList(); CSG_Parameter_Grid_List *pC = Parameters("C")->asGridList(); if( pA->Get_Count() != pB->Get_Count() ) { Error_Set(_TL("number of initial and final state grids differs")); return( false ); } if( pA->Get_Count() == 0 ) { Error_Set(_TL("no grids in list")); return( false ); } //----------------------------------------------------- int n = pA->Get_Count(); bool bAngle = Parameters("ANGLE")->asBool() && n == 2; bool bC_Out = Parameters("C_OUT")->asBool(); CSG_Grid *pDist = Parameters("DIST")->asGrid(); CSG_Grid *pDir = Parameters("DIR" )->asGrid(); //----------------------------------------------------- pC->Del_Items(); if( bC_Out ) { for(int i=0; iSet_Name(CSG_String::Format(SG_T("%s %01d"), _TL("Change Vector"), i + 1)); pC->Add_Item(pGrid); } } //----------------------------------------------------- CSG_Parameter *pLUT; CSG_Colors Colors; Colors.Set_Count(100); Colors.Set_Ramp(SG_GET_RGB(255, 255, 255), SG_GET_RGB( 0, 127, 127), 0, Colors.Get_Count() / 2); Colors.Set_Ramp(SG_GET_RGB( 0, 127, 127), SG_GET_RGB(255, 0, 0), Colors.Get_Count() / 2, Colors.Get_Count()); DataObject_Set_Colors(pDist, Colors); if( (pLUT = DataObject_Get_Parameter(pDir, "LUT")) == NULL || pLUT->asTable() == NULL || bAngle ) { Colors.Set_Default(100); Colors.Set_Ramp_Brighness(255, 0, 0, Colors.Get_Count() / 2); Colors.Set_Ramp_Brighness( 0, 255, Colors.Get_Count() / 2, Colors.Get_Count()); DataObject_Set_Colors(pDir, Colors); DataObject_Set_Parameter(pDir, "COLORS_TYPE", 2); } else { pLUT->asTable()->Del_Records(); for(int i=0, nClasses=(int)pow(2.0, n); iasTable()->Add_Record(); pClass->Set_Value(1, s); pClass->Set_Value(3, i); pClass->Set_Value(4, i); } Colors.Set_Count(pLUT->asTable()->Get_Count()); Colors.Random(); for(int c=0; casTable()->Get_Count(); c++) { pLUT->asTable()->Get_Record(c)->Set_Value(0, Colors.Get_Color(c)); } DataObject_Set_Parameter(pDir, pLUT); DataObject_Set_Parameter(pDir, "COLORS_TYPE", 1); // Color Classification Type: Lookup Table } //----------------------------------------------------- for(int y=0; yasGrid(i)->is_NoData(x, y) || pB->asGrid(i)->is_NoData(x, y) ) { bOkay = false; } else { v[i] = pB->asGrid(i)->asDouble(x, y) - pA->asGrid(i)->asDouble(x, y); } } //--------------------------------------------- if( bOkay ) { if( bAngle ) { d = atan2(v[0], v[1]); } else for(i=0, j=1, d=0.0; i= 0.0 ) { d += j; } } pDist->Set_Value(x, y, v.Get_Length()); pDir ->Set_Value(x, y, d); for(i=0; iasGrid(i)->Set_Value(x, y, v[i]); } } //--------------------------------------------- else { pDist->Set_NoData(x, y); pDir ->Set_NoData(x, y); for(i=0; iasGrid(i)->Set_NoData(x, y); } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_CVA.h000066400000000000000000000057101224124640700231140ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_CVA.h 1346 2012-03-08 17:08:55Z oconrad $ *********************************************************/ /******************************************************************************* Grid_CVA.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_CVA_H #define HEADER_INCLUDED__Grid_CVA_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_CVA : public CSG_Module_Grid { public: CGrid_CVA(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Imagery|Tools") ); } protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_CVA_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_IMCORR.cpp000066400000000000000000001265531224124640700240420ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_IMCORR.cpp 1597 2013-01-28 17:02:55Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid analysis // // // //-------------------------------------------------------// // // // Grid_IMCORR.cpp // // // // Copyright (C) 2012 by // // Magnus Bremer // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: magnus.bremer@uibk.ac.at // // // // contact: Magnus Bremer // // Institute of Geography // // University of Innsbruck // // Innrain 52 // // 6020 Innsbruck // // Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_IMCORR.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// /* This implementation is based on the original FORTRAN code available from . This implementation extends the functionality by introducing the possibility to derive 3D displacement vectors once DTM datasets are provided. */ //--------------------------------------------------------- CGrid_IMCORR::CGrid_IMCORR(void) { Set_Name (_TL("IMCORR - Feature Tracking")); Set_Author (SG_T("Magnus Bremer (c) 2012")); Set_Description (_TW( "The module performs an image correlation " "based on two raster data sets.\n" "Additionally, two DTMs can be given and used to optain 3D displacement vectors.\n\n" "This is a SAGA implementation of the standalone " "IMCORR software provided by the " "National Snow and Ice Data Center in Boulder, Colorado / US.\n\n" "The standalone software and documentation is available from:\n" "http://nsidc.org/data/velmap/imcorr.html\n\n" "References:\n" "Scambos, T. A., Dutkiewicz, M. J., Wilson, J. C., and R. A. Bindschadler (1992): " "Application of image cross-correlation to the measurement of glacier velocity " "using satellite image data. Remote Sensing Environ., 42(3), 177-186.\n\n" "Fahnestock, M. A., Scambos, T.A., and R. A. Bindschadler (1992): " "Semi-automated ice velocity determination from satellite imagery. Eos, 73, 493.\n\n" )); Parameters.Add_Grid( NULL , "GRID_1", _TL("Grid 1"), _TL("The first grid to correlate"), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "GRID_2" , _TL("Grid 2"), _TL("The second grid to correlate"), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "DTM_1", _TL("DTM 1"), _TL("The first DTM used to assign height information to grid 1"), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL , "DTM_2" , _TL("DTM 2"), _TL("The second DTM used to assign height information to grid 2"), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Shapes( NULL, "CORRPOINTS" , _TL("Correlated Points"), _TL("Correlated points with displacement and correlation information"), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL, "CORRLINES" , _TL("Displacement Vector"), _TL("Displacement vectors between correlated points"), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); Parameters.Add_Choice( NULL , "SEARCH_CHIPSIZE" , _TL("Search Chip Size (Cells)"), _TL("Chip size of search chip, used to find correlating reference chip"), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("16x16"), _TL("32x32"), _TL("64x64"), _TL("128x128"), _TL("256x256") ), 2 ); Parameters.Add_Choice( NULL , "REF_CHIPSIZE" , _TL("Reference Chip Size (Cells)"), _TL("Chip size of reference chip to be found in search chip"), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("16x16"), _TL("32x32"), _TL("64x64"), _TL("128x128") ), 1 ); Parameters.Add_Value( NULL , "GRID_SPACING" , _TL("Grid Spacing (Map Units)"), _TL("Grid spacing used for the construction of correlated points [map units]"), PARAMETER_TYPE_Double, 10.0, 0.1, true, 256.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_IMCORR::On_Execute(void) { CSG_Grid *pGrid1, *pGrid2, *pDTM1, *pDTM2; CSG_Shapes *pCorrPts, *pCorrLines; CSG_Shape *pCorrPt, *pCorrLine; int Search_Chipsize, Ref_Chipsize, Grid_Spacing; double SpacingMetrics; pGrid1 = Parameters("GRID_1")->asGrid(); pGrid2 = Parameters("GRID_2")->asGrid(); pDTM1 = Parameters("DTM_1")->asGrid(); pDTM2 = Parameters("DTM_2")->asGrid(); pCorrPts = Parameters("CORRPOINTS")->asShapes(); pCorrLines = Parameters("CORRLINES")->asShapes(); Search_Chipsize = Parameters("SEARCH_CHIPSIZE")->asInt(); Ref_Chipsize = Parameters("REF_CHIPSIZE")->asInt(); SpacingMetrics = Parameters("GRID_SPACING")->asDouble(); Search_Chipsize = (int)(pow(2.0,4+Search_Chipsize)); Ref_Chipsize = (int)(pow(2.0,4+Ref_Chipsize)); if (Search_Chipsize < Ref_Chipsize) Search_Chipsize = Ref_Chipsize; CSG_String Message = CSG_String::Format(_TL("Search chip size set to %d"), Search_Chipsize); SG_UI_Msg_Add(Message,true); Message = CSG_String::Format(_TL("Reference chip size set to %d"), Ref_Chipsize); SG_UI_Msg_Add(Message,true); if (pDTM1 == NULL || pDTM2 == NULL) { CSG_String name = CSG_String::Format(_TL("%s_CORRPOINTS"), pGrid1->Get_Name()); pCorrPts->Create(SHAPE_TYPE_Point, name.c_str(), pCorrPts); pCorrPts->Add_Field(SG_T("ID"), SG_DATATYPE_Int); pCorrPts->Add_Field(SG_T("GX"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("GY"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("REALX"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("REALY"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("DISP"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("STRENGTH"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("FLAG"), SG_DATATYPE_Int); pCorrPts->Add_Field(SG_T("XDISP"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("YDISP"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("XDISP_UNIT"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("YDISP_UNIT"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("XTARG"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("YTARG"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("XERR"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("YERR"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("ASPECT"), SG_DATATYPE_Double); CSG_String name2 = CSG_String::Format(_TL("%s_DISP_VEC"), pGrid1->Get_Name()); pCorrLines->Create(SHAPE_TYPE_Line, name2.c_str(), pCorrLines); pCorrLines->Add_Field(SG_T("ID"), SG_DATATYPE_Int); pCorrLines->Add_Field(SG_T("GX"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("GY"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("REALX"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("REALY"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("DISP"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("STRENGTH"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("FLAG"), SG_DATATYPE_Int); pCorrLines->Add_Field(SG_T("XDISP"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("YDISP"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("XDISP_UNIT"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("YDISP_UNIT"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("XTARG"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("YTARG"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("XERR"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("YERR"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("ASPECT"), SG_DATATYPE_Double); } else // If DTM is given the Output gets 3D { CSG_String name = CSG_String::Format(_TL("%s_CORRPOINTS"), pGrid1->Get_Name()); pCorrPts->Create(SHAPE_TYPE_Point, name.c_str(), pCorrPts, SG_VERTEX_TYPE_XYZ); pCorrPts->Add_Field(SG_T("ID"), SG_DATATYPE_Int); pCorrPts->Add_Field(SG_T("GX"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("GY"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("REALX"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("REALY"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("REALZ"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("DISP"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("DISP_REAL"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("STRENGTH"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("FLAG"), SG_DATATYPE_Int); pCorrPts->Add_Field(SG_T("XDISP"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("YDISP"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("ZDISP"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("XDISP_UNIT"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("YDISP_UNIT"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("XTARG"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("YTARG"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("ZTARG"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("XERR"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("YERR"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("ASPECT"), SG_DATATYPE_Double); pCorrPts->Add_Field(SG_T("SLOPE"), SG_DATATYPE_Double); CSG_String name2 = CSG_String::Format(_TL("%s_DISP_VEC"), pGrid1->Get_Name()); pCorrLines->Create(SHAPE_TYPE_Line, name2.c_str(), pCorrLines, SG_VERTEX_TYPE_XYZ); pCorrLines->Add_Field(SG_T("ID"), SG_DATATYPE_Int); pCorrLines->Add_Field(SG_T("GX"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("GY"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("REALX"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("REALY"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("REALZ"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("DISP"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("DISP_REAL"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("STRENGTH"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("FLAG"), SG_DATATYPE_Int); pCorrLines->Add_Field(SG_T("XDISP"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("YDISP"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("ZDISP"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("XDISP_UNIT"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("YDISP_UNIT"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("XTARG"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("YTARG"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("ZTARG"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("XERR"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("YERR"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("ASPECT"), SG_DATATYPE_Double); pCorrLines->Add_Field(SG_T("SLOPE"), SG_DATATYPE_Double); } // create containers std::vector > SearchChip; SearchChip.resize(Search_Chipsize); for(int i = 0; i < Search_Chipsize; i++) SearchChip[i].resize(Search_Chipsize); std::vector > RefChip; RefChip.resize(Ref_Chipsize); for(int i = 0; i < Ref_Chipsize; i++) RefChip[i].resize(Ref_Chipsize); // defaults for values; double mincorr = 2.0; int fitmeth = 1, okparam = 1; double maxdis = -1.0; std::vectorioffrq,nomoff; nomoff.push_back(0.0); nomoff.push_back((Search_Chipsize-Ref_Chipsize)*0.5); nomoff.push_back((Search_Chipsize-Ref_Chipsize)*0.5); ioffrq.push_back(0.0); ioffrq.push_back(Search_Chipsize/2); ioffrq.push_back(Search_Chipsize/2); double disp=0.0; double strength=0.0; std::vectorbest_fit, est_err; Grid_Spacing = (int)(SpacingMetrics / (pGrid1->Get_Cellsize())); // enshures that chips are always in grid int ID = 0; for(int gx1 = (Search_Chipsize/2-1); gx1 < pGrid1->Get_NX()-(Search_Chipsize/2) && Set_Progress(gx1, pGrid1->Get_NX()-(Search_Chipsize/2)); gx1 += Grid_Spacing) { for(int gy1 = (Search_Chipsize/2-1); gy1 < pGrid1->Get_NY()-(Search_Chipsize/2); gy1 += Grid_Spacing) { // get ref_chip Get_This_Chip(RefChip, pGrid1, gx1, gy1, Ref_Chipsize); // get search chip Get_This_Chip(SearchChip, pGrid2, gx1, gy1, Search_Chipsize); gcorr(SearchChip, RefChip, mincorr, fitmeth, maxdis, ioffrq, nomoff, okparam, strength, best_fit, est_err, disp); if (okparam ==1) { disp = sqrt(best_fit[1]*best_fit[1] + best_fit[2]*best_fit[2]); double DirNormX = best_fit[2]/disp; double DirNormY = best_fit[1]/disp; double Aspect; if((DirNormY > 0.0 && DirNormX > 0)) Aspect = (atan(fabs(DirNormX)/fabs(DirNormY)))*M_RAD_TO_DEG; else if ((DirNormY <= 0.0 && DirNormX > 0)) Aspect = 90+((atan(fabs(DirNormY)/fabs(DirNormX)))*M_RAD_TO_DEG); else if ((DirNormY <= 0.0 && DirNormX <= 0)) Aspect = 180+((atan(fabs(DirNormX)/fabs(DirNormY)))*M_RAD_TO_DEG); else Aspect = 270+((atan(fabs(DirNormY)/fabs(DirNormX)))*M_RAD_TO_DEG); double xReal = pGrid1->Get_System().Get_xGrid_to_World(gx1); double yReal = pGrid1->Get_System().Get_yGrid_to_World(gy1); double xReal2 = pGrid1->Get_System().Get_xGrid_to_World(gx1+(int)(best_fit[2])); double yReal2 = pGrid1->Get_System().Get_yGrid_to_World(gy1+(int)(best_fit[1])); if (pDTM1 == NULL || pDTM2 == NULL) { pCorrPt = pCorrPts->Add_Shape(); pCorrPt->Add_Point(xReal, yReal); pCorrPt->Set_Value(0, ID); pCorrPt->Set_Value(1, gx1); pCorrPt->Set_Value(2, gy1); pCorrPt->Set_Value(3, xReal); pCorrPt->Set_Value(4, yReal); pCorrPt->Set_Value(5, disp); pCorrPt->Set_Value(6,strength); pCorrPt->Set_Value(7, okparam); pCorrPt->Set_Value(8, best_fit[2]); pCorrPt->Set_Value(9, best_fit[1]); pCorrPt->Set_Value(10, DirNormX); pCorrPt->Set_Value(11, DirNormY); pCorrPt->Set_Value(12, xReal2); pCorrPt->Set_Value(13, yReal2); pCorrPt->Set_Value(14, est_err[2]); pCorrPt->Set_Value(15, est_err[1]); pCorrPt->Set_Value(16, Aspect); pCorrLine = pCorrLines->Add_Shape(); pCorrLine->Add_Point(xReal, yReal); pCorrLine->Add_Point(xReal2, yReal2); pCorrLine->Set_Value(0, ID); pCorrLine->Set_Value(1, gx1); pCorrLine->Set_Value(2, gy1); pCorrLine->Set_Value(3, xReal); pCorrLine->Set_Value(4, yReal); pCorrLine->Set_Value(5, disp); pCorrLine->Set_Value(6,strength); pCorrLine->Set_Value(7, okparam); pCorrLine->Set_Value(8, best_fit[2]); pCorrLine->Set_Value(9, best_fit[1]); pCorrLine->Set_Value(10, DirNormX); pCorrLine->Set_Value(11, DirNormY); pCorrLine->Set_Value(12, xReal2); pCorrLine->Set_Value(13, yReal2); pCorrLine->Set_Value(14, est_err[2]); pCorrLine->Set_Value(15, est_err[1]); pCorrLine->Set_Value(16, Aspect); } else { double zReal2 = pDTM2->asDouble(gx1+(int)(best_fit[2]), gy1+(int)(best_fit[1])); double zReal = pDTM1->asDouble(gx1, gy1); double Slope = (atan((zReal2-zReal)/fabs(disp)))*M_RAD_TO_DEG; double dispReal = sqrt(pow(zReal2-zReal,2) + disp*disp); pCorrPt = pCorrPts->Add_Shape(); pCorrPt->Add_Point(xReal,yReal); pCorrPt->Set_Z(zReal,ID,0); pCorrPt->Set_Value(0, ID); pCorrPt->Set_Value(1, gx1); pCorrPt->Set_Value(2, gy1); pCorrPt->Set_Value(3, xReal); pCorrPt->Set_Value(4, yReal); pCorrPt->Set_Value(5, zReal); pCorrPt->Set_Value(6, disp); pCorrPt->Set_Value(7, dispReal); pCorrPt->Set_Value(8,strength); pCorrPt->Set_Value(9, okparam); pCorrPt->Set_Value(10, best_fit[2]); pCorrPt->Set_Value(11, best_fit[1]); pCorrPt->Set_Value(12, zReal2-zReal); pCorrPt->Set_Value(13, DirNormX); pCorrPt->Set_Value(14, DirNormY); pCorrPt->Set_Value(15, xReal2); pCorrPt->Set_Value(16, yReal2); pCorrPt->Set_Value(17, zReal2); pCorrPt->Set_Value(18, est_err[2]); pCorrPt->Set_Value(19, est_err[1]); pCorrPt->Set_Value(20, Aspect); pCorrPt->Set_Value(21, Slope); pCorrLine = pCorrLines->Add_Shape(); pCorrLine->Add_Point(xReal, yReal); pCorrLine->Set_Z(zReal,0,0); pCorrLine->Add_Point(xReal2, yReal2); pCorrLine->Set_Z(zReal2,1,0); pCorrLine->Set_Value(0, ID); pCorrLine->Set_Value(1, gx1); pCorrLine->Set_Value(2, gy1); pCorrLine->Set_Value(3, xReal); pCorrLine->Set_Value(4, yReal); pCorrLine->Set_Value(5, zReal); pCorrLine->Set_Value(6, disp); pCorrLine->Set_Value(7, dispReal); pCorrLine->Set_Value(8,strength); pCorrLine->Set_Value(9, okparam); pCorrLine->Set_Value(10, best_fit[2]); pCorrLine->Set_Value(11, best_fit[1]); pCorrLine->Set_Value(12, zReal2-zReal); pCorrLine->Set_Value(13, DirNormX); pCorrLine->Set_Value(14, DirNormY); pCorrLine->Set_Value(15, xReal2); pCorrLine->Set_Value(16, yReal2); pCorrLine->Set_Value(17, zReal2); pCorrLine->Set_Value(18, est_err[2]); pCorrLine->Set_Value(19, est_err[1]); pCorrLine->Set_Value(20, Aspect); pCorrLine->Set_Value(21, Slope); } ID++; } } } return( true ); } /////////////////////////////////////////////////////////// // // // Methods // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_IMCORR::gcorr(std::vector >ChipSearch, std::vector >ChipRef, double csmin, int mfit, double ddmx, std::vector ioffrq, std::vector nomoff, int& iacrej, double& streng, std::vector& bfoffs, std::vector& tlerrs, double ddact) { bfoffs.resize(3); std::vectorunormc; // compute raw cross-product sums cross(unormc,ChipSearch,ChipRef); // compute normalized cross-correlation values and compile statistics std::vectorccnorm; std::vectorpkval; std::vectoripkcol; std::vectoripkrow; std::vectorsums; gnorm(ccnorm,pkval, ipkcol, ipkrow,sums,ChipSearch, ChipRef,unormc); int ncol = (int)(ChipSearch[0].size()-ChipRef[0].size()+1); int nrow = (int)(ChipSearch.size()-ChipRef.size()+1); // Evaluate Strength of correlation peak std::vectorcpval; eval(ncol, nrow, ccnorm,pkval, ipkcol, ipkrow,sums,csmin, streng, iacrej,cpval); std::vectorpkoffs; // determine offsets of peak relative to nominal location if (iacrej==1) { if (mfit != 4) { fitreg(cpval, mfit, pkoffs, tlerrs); bfoffs[1] = (ipkcol[1] - 1) - nomoff[1] + pkoffs[1]; bfoffs[2] = (ipkrow[1] - 1) - nomoff[2] + pkoffs[2]; } else { bfoffs[1] = (ipkcol[1] - 1) - nomoff[1]; bfoffs[2] = (ipkrow[1] - 1) - nomoff[2]; tlerrs[1] = 0.5; tlerrs[2] = 0.5; } // // Determine diagonal displacement from nominal and check against maximum // acceptable value ddact = sqrt(bfoffs[1]*bfoffs[1] + bfoffs[2]*bfoffs[2]); if (ddmx > 0.0) { if (ddact > ddmx) iacrej = 5; } else { if ( (bfoffs[1]*bfoffs[1] > ioffrq[1]*ioffrq[1])|| (bfoffs[2]*bfoffs[2] > ioffrq[2]*ioffrq[2]) ) iacrej = 5; } } return; } //--------------------------------------------------------- void CGrid_IMCORR::fitreg(std::vector cpval, int mfit, std::vector& pkoffs, std::vector& tlerrs) { pkoffs.resize(3); tlerrs.resize(3); int i, j; std::vector >b; std::vector coeffs, vector, wghts, z; coeffs.resize(7); double denom; // compute elements of matrix and column vector; sums(cpval, mfit, z, wghts, b, vector); // invert matrix to get best-fit peak offsets kvert(b); i = 1; while (i <= 6) { coeffs[i] = 0.0; j = 1; while(j <= 6) { coeffs[i] += (b[i-1][j-1]*vector[j]); j++; } i++; } denom = 4.0*coeffs[4]*coeffs[6] - coeffs[5]*coeffs[5]; pkoffs[1] = (coeffs[3] * coeffs[5] - 2.0 * coeffs[2] * coeffs[6])/denom; pkoffs[2] = (coeffs[2]*coeffs[5] - 2.0 * coeffs[3] * coeffs[4])/denom; // estimate errors in best fit offsets; esterr(z, wghts, b, coeffs, pkoffs, tlerrs); return; } //--------------------------------------------------------- void CGrid_IMCORR::esterr(std::vector z, std::vector wghts,std::vector > bnvrs, std::vector coeffs, std::vector& pkoffs, std::vector& tlerrs) { pkoffs.resize(3); tlerrs.resize(4); int i, ivalpt, j; std::vectordu, dv; du.resize(7); dv.resize(7); double c, denom, f, usum, var, vsum, x, xsum, y; //Compute residual variance for elements of peak array; ivalpt = 1; var = 0.0; y = -2.0; while (y <= 2.0) { x= -2.0; while(x <= 2.0) { f = coeffs[1] + coeffs[2]*x + coeffs[3]*y+ coeffs[4]*x+x + coeffs[5]*x*y + coeffs[6]*y*y; var+= (wghts[ivalpt]*pow((f-z[ivalpt]),2)); ivalpt+=1; x+=1.0; } y+=1.0; } // compute constants to use the weights c = var/19.0; // compute partial derivatives of peak offsets with respect to polynomal coefficients denom = 4.0 * coeffs[4] * coeffs[6] - (coeffs[5] * coeffs[5]); du[1] = 0.0; du[2] = -2.0 * coeffs[6]/denom; du[3] = coeffs[5]/denom; du[4] = -4.0 * coeffs[6] * pkoffs[1]/denom; du[5] = (coeffs[3]+2.0*coeffs[5]*pkoffs[1])/denom; du[6] = (-2.0 * coeffs[2]-4.0*coeffs[4]*pkoffs[1])/denom; dv[1] = 0.0; dv[2] = du[3]; dv[3] = -2.0 * coeffs[4]/denom; dv[4] = (-2.0*coeffs[3] - 4.0*coeffs[6]*pkoffs[2])/denom; dv[5] = (coeffs[2] + 2.0*coeffs[5] * pkoffs[2])/denom; dv[6] = -4.0 * coeffs[4] * pkoffs[2]/denom; // compute estimated errors in offsets usum = 0.0; vsum = 0.0; xsum = 0.0; i=1; while (i <= 6) { j=1; while(j <= 6) { usum += (du[i] * du[j] * bnvrs[i-1][j-1]); vsum += (dv[i] * dv[j] * bnvrs[i-1][j-1]); xsum += (du[i] * dv[j] * bnvrs[i-1][j-1]); j++; } i++; } tlerrs[1] = sqrt(abs(c*usum)); tlerrs[2] = sqrt(abs(c*vsum)); tlerrs[3] = c*xsum; return; } //--------------------------------------------------------- void CGrid_IMCORR::sums(std::vector cpval, int mfit, std::vector& z, std::vector& wghts,std::vector > & b, std::vector& vector) { b.resize(6); for(int i = 0; i term; term.resize(7); double val; //initialize arrays and constants i = 1; while (i <= 6) { j=1; while(j <= 6) { b[i-1][j-1] = 0.0; j++; } vector[i] = 0.0; i++; } term[1] = 1.0; ivalpt = 0; //compute function of correlation coefficient and assign weight for // each location in neighbourhood of peak ir = 1; while(ir <= 5) { ic = 1; while (ic <= 5) { ivalpt++; if (cpval[ivalpt] > 1.0) val = cpval[ivalpt]; else val = 1.0; if (mfit == 1) // eliptical paraboloid { z[ivalpt] = val; wghts[ivalpt] = 1.0; } else if (mfit == 2) // eliptical gaussian { z[ivalpt] = log(val); wghts[ivalpt] = pow(val,2); } else // reciprocal paraboloid { z[ivalpt] = 1.0/val; wghts[ivalpt] = pow(val,4); } // compute matrix and vector elements in linear equations for best-fit coefficients term[2] = ic -3; term[3] = ir -3; term[4] = term[2] * term[2]; term[5] = term[2] * term[3]; term[6] = term[3] * term[3]; i = 1; while (i <= 6) { vector[i] += (wghts[ivalpt]*term[i]*z[ivalpt]); j=1; while (j <= 6) { b[i-1][j-1] += (float)(wghts[ivalpt]*term[i]*term[j]); j++; } i++; } ic++; } ir++; } return; } //--------------------------------------------------------- void CGrid_IMCORR::cofact( float num[ 25 ][ 25 ], float f, std::vector >& INV ) { float b[ 25 ][ 25 ], fac[ 25 ][ 25 ]; int p, q, m, n, i, j; for ( q = 0;q < f;q++ ) { for ( p = 0;p < f;p++ ) { m = 0; n = 0; for ( i = 0;i < f;i++ ) { for ( j = 0;j < f;j++ ) { b[ i ][ j ] = 0; if ( i != q && j != p ) { b[ m ][ n ] = num[ i ][ j ]; if ( n < ( f-2.0 ) ) n++; else { n = 0; m++; } } } } fac[ q ][ p ] = (float)(pow( -1.0, (q + p) ) * detrm( b, (f-1) )); } } trans( num, fac, f, INV ); return; } //--------------------------------------------------------- float CGrid_IMCORR::detrm( float a[ 25 ][ 25 ], float k ) { float s = 1, det = 0, b[ 25 ][ 25 ]; int i, j, m, n, c; if ( k == 1 ) { return ( a[ 0 ][ 0 ] ); } else { det = 0; for ( c = 0;c < k;c++ ) { m = 0; n = 0; for ( i = 0;i < k;i++ ) { for ( j = 0;j < k;j++ ) { b[ i ][ j ] = 0; if ( i != 0 && j != c ) { b[ m ][ n ] = a[ i ][ j ]; if ( n < ( k-2 ) ) n++; else { n = 0; m++; } } } } det = det + s * ( a[ 0 ][ c ] * detrm( b, k-1 ) ); s = -1 * s; } } return ( det ); } //--------------------------------------------------------- void CGrid_IMCORR::trans( float num[ 25 ][ 25 ], float fac[ 25 ][ 25 ], float r , std::vector >& INV) { int i, j; float b[ 25 ][ 25 ], inv[ 25 ][ 25 ], d; for ( i = 0;i < r;i++ ) { for ( j = 0;j < r;j++ ) { b[ i ][ j ] = fac[ j ][ i ]; } } d = detrm( num, r ); inv[ i ][ j ] = 0; for ( i = 0;i < r;i++ ) { for ( j = 0;j < r;j++ ) { inv[ i ][ j ] = b[ i ][ j ] / d; } } INV.resize((int)r); for (int ii = 0; ii < r; ii++) { INV[ii].resize((int)r); } for ( i = 0;i < r;i++ ) { for ( j = 0;j < r;j++ ) { INV[ i ][ j ] = inv[ i ][ j ]; } } return; } //--------------------------------------------------------- void CGrid_IMCORR::kvert(std::vector >& V) { const int k = (int)V[0].size(); float b[25][25]; for ( int i = 0;i < k;i++ ) { for (int j = 0;j < k;j++ ) { b[ i ][ j ] = V[ i ][ j ]; } } float d = detrm( b, (float)k ); if ( d != 0 ) cofact( b, (float)k, V); return; } //--------------------------------------------------------- // code from original FORTRAN version //void CGrid_IMCORR::kvert(std::vector >& V, std::vectorW) //{ // int LV = V[0].size()-1; // int N = V.size()-1; // int H,I,J,K,L,M,N,O,P,Q; // double S, T; // // // if (N != 1) // { // O = N+1; // L = 0; // M = 1; // if (L != N) // { // K = L; // L = M; // M = M + 1; // // find pivot and start row swap // P = L; // Q = L; // S = abs(V[L][L]); // H = L; // bool GoOut = false; // while (H <= N) // { // I = L; // while(I <= N) // { // T = abs(V[I][H]); // if (T <= S) // break; // P = I; // Q = H; // S = T; // if ( I>N) // break; // I++; // } // H++; // } // W[N+L] = P; // W[O-L] = Q; // I = 1; // while(I <= N) // { // T = V[I][L]; // V[I][L] = V[I][Q]; // V[I][Q] = T; // I++; // } // S = V[P][L]; // V[P][L] = V[L][L]; // if (S != 0.0) // { // // compute multipliers // V[L][L] = -1; // S = 1.0/S; // I=1; // while(I <= N) // { // V[I][L] = -S * V[I][L]; // I++; // } // J=L; // J++; // if(J > N) // J = 1; // // // } // // } // } // return; //} //--------------------------------------------------------- void CGrid_IMCORR::eval(int ncol, int nrow, std::vector CCNORM , std::vector pkval, std::vector ipkcol, std::vector ipkrow, std::vector sums, double& csmin, double& streng, int& iacrej, std::vector& cpval) { cpval.resize(26,0.0);// shift to rebuild fortran; std::vectoript5(3); int i, icol, idist, iptr, ipt7, irow, krbase, lcol, lrow, npts, n5, n7, j; double bmean, bsigma; ipt5[0] = 0; ipt5[1] = 32; ipt5[2] = 32; iacrej = 1; streng = 0.0; ipt7 =1; // check for peak value within two rows or columns of edge if ((ipkcol[1] <= 2) || (ipkcol[1] >= ncol-1) || (ipkrow[1] <= 2) || (ipkrow[1] >= nrow-1)) { iacrej = 0; return; } // Find largest values outside 5 by 5 and 7 by 7 neoghbourhoods of peak n5 = 0; n7 = 0; i=2; while ((n5 < 2) && (i <= 32)) { if (abs(ipkcol[1]-ipkcol[i]) > abs(ipkrow[1]-ipkrow[i])) idist = abs(ipkcol[1]-ipkcol[i]); else idist = abs(ipkrow[1]-ipkrow[i]); if (idist > 2) { n5 = n5 +1; ipt5[n5] = i; if ((n7 == 0) && (idist < 3)) { ipt7 = i; n7 = 1; } } i++; } if((ipt5[1] <= 3) || ipt5[2] <=5) { iacrej = 3; return; } //Find edges of 9 by 9 array centred on peak if (1 > ipkcol[1] -4) icol = 1; else icol = ipkcol[1] -4; if (1 > ipkcol[1] -4) irow = 1; else irow = ipkcol[1] -4; if (ncol < ipkcol[1] -4) lcol = ncol; else lcol = ipkcol[1] -4; if (nrow < ipkcol[1] -4) lrow = nrow; else lrow = ipkcol[1] -4; // eliminate points within 9 by 9 array from background statistics krbase = ncol*(nrow-1); i = irow; while (i <= lrow) { j=icol; while (j <= lcol) { sums[0] -= CCNORM[krbase+j]; sums[1] -= (CCNORM[krbase+j]*CCNORM[krbase+j]); j++; } krbase+= ncol; i++; } //Compute background mean and standard deviation npts = ncol*nrow - (lcol - icol +1) * (lrow - irow +1); bmean = sums[0]/npts; bsigma = sqrt(sums[1]/npts - bmean*bmean); // Compute correlation strength and check against minimum. Note that // the LAS 4.x Version of the code contains an error... it often tries to // access pkval array element zero when there are no significant subsidiary peaks, resulting in // unpredictable results if (n7 == 0) streng = 2 * ((pkval[1] -bmean)/bsigma) -0.2; else { streng = (pkval[1] -bmean)/bsigma + (pkval[0] - pkval[ipt7])/bsigma + 0.2*(n7-1.0); } if (streng < csmin) { iacrej = 4; return; } //convert 5 by 5 neighbourhood of peak to standard deviations above mean krbase = ncol*(ipkrow[1]-3); iptr = 1; int I = 1; while (I <= 5) { j = ipkcol[1]-2; while (j <= ipkcol[1]+2) { cpval[iptr] = ((CCNORM[krbase+j] - bmean)/bsigma); iptr++; j++; } krbase+= ncol; I++; } return; } //--------------------------------------------------------- void CGrid_IMCORR::gnorm(std::vector& CCNORM , std::vector& pkval, std::vector& ipkcol, std::vector& ipkrow, std::vector& sums, std::vector >ChipSearch, std::vector >ChipRef, std::vector UNORMC ) { std::vectorser, ref; //create arrays ser.push_back(0.0); // dummy index to allow fortran conform indexing for(int i = 0; ixval, colsum, colsqr; xval.resize(33); colsum.resize(257,0.0); colsqr.resize(257,0.0); // integer vectors std::vectoriptr, ixcol, ixrow; iptr.resize(33); ixcol.resize(33); ixrow.resize(33); // in most cases search is bigger than ref (default = 64x64) std::vectornsnew; nsnew.push_back((int)ChipSearch[0].size()); nsnew.push_back((int)ChipSearch.size()); // in most cases ref is smaller than search (default = 32x32) std::vectornrnew; nrnew.push_back((int)ChipRef[0].size()); nrnew.push_back((int)ChipRef.size()); int ipfree, ipt, jstart, jstop, k, kol, koladd, kolsub, line, lnadd, lnsub, ncol, nrow, nrtot; double refsum, refsqr, rho, rmean, rsigma, rtotal, sigma1, sigmas, srchsm, srchsq, temp, tempmn, igl, iglnew, iglold; refsum = 0; refsqr = 0; nrtot = nrnew[0]*nrnew[1]; ipt =1; while (ipt <= nrtot) { igl = ref[ipt]; refsum = refsum + igl; refsqr = refsqr +igl*igl; ipt++; } rtotal = nrtot; tempmn = 0.01 * (rtotal*rtotal); rmean = refsum/rtotal; if ((refsqr/rtotal - rmean*rmean) > 0.01) rsigma = sqrt(refsqr/rtotal - rmean*rmean); else rsigma = sqrt(0.01); // clear sums and sums of squares of normalized correlation values sums.push_back(0.0); sums.push_back(0.0); k =1; while (k <= 32) { xval[k] = -1.0; iptr[k] = k; k++; } ncol = nsnew[0] - nrnew[0] +1; nrow = nsnew[1] - nrnew[1] +1; // compute normalized cross-corr values for one row of alignments at a time jstart = 1; jstop = ncol; int i = 1; while (i <= nrow) { // Get column sums and sums of squares for portion of search // subimage overlain by reference in current row of alignments if (i == 1) { kol = 1; while(kol <= nsnew[0]) { colsum[kol] = 0.0; colsqr[kol] = 0.0; kol++; } ipt = 1; line = 1; while (line <= nrnew[1]) { kol = 1; while (kol <= nsnew[0]) { igl = ser[ipt]; colsum[kol]+=igl; colsqr[kol]+=(igl*igl); ipt++; kol++; } line++; } } else // if i != 1 { lnsub = (i-2)*nsnew[0]; lnadd = lnsub + nsnew[0] * nrnew[1]; kol = 1; while (kol <= nsnew[0]) { iglnew = ser[lnadd+kol]; iglold = ser[lnsub+kol]; colsum[kol]+= (iglnew-iglold); colsqr[kol]+= ((iglnew*iglnew)-(iglold*iglold)); kol++; } } // end if // complete computation of search-subarea pixel statistics int j = jstart; while(j <= jstop) { if(j == jstart) { srchsm = 0.0; srchsq = 0.0; kol = 1; while (kol <= nrnew[0]) { srchsm+= colsum[kol]; srchsq+= colsqr[kol]; kol++; } if (tempmn > (rtotal*srchsq - srchsm*srchsm)) temp = tempmn; else temp = (rtotal*srchsq - srchsm*srchsm); sigmas = sqrt(temp); } else { kolsub = j -jstart; koladd = kolsub + nrnew[0]; srchsm+= (colsum[koladd] - colsum[kolsub]); srchsq+= (colsqr[koladd] - colsqr[kolsub]); if (tempmn > (rtotal*srchsq - srchsm*srchsm)) temp = tempmn; else temp = (rtotal*srchsq - srchsm*srchsm); sigma1 = 0.5 * (sigmas + temp/sigmas); sigmas = 0.5 *(sigma1 + temp/sigma1); } // compute normalized cross-correlation value rho = (UNORMC[j] - rmean*srchsm)/(rsigma * sigmas); CCNORM.push_back(rho); sums[0]+= rho; sums[1]+= (rho*rho); // check whether value is among top 32 if (rho > xval[iptr[32]]) { k = 32; ipfree = iptr[32]; while ( k > 1 && rho > xval[iptr[k-1]]) { iptr[k] = iptr[k-1]; k = k-1; } iptr[k] = ipfree; xval[ipfree] = rho; ixcol[ipfree] = j - jstart + 1; ixrow[ipfree] = i; } j++; } jstart+= ncol; jstop+= ncol; i++; } // copy peak values and coordinates in correct sequence k= 1; pkval.push_back(0.0); ipkcol.push_back(0); ipkrow.push_back(0); while (k <= 32) { pkval.push_back(xval[iptr[k]]); ipkcol.push_back(ixcol[iptr[k]]); ipkrow.push_back(ixrow[iptr[k]]); k++; } return; } //--------------------------------------------------------- void CGrid_IMCORR::cross(std::vector& UNORMC , std::vector >ChipSearch, std::vector >ChipRef) { // in most cases search is bigger than ref (default = 64x64) std::vectornsnew; nsnew.push_back((int)ChipSearch[0].size()); nsnew.push_back((int)ChipSearch.size()); // in most cases ref is smaller than search (default = 32x32) std::vectornrnew; nrnew.push_back((int)ChipRef[0].size()); nrnew.push_back((int)ChipRef.size()); std::vector > ChipRef2; ChipRef2.resize(ChipSearch[0].size()); for(int i = 0; i < ChipSearch[0].size(); i++) ChipRef2[i].resize(ChipSearch.size(),0.0); // zero extent chipref to search chip size for(int i = 0; iser, ref; //create arrays ser.push_back(0.0); // dummy index to allow fortran conform indexing for(int i = 0; icser, cref; cser.push_back(0.0); cref.push_back(0.0); for (int i = 1; i < ser.size(); i++) { cser.push_back(ser[i]); cser.push_back(0.0); cref.push_back(ref[i]); cref.push_back(0.0); } // take fast fourier transform of search and reference data fft2(cser,nsnew,1); // from "house" format to frequency format fft2(cref,nsnew,1); // make point by multiplication of ft of search ft with conjugate of reference image for(int i = 1; iWhichValues; while(i <= nrow) { int j = 1; while(j <= ncol*2) { //UNORMC.push_back((double)(cser[(j-1)*nsnew[1]+i])/(double) (denom)); UNORMC.push_back((double)(cser[(i-1)*(nsnew[1]*2)+j])/(double) (denom)); WhichValues.push_back((i-1)*(nsnew[1]*2)+j); ndxout++; j+=2; // because of pseudo complex configuration } i+=1; // I think rows are not influenced by complex padding } return; } //--------------------------------------------------------- void CGrid_IMCORR::fft2(std::vector& data, std::vectornel, int isign) { double wr,wi,wpr,wpi,wtemp,theta; int ntot = nel[0]*nel[1]; int nprev = 1; int idim = 1; while(idim <= 2) { int n = nel[idim-1]; int nrem = ntot/(n*nprev); int ip1 = 2*nprev; int ip2 = ip1*n; int ip3 = ip2 * nrem; int i2rev = 1; // perform bit reversal int i2 = 1; while(i2 <= ip2) { if(i2 < i2rev) { int i1= i2; while (i1 <= (i2+ip1-2)) { int i3=i1; while (i3 <= ip3) { int i3rev = i2rev+i3-i2; double tempr = data[i3]; double tempi = data[i3+1]; data[i3] = data[i3rev]; data[i3+1] = data[i3rev+1]; data[i3rev] = tempr; data[i3rev+1] = tempi; i3+=ip2; } i1+=2; } } int ibit = ip2/2; while (ibit >= ip1 && i2rev > ibit) { i2rev = i2rev-ibit; ibit = ibit/2; } i2rev = i2rev+ibit; i2+=ip1; } // end of bit reversal // Danielson-Lanczos Section int ifp1 = ip1; while(ifp1 < ip2) { int ifp2 = 2* ifp1; // Initialize for the trigonometric recurrence theta = isign *(M_PI*2) / (ifp2/ip1); wtemp = sin(0.5*theta); wpr = -2.0 * (wtemp*wtemp); wpi = sin(theta); wr = 1.0; wi = 0.0; int i3=1; while (i3 <= ifp1) { int i1 = i3; while (i1 <= (i3+ip1-2)) { int i2 = i1; while (i2 <= ip3) { int k1 = i2; int k2 = k1+ifp1; double tempr = wr * data[k2] - wi * data[k2+1]; double tempi = wr * data[k2+1] + wi * data[k2]; data[k2] = data[k1]-tempr; data[k2+1] = data[k1+1]-tempi; data[k1] = data[k1]+tempr; data[k1+1] = data[k1+1]+tempi; i2+=ifp2; } i1+=2; } // the trigonometric recurrence wtemp = wr; wr = wr*wpr-wi*wpi+wr; wi=wi*wpr+wtemp*wpi+wi; i3+=ip1; } ifp1=ifp2; } nprev = n*nprev; idim++; } return; } //--------------------------------------------------------- int CGrid_IMCORR::decimal(std::vector Bin) { int Sum = 0; for (int i = 0; i < Bin.size(); i++) { int Exponent = (int)(Bin.size()-1)-i; Sum+= Bin[i] * (int)pow(2.0, Exponent); } return Sum; } //--------------------------------------------------------- void CGrid_IMCORR::binary(std::vector& Bin, int number) { int remainder; if(number <= 1) { Bin.push_back(number); return; } remainder = number%2; binary(Bin, number >> 1); Bin.push_back(remainder); } //--------------------------------------------------------- void CGrid_IMCORR::Get_This_Chip(std::vector >& Chip, CSG_Grid *pGrid, int gx, int gy, int Ref_Chipsize) { int ref_chipX = 0; int ref_chipY = 0; for (int refx = gx - (Ref_Chipsize/2-1); refx < gx - (Ref_Chipsize/2-1) + Ref_Chipsize; refx++) { ref_chipY = 0; for (int refy = gy - (Ref_Chipsize/2-1); refy < gy - (Ref_Chipsize/2-1) + Ref_Chipsize; refy++) { Chip[ref_chipX][ref_chipY] = pGrid->asDouble(refx,refy); ref_chipY++; } ref_chipX++; } return; } //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_IMCORR.h000066400000000000000000000140641224124640700235000ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_IMCORR.h 1597 2013-01-28 17:02:55Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid analysis // // // //-------------------------------------------------------// // // // Grid_IMCORR.h // // // // Copyright (C) 2012 by // // Magnus Bremer // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: magnus.bremer@uibk.ac.at // // // // contact: Magnus Bremer // // Institute of Geography // // University of Innsbruck // // Innrain 52 // // 6020 Innsbruck // // Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_IMCORR_H #define HEADER_INCLUDED__Grid_IMCORR_H //--------------------------------------------------------- #include "MLB_Interface.h" #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_IMCORR : public CSG_Module_Grid { public: CGrid_IMCORR(void); protected: virtual bool On_Execute (void); private: void Get_This_Chip(std::vector >& Chip, CSG_Grid *pGrid, int gx, int gy, int Ref_Chipsize); void gcorr(std::vector >ChipSearch, std::vector >ChipRef, double csmin, int mfit, double ddmx, std::vector ioffrq, std::vector nomoff, int& iacrej, double& streng, std::vector& bfoffs, std::vector& tlerrs, double ddact); int decimal(std::vector Bin); void binary(std::vector& Bin, int number); void cross(std::vector& UNORMC , std::vector >ChipSearch, std::vector >ChipRef); void fft2(std::vector& data, std::vectornel, int isign); void gnorm(std::vector& CCNORM , std::vector& pkval, std::vector& ipkcol, std::vector& ipkrow, std::vector& sums, std::vector >ChipSearch, std::vector >ChipRef, std::vector UNORMC ); void eval(int ncol, int nrow, std::vector CCNORM , std::vector pkval, std::vector ipkcol, std::vector ipkrow, std::vector sums, double& csmin, double& streng, int& iacrej, std::vector& cpval); void fitreg(std::vector cpval, int mfit, std::vector& pkoffs, std::vector& tlerrs); void sums(std::vector cpval, int mfit, std::vector& z, std::vector& wghts,std::vector > & b, std::vector& vector); void kvert(std::vector >& V); float detrm( float a[ 25 ][ 25 ], float k ); void cofact( float num[ 25 ][ 25 ], float f, std::vector >& INV ); void trans( float num[ 25 ][ 25 ], float fac[ 25 ][ 25 ], float r , std::vector >& INV); void esterr(std::vector z, std::vector wghts,std::vector > bnvrs, std::vector coeffs, std::vector& pkoffs, std::vector& tlerrs); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_IMCORR_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.cpp000066400000000000000000000071221224124640700267310ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_LayerOfMaximumValue.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CLayerOfMaximumValue.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #define MAXIMUM 0 #define MINIMUM 1 #include "Grid_LayerOfMaximumValue.h" CLayerOfMaximumValue::CLayerOfMaximumValue(void) { Parameters.Set_Name(_TL("Layer of extreme value")); Parameters.Set_Description(_TW( "It creates a new grid containing the ID of the grid with the maximum (minimum) value.\r\n" "Copyright 2005 Victor Olaya: e-mail: volaya@ya.com") ); Parameters.Add_Grid_List(NULL, "GRIDS", _TL("Grids"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RESULT", _TL("Result"), _TL(""), PARAMETER_OUTPUT); Parameters.Add_Choice(NULL, "CRITERIA", _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|"),_TL("Maximum"), _TL("Minimum")), 0); } //--------------------------------------------------------- CLayerOfMaximumValue::~CLayerOfMaximumValue(void) {} bool CLayerOfMaximumValue::On_Execute(void) { int iGrid, nGrids, x, y; double dExtremeValue, dValTemp; int iExtremeGrid; int iCriteria; CSG_Grid *pResult, *pGrid; CSG_Parameter_Grid_List *pParm_Grids; bool bMeetsCriteria; pParm_Grids = Parameters("GRIDS") ->asGridList(); pResult = Parameters("RESULT") ->asGrid(); nGrids = pParm_Grids ->Get_Count(); iCriteria = Parameters("CRITERIA")->asInt(); //----------------------------------------------------- if( nGrids > 1 ) { for(y=0; yasGrid(iGrid); if (!pGrid->is_NoData(x,y)){ dExtremeValue = pGrid->asDouble(x, y); break; }//if }//for iExtremeGrid = 0; for(iGrid=0; iGridasGrid(iGrid); if (!pGrid->is_NoData(x,y)){ dValTemp = pGrid->asDouble(x, y); switch (iCriteria){ case MINIMUM: bMeetsCriteria = (dExtremeValue >= dValTemp); break; case MAXIMUM: bMeetsCriteria = (dExtremeValue <= dValTemp); break; default: break; }//switch if (bMeetsCriteria) { dExtremeValue = dValTemp; iExtremeGrid = iGrid + 1; } } } if (iExtremeGrid){ pResult->Set_Value(x, y, iExtremeGrid); }//if else{ pResult->Set_NoData(x,y); }//else } } } else if( nGrids > 0 ) { pResult->Assign(1); } //----------------------------------------------------- return( nGrids > 0 ); } saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_LayerOfMaximumValue.h000066400000000000000000000026101224124640700263730ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_LayerOfMaximumValue.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* LayerOfMaximumValue.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CLayerOfMaximumValue : public CSG_Module_Grid { public: CLayerOfMaximumValue(void); virtual ~CLayerOfMaximumValue(void); protected: virtual bool On_Execute(void); }; saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_Pattern.cpp000066400000000000000000000136231224124640700244550ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Pattern.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* Grid_Pattern.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Grid_Pattern.h" CGrid_Pattern::CGrid_Pattern(void){ Set_Name(_TL("Pattern Analysis")); Set_Author(_TL("Copyrights (c) 2004 by Victor Olaya")); Set_Description (_TW( "(c) 2004 by Victor Olaya. Pattern Analysis")); Parameters.Add_Grid(NULL, "INPUT", _TL("Input Grid"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RELATIVE", _TL("Relative Richness"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Double); Parameters.Add_Grid(NULL, "DIVERSITY", _TL("Diversity"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Double); Parameters.Add_Grid(NULL, "DOMINANCE", _TL("Dominance"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Double); Parameters.Add_Grid(NULL, "FRAGMENTATION", _TL("Fragmentation"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Double); Parameters.Add_Grid(NULL, "NDC", _TL("Number of Different Classes"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Int); Parameters.Add_Grid(NULL, "CVN", _TL("Center Versus Neighbours"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Int); Parameters.Add_Choice(NULL, "WINSIZE", _TL("Size of Analysis Window"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("3 X 3"), _TL("5 X 5"), _TL("7 X 7") ), 0 ); Parameters.Add_Value(NULL, "MAXNUMCLASS", _TL("Max. Number of Classes"), _TL("Maximum number of classes in entire grid."), PARAMETER_TYPE_Int, 10); }//constructor CGrid_Pattern::~CGrid_Pattern(void) {} bool CGrid_Pattern::On_Execute(void){ m_pInput = Parameters("INPUT")->asGrid(); CSG_Grid *pRelative = Parameters("RELATIVE")->asGrid(); CSG_Grid *pDominance = Parameters("DOMINANCE")->asGrid(); CSG_Grid *pDiversity = Parameters("DIVERSITY")->asGrid(); CSG_Grid *pFragmentation = Parameters("FRAGMENTATION")->asGrid(); CSG_Grid *pNDC = Parameters("NDC")->asGrid(); CSG_Grid *pCVN = Parameters("CVN")->asGrid(); m_iWinSize = Parameters("WINSIZE")->asInt()*2+3; m_iNumClasses = Parameters("MAXNUMCLASS")->asInt(); for(int y=m_iWinSize-2; ySet_Value(x,y,((double)iNumClasses)/((double)m_iNumClasses)*100.0); pDominance->Set_Value(x,y,log((double)iNumClasses)-dDiversity); pDiversity->Set_Value(x,y,dDiversity); pFragmentation->Set_Value(x,y,((double)(iNumClasses-1))/((double)(m_iWinSize*m_iWinSize-1))); pNDC->Set_Value(x,y,iNumClasses); pCVN->Set_Value(x,y,getCVN(x,y)); }// for }// for return true; }//method int CGrid_Pattern::getNumberOfClasses(int iX, int iY){ int iValues[9]; int iNumClasses =0; int i,j,k; int iValue; for (i =0; i<9; i++){ iValues[i] = (int)m_pInput->Get_NoData_Value(); }//for for (i=-m_iWinSize+2; iasInt(iX+i,iY+j); if (iValue!=m_pInput->Get_NoData_Value()){ for (k=0; k<9; k++){ if (iValue==iValues[k]){ continue; }//if if (iValues[k]==m_pInput->Get_NoData_Value()){ iValues[k]=iValue; iNumClasses++; continue; }//if }//for }//if }//for }//for return iNumClasses; }//method double CGrid_Pattern::getDiversity(int iX, int iY){ int iValues[9][2]; int iMaxClass=0; int i,j,k; int iValue; double dDiversity=0; double dProp; for (i =0; i<9; i++){ iValues[i][0] = (int)m_pInput->Get_NoData_Value(); iValues[i][1] = 0; }//for for (i=-m_iWinSize+2; iasInt(iX+i,iY+j); if (iValue!=m_pInput->Get_NoData_Value()){ for (k=0; k<9; k++){ if (iValue==iValues[k][0]){ iValues[k][1]++; goto out; }//if if (iValues[k][0]==m_pInput->Get_NoData_Value()){ iValues[k][0]=iValue; iValues[k][1]++; iMaxClass=k+1; goto out; }//if }//for out:; }//if }//for }//for for (i=0; iasInt(iX,iY); int iCVN=0; for (int i=-m_iWinSize+2; iasInt(iX+i,iY+j); if (iValue2!=m_pInput->Get_NoData_Value()){ if (iValue!=iValue2){ iCVN++; }//if }//if }//for }//for return iCVN; }//method saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Grid_Pattern.h000066400000000000000000000033671224124640700241260ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Pattern.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* Grid_Pattern.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Pattern_H #define HEADER_INCLUDED__Grid_Pattern_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CGrid_Pattern : public CSG_Module_Grid { public: CGrid_Pattern(void); virtual ~CGrid_Pattern(void); private: CSG_Grid* m_pInput; int m_iWinSize; int m_iNumClasses; double getDiversity(int, int); int getCVN(int, int); int getNumberOfClasses(int, int); protected: virtual bool On_Execute(void); }; #endif // #ifndef HEADER_INCLUDED__Grid_Pattern_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/LeastCostPathProfile.cpp000066400000000000000000000227771224124640700261440ustar00rootroot00000000000000/********************************************************** * Version $Id: LeastCostPathProfile.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Cost Analysis // // // //-------------------------------------------------------// // // // LeastCostPathProfile.cpp // // // // Copyright (C) 2004 by // // Olaf Conrad & Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // // e-mail: oconrad@saga-gis.org // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "LeastCostPathProfile.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define VALUE_OFFSET 5 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CLeastCostPathProfile::CLeastCostPathProfile(void) { Parameters.Set_Name(_TL("Least Cost Path")); Parameters.Set_Description(_TW( "Creates a least cost past profile using an accumulated cost surface." "\n(c) 2004 Victor Olaya, Goettingen.\nemail: oconrad@gwdg.de\n") ); Parameters.Add_Grid( NULL, "DEM" , _TL("Accumulated cost"), _TL("Accumulated cost"), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL, "VALUES", _TL("Values"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Shapes( NULL, "POINTS", _TL("Profile (points)"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL, "LINE", _TL("Profile (lines)"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); } //--------------------------------------------------------- CLeastCostPathProfile::~CLeastCostPathProfile(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLeastCostPathProfile::On_Execute(void) { m_pDEM = Parameters("DEM") ->asGrid(); m_pValues = Parameters("VALUES") ->asGridList(); m_pPoints = Parameters("POINTS") ->asShapes(); m_pLine = Parameters("LINE") ->asShapes(); DataObject_Update(m_pDEM, true); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLeastCostPathProfile::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode) { switch( Mode ) { case MODULE_INTERACTIVE_LDOWN: Set_Profile(Get_System()->Fit_to_Grid_System(ptWorld)); break; } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLeastCostPathProfile::Set_Profile(TSG_Point ptWorld) { int x, y, i; //----------------------------------------------------- if( Get_System()->Get_World_to_Grid(x, y, ptWorld) && m_pDEM->is_InGrid(x, y) ) { m_pPoints->Create(SHAPE_TYPE_Point, CSG_String::Format(_TL("Profile [%s]"), m_pDEM->Get_Name())); m_pPoints->Add_Field("ID" , SG_DATATYPE_Int); m_pPoints->Add_Field("D" , SG_DATATYPE_Double); m_pPoints->Add_Field("X" , SG_DATATYPE_Double); m_pPoints->Add_Field("Y" , SG_DATATYPE_Double); m_pPoints->Add_Field("Z" , SG_DATATYPE_Double); for(i=0; iGet_Count(); i++) { m_pPoints->Add_Field(m_pValues->asGrid(i)->Get_Name(), SG_DATATYPE_Double); } //----------------------------------------------------- m_pLine->Create(SHAPE_TYPE_Line, CSG_String::Format(_TL("Profile [%s]"), m_pDEM->Get_Name())); m_pLine->Add_Field("ID", SG_DATATYPE_Int); m_pLine->Add_Shape()->Set_Value(0, 1); //----------------------------------------------------- Set_Profile(x, y); //----------------------------------------------------- DataObject_Update(m_pLine , false); DataObject_Update(m_pPoints , false); return( true ); } return( false ); } //--------------------------------------------------------- void CLeastCostPathProfile::Set_Profile(int iX, int iY) { int iNextX, iNextY; iNextX = iX; iNextY = iY; do { iX = iNextX; iY = iNextY; getNextCell(m_pDEM, iX, iY, iNextX, iNextY); }while (Add_Point(iX, iY) && (iX != iNextX || iY != iNextY)); } void CLeastCostPathProfile::getNextCell(CSG_Grid *g, int iX, int iY, int &iNextX, int &iNextY) { float fMaxSlope; float fSlope; fMaxSlope = 0; fSlope = 0; if (iX < 1 || iX >= g->Get_NX()-1 || iY < 1 || iY >= g->Get_NY()-1 || g->is_NoData(iX,iY)) { iNextX = iX; iNextY = iY; return; }// if for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (!g->is_NoData(iX+i,iY+j)){ fSlope = (g->asFloat(iX+i,iY+j) - g->asFloat(iX,iY)); if (fSlope <= fMaxSlope) { iNextX = iX+i; iNextY = iY+j; fMaxSlope = fSlope; }// if }//if }// for }// for }// method //--------------------------------------------------------- bool CLeastCostPathProfile::Add_Point(int x, int y) { int i; double Distance; TSG_Point Point; CSG_Shape *pPoint, *pLast; if( m_pDEM->is_InGrid(x, y) ) { Point = Get_System()->Get_Grid_to_World(x, y); if( m_pPoints->Get_Count() == 0 ) { Distance = 0.0; } else { pLast = m_pPoints->Get_Shape(m_pPoints->Get_Count() - 1); Distance = SG_Get_Distance(Point, pLast->Get_Point(0)); Distance += pLast->asDouble(1); } pPoint = m_pPoints->Add_Shape(); pPoint->Add_Point(Point); pPoint->Set_Value(0, m_pPoints->Get_Count()); pPoint->Set_Value(1, Distance); pPoint->Set_Value(2, Point.x); pPoint->Set_Value(3, Point.y); pPoint->Set_Value(4, m_pDEM->asDouble(x, y)); for(i=0; iGet_Count(); i++) { pPoint->Set_Value(VALUE_OFFSET + i, m_pValues->asGrid(i)->asDouble(x, y, true)); } m_pLine->Get_Shape(0)->Add_Point(Point); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //---------------------------------------------------------saga-2.1.0+dfsg/src/modules/grid/grid_analysis/LeastCostPathProfile.h000066400000000000000000000112651224124640700255770ustar00rootroot00000000000000/********************************************************** * Version $Id: LeastCostPathProfile.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Terrain_Analysis // // // //-------------------------------------------------------// // // // LeastCostPathProfile.h // // // // Copyright (C) 2004 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // // e-mail: oconrad@saga-gis.org // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__LeastCostPathProfile_H #define HEADER_INCLUDED__LeastCostPathProfile_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CLeastCostPathProfile : public CSG_Module_Grid_Interactive { public: CLeastCostPathProfile(void); virtual ~CLeastCostPathProfile(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Cost Analysis") ); } protected: virtual bool On_Execute(void); virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode); private: CSG_Shapes *m_pPoints, *m_pLine; CSG_Grid *m_pDEM; CSG_Parameter_Grid_List *m_pValues; bool Set_Profile(TSG_Point ptWorld); void Set_Profile(int x, int y); bool Add_Point(int x, int y); void getNextCell(CSG_Grid *g, int iX, int iY, int &iNextX, int &iNextY); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__LeastCostPathProfile_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/LeastCostPathProfile_Points.cpp000066400000000000000000000244401224124640700274650ustar00rootroot00000000000000/********************************************************** * Version $Id: LeastCostPathProfile_Points.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // LeastCostPathProfile_Points.cpp // // // // Copyright (C) 2004-2010 by // // Olaf Conrad, Victor Olaya & Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "LeastCostPathProfile_Points.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define VALUE_OFFSET 5 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CLeastCostPathProfile_Points::CLeastCostPathProfile_Points(void) { Set_Name(_TL("Least Cost Paths")); Set_Author(SG_T("O. Conrad, V. Olaya, V. Wichmann (c) 2004-2010")); Parameters.Set_Description(_TW( "This module allows to compute least cost path profile(s). It takes an " "accumulated cost surface grid and a point shapefile as input. Each " "point in the shapefile represents a source for which the least cost path " "is calculated.\n" "In case the point shapefile has more than one source point " "defined, a separate least cost path is calculated for each point. " "The module outputs a point and a line shapefile for each least cost path.\n " "The module allows for optional input grids. The cell values of these grids " "along the least cost path are written to the outputs as additional table fields.\n\n") ); Parameters.Add_Shapes( NULL, "SOURCE" , _TL("Source Point(s)"), _TL("Point shapefile with source point(s)"), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Grid( NULL, "DEM" , _TL("Accumulated cost"), _TL("Accumulated cost surface"), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL, "VALUES", _TL("Values"), _TL("Allows to write cell values from additional grids to the output"), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Shapes_List( NULL, "POINTS", _TL("Profile (points)"), _TL("Least cost path profile points"), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes_List( NULL, "LINE", _TL("Profile (lines)"), _TL("Least cost path profile line"), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); } //--------------------------------------------------------- CLeastCostPathProfile_Points::~CLeastCostPathProfile_Points(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLeastCostPathProfile_Points::On_Execute(void) { int x, y; CSG_Shape *pShape; CSG_Shapes *pSources; CSG_Shapes *pPoints, *pLine; CSG_Parameter_Shapes_List *pShapesPoints, *pShapesLine; pSources = Parameters("SOURCE") ->asShapes(); m_pDEM = Parameters("DEM") ->asGrid(); m_pValues = Parameters("VALUES") ->asGridList(); pShapesPoints = Parameters("POINTS") ->asShapesList(); pShapesLine = Parameters("LINE") ->asShapesList(); //----------------------------------------------------- pShapesPoints ->Del_Items(); pShapesLine ->Del_Items(); //----------------------------------------------------- for( int i=0; iGet_Count(); i++ ) { pShape = pSources->Get_Shape(i); if( Get_System()->Get_World_to_Grid(x, y, pShape->Get_Point(0)) && m_pDEM->is_InGrid(x, y) ) { //----------------------------------------------------- pPoints = SG_Create_Shapes(SHAPE_TYPE_Point, CSG_String::Format(_TL("Profile_Points_[%s]_%d"), m_pDEM->Get_Name(), i+1)); pPoints ->Add_Field("ID" , SG_DATATYPE_Int); pPoints ->Add_Field("D" , SG_DATATYPE_Double); pPoints ->Add_Field("X" , SG_DATATYPE_Double); pPoints ->Add_Field("Y" , SG_DATATYPE_Double); pPoints ->Add_Field("Z" , SG_DATATYPE_Double); for( int j=0; jGet_Count(); j++) { pPoints->Add_Field(m_pValues->asGrid(j)->Get_Name(), SG_DATATYPE_Double); } //----------------------------------------------------- pLine = SG_Create_Shapes(SHAPE_TYPE_Line, CSG_String::Format(_TL("Profile_Line_[%s]_%d"), m_pDEM->Get_Name(), i+1)); pLine ->Add_Field("ID", SG_DATATYPE_Int); pLine ->Add_Shape()->Set_Value(0, 1); Set_Profile(x, y, pPoints, pLine); //----------------------------------------------------- if( pPoints->Get_Count() > 0 ) { pShapesPoints->Add_Item(pPoints); pShapesLine->Add_Item(pLine); } else { delete(pPoints); delete(pLine); } } } return( pShapesPoints->Get_Count() > 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CLeastCostPathProfile_Points::Set_Profile(int iX, int iY, CSG_Shapes *pPoints, CSG_Shapes *pLine) { int iNextX, iNextY; iNextX = iX; iNextY = iY; do { iX = iNextX; iY = iNextY; getNextCell(m_pDEM, iX, iY, iNextX, iNextY); } while( Add_Point(iX, iY, pPoints, pLine) && (iX != iNextX || iY != iNextY) ); } //--------------------------------------------------------- void CLeastCostPathProfile_Points::getNextCell(CSG_Grid *g, int iX, int iY, int &iNextX, int &iNextY) { float fMaxSlope = 0; float fSlope = 0; if( iX<1 || iX>=g->Get_NX()-1 || iY<1 || iY>=g->Get_NY()-1 || g->is_NoData(iX,iY) ) { iNextX = iX; iNextY = iY; return; } for( int i=-1; i<2; i++ ) { for( int j=-1; j<2; j++) { if( !g->is_NoData(iX+i,iY+j) ) { fSlope = g->asFloat(iX+i,iY+j) - g->asFloat(iX,iY); if( fSlope <= fMaxSlope ) { iNextX = iX + i; iNextY = iY + j; fMaxSlope = fSlope; } } } } return; } //--------------------------------------------------------- bool CLeastCostPathProfile_Points::Add_Point(int x, int y, CSG_Shapes *pPoints, CSG_Shapes *pLine) { int i; double Distance; TSG_Point Point; CSG_Shape *pPoint, *pLast; if( m_pDEM->is_InGrid(x, y) ) { Point = Get_System()->Get_Grid_to_World(x, y); if( pPoints->Get_Count() == 0 ) { Distance = 0.0; } else { pLast = pPoints->Get_Shape(pPoints->Get_Count() - 1); Distance = SG_Get_Distance(Point, pLast->Get_Point(0)); Distance += pLast->asDouble(1); } pPoint = pPoints->Add_Shape(); pPoint->Add_Point(Point); pPoint->Set_Value(0, pPoints->Get_Count()); pPoint->Set_Value(1, Distance); pPoint->Set_Value(2, Point.x); pPoint->Set_Value(3, Point.y); pPoint->Set_Value(4, m_pDEM->asDouble(x, y)); for( i=0; iGet_Count(); i++ ) { pPoint->Set_Value(VALUE_OFFSET + i, m_pValues->asGrid(i)->asDouble(x, y, true)); } pLine->Get_Shape(0)->Add_Point(Point); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_analysis/LeastCostPathProfile_Points.h000066400000000000000000000110771224124640700271340ustar00rootroot00000000000000/********************************************************** * Version $Id: LeastCostPathProfile_Points.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // LeastCostPathProfile_Points.h // // // // Copyright (C) 2004-2010 by // // Olaf Conrad, Victor Olaya & Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__LeastCostPathProfile_Points_H #define HEADER_INCLUDED__LeastCostPathProfile_Points_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CLeastCostPathProfile_Points : public CSG_Module_Grid { public: CLeastCostPathProfile_Points(void); virtual ~CLeastCostPathProfile_Points(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Cost Analysis") ); } protected: virtual bool On_Execute(void); private: CSG_Grid *m_pDEM; CSG_Parameter_Grid_List *m_pValues; void Set_Profile(int x, int y, CSG_Shapes *pPoints, CSG_Shapes *pLine); bool Add_Point(int x, int y, CSG_Shapes *pPoints, CSG_Shapes *pLine); void getNextCell(CSG_Grid *g, int iX, int iY, int &iNextX, int &iNextY); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__LeastCostPathProfile_Points_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/MLB_Interface.cpp000066400000000000000000000132501224124640700244610ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1597 2013-01-28 17:02:55Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid analysis // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2004 by // // Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: volaya@ya.com // // // // contact: Victor Olaya Ferrero // // Madrid // // Spain // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Grid - Analysis") ); case MLB_INFO_Author: return( _TL("Various authors.") ); case MLB_INFO_Description: return( _TL("Some Grid Analysis Tools.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Grid|Analysis") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Cost_Isotropic.h" #include "Cost_Anisotropic.h" #include "LeastCostPathProfile.h" #include "LeastCostPathProfile_Points.h" #include "Grid_CVA.h" #include "CoveredDistance.h" #include "Grid_Pattern.h" #include "Grid_LayerOfMaximumValue.h" #include "Grid_AHP.h" #include "owa.h" #include "Grid_AggregationIndex.h" #include "CrossClassification.h" #include "Soil_Texture.h" #include "fragmentation_standard.h" #include "fragmentation_resampling.h" #include "fragmentation_classify.h" #include "Grid_Accumulation_Functions.h" #include "Grid_IMCORR.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CCost_Isotropic ); case 1: return( new CCost_Anisotropic ); case 2: return( MLB_INTERFACE_SKIP_MODULE ); // removed: CCost_PolarToRect case 3: return( MLB_INTERFACE_SKIP_MODULE ); // removed: CCost_RectToPolar case 4: return( new CLeastCostPathProfile ); case 5: return( new CLeastCostPathProfile_Points ); case 6: return( new CGrid_CVA ); case 7: return( new CCoveredDistance ); case 8: return( new CGrid_Pattern ); case 9: return( new CLayerOfMaximumValue ); case 10: return( new CAHP ); case 11: return( new COWA ); case 12: return( new CAggregationIndex ); case 13: return( new CCrossClassification ); case 14: return( new CSoil_Texture ); case 15: return( new CFragmentation_Standard ); case 16: return( new CFragmentation_Resampling ); case 17: return( new CFragmentation_Classify ); case 18: return( new CGrid_Accumulation_Functions ); case 19: return( new CGrid_IMCORR ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/grid/grid_analysis/MLB_Interface.h000066400000000000000000000073501224124640700241320ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2004 by // // Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: volaya@ya.com // // // // contact: Victor Olaya Ferrero // // Madrid // // Spain // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_analysis_H #define HEADER_INCLUDED__grid_analysis_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef grid_analysis_EXPORTS #define grid_analysis_EXPORT _SAGA_DLL_EXPORT #else #define grid_analysis_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_analysis_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Makefile.am000066400000000000000000000026711224124640700234240ustar00rootroot00000000000000# # $Id: Makefile.am 1597 2013-01-28 17:02:55Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_analysis.la libgrid_analysis_la_SOURCES =\ Cost_Anisotropic.cpp\ Cost_Isotropic.cpp\ CoveredDistance.cpp\ CrossClassification.cpp\ fragmentation_base.cpp\ fragmentation_classify.cpp\ fragmentation_resampling.cpp\ fragmentation_standard.cpp\ Grid_Accumulation_Functions.cpp\ Grid_AggregationIndex.cpp\ Grid_AHP.cpp\ Grid_CVA.cpp\ Grid_IMCORR.cpp\ Grid_LayerOfMaximumValue.cpp\ Grid_Pattern.cpp\ LeastCostPathProfile.cpp\ LeastCostPathProfile_Points.cpp\ MLB_Interface.cpp\ owa.cpp\ PointsEx.cpp\ Soil_Texture.cpp\ Cost_Anisotropic.h\ Cost_Isotropic.h\ CoveredDistance.h\ CrossClassification.h\ fragmentation_base.h\ fragmentation_classify.h\ fragmentation_resampling.h\ fragmentation_standard.h\ Grid_Accumulation_Functions.h\ Grid_AggregationIndex.h\ Grid_AHP.h\ Grid_CVA.h\ Grid_IMCORR.h\ Grid_LayerOfMaximumValue.h\ Grid_Pattern.h\ LeastCostPathProfile.h\ LeastCostPathProfile_Points.h\ MLB_Interface.h\ owa.h\ PointsEx.h\ Soil_Texture.h libgrid_analysis_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS) saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Makefile.in000066400000000000000000000516201224124640700234330ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/grid/grid_analysis DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgrid_analysis_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgrid_analysis_la_OBJECTS = Cost_Anisotropic.lo Cost_Isotropic.lo \ CoveredDistance.lo CrossClassification.lo \ fragmentation_base.lo fragmentation_classify.lo \ fragmentation_resampling.lo fragmentation_standard.lo \ Grid_Accumulation_Functions.lo Grid_AggregationIndex.lo \ Grid_AHP.lo Grid_CVA.lo Grid_IMCORR.lo \ Grid_LayerOfMaximumValue.lo Grid_Pattern.lo \ LeastCostPathProfile.lo LeastCostPathProfile_Points.lo \ MLB_Interface.lo owa.lo PointsEx.lo Soil_Texture.lo libgrid_analysis_la_OBJECTS = $(am_libgrid_analysis_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgrid_analysis_la_SOURCES) DIST_SOURCES = $(libgrid_analysis_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1597 2013-01-28 17:02:55Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_analysis.la libgrid_analysis_la_SOURCES = \ Cost_Anisotropic.cpp\ Cost_Isotropic.cpp\ CoveredDistance.cpp\ CrossClassification.cpp\ fragmentation_base.cpp\ fragmentation_classify.cpp\ fragmentation_resampling.cpp\ fragmentation_standard.cpp\ Grid_Accumulation_Functions.cpp\ Grid_AggregationIndex.cpp\ Grid_AHP.cpp\ Grid_CVA.cpp\ Grid_IMCORR.cpp\ Grid_LayerOfMaximumValue.cpp\ Grid_Pattern.cpp\ LeastCostPathProfile.cpp\ LeastCostPathProfile_Points.cpp\ MLB_Interface.cpp\ owa.cpp\ PointsEx.cpp\ Soil_Texture.cpp\ Cost_Anisotropic.h\ Cost_Isotropic.h\ CoveredDistance.h\ CrossClassification.h\ fragmentation_base.h\ fragmentation_classify.h\ fragmentation_resampling.h\ fragmentation_standard.h\ Grid_Accumulation_Functions.h\ Grid_AggregationIndex.h\ Grid_AHP.h\ Grid_CVA.h\ Grid_IMCORR.h\ Grid_LayerOfMaximumValue.h\ Grid_Pattern.h\ LeastCostPathProfile.h\ LeastCostPathProfile_Points.h\ MLB_Interface.h\ owa.h\ PointsEx.h\ Soil_Texture.h libgrid_analysis_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/grid/grid_analysis/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/grid/grid_analysis/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgrid_analysis.la: $(libgrid_analysis_la_OBJECTS) $(libgrid_analysis_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgrid_analysis_la_OBJECTS) $(libgrid_analysis_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Cost_Anisotropic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Cost_Isotropic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CoveredDistance.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CrossClassification.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_AHP.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Accumulation_Functions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_AggregationIndex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_CVA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_IMCORR.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_LayerOfMaximumValue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Pattern.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LeastCostPathProfile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LeastCostPathProfile_Points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PointsEx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Soil_Texture.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragmentation_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragmentation_classify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragmentation_resampling.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragmentation_standard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owa.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/grid/grid_analysis/PointsEx.cpp000066400000000000000000000015501224124640700236400ustar00rootroot00000000000000/********************************************************** * Version $Id: PointsEx.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #include #include "PointsEx.h" CPointsEx::CPointsEx(void) { m_nPoints = 0; m_Points = NULL; m_ClosestPts = NULL; } CPointsEx::~CPointsEx(void) { Clear(); } void CPointsEx::Clear(void) { if( m_Points ) { SG_Free(m_Points); SG_Free(m_ClosestPts); } m_nPoints = 0; m_Points = NULL; m_ClosestPts = NULL; } bool CPointsEx::Add(int x, int y, int iClosestPt) { m_Points = (TSG_Point_Int *)SG_Realloc(m_Points, (m_nPoints + 1) * sizeof(TSG_Point_Int)); m_ClosestPts = (int*)SG_Realloc(m_ClosestPts, (m_nPoints + 1) * sizeof(int)); m_Points[m_nPoints].x = x; m_Points[m_nPoints].y = y; m_ClosestPts[m_nPoints] = iClosestPt; m_nPoints++; return( true ); } saga-2.1.0+dfsg/src/modules/grid/grid_analysis/PointsEx.h000066400000000000000000000013221224124640700233020ustar00rootroot00000000000000/********************************************************** * Version $Id: PointsEx.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #include "MLB_Interface.h" class CPointsEx { public: CPointsEx(); virtual ~CPointsEx(); void Clear (void); bool Add (int x, int y, int iClosestPt); int Get_Count (void) { return( m_nPoints ); } int Get_X (int Index) { return( m_Points[Index].x ); } int Get_Y (int Index) { return( m_Points[Index].y ); } int Get_ClosestPoint (int Index) { return( m_ClosestPts[Index] ); } private: int m_nPoints; TSG_Point_Int *m_Points; int *m_ClosestPts; };saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Soil_Texture.cpp000066400000000000000000000247641224124640700245310ustar00rootroot00000000000000/********************************************************** * Version $Id: Soil_Texture.cpp 1607 2013-02-15 15:28:07Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for an Automated Geo-Scientific Analysis // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // Soil_Texture.cpp // // // // Copyright (C) 2007 by // // Gianluca Massei // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for an Automated // // Geo-Scientific Analysis'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: g_massa@libero.it // // // // contact: Gianluca Massei // // Department of Economics and Appraisal // // University of Perugia - Italy // // www.unipg.it // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Soil_Texture.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- struct SClass { int ID, Color; CSG_String Name; int nPoints; double Sand[8], Clay[8]; }; //--------------------------------------------------------- const struct SClass Classes[12] = { { 1, SG_GET_RGB(000, 000, 255), _TL("Clay"), 6, { 0, 0, 20, 45, 45, 0 }, { 100, 60, 40, 40, 55, 100 } }, { 2, SG_GET_RGB(000, 200, 255), _TL("Silty Clay"), 4, { 0, 0, 20, 0 }, { 100, 60, 40, 40 } }, { 3, SG_GET_RGB(000, 200, 200), _TL("Silty Clay-Loam"), 5, { 0, 0, 20, 20, 0 }, { 40, 27, 27, 40, 40 } }, { 4, SG_GET_RGB(200, 000, 255), _TL("Sandy Clay"), 4, { 45, 45, 65, 45 }, { 55, 35, 35, 55 } }, { 5, SG_GET_RGB(200, 200, 200), _TL("Sandy Clay-Loam"), 6, { 45, 45, 52, 80, 65, 45 }, { 35, 27, 20, 20, 35, 35 } }, { 6, SG_GET_RGB(127, 127, 200), _TL("Clay-Loam"), 5, { 20, 20, 45, 45, 20 }, { 40, 27, 27, 40, 40 } }, { 7, SG_GET_RGB(000, 255, 000), _TL("Silt"), 5, { 0, 0, 20, 8, 0 }, { 12, 0, 0, 12, 12 } }, { 8, SG_GET_RGB(127, 255, 127), _TL("Silt-Loam"), 7, { 8, 20, 50, 23, 0, 0, 8 }, { 12, 0, 0, 27, 27, 12, 12 } }, { 9, SG_GET_RGB(127, 127, 127), _TL("Loam"), 6, { 23, 43, 52, 52, 45, 23 }, { 27, 7, 7, 20, 27, 27 } }, { 10, SG_GET_RGB(255, 000, 000), _TL("Sand"), 4, { 85, 100, 90, 85 }, { 0, 0, 10, 0 } }, { 11, SG_GET_RGB(255, 000, 127), _TL("Loamy Sand"), 5, { 70, 85, 90, 85, 70 }, { 0, 0, 10, 15, 0 } }, { 12, SG_GET_RGB(200, 127, 127), _TL("Sandy Loam"), 8, { 43, 50, 70, 85, 80, 52, 52, 43 }, { 7, 0, 0, 15, 20, 20, 7, 7 } } }; /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSoil_Texture::CSoil_Texture(void) { Set_Name (_TL("Soil Texture Classification")); Set_Author (_TL("Gianluca Massei (c) 2007 (g_massa@libero.it)")); Set_Description (_TW( "Derive soil texture classes with USDA scheme from sand, silt and clay contents.\n\n" " 1 - Clay\n" " 2 - Silty Clay\n" " 3 - Silty Clay-Loam\n" " 4 - Sandy Clay\n" " 5 - Sandy Clay-Loam\n" " 6 - Clay-Loam\n" " 7 - Silt\n" " 8 - Silt-Loam\n" " 9 - Loam\n" " 10 - Sand\n" " 11 - Loamy Sand\n" " 12 - Sandy Loam\n" "\nReference:\n" "USDA NRCS Soils Website\n" )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL, "SAND" , _TL("Sand"), _TL("sand content given as percentage"), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "SILT" , _TL("Silt"), _TL("silt content given as percentage"), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "CLAY" , _TL("Clay"), _TL("clay content given as percentage"), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "TEXTURE" , _TL("Soil Texture"), _TL("soil texture"), PARAMETER_OUTPUT, true, SG_DATATYPE_Byte ); Parameters.Add_Grid( NULL, "SUM" , _TL("Sum"), _TL("Sum of percentages"), PARAMETER_OUTPUT_OPTIONAL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSoil_Texture::On_Execute(void) { CSG_Grid *pSand, *pSilt, *pClay, *pTexture, *pSum; //----------------------------------------------------- pSand = Parameters("SAND") ->asGrid(); pSilt = Parameters("SILT") ->asGrid(); pClay = Parameters("CLAY") ->asGrid(); pTexture = Parameters("TEXTURE") ->asGrid(); pSum = Parameters("SUM") ->asGrid(); //----------------------------------------------------- if( (pSand ? 1 : 0) + (pSilt ? 1 : 0) + (pClay ? 1 : 0) < 2 ) { Error_Set(_TL("at least two contents (sand, silt, clay) have to be given")); return( false ); } //----------------------------------------------------- pTexture->Set_NoData_Value(0.0); CSG_Parameters P; if( DataObject_Get_Parameters(pTexture, P) && P("COLORS_TYPE") && P("LUT") ) { CSG_Table *pLUT = P("LUT")->asTable(); for(int iClass=0; iClass<12; iClass++) { CSG_Table_Record *pClass; if( (pClass = pLUT->Get_Record(iClass)) == NULL ) { pClass = pLUT->Add_Record(); } pClass->Set_Value(0, Classes[iClass].Color); pClass->Set_Value(1, Classes[iClass].Name); pClass->Set_Value(2, Classes[iClass].Name); pClass->Set_Value(3, Classes[iClass].ID); pClass->Set_Value(4, Classes[iClass].ID); } while( pLUT->Get_Record_Count() > 12 ) { pLUT->Del_Record(pLUT->Get_Record_Count() - 1); } P("COLORS_TYPE")->Set_Value(1); // Color Classification Type: Lookup Table DataObject_Set_Parameters(pTexture, P); } //----------------------------------------------------- for(int y=0; yis_NoData(x, y)) && !(pSilt && pSilt->is_NoData(x, y)) && !(pClay && pClay->is_NoData(x, y)) ) { double Sand = pSand ? pSand->asDouble(x, y) : 100.0 - (pSilt->asDouble(x, y) + pClay->asDouble(x, y)); double Silt = pSilt ? pSilt->asDouble(x, y) : 100.0 - (pSand->asDouble(x, y) + pClay->asDouble(x, y)); double Clay = pClay ? pClay->asDouble(x, y) : 100.0 - (pSand->asDouble(x, y) + pSilt->asDouble(x, y)); if( (Sum = Sand + Silt + Clay) > 0.0 ) { if( Sum != 100.0 ) { Sand *= 100.0 / Sum; Clay *= 100.0 / Sum; } Texture = Get_Texture(Sand, Clay); } } if( Texture ) { pTexture->Set_Value(x, y, Texture); if( pSum ) { pSum->Set_Value(x, y, Sum); } } else { pTexture->Set_NoData(x, y); if( pSum ) { pSum->Set_NoData(x, y); } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CSoil_Texture::Get_Texture(double Sand, double Clay) { for(int iClass=0; iClass<12; iClass++) { const struct SClass *c = Classes + iClass; bool bClass = false; for(int i=0, j=c->nPoints-1; inPoints; j=i++) { if( ((c->Clay[i] <= Clay && Clay < c->Clay[j]) || (c->Clay[j] <= Clay && Clay < c->Clay[i])) && Sand < (c->Sand[j] - c->Sand[i]) * (Clay - c->Clay[i]) / (c->Clay[j] - c->Clay[i]) + c->Sand[i] ) { bClass = !bClass; } } if( bClass ) { return( c->ID ); } } //----------------------------------------------------- return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_analysis/Soil_Texture.h000066400000000000000000000100701224124640700241570ustar00rootroot00000000000000/********************************************************** * Version $Id: Soil_Texture.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for an Automated Geo-Scientific Analysis // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // Soil_Texture.h // // // // Copyright (C) 2007 by // // Gianluca Massei // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for an Automated // // Geo-Scientific Analysis'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: g_massa@libero.it // // // // contact: Gianluca Massei // // Department of Economics and Appraisal // // University of Perugia - Italy // // www.unipg.it // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Soil_Texture_H #define HEADER_INCLUDED__Soil_Texture_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSoil_Texture : public CSG_Module_Grid { public: CSoil_Texture(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Soil Analysis") ); } protected: virtual bool On_Execute (void); private: int Get_Texture (double Sand, double Clay); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Soil_Texture_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/fragmentation_base.cpp000066400000000000000000000346411224124640700257260ustar00rootroot00000000000000/********************************************************** * Version $Id: fragmentation_base.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // Fragmentation_Base.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "fragmentation_base.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define LUT_ADD(i, color, id, name) m_LUT.Add_Record(); m_LUT[i][0] = color; m_LUT[i][1] = name; m_LUT[i][3] = id; m_LUT[i][4] = id; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFragmentation_Base::CFragmentation_Base(void) { //----------------------------------------------------- Set_Name (_TL("Fragmentation")); Set_Author (SG_T("(c) 2008 by O.Conrad")); Set_Description (_TW( "\n" "(1) interior, if Density = 1.0\n" "(2) undetermined, if Density > 0.6 and Density = Connectivity\n" "(3) perforated, if Density > 0.6 and Density - Connectivity > 0\n" "(4) edge, if Density > 0.6 and Density - Connectivity < 0\n" "(5) transitional, if 0.4 < Density < 0.6\n" "(6) patch, if Density < 0.4\n" "\n" "\n" "References:\n" "Riitters, K., Wickham, J., O'Neill, R., Jones, B., Smith, E. (2000): \n" "Global-scale patterns of forest fragmentation. Conservation Ecology 4(2): 3\n" "http://www.ecologyandsociety.org/vol4/iss2/art3/\n" )); //----------------------------------------------------- m_LUT.Add_Field(SG_T("COLOR") , SG_DATATYPE_Color); m_LUT.Add_Field(SG_T("NAME") , SG_DATATYPE_String); m_LUT.Add_Field(SG_T("DECRIPTION") , SG_DATATYPE_String); m_LUT.Add_Field(SG_T("MIN") , SG_DATATYPE_Double); m_LUT.Add_Field(SG_T("MAX") , SG_DATATYPE_Double); LUT_ADD(0, SG_GET_RGB( 0, 127, 0), CLASS_CORE , _TL("Core")) LUT_ADD(1, SG_GET_RGB( 34, 255, 34), CLASS_INTERIOR , _TL("Interior")) LUT_ADD(2, SG_GET_RGB(129, 255, 129), CLASS_UNDETERMINED, _TL("Undetermined")) LUT_ADD(3, SG_GET_RGB(255, 110, 0), CLASS_PERFORATED , _TL("Perforated")) LUT_ADD(4, SG_GET_RGB(255, 255, 0), CLASS_EDGE , _TL("Edge")) LUT_ADD(5, SG_GET_RGB(162, 162, 255), CLASS_TRANSITIONAL, _TL("Transitional")) LUT_ADD(6, SG_GET_RGB( 56, 56, 255), CLASS_PATCH , _TL("Patch")) LUT_ADD(7, SG_GET_RGB(200, 200, 200), CLASS_NONE , _TL("None")) //----------------------------------------------------- Parameters.Add_Grid( NULL , "CLASSES" , _TL("Classification"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "DENSITY" , _TL("Density [Percent]"), _TL("Density Index (Pf)."), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "CONNECTIVITY" , _TL("Connectivity [Percent]"), _TL("Connectivity Index (Pff)."), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "FRAGMENTATION" , _TL("Fragmentation"), _TL("Fragmentation Index"), PARAMETER_OUTPUT, true, SG_DATATYPE_Byte ); Parameters.Add_Table( NULL , "FRAGSTATS" , _TL("Summary"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Value( NULL , "CLASS" , _TL("Class Identifier"), _TL(""), PARAMETER_TYPE_Int , 1 ); Parameters.Add_Range( NULL , "NEIGHBORHOOD" , _TL("Neighborhood"), _TL("Moving window size = 1 + 2 * Neighborhood."), 3, 3, 0.0, true ); Parameters.Add_Choice( NULL , "AGGREGATION" , _TL("Level Aggregation"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("average"), _TL("multiplicative") ), 0 ); Parameters.Add_Value( NULL , "BORDER" , _TL("Add Border"), _TL(""), PARAMETER_TYPE_Bool , false ); Parameters.Add_Value( NULL , "WEIGHT" , _TL("Connectivity Weighting"), _TL(""), PARAMETER_TYPE_Double , 1.1, 0.0, true ); Parameters.Add_Value( NULL , "DENSITY_MIN" , _TL("Minimum Density [Percent]"), _TL(""), PARAMETER_TYPE_Double , 10.0, 0.0, true, 100.0, true ); Parameters.Add_Value( NULL , "DENSITY_INT" , _TL("Minimum Density for Interior Forest [Percent]"), _TL("if less than 100, it is distinguished between interior and core forest"), PARAMETER_TYPE_Double , 99.0, 0.0, true, 100.0, true ); } //--------------------------------------------------------- CFragmentation_Base::~CFragmentation_Base(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFragmentation_Base::On_Execute(void) { int Class; CSG_Grid *pClasses, *pDensity, *pConnectivity, *pFragmentation; //----------------------------------------------------- pClasses = Parameters("CLASSES") ->asGrid(); pDensity = Parameters("DENSITY") ->asGrid(); pConnectivity = Parameters("CONNECTIVITY") ->asGrid(); pFragmentation = Parameters("FRAGMENTATION") ->asGrid(); Class = Parameters("CLASS") ->asInt(); m_Radius_Min = Parameters("NEIGHBORHOOD") ->asRange()->Get_LoParm()->asDouble(); m_Radius_Max = Parameters("NEIGHBORHOOD") ->asRange()->Get_HiParm()->asDouble(); m_Aggregation = Parameters("AGGREGATION") ->asInt(); m_Weight = Parameters("WEIGHT") ->asDouble(); m_Density_Min = Parameters("DENSITY_MIN") ->asDouble() / 100.0; m_Density_Interior = Parameters("DENSITY_INT") ->asDouble() / 100.0; m_Radius_iMin = (int)(0.5 + m_Radius_Min); m_Radius_iMax = (int)(0.5 + m_Radius_Max); //----------------------------------------------------- CSG_Parameters Parms; DataObject_Set_Colors(pDensity , 100, SG_COLORS_WHITE_GREEN); DataObject_Set_Colors(pConnectivity , 100, SG_COLORS_WHITE_GREEN); DataObject_Set_Colors(pFragmentation, 100, SG_COLORS_WHITE_GREEN, true); if( DataObject_Get_Parameters(pFragmentation, Parms) && Parms("COLORS_TYPE") && Parms("LUT") ) { Parms("LUT")->asTable()->Assign_Values(&m_LUT); // Lookup Table Parms("COLORS_TYPE")->Set_Value(1); // Color Classification Type: Lookup Table DataObject_Set_Parameters(pFragmentation, Parms); } // pFragmentation->Set_NoData_Value(CLASS_NONE); //----------------------------------------------------- if( Initialise(pClasses, Class) ) { for(int y=0; ySet_Value (x, y, 100.0 * Density); pConnectivity ->Set_Value (x, y, 100.0 * Connectivity); // pFragmentation ->Set_Value (x, y, 100.0 * Density * Connectivity); pFragmentation ->Set_Value (x, y, Get_Classification(Density, Connectivity)); } else { pDensity ->Set_NoData(x, y); pConnectivity ->Set_NoData(x, y); pFragmentation ->Set_NoData(x, y); } } } //------------------------------------------------- if( Parameters("BORDER")->asBool() ) { Add_Border(pFragmentation); } Get_Statistics(pFragmentation, *Parameters("FRAGSTATS")->asTable()); Finalise(); return( true ); } Finalise(); return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CFragmentation_Base::Get_Classification(double Density, double Connectivity) { if( Density >= 0.999 ) // (7) core, if Density = 1.0 { if( m_Density_Interior < 0.999 ) { return( CLASS_CORE ); } else { return( CLASS_INTERIOR ); } } if( Density >= m_Density_Interior ) // (4) interior, if Density = 1.0 { return( CLASS_INTERIOR ); } else if( Density > 0.6 ) { Connectivity *= m_Weight; if( Density < Connectivity ) // (1) edge, if Density > 0.6 and Density - Connectivity < 0 { return( CLASS_EDGE ); } else if( Density > Connectivity ) // (3) perforated, if Density > 0.6 and Density - Connectivity > 0 { return( CLASS_PERFORATED ); } else // (2) undetermined, if Density > 0.6 and Density = Connectivity { return( CLASS_UNDETERMINED ); } } else if( Density >= 0.4 ) // (6) transitional, if 0.4 < Density < 0.6 { return( CLASS_TRANSITIONAL ); } else if( Density >= m_Density_Min ) // (5) patch, if Density < 0.4 { return( CLASS_PATCH ); } else { return( CLASS_NONE ); } } //--------------------------------------------------------- void CFragmentation_Base::Add_Border(CSG_Grid *pFragmentation) { int x, y; CSG_Grid Tmp(pFragmentation, SG_DATATYPE_Byte); for(y=0; yasInt(x, y) == CLASS_INTERIOR ) { int i, ix, iy; for(i=0; i<8; i++) { if( pFragmentation->Get_System().Get_Neighbor_Pos(i, x, y, ix, iy) && pFragmentation->asInt(ix, iy) != CLASS_INTERIOR && pFragmentation->asInt(ix, iy) != CLASS_CORE ) { Tmp.Set_Value(ix, iy, 1); } } } } } for(y=0; ySet_Value(x, y, CLASS_INTERIOR); } } } } //--------------------------------------------------------- #define STATISTICS_ADD(i, id, name) Statistics.Add_Record();\ Statistics[i][0] = id;\ Statistics[i][1] = name;\ Statistics[i][2] = s[i];\ Statistics[i][3] = s[i] * Get_Cellsize();\ Statistics[i][4] = 100.0 * s[i] / (double)n; //--------------------------------------------------------- void CFragmentation_Base::Get_Statistics(CSG_Grid *pFragmentation, CSG_Table &Statistics) { if( pFragmentation != NULL && &Statistics != NULL ) { int i, n, s[8]; for(i=0, n=0; i<8; i++) { s[i] = 0; } for(int y=0; yasInt(x, y) ) { case CLASS_CORE: s[0]++; n++; break; case CLASS_INTERIOR: s[1]++; n++; break; case CLASS_UNDETERMINED: s[2]++; n++; break; case CLASS_PERFORATED: s[3]++; n++; break; case CLASS_EDGE: s[4]++; n++; break; case CLASS_TRANSITIONAL: s[5]++; n++; break; case CLASS_PATCH: s[6]++; n++; break; case CLASS_NONE: s[7]++; n++; break; } } } //------------------------------------------------- Statistics.Destroy(); Statistics.Add_Field(SG_T("CLASS_ID") , SG_DATATYPE_Int); Statistics.Add_Field(SG_T("CLASS_NAME") , SG_DATATYPE_String); Statistics.Add_Field(SG_T("N_CELLS") , SG_DATATYPE_Int); Statistics.Add_Field(SG_T("AREA_ABS") , SG_DATATYPE_Double); Statistics.Add_Field(SG_T("AREA_REL") , SG_DATATYPE_Double); STATISTICS_ADD(0, CLASS_CORE , _TL("Core")) STATISTICS_ADD(1, CLASS_INTERIOR , _TL("Interior")) STATISTICS_ADD(2, CLASS_UNDETERMINED, _TL("Undetermined")) STATISTICS_ADD(3, CLASS_PERFORATED , _TL("Perforated")) STATISTICS_ADD(4, CLASS_EDGE , _TL("Edge")) STATISTICS_ADD(5, CLASS_TRANSITIONAL, _TL("Transitional")) STATISTICS_ADD(6, CLASS_PATCH , _TL("Patch")) STATISTICS_ADD(7, CLASS_NONE , _TL("None")) } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_analysis/fragmentation_base.h000066400000000000000000000132601224124640700253650ustar00rootroot00000000000000/********************************************************** * Version $Id: fragmentation_base.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // Fragmentation.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Fragmentation_Base_H #define HEADER_INCLUDED__Fragmentation_Base_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // #define CLASS_ORIGINAL #ifdef CLASS_ORIGINAL enum { CLASS_CORE = 7, CLASS_INTERIOR = 4, CLASS_UNDETERMINED = 2, CLASS_PERFORATED = 3, CLASS_EDGE = 1, CLASS_TRANSITIONAL = 6, CLASS_PATCH = 5, CLASS_NONE = 0 }; #else enum { CLASS_CORE = 1, CLASS_INTERIOR, CLASS_UNDETERMINED, CLASS_PERFORATED, CLASS_EDGE, CLASS_TRANSITIONAL, CLASS_PATCH, CLASS_NONE }; #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFragmentation_Base : public CSG_Module_Grid { public: CFragmentation_Base(void); virtual ~CFragmentation_Base(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Fragmentation Analysis") ); } protected: virtual bool On_Execute (void); virtual bool Initialise (CSG_Grid *pClasses, int Class) { return( true ); } virtual bool Finalise (void) { return( true ); } virtual bool Get_Fragmentation (int x, int y, double &Density, double &Connectivity) = 0; int m_Aggregation, m_Radius_iMin, m_Radius_iMax; double m_Density_Min, m_Density_Interior, m_Weight, m_Radius_Min, m_Radius_Max; CSG_Table m_LUT; int Get_Classification (double Density, double Connectivity); void Add_Border (CSG_Grid *pFragmentation); void Get_Statistics (CSG_Grid *pFragmentation, CSG_Table &Statistics); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Fragmentation_Base_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/fragmentation_classify.cpp000066400000000000000000000176411224124640700266320ustar00rootroot00000000000000/********************************************************** * Version $Id: fragmentation_classify.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // Fragmentation_Classify.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "fragmentation_classify.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFragmentation_Classify::CFragmentation_Classify(void) { Parameters.Create(this, SG_T(""), SG_T(""), SG_T(""), true); //----------------------------------------------------- Set_Name (_TL("Fragmentation Classes from Density and Connectivity")); Set_Author (SG_T("(c) 2008 by O.Conrad")); Set_Description (_TW( "\n" "(1) interior, if Density = 1.0\n" "(2) undetermined, if Density > 0.6 and Density = Connectivity\n" "(3) perforated, if Density > 0.6 and Density - Connectivity > 0\n" "(4) edge, if Density > 0.6 and Density - Connectivity < 0\n" "(5) transitional, if 0.4 < Density < 0.6\n" "(6) patch, if Density < 0.4\n" "\n" "\n" "References:\n" "Riitters, K., Wickham, J., O'Neill, R., Jones, B., Smith, E. (2000): \n" "Global-scale patterns of forest fragmentation. Conservation Ecology 4(2): 3\n" "http://www.ecologyandsociety.org/vol4/iss2/art3/\n" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "DENSITY" , _TL("Density [Percent]"), _TL("Density Index (Pf)."), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "CONNECTIVITY" , _TL("Connectivity [Percent]"), _TL("Connectivity Index (Pff)."), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "FRAGMENTATION" , _TL("Fragmentation"), _TL("Fragmentation Index"), PARAMETER_OUTPUT, true, SG_DATATYPE_Byte ); Parameters.Add_Value( NULL , "BORDER" , _TL("Add Border"), _TL(""), PARAMETER_TYPE_Bool , false ); Parameters.Add_Value( NULL , "WEIGHT" , _TL("Connectivity Weighting"), _TL(""), PARAMETER_TYPE_Double , 1.1, 0.0, true ); Parameters.Add_Value( NULL , "DENSITY_MIN" , _TL("Minimum Density [Percent]"), _TL(""), PARAMETER_TYPE_Double , 10.0, 0.0, true, 100.0, true ); Parameters.Add_Value( NULL , "DENSITY_INT" , _TL("Minimum Density for Interior Forest [Percent]"), _TL("if less than 100, it is distinguished between interior and core forest"), PARAMETER_TYPE_Double , 99.0, 0.0, true, 100.0, true ); } //--------------------------------------------------------- CFragmentation_Classify::~CFragmentation_Classify(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFragmentation_Classify::On_Execute(void) { CSG_Grid *pDensity, *pConnectivity, *pFragmentation; pDensity = Parameters("DENSITY") ->asGrid(); pConnectivity = Parameters("CONNECTIVITY") ->asGrid(); pFragmentation = Parameters("FRAGMENTATION") ->asGrid(); m_Weight = Parameters("WEIGHT") ->asDouble(); m_Density_Min = Parameters("DENSITY_MIN") ->asDouble() / 100.0; m_Density_Interior = Parameters("DENSITY_INT") ->asDouble() / 100.0; //----------------------------------------------------- CSG_Parameters Parms; DataObject_Set_Colors(pFragmentation, 100, SG_COLORS_WHITE_GREEN, true); if( DataObject_Get_Parameters(pFragmentation, Parms) && Parms("COLORS_TYPE") && Parms("LUT") ) { Parms("LUT")->asTable()->Assign_Values(&m_LUT); // Lookup Table Parms("COLORS_TYPE")->Set_Value(1); // Color Classification Type: Lookup Table DataObject_Set_Parameters(pFragmentation, Parms); } // pFragmentation->Set_NoData_Value(CLASS_NONE); //----------------------------------------------------- if( 1 ) { for(int y=0; yis_NoData(x, y) && !pConnectivity->is_NoData(x, y) ) { double Density = pDensity ->asDouble(x, y) / 100.0; double Connectivity = pConnectivity ->asDouble(x, y) / 100.0; // pFragmentation ->Set_Value (x, y, 100.0 * Density * Connectivity); pFragmentation ->Set_Value (x, y, Get_Classification(Density, Connectivity)); } else { pFragmentation ->Set_NoData(x, y); } } } //------------------------------------------------- if( Parameters("BORDER")->asBool() ) { Add_Border(pFragmentation); } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_analysis/fragmentation_classify.h000066400000000000000000000110151224124640700262640ustar00rootroot00000000000000/********************************************************** * Version $Id: fragmentation_classify.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // Fragmentation_Classify.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Fragmentation_Classify_H #define HEADER_INCLUDED__Fragmentation_Classify_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "fragmentation_base.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFragmentation_Classify : public CFragmentation_Base { public: CFragmentation_Classify(void); virtual ~CFragmentation_Classify(void); protected: virtual bool On_Execute (void); virtual bool Get_Fragmentation (int x, int y, double &Density, double &Connectivity) { return( false ); } private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Fragmentation_Classify_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/fragmentation_resampling.cpp000066400000000000000000000245171224124640700271560ustar00rootroot00000000000000/********************************************************** * Version $Id: fragmentation_resampling.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // Fragmentation_Resampling.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "fragmentation_resampling.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFragmentation_Resampling::CFragmentation_Resampling(void) : CFragmentation_Base() { //----------------------------------------------------- Set_Name (_TL("Fragmentation (Alternative)")); Set_Author (SG_T("(c) 2008 by O.Conrad")); Set_Description (_TW( "\n" "(1) interior, if Density = 1.0\n" "(2) undetermined, if Density > 0.6 and Density = Connectivity\n" "(3) perforated, if Density > 0.6 and Density - Connectivity > 0\n" "(4) edge, if Density > 0.6 and Density - Connectivity < 0\n" "(5) transitional, if 0.4 < Density < 0.6\n" "(6) patch, if Density < 0.4\n" "\n" "\n" "References:\n" "Riitters, K., Wickham, J., O'Neill, R., Jones, B., Smith, E. (2000): \n" "Global-scale patterns of forest fragmentation. Conservation Ecology 4(2): 3\n" "http://www.ecologyandsociety.org/vol4/iss2/art3/\n" )); //----------------------------------------------------- Parameters.Add_Value( NULL , "LEVEL_GROW" , _TL("Search Distance Increment"), _TL(""), PARAMETER_TYPE_Double , 1.0, 0.0, true ); Parameters.Add_Value( NULL , "DENSITY_MEAN" , _TL("Density from Neighbourhood"), _TL(""), PARAMETER_TYPE_Bool , true ); } //--------------------------------------------------------- CFragmentation_Resampling::~CFragmentation_Resampling(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFragmentation_Resampling::Initialise(CSG_Grid *pClasses, int Class) { int x, y, Level_Count; double Level_Grow, Level_Start, Density, Connectivity; CSG_Grid *pDensity, *pConnectivity; pDensity = Parameters("DENSITY") ->asGrid(); pConnectivity = Parameters("CONNECTIVITY") ->asGrid(); Level_Grow = Parameters("LEVEL_GROW") ->asDouble(); m_bDensityMean = Parameters("DENSITY_MEAN") ->asBool(); //----------------------------------------------------- if( Level_Grow > 0.0 ) { for(y=0; ySet_Value (x, y, Density); pConnectivity ->Set_Value (x, y, Connectivity); } else { pDensity ->Set_NoData(x, y); pConnectivity ->Set_NoData(x, y); } } } //------------------------------------------------- // Level_Grow *= Get_Cellsize(); // Level_Start = 0.0; // Level_Count = m_Radius_iMax; // m_Radius_iMin--; // m_Radius_iMax--; Level_Count = 1 + (int)((m_Radius_Max - m_Radius_Min) / Level_Grow); Level_Grow *= Get_Cellsize(); Level_Start = Level_Grow * (1.0 + 2.0 * m_Radius_Min); if( m_Density .Create(pDensity , Level_Grow, Level_Start, Level_Count, GRID_PYRAMID_Mean, GRID_PYRAMID_Arithmetic) && m_Connectivity .Create(pConnectivity , Level_Grow, Level_Start, Level_Count, GRID_PYRAMID_Mean, GRID_PYRAMID_Arithmetic) ) { for(int iGrid=0; iGridGet_Cellsize(), m_Density.Get_Grid(iGrid)->Get_Cellsize() / Get_Cellsize())); // DataObject_Add(SG_Create_Grid(*m_Density .Get_Grid(iGrid))); // DataObject_Add(SG_Create_Grid(*m_Connectivity .Get_Grid(iGrid))); } return( true ); } } return( false ); } //--------------------------------------------------------- bool CFragmentation_Resampling::Finalise(void) { m_Density .Destroy(); m_Connectivity .Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFragmentation_Resampling::Get_Fragmentation(int x, int y, double &Density, double &Connectivity) { if( m_Density.Get_Grid(-1)->is_InGrid(x, y) ) { TSG_Point p = Get_System()->Get_Grid_to_World(x, y); // Density = 0.0; m_Density .Get_Grid(m_Radius_iMin)->Get_Value(p, Density); // Connectivity = 0.0; m_Connectivity .Get_Grid(m_Radius_iMin)->Get_Value(p, Connectivity); // for(int iGrid=m_Radius_iMin+1; iGridGet_Value(p, Density); Connectivity = 0.0; m_Connectivity .Get_Grid(0)->Get_Value(p, Connectivity); for(int iGrid=1; iGridGet_Value(p, d) && m_Connectivity.Get_Grid(iGrid)->Get_Value(p, c) ) { switch( m_Aggregation ) { case 0: default: Density = 0.5 * (d + Density); Connectivity = 0.5 * (c + Connectivity); break; case 1: Density *= d; Connectivity *= c; break; } } } if( Density < 0.0 || Connectivity < 0.0 ) return( false ); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFragmentation_Resampling::Get_Connectivity(int x, int y, CSG_Grid *pClasses, int Class, double &Density, double &Connectivity) { if( pClasses && pClasses->is_InGrid(x, y) ) { bool bClass; int i, j, nDensity, nConnectivity, ix, iy; //------------------------------------------------- bClass = pClasses->asInt(x, y) == Class; Density = bClass ? 1.0 : 0.0; Connectivity = 0.0; for(i=0, j=7, nDensity=1, nConnectivity=0; i<8; j=i++) { if( Get_System()->Get_Neighbor_Pos(i, x, y, ix, iy) && !pClasses->is_NoData(ix, iy) ) { nDensity++; if( pClasses->asInt(ix, iy) == Class ) { if( m_bDensityMean ) Density++; nConnectivity++; if( bClass ) Connectivity++; if( Get_System()->Get_Neighbor_Pos(j, x, y, ix, iy) && !pClasses->is_NoData(ix, iy) ) { nConnectivity++; if( pClasses->asInt(ix, iy) == Class ) Connectivity++; } } else { if( bClass ) nConnectivity++; if( Get_System()->Get_Neighbor_Pos(j, x, y, ix, iy) && !pClasses->is_NoData(ix, iy) && pClasses->asInt(ix, iy) == Class ) nConnectivity++; } } } if( nDensity > 1 && m_bDensityMean ) { Density /= nDensity; } if( nConnectivity > 1 ) { Connectivity /= nConnectivity; } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_analysis/fragmentation_resampling.h000066400000000000000000000111121224124640700266060ustar00rootroot00000000000000/********************************************************** * Version $Id: fragmentation_resampling.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // Fragmentation_Resampling.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Fragmentation_Resampling_H #define HEADER_INCLUDED__Fragmentation_Resampling_H //--------------------------------------------------------- #include "fragmentation_base.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFragmentation_Resampling : public CFragmentation_Base { public: CFragmentation_Resampling(void); virtual ~CFragmentation_Resampling(void); protected: virtual bool Initialise (CSG_Grid *pClasses, int Class); virtual bool Finalise (void); virtual bool Get_Fragmentation (int x, int y, double &Density, double &Connectivity); private: bool m_bDensityMean; CSG_Grid_Pyramid m_Density, m_Connectivity; bool Get_Connectivity (int x, int y, CSG_Grid *pClasses, int Class, double &Density, double &Connectivity); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Fragmentation_Resampling_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/fragmentation_standard.cpp000066400000000000000000000260101224124640700266030ustar00rootroot00000000000000/********************************************************** * Version $Id: fragmentation_standard.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // Fragmentation_Standard.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "fragmentation_standard.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define VAL_NODATA -1 #define VAL_NO 0 #define VAL_YES 1 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFragmentation_Standard::CFragmentation_Standard(void) : CFragmentation_Base() { //----------------------------------------------------- Set_Name (_TL("Fragmentation (Standard)")); Set_Author (SG_T("(c) 2008 by O.Conrad")); Set_Description (_TW( "Grid based fragmentation analysis after Riitters et al. (2000).\n" "\n" "(1) interior, if Density = 1.0\n" "(2) undetermined, if Density > 0.6 and Density = Connectivity\n" "(3) perforated, if Density > 0.6 and Density - Connectivity > 0\n" "(4) edge, if Density > 0.6 and Density - Connectivity < 0\n" "(5) transitional, if 0.4 < Density < 0.6\n" "(6) patch, if Density < 0.4\n" "\n" "\n" "References:\n" "Riitters, K., Wickham, J., O'Neill, R., Jones, B., Smith, E. (2000): \n" "Global-scale patterns of forest fragmentation. Conservation Ecology 4(2): 3\n" "http://www.ecologyandsociety.org/vol4/iss2/art3/\n" )); //----------------------------------------------------- Parameters.Add_Choice( NULL , "CIRCULAR" , _TL("Neighborhood Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("square"), _TL("circle") ), 1 ); Parameters.Add_Value( NULL , "DIAGONAL" , _TL("Include diagonal neighbour relations"), _TL(""), PARAMETER_TYPE_Bool , true ); } //--------------------------------------------------------- CFragmentation_Standard::~CFragmentation_Standard(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFragmentation_Standard::Initialise(CSG_Grid *pClasses, int Class) { int x, y; m_bCircular = Parameters("CIRCULAR")->asInt() == 1; m_bDiagonal = Parameters("DIAGONAL")->asBool(); //----------------------------------------------------- m_Grid.Create(*Get_System(), SG_DATATYPE_Char); m_Grid.Set_NoData_Value(VAL_NODATA); for(y=0; yis_NoData(x, y) ? VAL_NODATA : pClasses->asInt(x, y) == Class ? VAL_YES : VAL_NO); } } //----------------------------------------------------- m_Radius.Create(SG_DATATYPE_Int, 1 + 2 * m_Radius_iMax, 1 + 2 * m_Radius_iMax); for(y=0; y 0 ) { Density /= nDensity; } if( nConnectivity > 0 ) { Connectivity /= nConnectivity; } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline bool CFragmentation_Standard::in_Radius(int x, int y, int Radius) { if( m_bCircular ) { x += m_Radius_iMax; y += m_Radius_iMax; if( !m_Radius.is_InGrid(x, y) || m_Radius.asInt(x, y) > Radius ) { return( false ); } } return( true ); } //--------------------------------------------------------- inline bool CFragmentation_Standard::Get_Value(int x, int y, int dx, int dy, int Radius, int &Value) { if( in_Radius(dx, dy, Radius) ) { x += dx; y += dy; if( m_Grid.is_InGrid(x, y) ) { Value = m_Grid.asInt(x, y); return( true ); } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_analysis/fragmentation_standard.h000066400000000000000000000115331224124640700262540ustar00rootroot00000000000000/********************************************************** * Version $Id: fragmentation_standard.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_analysis // // // //-------------------------------------------------------// // // // Fragmentation_Standard.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Fragmentation_Standard_H #define HEADER_INCLUDED__Fragmentation_Standard_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "fragmentation_base.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFragmentation_Standard : public CFragmentation_Base { public: CFragmentation_Standard(void); virtual ~CFragmentation_Standard(void); protected: virtual bool Initialise (CSG_Grid *pClasses, int Class); virtual bool Finalise (void); virtual bool Get_Fragmentation (int x, int y, double &Density, double &Connectivity); private: bool m_bCircular, m_bDiagonal; CSG_Grid m_Grid, m_Radius; bool Get_Fragmentation (int x, int y, double &Density, double &Connectivity, int Radius); bool in_Radius (int x, int y, int Radius); bool Get_Value (int x, int y, int dx, int dy, int Radius, int &Value); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Fragmentation_Standard_H saga-2.1.0+dfsg/src/modules/grid/grid_analysis/owa.cpp000066400000000000000000000102221224124640700226510ustar00rootroot00000000000000/********************************************************** * Version $Id: owa.cpp 1394 2012-05-07 14:23:12Z manfred-e $ *********************************************************/ /******************************************************************************* OWA.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "owa.h" COWA::COWA(void){ Parameters.Set_Name(_TL("Ordered Weighted Averaging (OWA)")); Parameters.Set_Description(_TW( "(c) 2006 by Victor Olaya. Ordered Weighted Averaging (OWA)")); Parameters.Add_Grid_List(NULL, "GRIDS", _TL("Input Grids"), _TL("Input Grids"), PARAMETER_INPUT); Parameters.Add_FixedTable(NULL, "WEIGHTS", _TL("Weights"), _TL("")); Parameters.Add_Grid(NULL, "OUTPUT", _TL("Output Grid"), _TL(""), PARAMETER_OUTPUT); CSG_Table_Record *pRecord; CSG_Table *pWeights = Parameters("WEIGHTS")->asTable(); pWeights->Set_Name(_TL("Weights")); pWeights->Add_Field(_TL("Weight") , SG_DATATYPE_Double); pRecord = pWeights->Add_Record(); pRecord->Set_Value(0, 1); }//constructor COWA::~COWA(void){} bool COWA::On_Execute(void){ bool bAllValuesAreOK; int i; int x,y; double *pCoefs; double *pOrderedValues; double dValue; double dSum = 0; CSG_Grid *pOutputGrid; // OC: CSG_Grid **pGrids; CSG_Table_Record *pRecord; CSG_Table *pTable; CSG_Parameter_Grid_List* pGridsList; pTable = Parameters("WEIGHTS")->asTable(); pOutputGrid = Parameters("OUTPUT")->asGrid(); if( (pGridsList = (CSG_Parameter_Grid_List *)Parameters("GRIDS")->Get_Data()) != NULL && pGridsList->Get_Count() > 0 ){ if (pTable->Get_Record_Count() < pGridsList->Get_Count()){ Message_Add(_TL("Error : Wrong weights table. Check table dimensions")); return false; }//if pCoefs = new double [pGridsList->Get_Count()]; pOrderedValues = new double [pGridsList->Get_Count()]; // OC: for (i = 0; iGet_Count(); i++){ pRecord = pTable->Get_Record(i); pCoefs[i] = pRecord->asDouble(0); dSum += pRecord->asDouble(0); }//for for (i = 0; iGet_Count(); i++){ pCoefs[i] = pCoefs[i] / dSum; }//for for(y=0; yGet_Count(); i++){ // OC: if (!pGrids[i]->is_NoData(x,y)){ if (!pGridsList->asGrid(i)->is_NoData(x,y)){ // OC: pOrderedValues[i] = pGrids[i]->asDouble(x,y); pOrderedValues[i] = pGridsList->asGrid(i)->asDouble(x,y); }//if else{ bAllValuesAreOK = false; break; }//else }//for if (bAllValuesAreOK){ Sort(pOrderedValues, pGridsList->Get_Count()); for (i = 0; iGet_Count(); i++){ dValue += pCoefs[i] * pOrderedValues[i]; }//for pOutputGrid->Set_Value(x,y,dValue); }//if else{ pOutputGrid->Set_NoData(x,y); }//else }//for }//for delete [] pCoefs; delete [] pOrderedValues; }//if return true; }//method #define SWAP(a,b) {dTemp=(a);(a)=(b);(b)=dTemp;} void COWA::Sort(double *arr, int size){ int indexOfMin, pass, j; double dTemp; for (pass = 0; pass < size - 1; pass++){ indexOfMin = pass; for (j = pass + 1; j < size; j++) if (arr[j] < arr[indexOfMin]) indexOfMin = j; SWAP(arr[pass], arr[indexOfMin]); }//for }// method saga-2.1.0+dfsg/src/modules/grid/grid_analysis/owa.h000066400000000000000000000025341224124640700223250ustar00rootroot00000000000000/********************************************************** * Version $Id: owa.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* owa.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class COWA : public CSG_Module_Grid { public: COWA(void); virtual ~COWA(void); private: void Sort(double *arr, int size); protected: virtual bool On_Execute(void); }; saga-2.1.0+dfsg/src/modules/grid/grid_calculus/000077500000000000000000000000001224124640700213525ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Fuzzify.cpp000066400000000000000000000164151224124640700235330ustar00rootroot00000000000000/********************************************************** * Version $Id: Fuzzify.cpp 1318 2012-01-26 13:44:28Z oconrad $ *********************************************************/ /******************************************************************************* Fuzzify.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Fuzzify.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFuzzify::CFuzzify(void) { Set_Name (_TL("Fuzzify")); Set_Author (SG_T("Victor Olaya (c) 2004")); Set_Description (_TW( "Translates grid values into fuzzy set membership as preparation for fuzzy logic analysis." )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Fuzzified Grid"), _TL(""), PARAMETER_OUTPUT ); CSG_Parameter *pNode = Parameters.Add_Node( NULL , "NODE_PTS", _TL("Control Points"), _TL("") ); Parameters.Add_Value( pNode , "A" , _TL("A"), _TL("Values lower than A will be set to 0."), PARAMETER_TYPE_Double, 10 ); Parameters.Add_Value( pNode , "B" , _TL("B"), _TL("Values between A and B increase from 0 to 1, values between B and C will be set to 1."), PARAMETER_TYPE_Double, 10 ); Parameters.Add_Value( pNode , "C" , _TL("C"), _TL("Values between B and C will be set to 1, values between C and D decrease from 1 to 0."), PARAMETER_TYPE_Double, 10 ); Parameters.Add_Value( pNode , "D" , _TL("D"), _TL("Values greater than D will be set to 0."), PARAMETER_TYPE_Double, 10 ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Membership Function Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("linear"), _TL("sigmoidal"), _TL("j-shaped") ), 0 ); Parameters.Add_Value( NULL , "AUTOFIT" , _TL("Adjust to Grid"), _TL("Automatically adjust control points to grid's data range"), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CFuzzify::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("INPUT")) || !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AUTOFIT")) ) { if( pParameters->Get_Parameter("AUTOFIT")->asBool() && pParameters->Get_Parameter("INPUT")->asGrid() ) { CSG_Grid *pGrid = pParameters->Get_Parameter("INPUT")->asGrid(); pParameters->Get_Parameter("A")->Set_Value(pGrid->Get_ZMin()); pParameters->Get_Parameter("B")->Set_Value(pGrid->Get_ZMin() + 0.3 * pGrid->Get_ZRange()); pParameters->Get_Parameter("C")->Set_Value(pGrid->Get_ZMax() - 0.3 * pGrid->Get_ZRange()); pParameters->Get_Parameter("D")->Set_Value(pGrid->Get_ZMax()); } } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("A")) ) { if( pParameter->asDouble() > pParameters->Get_Parameter("B")->asDouble() ) { pParameter->Set_Value(pParameters->Get_Parameter("B")->asDouble()); } } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("B")) ) { if( pParameter->asDouble() < pParameters->Get_Parameter("A")->asDouble() ) { pParameter->Set_Value(pParameters->Get_Parameter("A")->asDouble()); } else if( pParameter->asDouble() > pParameters->Get_Parameter("C")->asDouble() ) { pParameter->Set_Value(pParameters->Get_Parameter("C")->asDouble()); } } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("C")) ) { if( pParameter->asDouble() < pParameters->Get_Parameter("B")->asDouble() ) { pParameter->Set_Value(pParameters->Get_Parameter("B")->asDouble()); } else if( pParameter->asDouble() > pParameters->Get_Parameter("D")->asDouble() ) { pParameter->Set_Value(pParameters->Get_Parameter("D")->asDouble()); } } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("D")) ) { if( pParameter->asDouble() < pParameters->Get_Parameter("C")->asDouble() ) { pParameter->Set_Value(pParameters->Get_Parameter("C")->asDouble()); } } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFuzzify::On_Execute(void) { int Type; double A, B, C, D; CSG_Grid *pInput, *pOutput; //----------------------------------------------------- pInput = Parameters("INPUT") ->asGrid(); pOutput = Parameters("OUTPUT") ->asGrid(); Type = Parameters("TYPE") ->asInt(); A = Parameters("A") ->asDouble(); B = Parameters("B") ->asDouble(); C = Parameters("C") ->asDouble(); D = Parameters("D") ->asDouble(); if( A > B || B > C || C > D ) { Error_Set(_TL("invalid control points")); return( false ); } pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), _TL("Fuzzified"))); DataObject_Set_Colors(pOutput, 100, SG_COLORS_BLACK_WHITE); //----------------------------------------------------- for(int y=0; yis_InGrid(x, y) ) { double Value = pInput->asDouble(x, y); if( Value <= A || Value >= D ) { Value = 0.0; } else if( Value >= B && Value <= C ) { Value = 1.0; } else { double dX, dW; if( Value < B ) { dX = Value - A; dW = B - A; } else { dX = D - Value; dW = D - C; } switch( Type ) { case 0: Value = dX / dW; break; case 1: Value = pow(sin(dX / dW * M_PI_090), 2.0); break; case 2: Value = 1.0 / (1.0 + pow((dW - dX) / dW, 2.0)); break; } } pOutput->Set_Value(x, y, Value); } else { pOutput->Set_NoData(x, y); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Fuzzify.h000066400000000000000000000047751224124640700232060ustar00rootroot00000000000000/********************************************************** * Version $Id: Fuzzify.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Fuzzify.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Fuzzify_H #define HEADER_INCLUDED__Fuzzify_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFuzzify : public CSG_Module_Grid { public: CFuzzify(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Fuzzy Logic") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // HEADER_INCLUDED__Fuzzify_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/FuzzyAND.cpp000066400000000000000000000137631224124640700235420ustar00rootroot00000000000000/********************************************************** * Version $Id: FuzzyAND.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // FuzzyAND.cpp // // // // Copyright (C) 2004 by // // Antonio Boggia and Gianluca Massei // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: boggia@unipg.it // // g_massa@libero.it // // // // contact: Antonio Boggia // // Gianluca Massei // // Department of Economics and Appraisal // // University of Perugia - Italy // // www.unipg.it // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "FuzzyAND.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFuzzyAND::CFuzzyAND(void) { Set_Name (_TL("Fuzzy Intersection (AND)")); Set_Author (SG_T("Antonio Boggia and Gianluca Massei (c) 2004")); Set_Description (_TW( "Calculates the intersection (min operator) for each grid cell of the selected grids.\n " "e-mail Gianluca Massei: g_massa@libero.it \n" "e-mail Antonio Boggia: boggia@unipg.it \n" )); Parameters.Add_Grid_List( NULL, "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "AND" , _TL("Intersection"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL, "TYPE" , _TL("Operator Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("min(a, b) (non-interactive)"), _TL("a * b"), _TL("max(0, a + b - 1)") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFuzzyAND::On_Execute(void) { int Type; CSG_Grid *pAND; CSG_Parameter_Grid_List *pGrids; //----------------------------------------------------- pGrids = Parameters("GRIDS") ->asGridList(); pAND = Parameters("AND") ->asGrid(); Type = Parameters("TYPE") ->asInt(); //----------------------------------------------------- if( pGrids->Get_Count() < 1 ) { return( false ); } //----------------------------------------------------- for(int y=0; yasGrid(0)->is_NoData(x, y); double AND = pGrids->asGrid(0)->asDouble (x, y); for(int i=1; iGet_Count() && !bNoData; i++) { if( !(bNoData = pGrids->asGrid(i)->is_NoData(x, y)) ) { double iz = pGrids->asGrid(i)->asDouble(x, y); switch( Type ) { case 0: if( AND > iz ) { AND = iz; } break; case 1: AND *= iz; break; case 2: if( (AND = AND + iz - 1.0) < 0.0 ) { AND = 0.0; } break; } } } if( bNoData ) { pAND->Set_NoData(x, y); } else { pAND->Set_Value(x, y, AND); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus/FuzzyAND.h000066400000000000000000000104561224124640700232030ustar00rootroot00000000000000/********************************************************** * Version $Id: FuzzyAND.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // FuzzyAND.h // // // // Copyright (C) 2003 by // // Antonio Boggia and Gianluca Massei // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: boggia@unipg.it // // g_massa@libero.it // // // // contact: Antonio Boggia // // Gianluca Massei // // Department of Economics and Appraisal // // University of Perugia - Italy // // www.unipg.it // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__FuzzyAND_H #define HEADER_INCLUDED__FuzzyAND_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFuzzyAND : public CSG_Module_Grid { public: CFuzzyAND(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Fuzzy Logic") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // HEADER_INCLUDED__FuzzyAND_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/FuzzyOR.cpp000066400000000000000000000137341224124640700234560ustar00rootroot00000000000000/********************************************************** * Version $Id: FuzzyOR.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // FuzzyOR.cpp // // // // Copyright (C) 2004 by // // Antonio Boggia and Gianluca Massei // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: boggia@unipg.it // // g_massa@libero.it // // // // contact: Antonio Boggia // // Gianluca Massei // // Department of Economics and Appraisal // // University of Perugia - Italy // // www.unipg.it // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "FuzzyOR.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFuzzyOR::CFuzzyOR(void) { Set_Name (_TL("Fuzzy Union (OR)")); Set_Author (SG_T("Antonio Boggia and Gianluca Massei (c) 2004")); Set_Description (_TW( "Calculates the union (max operator) for each grid cell of the selected grids.\n " "e-mail Gianluca Massei: g_massa@libero.it \n" "e-mail Antonio Boggia: boggia@unipg.it \n") ); Parameters.Add_Grid_List( NULL, "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "OR" , _TL("Union"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL, "TYPE" , _TL("Operator Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("max(a, b) (non-interactive)"), _TL("a + b - a * b"), _TL("min(1, a + b)") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFuzzyOR::On_Execute(void) { int Type; CSG_Grid *pOR; CSG_Parameter_Grid_List *pGrids; //----------------------------------------------------- pGrids = Parameters("GRIDS") ->asGridList(); pOR = Parameters("OR") ->asGrid(); Type = Parameters("TYPE") ->asInt(); //----------------------------------------------------- if( pGrids->Get_Count() < 1 ) { return( false ); } //----------------------------------------------------- for(int y=0; yasGrid(0)->is_NoData(x, y); double OR = pGrids->asGrid(0)->asDouble (x, y); for(int i=1; iGet_Count() && !bNoData; i++) { if( !(bNoData = pGrids->asGrid(i)->is_NoData(x, y)) ) { double iz = pGrids->asGrid(i)->asDouble(x, y); switch( Type ) { case 0: if( OR < iz ) { OR = iz; } break; case 1: OR = OR + iz - OR * iz; break; case 2: if( (OR = OR + iz) > 1.0 ) { OR = 1.0; } break; } } } if( bNoData ) { pOR->Set_NoData(x, y); } else { pOR->Set_Value(x, y, OR); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus/FuzzyOR.h000066400000000000000000000104471224124640700231210ustar00rootroot00000000000000/********************************************************** * Version $Id: FuzzyOR.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // FuzzyOR.h // // // // Copyright (C) 2003 by // // Antonio Boggia and Gianluca Massei // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: boggia@unipg.it // // g_massa@libero.it // // // // contact: Antonio Boggia // // Gianluca Massei // // Department of Economics and Appraisal // // University of Perugia - Italy // // www.unipg.it // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__FuzzyOR_H #define HEADER_INCLUDED__FuzzyOR_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFuzzyOR : public CSG_Module_Grid { public: CFuzzyOR(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Fuzzy Logic") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // HEADER_INCLUDED__FuzzyOR_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Calculator.cpp000066400000000000000000000265341224124640700251260ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Calculator.cpp 1698 2013-05-22 07:51:24Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Calculator.cpp // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "Grid_Calculator.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #if defined(_SAGA_LINUX) bool _finite(double val) { return( true ); } #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Calculator::CGrid_Calculator(void) { //----------------------------------------------------- Set_Name(_TL("Grid Calculator")); Set_Author(_TL("Copyrights (c) 2003 by Andre Ringeler")); CSG_String s(_TW( "The Grid Calculator calculates a new grid based on existing grids and a mathematical formula. " "The grid variables are single characters which correspond in alphabetical order to the grid list order " "('a' = first grid, 'b' = second grid, ...)\n" "Alternatively you can address with letter 'g' followed by position index (g1, g2, g3, ...). " "Grids from other systems are addressed similarly, just using letter 'h' (h1, h2, h3, ...)\n" "Examples:\n" "using letters: sin(a) * b + c\n" "the same using indices: sin(g1) * g2 + g3\n\n" "The following operators are available for the formula definition:\n" )); s += CSG_Formula::Get_Help_Operators(); Set_Description(s); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL("in formula these grids are addressed in order of the list as 'g1, g2, g3, ...'"), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "XGRIDS" , _TL("Grids from different Systems"), _TL("in formula these grids are addressed in order of the list as 'h1, h2, h3, ...'"), PARAMETER_INPUT_OPTIONAL, false ); Parameters.Add_Grid( NULL , "RESULT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_String( NULL , "FORMULA" , _TL("Formula"), _TL(""), SG_T("(g1 - g2) / (g1 + g2)") ); CSG_Parameter *pNode = Parameters.Add_String( NULL , "NAME" , _TL("Name"), _TL(""), _TL("Calculation") ); Parameters.Add_Value( pNode , "FNAME" , _TL("Take Formula"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( NULL , "USE_NODATA" , _TL("Use NoData"), _TL("Check this in order to include NoData cells in the calculation."), PARAMETER_TYPE_Bool, false ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Data Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|"), SG_Data_Type_Get_Name(SG_DATATYPE_Bit ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Byte ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Char ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Word ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Short ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_DWord ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Int ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Float ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Double).c_str() ), 7 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGrid_Calculator::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FORMULA")) || !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FNAME")) ) { if( pParameters->Get_Parameter("FNAME")->asBool() ) { pParameters->Get_Parameter("NAME")->Set_Value(CSG_String::Format(SG_T("%s [%s]"), _TL("Calculation"), pParameters->Get_Parameter("FORMULA")->asString())); } } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Calculator::On_Execute(void) { bool bUseNoData; CSG_Formula Formula; CSG_Parameter_Grid_List *pGrids, *pXGrids; CSG_Grid *pResult; //----------------------------------------------------- pResult = Parameters("RESULT" )->asGrid(); pGrids = Parameters("GRIDS" )->asGridList(); pXGrids = Parameters("XGRIDS" )->asGridList(); bUseNoData = Parameters("USE_NODATA")->asBool(); //----------------------------------------------------- if( !Get_Formula(Formula, Parameters("FORMULA")->asString(), pGrids->Get_Count(), pXGrids->Get_Count()) ) { return( false ); } //----------------------------------------------------- TSG_Data_Type Type; switch( Parameters("TYPE")->asInt() ) { default: Type = SG_DATATYPE_Float ; break; case 0: Type = SG_DATATYPE_Bit ; break; case 1: Type = SG_DATATYPE_Byte ; break; case 2: Type = SG_DATATYPE_Char ; break; case 3: Type = SG_DATATYPE_Word ; break; case 4: Type = SG_DATATYPE_Short ; break; case 5: Type = SG_DATATYPE_DWord ; break; case 6: Type = SG_DATATYPE_Int ; break; case 7: Type = SG_DATATYPE_Float ; break; case 8: Type = SG_DATATYPE_Double; break; } if( Type != pResult->Get_Type() ) { pResult->Create(*Get_System(), Type); } pResult->Set_Name(Parameters("NAME")->asString()); //----------------------------------------------------- for(int y=0; yGet_Count() + pXGrids->Get_Count()); for(i=0; iGet_Count() && !bNoData; i++) { if( !bUseNoData && pGrids->asGrid(i)->is_NoData(x, y) ) { bNoData = true; } else { Values[i] = pGrids->asGrid(i)->asDouble(x, y); } } if( !bNoData && pXGrids->Get_Count() ) { for(i=0, j=pGrids->Get_Count(); iGet_Count() && !bNoData; i++, j++) { if( !pXGrids->asGrid(i)->Get_Value(Get_System()->Get_Grid_to_World(x, y), Values[j]) ) { bNoData = true; } } } if( bNoData || !_finite(Result = Formula.Get_Value(Values)) ) { pResult->Set_NoData(x, y); } else { pResult->Set_Value(x, y, Result); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Calculator::Get_Formula(CSG_Formula &Formula, CSG_String sFormula, int nGrids, int nXGrids) { //----------------------------------------------------- const int nVars = 27; const SG_Char Vars[nVars] = SG_T("abcdefghijklmnopqrstuvwxyz"); //----------------------------------------------------- if( nGrids + nXGrids > nVars ) { Error_Set(_TL("too many input grids")); return( false ); } //----------------------------------------------------- int i, n = nGrids + nXGrids - 1; for(i=nXGrids; i>0; i--, n--) { sFormula.Replace(CSG_String::Format(SG_T("h%d"), i), Vars[n]); } for(i=nGrids; i>0; i--, n--) { sFormula.Replace(CSG_String::Format(SG_T("g%d"), i), Vars[n]); } //----------------------------------------------------- if( !Formula.Set_Formula(sFormula) ) { CSG_String Message; if( !Formula.Get_Error(Message) ) { Message.Printf(SG_T("%s: %s"), _TL("error in formula"), sFormula.c_str()); } Error_Set(Message); return( false ); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Calculator.h000066400000000000000000000107001224124640700245570ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Calculator.h 1627 2013-03-19 16:39:22Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Calculator.h // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Calculator_H #define HEADER_INCLUDED__Grid_Calculator_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Calculator : public CSG_Module_Grid { public: CGrid_Calculator(void); protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: bool Get_Formula (CSG_Formula &Formula, CSG_String sFormula, int nGrids, int nXGrids); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Calculator_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Geometric_Figures.cpp000066400000000000000000000176371224124640700264430ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Geometric_Figures.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Geometric_Figures.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Geometric_Figures.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Geometric_Figures::CGrid_Geometric_Figures(void) { Set_Name (_TL("Geometric Figures")); Set_Author (SG_T("(c) 2001 by O.Conrad")); Set_Description(_TW( "Construct grids from geometric figures (planes, cones).\n" "(c) 2001 by Olaf Conrad, Goettingen\nemail: oconrad@gwdg.de") ); //----------------------------------------------------- Parameters.Add_Grid_List( NULL, "RESULT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, false ); Parameters.Add_Value( NULL, "CELL_COUNT" , _TL("Cell Count"), _TL(""), PARAMETER_TYPE_Int, 100, 2.0, true ); Parameters.Add_Value( NULL, "CELL_SIZE" , _TL("Cell Size"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); Parameters.Add_Choice( NULL, "FIGURE" , _TL("Figure"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Cone (up)"), _TL("Cone (down)"), _TL("Plane")), 0 ); Parameters.Add_Value( NULL, "PLANE" , _TL("Direction of Plane [Degree]"), _TL(""), PARAMETER_TYPE_Double, 22.5 ); } //--------------------------------------------------------- CGrid_Geometric_Figures::~CGrid_Geometric_Figures(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Geometric_Figures::On_Execute(void) { int NXY; double DXY; CSG_Grid *pGrid; //----------------------------------------------------- NXY = Parameters("CELL_COUNT") ->asInt(); DXY = Parameters("CELL_SIZE") ->asDouble(); Parameters("RESULT")->asGridList()->Add_Item( pGrid = SG_Create_Grid(SG_DATATYPE_Float, NXY, NXY, DXY) ); //----------------------------------------------------- switch( Parameters("FIGURE")->asInt() ) { case 0: default: Create_Cone (pGrid, true); break; case 1: Create_Cone (pGrid, false); break; case 2: Create_Plane (pGrid, Parameters("PLANE")->asDouble()); break; } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_Geometric_Figures::Create_Cone(CSG_Grid *pGrid, bool bUp) { int x, y; double nx_2, ny_2, dx, dy, d; //----------------------------------------------------- pGrid->Set_Name(bUp ? _TL("Cone (Up)") : _TL("Cone (Down)")); nx_2 = pGrid->Get_Cellsize() * (double)pGrid->Get_NX() / 2.0; ny_2 = pGrid->Get_Cellsize() * (double)pGrid->Get_NY() / 2.0; //----------------------------------------------------- for(y=0; yGet_NY() && Set_Progress(y, pGrid->Get_NY()); y++) { for(x=0; xGet_NX(); x++) { dx = 0.5 + x * pGrid->Get_Cellsize() - nx_2; dy = 0.5 + y * pGrid->Get_Cellsize() - ny_2; d = sqrt(dx*dx + dy*dy); if( d < nx_2 ) { pGrid->Set_Value(x, y, bUp ? d : -d); } else { pGrid->Set_NoData(x, y); } } } } //--------------------------------------------------------- void CGrid_Geometric_Figures::Create_Plane(CSG_Grid *pGrid, double Direction) { int x, y; double xPos, yPos, z, dSin, dCos, Max; //----------------------------------------------------- pGrid->Set_Name(CSG_String::Format(_TL("Plane (%.2fDegree)"), Direction)); Max = sqrt(2.0) * pGrid->Get_Cellsize() * pGrid->Get_Cellsize() / 4.0; dSin = sin(M_DEG_TO_RAD * Direction); dCos = cos(M_DEG_TO_RAD * Direction); //----------------------------------------------------- for(y=0, yPos=0.5-pGrid->Get_Cellsize()*pGrid->Get_NY()/2.0; yGet_NY() && Set_Progress(y, pGrid->Get_NY()); y++, yPos+=pGrid->Get_Cellsize()) { for(x=0, xPos=0.5-pGrid->Get_Cellsize()*pGrid->Get_NX()/2.0; xGet_NX(); x++, xPos+=pGrid->Get_Cellsize()) { // pGrid->Set_NoData(x, y); // z = dCos * xPos - dSin * yPos; // if( z >= -Max && z <= Max ) { // z = dSin * xPos + dCos * yPos; // if( z >= -Max && z <= Max ) { z = xPos * dSin + yPos * dCos; pGrid->Set_Value(x, y, z); } } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Geometric_Figures.h000066400000000000000000000106361224124640700261000ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Geometric_Figures.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Geometric_Figures.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Geometric_Figures_H #define HEADER_INCLUDED__Grid_Geometric_Figures_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Geometric_Figures : public CSG_Module { public: CGrid_Geometric_Figures(void); virtual ~CGrid_Geometric_Figures(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Grid Generation") ); } protected: virtual bool On_Execute (void); private: void Create_Cone (CSG_Grid *pGrid, bool bUp); void Create_Plane (CSG_Grid *pPlane, double Direction); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Geometric_Figures_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Normalise.cpp000066400000000000000000000171661224124640700247670ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Normalise.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Normalise.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Normalise.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Normalise::CGrid_Normalise(void) { Set_Name (_TL("Grid Normalisation")); Set_Author (SG_T("O.Conrad (c) 2003")); Set_Description (_TW( "Normalise the values of a grid. " "Rescales all grid values to fall in the range 'Minimum' to 'Maximum', " "usually 0 to 1. " )); Parameters.Add_Grid( NULL , "INPUT" ,_TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Normalised Grid"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Range( NULL , "RANGE" , _TL("Target Range"), _TL(""), 0.0, 1.0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Normalise::On_Execute(void) { CSG_Grid *pGrid = Parameters("INPUT")->asGrid(); if( pGrid->Get_StdDev() <= 0.0 ) { return( false ); } if( pGrid != Parameters("OUTPUT")->asGrid() ) { pGrid = Parameters("OUTPUT")->asGrid(); pGrid ->Assign(Parameters("INPUT")->asGrid()); } pGrid->Set_Name(CSG_String::Format(SG_T("%s (%s)"), pGrid->Get_Name(), _TL("Normalised"))); //----------------------------------------------------- double Minimum, Maximum, zMin, Stretch; Minimum = Parameters("RANGE")->asRange()->Get_LoVal(); Maximum = Parameters("RANGE")->asRange()->Get_HiVal(); zMin = pGrid->Get_ZMin(); Stretch = (Maximum - Minimum) / pGrid->Get_ZRange(); for(int y=0; yis_NoData(x, y) ) { pGrid->Set_Value(x, y, Minimum + Stretch * (pGrid->asDouble(x, y) - zMin)); } } } //----------------------------------------------------- if( pGrid == Parameters("INPUT")->asGrid() ) { DataObject_Update(pGrid); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Standardise::CGrid_Standardise(void) { Set_Name (_TL("Grid Standardisation")); Set_Author (SG_T("O.Conrad (c) 2003")); Set_Description (_TW( "Standardise the values of a grid. " "The standard score (z) is calculated as raw score (x) less " "arithmetic mean (m) divided by standard deviation (s).\n" "z = (x - m) * s" )); Parameters.Add_Grid( NULL , "INPUT" ,_TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Standardised Grid"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "STRETCH" , _TL("Stretch Factor"), _TL(""), PARAMETER_TYPE_Double, 1.0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Standardise::On_Execute(void) { CSG_Grid *pGrid = Parameters("INPUT")->asGrid(); if( pGrid->Get_StdDev() <= 0.0 ) { return( false ); } if( pGrid != Parameters("OUTPUT")->asGrid() ) { pGrid = Parameters("OUTPUT")->asGrid(); pGrid ->Assign(Parameters("INPUT")->asGrid()); } pGrid->Set_Name(CSG_String::Format(SG_T("%s (%s)"), pGrid->Get_Name(), _TL("Standard Score"))); //----------------------------------------------------- double Mean = pGrid->Get_ArithMean(); double Stretch = Parameters("STRETCH")->asDouble() / pGrid->Get_StdDev(); for(int y=0; yis_NoData(x, y) ) { pGrid->Set_Value(x, y, Stretch * (pGrid->asDouble(x, y) - Mean)); } } } //----------------------------------------------------- if( pGrid == Parameters("INPUT")->asGrid() ) { DataObject_Update(pGrid); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Normalise.h000066400000000000000000000114511224124640700244230ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Normalise.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Normalise.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Normalise_H #define HEADER_INCLUDED__Grid_Normalise_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Normalise : public CSG_Module_Grid { public: CGrid_Normalise(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Standardise : public CSG_Module_Grid { public: CGrid_Standardise(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Normalise_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Plotter.cpp000066400000000000000000000123021224124640700244520ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Plotter.cpp 1398 2012-05-10 11:36:50Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Plotter.cpp // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Plotter.h" CGrid_Plotter::CGrid_Plotter(void) { Set_Name(_TL("Function")); Set_Author(_TL("Copyrights (c) 2003 by Andre Ringeler")); Set_Description(_TW( "Generate a grid based on a functional expression.\n" "The function interpreter uses an expression parser " "that offers the folowing operators:\n\n" "+ Addition\n" "- Subtraction\n" "* Multiplication\n" "/ Division\n" "^ power\n" "sin(a)\n" "cos(a)\n" "tan(a)\n" "asin(a)\n" "acos(a)\n" "atan(a)\n" "atan2(a,b)\n" "abs(a)\n" "int(a)\n" "sqrt(a)\n" "int(a)\n" "mod(a,b)\n" "gt(a,b) returns 1 if a greater b\n" "lt(a,b) returns 1 if a lower b\n" "eq(a,b) returns 1 if a equal b\n" "The Variablen are x and y\n" "Example: sin(x*x+y*y)/(x*x+y*y)\n") ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Function"), _TL(""), PARAMETER_OUTPUT); Parameters.Add_Value( NULL, "XMIN" , _TL("xmin") , _TL(""), PARAMETER_TYPE_Double,-5); Parameters.Add_Value( NULL, "XMAX" , _TL("xmax") , _TL(""), PARAMETER_TYPE_Double,5); Parameters.Add_Value( NULL, "YMIN" , _TL("ymin") , _TL(""), PARAMETER_TYPE_Double,-5); Parameters.Add_Value( NULL, "YMAX" , _TL("ymax") , _TL(""), PARAMETER_TYPE_Double,5); Parameters.Add_String( NULL, "FORMUL" , _TL("Formula") , _TL(""), _TL("sin(x*x + y*y)")); } //--------------------------------------------------------- CGrid_Plotter::~CGrid_Plotter(void) {} //--------------------------------------------------------- bool CGrid_Plotter::On_Execute(void) { pResult = Parameters("RESULT")->asGrid(); double xmin = Parameters("XMIN")->asDouble(); double ymin = Parameters("YMIN")->asDouble(); double xmax = Parameters("XMAX")->asDouble(); double ymax = Parameters("YMAX")->asDouble(); const SG_Char *formel = Parameters("FORMUL")->asString(); CSG_Formula Formel; Formel.Set_Formula(formel); CSG_String Msg; if (Formel.Get_Error(Msg)) { Message_Add(Msg); return false; } for(int y=0; ySet_Value(x,y,Formel.Get_Value(SG_T("xy"),(xmax-xmin)*((double)x/Get_NX())+xmin,(ymax-ymin)*((double)y/Get_NY())+ymin)); } return( true ); } saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Plotter.h000066400000000000000000000101051224124640700241160ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Plotter.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Plotter.h // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Plotter_H #define HEADER_INCLUDED__Grid_Plotter_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Plotter : public CSG_Module_Grid { public: CGrid_Plotter(void); virtual ~CGrid_Plotter(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Grid Generation") ); } protected: virtual bool On_Execute (void); private: CSG_Grid *pInput, *pResult; }; #endif // #ifndef HEADER_INCLUDED__Grid_Plotter_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Random_Field.cpp000066400000000000000000000171651224124640700253600ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Random_Field.cpp 1615 2013-02-27 16:20:14Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Random_Field.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Random_Field.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Random_Field::CGrid_Random_Field(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Random Field")); Set_Author (SG_T("O.Conrad (c) 2005")); Set_Description (_TW( "Create a grid with pseudo-random numbers as grid cell values. " )); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TARGET" , _TL("Target Grid"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("user defined"), _TL("grid") ), 0 ); m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid") , _TL(""))); m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid") , _TL(""))); //----------------------------------------------------- Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Uniform"), _TL("Gaussian") ), 1 ); //----------------------------------------------------- pNode = Parameters.Add_Node( NULL , "NODE_UNIFORM", _TL("Uniform"), _TL("") ); Parameters.Add_Range( pNode , "RANGE" , _TL("Range"), _TL(""), 0.0, 1.0 ); //----------------------------------------------------- pNode = Parameters.Add_Node( NULL , "NODE_GAUSS" , _TL("Gaussian"), _TL("") ); Parameters.Add_Value( pNode , "MEAN" , _TL("Arithmetic Mean"), _TL(""), PARAMETER_TYPE_Double, 0.0 ); Parameters.Add_Value( pNode , "STDDEV" , _TL("Standard Deviation"), _TL(""), PARAMETER_TYPE_Double, 1.0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGrid_Random_Field::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 ); } //--------------------------------------------------------- int CGrid_Random_Field::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) ) { pParameters->Get_Parameter("NODE_UNIFORM")->Set_Enabled(pParameter->asInt() == 0); pParameters->Get_Parameter("NODE_GAUSS" )->Set_Enabled(pParameter->asInt() == 1); } return( 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Random_Field::On_Execute(void) { //----------------------------------------------------- CSG_Grid *pGrid = NULL; switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... if( m_Grid_Target.Init_User(0.0, 0.0, 1.0, 100, 100) && Dlg_Parameters("USER") ) { pGrid = m_Grid_Target.Get_User(); } break; case 1: // grid... if( Dlg_Parameters("GRID") ) { pGrid = m_Grid_Target.Get_Grid(); } break; } if( !pGrid ) { return( false ); } pGrid->Set_Name(_TL("Random Field")); //----------------------------------------------------- int Method = Parameters("METHOD")->asInt(); double a = Method == 0 ? Parameters("RANGE" )->asRange()->Get_LoVal() : Parameters("MEAN" )->asDouble(); double b = Method == 0 ? Parameters("RANGE" )->asRange()->Get_HiVal() : Parameters("STDDEV")->asDouble(); //----------------------------------------------------- for(int y=0; yGet_NY() && Set_Progress(y, pGrid->Get_NY()); y++) { #pragma omp parallel for for(int x=0; xGet_NX(); x++) { switch( Method ) { case 0: // uniform... pGrid->Set_Value(x, y, CSG_Random::Get_Uniform (a, b)); break; case 1: // gaussian... pGrid->Set_Value(x, y, CSG_Random::Get_Gaussian(a, b)); break; } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Random_Field.h000066400000000000000000000114641224124640700250210ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Random_Field.h 1615 2013-02-27 16:20:14Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Random_Field.h // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Random_Field_H #define HEADER_INCLUDED__Grid_Random_Field_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Random_Field : public CSG_Module { public: CGrid_Random_Field(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Grid Generation") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: CSG_Parameters_Grid_Target m_Grid_Target; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Random_Field_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Random_Terrain.cpp000066400000000000000000000116521224124640700257340ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Random_Terrain.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* Grid_Random_Terrain.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Grid_Random_Terrain.h" CGrid_Random_Terrain::CGrid_Random_Terrain(void) { CSG_Parameters *pParameters; Set_Name(_TL("Random Terrain Generation")); Set_Author(_TL("Copyrights (c) 2004 by Victor Olaya")); Set_Description (_TW( "(c) 2004 by Victor Olaya. Terrain Generation")); Parameters.Add_Value(NULL, "RADIUS", _TL("Radius (cells)"), _TL("Radius (cells)"), PARAMETER_TYPE_Int, 15); Parameters.Add_Value(NULL, "ITERATIONS", _TL("Iterations"), _TL("Iterations"), PARAMETER_TYPE_Int, 10); Parameters.Add_Choice( NULL, "TARGET_TYPE", _TL("Target Dimensions"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"),_TL("User defined"), _TL("Grid Project"), _TL("Grid")), 0); Parameters.Add_Grid_List( NULL, "TARGET_GRID", _TL("Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, false); pParameters = Add_Parameters("USER", _TL("User defined grid"), _TL("")); pParameters->Add_Value( NULL, "CELL_SIZE", _TL("Grid Size"), _TL(""), PARAMETER_TYPE_Double, 100.0, 0.0, true); pParameters->Add_Value( NULL, "COLS", _TL("Cols"), _TL(""), PARAMETER_TYPE_Int, 100, 0.0, true); pParameters->Add_Value( NULL, "ROWS", _TL("Rows"), _TL(""), PARAMETER_TYPE_Int, 100, 0.0, true); //----------------------------------------------------- pParameters = Add_Parameters("GET_SYSTEM" , _TL("Choose Grid Project"), _TL("")); pParameters->Add_Grid_System( NULL, "SYSTEM" , _TL("System") , _TL("") ); pParameters = Add_Parameters("GRID", _TL("Choose Grid"), _TL("")); pParameters->Add_Grid(NULL, "GRID", _TL("Grid"), _TL(""), PARAMETER_INPUT , false ); } CGrid_Random_Terrain::~CGrid_Random_Terrain(void) {} CSG_Grid * CGrid_Random_Terrain::Get_Target_Grid(CSG_Parameters *pParameters ) { double iCellSize; int iRows,iCols; iCellSize = pParameters->Get_Parameter("CELL_SIZE")->asDouble(); iRows = pParameters->Get_Parameter("ROWS")->asInt(); iCols = pParameters->Get_Parameter("COLS")->asInt(); return( SG_Create_Grid(SG_DATATYPE_Float, iCols, iRows, iCellSize, 0, 0) ); } bool CGrid_Random_Terrain::On_Execute(void) { Parameters("TARGET_GRID")->asGridList()->Del_Items(); pGrid = NULL; switch( Parameters("TARGET_TYPE")->asInt() ) { case 0: // User defined... if( Dlg_Parameters("USER") ) { pGrid = Get_Target_Grid(Get_Parameters("USER")); } break; case 1: // Grid Project... if( Dlg_Parameters("GET_SYSTEM") ) { pGrid = SG_Create_Grid( *Get_Parameters("GET_SYSTEM")->Get_Parameter("SYSTEM")->asGrid_System() ); } break; case 2: // Grid... if( Dlg_Parameters("GRID") ) { pGrid = Get_Parameters("GRID")->Get_Parameter("GRID")->asGrid(); } break; }//switch //------------------------------------------------- if( pGrid ) { Parameters("TARGET_GRID")->asGridList()->Add_Item(pGrid); pGrid->Set_Name(_TL("DEM")); pGrid->Assign(0.0); int iIterations = Parameters("ITERATIONS")->asInt(); int iRadius = Parameters("RADIUS")->asInt(); for (int i=0 ; iGet_NX(); y = rand() % pGrid->Get_NY(); for (int i=-iRadius ; i0 && y2>0 && x2Get_NX() && y2 < pGrid->Get_NY()){ dDist= M_GET_LENGTH(x-x2, y-y2); if (dDist<=iRadius){ dOffset = (iRadius * iRadius) - (dDist * dDist); dValue = pGrid->asDouble(x2,y2); pGrid->Set_Value(x2,y2,dValue+dOffset); }//else }//if }//for }//for }//method saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Random_Terrain.h000066400000000000000000000033241224124640700253760ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Random_Terrain.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Grid_Random_Terrain.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Random_Terrain_H #define HEADER_INCLUDED__Grid_Random_Terrain_H #include "MLB_Interface.h" class CGrid_Random_Terrain : public CSG_Module { public: CGrid_Random_Terrain(void); virtual ~CGrid_Random_Terrain(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Grid Generation") ); } protected: CSG_Grid *pGrid; bool On_Execute(void); void addBump (CSG_Grid*, int); private: CSG_Grid* Get_Target_Grid(CSG_Parameters *pParameters); }; #endif // #ifndef HEADER_INCLUDED__Grid_Random_Terrain_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Volume.cpp000066400000000000000000000140321224124640700242720ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Volume.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Volume.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Volume.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Volume::CGrid_Volume(void) { Set_Name(_TL("Grid Volume")); Set_Author (SG_T("(c) 2005 by O.Conrad")); Set_Description( _TL("Calculate the volume under the grid's surface. This is mainly useful for Digital Elevation Models (DEM).") ); Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("Count Only Above Base Level"), _TL("Count Only Below Base Level"), _TL("Subtract Volumes Below Base Level"), _TL("Add Volumes Below Base Level") ) ); Parameters.Add_Value( NULL , "LEVEL" , _TL("Base Level"), _TL(""), PARAMETER_TYPE_Double, 0.0 ); } //--------------------------------------------------------- CGrid_Volume::~CGrid_Volume(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Volume::On_Execute(void) { int x, y, Method; double Level, Volume, z; CSG_Grid *pGrid; CSG_String s; //----------------------------------------------------- pGrid = Parameters("GRID") ->asGrid(); Level = Parameters("LEVEL") ->asDouble(); Method = Parameters("METHOD") ->asInt(); //----------------------------------------------------- for(y=0, Volume=0.0; yis_NoData(x, y) ) { z = pGrid->asDouble(x, y) - Level; switch( Method ) { case 0: // Count Only Above Base Level if( z > 0.0 ) { Volume += z; } break; case 1: // Count Only Below Base Level if( z < 0.0 ) { Volume -= z; } break; case 2: // Subtract Volumes Below Base Level Volume += z; break; case 3: // Add Volumes Below Base Level Volume += fabs(z); break; } } } } //----------------------------------------------------- Volume *= pGrid->Get_Cellarea(); s.Printf(_TL("Volume: %f"), Volume); Message_Add(s); Message_Dlg(s, _TL("Grid Volume")); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Grid_Volume.h000066400000000000000000000107361224124640700237460ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Volume.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Volume.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Volume_H #define HEADER_INCLUDED__Grid_Volume_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Volume : public CSG_Module_Grid { public: CGrid_Volume(void); virtual ~CGrid_Volume(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Volume_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/MLB_Interface.cpp000066400000000000000000000133301224124640700244500ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1549 2012-11-29 16:38:50Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Grid - Calculus") ); case MLB_INFO_Author: return( SG_T("O. Conrad, A. Ringeler, V. Olaya (c) 2001-4") ); case MLB_INFO_Description: return( _TL("Grid based or related calculations.") ); case MLB_INFO_Version: return( _TL("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Grid|Calculus" )); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Grid_Normalise.h" #include "Grid_Calculator.h" #include "Grid_Volume.h" #include "grid_difference.h" #include "Grid_Plotter.h" #include "Grid_Geometric_Figures.h" #include "Grid_Random_Terrain.h" #include "Grid_Random_Field.h" #include "Fuzzify.h" #include "FuzzyAND.h" #include "FuzzyOR.h" #include "grid_metric_conversion.h" #include "gradient_cartes_polar.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 1: return( new CGrid_Calculator ); case 2: return( new CGrid_Volume ); case 4: return( new CGrid_Plotter ); case 5: return( new CGrid_Geometric_Figures ); case 6: return( new CGrid_Random_Terrain ); case 7: return( new CGrid_Random_Field ); case 0: return( new CGrid_Normalise ); case 10: return( new CGrid_Standardise ); case 3: return( new CGrid_Difference ); case 18: return( new CGrid_Division ); case 8: return( new CGrids_Sum ); case 9: return( new CGrids_Product ); case 11: return( new CFuzzify ); case 12: return( new CFuzzyAND ); case 13: return( new CFuzzyOR ); case 14: return( new CGrid_Metric_Conversion ); case 15: return( new CGradient_Cartes_To_Polar ); case 16: return( new CGradient_Polar_To_Cartes ); //----------------------------------------------------- case 19: return( NULL ); default: return( MLB_INTERFACE_SKIP_MODULE ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/grid/grid_calculus/MLB_Interface.h000066400000000000000000000077311224124640700241250ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_calculus_H #define HEADER_INCLUDED__grid_calculus_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef grid_calculus_EXPORTS #define grid_calculus_EXPORT _SAGA_DLL_EXPORT #else #define grid_calculus_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_calculus_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Makefile.am000066400000000000000000000021131224124640700234030ustar00rootroot00000000000000# # $Id: Makefile.am 1549 2012-11-29 16:38:50Z oconrad $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_calculus.la libgrid_calculus_la_SOURCES =\ Fuzzify.cpp\ FuzzyAND.cpp\ FuzzyOR.cpp\ gradient_cartes_polar.cpp\ grid_metric_conversion.cpp\ Grid_Calculator.cpp\ grid_difference.cpp\ Grid_Geometric_Figures.cpp\ Grid_Normalise.cpp\ Grid_Plotter.cpp\ Grid_Random_Field.cpp\ Grid_Random_Terrain.cpp\ Grid_Volume.cpp\ MLB_Interface.cpp\ Fuzzify.h\ FuzzyAND.h\ FuzzyOR.h\ gradient_cartes_polar.h\ grid_metric_conversion.h\ Grid_Calculator.h\ grid_difference.h\ Grid_Geometric_Figures.h\ Grid_Normalise.h\ Grid_Plotter.h\ Grid_Random_Field.h\ Grid_Random_Terrain.h\ Grid_Volume.h\ MLB_Interface.h libgrid_calculus_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/grid/grid_calculus/Makefile.in000066400000000000000000000474341224124640700234330ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/grid/grid_calculus DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgrid_calculus_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgrid_calculus_la_OBJECTS = Fuzzify.lo FuzzyAND.lo FuzzyOR.lo \ gradient_cartes_polar.lo grid_metric_conversion.lo \ Grid_Calculator.lo grid_difference.lo \ Grid_Geometric_Figures.lo Grid_Normalise.lo Grid_Plotter.lo \ Grid_Random_Field.lo Grid_Random_Terrain.lo Grid_Volume.lo \ MLB_Interface.lo libgrid_calculus_la_OBJECTS = $(am_libgrid_calculus_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgrid_calculus_la_SOURCES) DIST_SOURCES = $(libgrid_calculus_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1549 2012-11-29 16:38:50Z oconrad $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_calculus.la libgrid_calculus_la_SOURCES = \ Fuzzify.cpp\ FuzzyAND.cpp\ FuzzyOR.cpp\ gradient_cartes_polar.cpp\ grid_metric_conversion.cpp\ Grid_Calculator.cpp\ grid_difference.cpp\ Grid_Geometric_Figures.cpp\ Grid_Normalise.cpp\ Grid_Plotter.cpp\ Grid_Random_Field.cpp\ Grid_Random_Terrain.cpp\ Grid_Volume.cpp\ MLB_Interface.cpp\ Fuzzify.h\ FuzzyAND.h\ FuzzyOR.h\ gradient_cartes_polar.h\ grid_metric_conversion.h\ Grid_Calculator.h\ grid_difference.h\ Grid_Geometric_Figures.h\ Grid_Normalise.h\ Grid_Plotter.h\ Grid_Random_Field.h\ Grid_Random_Terrain.h\ Grid_Volume.h\ MLB_Interface.h libgrid_calculus_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/grid/grid_calculus/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/grid/grid_calculus/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgrid_calculus.la: $(libgrid_calculus_la_OBJECTS) $(libgrid_calculus_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgrid_calculus_la_OBJECTS) $(libgrid_calculus_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Fuzzify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FuzzyAND.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FuzzyOR.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Calculator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Geometric_Figures.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Normalise.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Plotter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Random_Field.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Random_Terrain.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Volume.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gradient_cartes_polar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_difference.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_metric_conversion.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/grid/grid_calculus/gradient_cartes_polar.cpp000066400000000000000000000227731224124640700264240ustar00rootroot00000000000000/********************************************************** * Version $Id: gradient_cartes_polar.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* gradient_cartes_polar.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gradient_cartes_polar.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGradient_Cartes_To_Polar::CGradient_Cartes_To_Polar(void) { CSG_Parameter *pNode; Set_Name (_TL("Gradient Vector from Cartesian to Polar Coordinates")); Set_Author (SG_T("Victor Olaya & Volker Wichmann (c) 2004-2010")); Set_Description (_TW( "Converts gradient vector from directional components (Cartesian) " "to polar coordinates (direction or aspect angle and length or tangens of slope).\n" "The module supports three conventions on how to measure and output the angle of direction:\n" "(a) mathematical: direction angle is zero in East direction and the angle increases counterclockwise\n" "(b) geographical: direction angle is zero in North direction and the angle increases clockwise\n" "(c) zero direction and orientation are user defined\n" )); Parameters.Add_Grid(NULL, "DX" , _TL("X Component") , _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "DY" , _TL("Y Component") , _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "DIR" , _TL("Direction") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Grid(NULL, "LEN" , _TL("Length") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Choice( NULL , "UNITS" , _TL("Polar Angle Units"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("radians"), _TL("degree") ), 0 ); pNode = Parameters.Add_Choice( NULL , "SYSTEM" , _TL("Polar Coordinate System"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("mathematical"), _TL("geographical"), _TL("user defined") ), 1 ); Parameters.Add_Value( pNode , "SYSTEM_ZERO" , _TL("User defined Zero Direction"), _TL("given in degree clockwise from North direction"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 360.0, true ); Parameters.Add_Choice( pNode , "SYSTEM_ORIENT" , _TL("User defined Orientation"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("clockwise"), _TL("counterclockwise") ), 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGradient_Cartes_To_Polar::On_Execute(void) { bool bDegree, bClockwise; int Method; double DX, DY, DIR, Zero; CSG_Grid *pDX, *pDY, *pDIR, *pLEN; //----------------------------------------------------- pDX = Parameters("DX") ->asGrid(); pDY = Parameters("DY") ->asGrid(); pDIR = Parameters("DIR") ->asGrid(); pLEN = Parameters("LEN") ->asGrid(); bDegree = Parameters("UNITS") ->asInt() == 1; Method = Parameters("SYSTEM") ->asInt(); if( Method == 0 ) // mathematic { Zero = M_PI_090; bClockwise = false; } else { Zero = Parameters("SYSTEM_ZERO")->asDouble() * M_DEG_TO_RAD; bClockwise = Parameters("SYSTEM_ORIENT")->asInt() == 0; } //----------------------------------------------------- for(int y=0; yis_NoData(x, y) || pDY->is_NoData(x, y) ) { pLEN->Set_NoData(x, y); pDIR->Set_NoData(x, y); } else { DX = pDX->asDouble(x, y); DY = pDY->asDouble(x, y); if( DX == 0.0 && DY == 0.0 ) { pLEN->Set_Value (x, y, 0.0); pDIR->Set_NoData(x, y); } else { DIR = DY != 0.0 ? fmod(M_PI_360 + atan2(DX, DY), M_PI_360) : DX < 0.0 ? M_PI_270 : M_PI_090; if( Method != 1 ) // not geographic { DIR = fmod(M_PI_360 + (bClockwise ? DIR - Zero : Zero - DIR), M_PI_360); } pLEN->Set_Value(x, y, sqrt(DX*DX + DY*DY)); pDIR->Set_Value(x, y, bDegree ? M_RAD_TO_DEG * DIR : DIR); } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGradient_Polar_To_Cartes::CGradient_Polar_To_Cartes(void) { CSG_Parameter *pNode; Set_Name (_TL("Gradient Vector from Polar to Cartesian Coordinates")); Set_Author (SG_T("Victor Olaya & Volker Wichmann (c) 2004-2010")); Set_Description (_TW( "Converts gradient vector from polar coordinates (direction or aspect angle and length or tangens of slope) " "to directional components (Cartesian).\n" "The module supports three conventions on how the angle of direction can be supplied:\n" "(a) mathematical: direction angle is zero in East direction and the angle increases counterclockwise\n" "(b) geographical: direction angle is zero in North direction and the angle increases clockwise\n" "(c) zero direction and orientation are user defined\n" )); Parameters.Add_Grid(NULL, "DIR" , _TL("Direction") , _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "LEN" , _TL("Length") , _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "DX" , _TL("X Component") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Grid(NULL, "DY" , _TL("Y Component") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Choice( NULL , "UNITS" , _TL("Polar Angle Units"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("radians"), _TL("degree") ), 0 ); pNode = Parameters.Add_Choice( NULL , "SYSTEM" , _TL("Polar Coordinate System"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("mathematical"), _TL("geographical"), _TL("user defined") ), 1 ); Parameters.Add_Value( pNode , "SYSTEM_ZERO" , _TL("User defined Zero Direction"), _TL("given in degree clockwise from North direction"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 360.0, true ); Parameters.Add_Choice( pNode , "SYSTEM_ORIENT" , _TL("User defined Orientation"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("clockwise"), _TL("counterclockwise") ), 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGradient_Polar_To_Cartes::On_Execute(void) { bool bDegree, bClockwise; int Method; double LEN, DIR, Zero; CSG_Grid *pDX, *pDY, *pDIR, *pLEN; //----------------------------------------------------- pDX = Parameters("DX") ->asGrid(); pDY = Parameters("DY") ->asGrid(); pDIR = Parameters("DIR") ->asGrid(); pLEN = Parameters("LEN") ->asGrid(); bDegree = Parameters("UNITS") ->asInt() == 1; Method = Parameters("SYSTEM") ->asInt(); if( Method == 0 ) // mathematic { Zero = M_PI_090; bClockwise = false; } else { Zero = Parameters("SYSTEM_ZERO")->asDouble() * M_DEG_TO_RAD; bClockwise = Parameters("SYSTEM_ORIENT")->asInt() == 0; } //----------------------------------------------------- for(int y=0; yis_NoData(x, y) || pDIR->is_NoData(x, y) ) { pDX->Set_NoData(x, y); pDY->Set_NoData(x, y); } else { LEN = pLEN->asDouble(x, y); DIR = pDIR->asDouble(x, y); if( bDegree ) { DIR *= M_DEG_TO_RAD; } if( Method != 1 ) // not geographic { DIR = bClockwise ? DIR - Zero : Zero - DIR; } pDX->Set_Value(x, y, LEN * sin(DIR)); pDY->Set_Value(x, y, LEN * cos(DIR)); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus/gradient_cartes_polar.h000066400000000000000000000066371224124640700260720ustar00rootroot00000000000000/********************************************************** * Version $Id: gradient_cartes_polar.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* gradient_cartes_polar.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gradient_cartes_polar_H #define HEADER_INCLUDED__gradient_cartes_polar_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGradient_Cartes_To_Polar : public CSG_Module_Grid { public: CGradient_Cartes_To_Polar(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Conversions") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGradient_Polar_To_Cartes : public CSG_Module_Grid { public: CGradient_Polar_To_Cartes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Conversions") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gradient_cartes_polar_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/grid_difference.cpp000066400000000000000000000240651224124640700251640ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_difference.cpp 1211 2011-11-03 10:19:19Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Difference.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_difference.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Difference::CGrid_Difference(void) { Set_Name (_TL("Grid Difference")); Set_Author (SG_T("O. Conrad (c) 2009")); Set_Description (_TW( "" )); Parameters.Add_Grid( NULL , "A" , _TL("A"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "B" , _TL("B"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "C" , _TL("Difference (A - B)"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Difference::On_Execute(void) { CSG_Grid *pA, *pB, *pC; //----------------------------------------------------- pA = Parameters("A")->asGrid(); pB = Parameters("B")->asGrid(); pC = Parameters("C")->asGrid(); DataObject_Set_Colors(pC, 100, SG_COLORS_RED_GREY_BLUE); //----------------------------------------------------- for(int y=0; yis_NoData(x, y) || pB->is_NoData(x, y) ) { pC->Set_NoData(x, y); } else { pC->Set_Value(x, y, pA->asDouble(x, y) - pB->asDouble(x, y)); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Division::CGrid_Division(void) { Set_Name (_TL("Grid Division")); Set_Author (SG_T("O. Conrad (c) 2011")); Set_Description (_TW( "" )); Parameters.Add_Grid( NULL , "A" , _TL("Dividend"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "B" , _TL("Divisor"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "C" , _TL("Quotient"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Division::On_Execute(void) { CSG_Grid *pA, *pB, *pC; //----------------------------------------------------- pA = Parameters("A")->asGrid(); pB = Parameters("B")->asGrid(); pC = Parameters("C")->asGrid(); DataObject_Set_Colors(pC, 100, SG_COLORS_RED_GREY_BLUE); //----------------------------------------------------- for(int y=0; yis_NoData(x, y) || pB->is_NoData(x, y) || pB->asDouble(x, y) == 0.0 ) { pC->Set_NoData(x, y); } else { pC->Set_Value(x, y, pA->asDouble(x, y) / pB->asDouble(x, y)); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrids_Sum::CGrids_Sum(void) { Set_Name (_TL("Grids Sum")); Set_Author (SG_T("O. Conrad (c) 2010")); Set_Description (_TW( "Cellwise addition of grid values." )); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "RESULT" , _TL("Sum"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrids_Sum::On_Execute(void) { CSG_Grid *pResult; CSG_Parameter_Grid_List *pGrids; //----------------------------------------------------- pGrids = Parameters("GRIDS") ->asGridList(); pResult = Parameters("RESULT") ->asGrid(); //----------------------------------------------------- if( pGrids->Get_Count() < 1 ) { Error_Set(_TL("no grid in list")); return( false ); } //----------------------------------------------------- for(int y=0; yGet_Count(); i++) { if( pGrids->asGrid(i)->is_InGrid(x, y) ) { n ++; d += pGrids->asGrid(i)->asDouble(x, y); } } if( n == pGrids->Get_Count() ) { pResult->Set_Value(x, y, d); } else { pResult->Set_NoData(x, y); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrids_Product::CGrids_Product(void) { Set_Name (_TL("Grids Product")); Set_Author (SG_T("O. Conrad (c) 2010")); Set_Description (_TW( "Cellwise multiplication of grid values." )); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "RESULT" , _TL("Product"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrids_Product::On_Execute(void) { CSG_Grid *pResult; CSG_Parameter_Grid_List *pGrids; //----------------------------------------------------- pGrids = Parameters("GRIDS") ->asGridList(); pResult = Parameters("RESULT") ->asGrid(); //----------------------------------------------------- if( pGrids->Get_Count() < 1 ) { Error_Set(_TL("no grid in list")); return( false ); } //----------------------------------------------------- for(int y=0; yGet_Count(); i++) { if( pGrids->asGrid(i)->is_InGrid(x, y) ) { if( n++ < 1 ) { d = pGrids->asGrid(i)->asDouble(x, y); } else { d *= pGrids->asGrid(i)->asDouble(x, y); } } } if( n == pGrids->Get_Count() ) { pResult->Set_Value(x, y, d); } else { pResult->Set_NoData(x, y); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus/grid_difference.h000066400000000000000000000125131224124640700246240ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_difference.h 1211 2011-11-03 10:19:19Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // Grid_Difference.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Difference_H #define HEADER_INCLUDED__Grid_Difference_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Difference : public CSG_Module_Grid { public: CGrid_Difference(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Division : public CSG_Module_Grid { public: CGrid_Division(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrids_Sum : public CSG_Module_Grid { public: CGrids_Sum(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrids_Product : public CSG_Module_Grid { public: CGrids_Product(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Difference_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus/grid_metric_conversion.cpp000066400000000000000000000134311224124640700266150ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_metric_conversion.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // grid_metric_conversion.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_metric_conversion.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Metric_Conversion::CGrid_Metric_Conversion(void) { Set_Name (_TL("Metric Conversions")); Set_Author (SG_T("O. Conrad (c) 2011")); Set_Description (_TW( "" )); Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "CONV" , _TL("Converted Grid"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "CONVERSION" , _TL("Conversion"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("radians to degree"), _TL("degree to radians"), _TL("Celsius to Fahrenheit"), _TL("Fahrenheit to Celsius") ) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Metric_Conversion::On_Execute(void) { int Conversion; CSG_Grid *pGrid, *pConv; //----------------------------------------------------- pGrid = Parameters("GRID") ->asGrid(); pConv = Parameters("CONV") ->asGrid(); Conversion = Parameters("CONVERSION") ->asInt(); switch( Conversion ) { case 0: pConv->Set_Unit(SG_T("\xbo")); break; // radians to degree case 1: pConv->Set_Unit(SG_T("\xbo")); break; // degree to radians case 2: pConv->Set_Unit(SG_T("\xboF")); break; // Celsius to Fahrenheit case 3: pConv->Set_Unit(SG_T("\xboC")); break; // Fahrenheit to Celsius } //----------------------------------------------------- for(int y=0; yis_NoData(x, y) ) { pConv->Set_NoData(x, y); } else { double z = pGrid->asDouble(x, y); switch( Conversion ) { case 0: z = z * M_RAD_TO_DEG; break; // radians to degree case 1: z = z * M_DEG_TO_RAD; break; // degree to radians case 2: z = z * 1.8 + 32.0; break; // Celsius to Fahrenheit case 3: z = (z - 32.0) / 1.8; break; // Fahrenheit to Celsius } pConv->Set_Value(x, y, z); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus/grid_metric_conversion.h000066400000000000000000000107311224124640700262620ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_metric_conversion.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Calculus // // // //-------------------------------------------------------// // // // grid_metric_conversion.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_metric_conversion_H #define HEADER_INCLUDED__grid_metric_conversion_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Metric_Conversion : public CSG_Module_Grid { public: CGrid_Metric_Conversion(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Conversions") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_metric_conversion_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/000077500000000000000000000000001224124640700222125ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/MLB_Interface.cpp000066400000000000000000000031031224124640700253050ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Grid - Calculus BSL") ); case MLB_INFO_Author: return( SG_T("SAGA User Group Associaton (c) 2009") ); case MLB_INFO_Description: return( _TL("Boehner's Simple Language (BSL) is a macro script language for grid based calculations.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Grid|Calculus") ); } } //--------------------------------------------------------- #include "bsl_interpreter.h" //--------------------------------------------------------- CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CBSL_Interpreter(false) ); case 1: return( new CBSL_Interpreter(true) ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/MLB_Interface.h000066400000000000000000000013541224124640700247600ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_calculus_bsl_H #define HEADER_INCLUDED__grid_calculus_bsl_H //--------------------------------------------------------- #include //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_calculus_bsl_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/Makefile.am000066400000000000000000000022151224124640700242460ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_calculus_bsl.la libgrid_calculus_bsl_la_SOURCES =\ ausdruck.cpp\ auswert_anweisung.cpp\ auswert_foreach.cpp\ auswert_if.cpp\ auswert_zuweisung.cpp\ basistypen.cpp\ bedingung.cpp\ diverses.cpp\ foreach.cpp\ funktion.cpp\ grid_bsl.cpp\ interpolation.cpp\ bsl_interpreter.cpp\ MLB_Interface.cpp\ pars_all.cpp\ vector.cpp\ zuweisung.cpp\ ausdruck.h\ auswert_anweisung.h\ auswert_foreach.h\ auswert_if.h\ auswert_zuweisung.h\ basistypen.h\ bedingung.h\ diverses.h\ foreach.h\ funktion.h\ funktion_numerisch.h\ funktion_statistisch.h\ grid_bsl.h\ gr_def.h\ gr_syst.h\ interpolation.h\ bsl_interpreter.h\ MLB_Interface.h\ pars_all.h\ vector.h\ zuweisung.h libgrid_calculus_bsl_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/Makefile.in000066400000000000000000000500721224124640700242630ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/grid/grid_calculus_bsl DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgrid_calculus_bsl_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgrid_calculus_bsl_la_OBJECTS = ausdruck.lo auswert_anweisung.lo \ auswert_foreach.lo auswert_if.lo auswert_zuweisung.lo \ basistypen.lo bedingung.lo diverses.lo foreach.lo funktion.lo \ grid_bsl.lo interpolation.lo bsl_interpreter.lo \ MLB_Interface.lo pars_all.lo vector.lo zuweisung.lo libgrid_calculus_bsl_la_OBJECTS = \ $(am_libgrid_calculus_bsl_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgrid_calculus_bsl_la_SOURCES) DIST_SOURCES = $(libgrid_calculus_bsl_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_calculus_bsl.la libgrid_calculus_bsl_la_SOURCES = \ ausdruck.cpp\ auswert_anweisung.cpp\ auswert_foreach.cpp\ auswert_if.cpp\ auswert_zuweisung.cpp\ basistypen.cpp\ bedingung.cpp\ diverses.cpp\ foreach.cpp\ funktion.cpp\ grid_bsl.cpp\ interpolation.cpp\ bsl_interpreter.cpp\ MLB_Interface.cpp\ pars_all.cpp\ vector.cpp\ zuweisung.cpp\ ausdruck.h\ auswert_anweisung.h\ auswert_foreach.h\ auswert_if.h\ auswert_zuweisung.h\ basistypen.h\ bedingung.h\ diverses.h\ foreach.h\ funktion.h\ funktion_numerisch.h\ funktion_statistisch.h\ grid_bsl.h\ gr_def.h\ gr_syst.h\ interpolation.h\ bsl_interpreter.h\ MLB_Interface.h\ pars_all.h\ vector.h\ zuweisung.h libgrid_calculus_bsl_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/grid/grid_calculus_bsl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/grid/grid_calculus_bsl/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgrid_calculus_bsl.la: $(libgrid_calculus_bsl_la_OBJECTS) $(libgrid_calculus_bsl_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgrid_calculus_bsl_la_OBJECTS) $(libgrid_calculus_bsl_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ausdruck.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auswert_anweisung.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auswert_foreach.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auswert_if.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auswert_zuweisung.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basistypen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bedingung.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsl_interpreter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diverses.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foreach.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/funktion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_bsl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interpolation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pars_all.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zuweisung.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/ausdruck.cpp000066400000000000000000000417711224124640700245510ustar00rootroot00000000000000/********************************************************** * Version $Id: ausdruck.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //#include "..\stdafx.h" #include #include #include "ausdruck.h" #include "funktion.h" using namespace std; class compare_BB_Funktion : public greater { public: bool operator()(const BBFunktion * &x, const BBFunktion * &y) const { return x->name < y->name; }; }; BBBaumInteger::BBBaumInteger() { typ = NoOp; memset(&k, 0, sizeof(BBKnoten)); } BBBaumInteger::~BBBaumInteger() { if (typ == NoOp) return; switch(typ) { case BIOperator: if (k.BiOperator.links != NULL) delete k.BiOperator.links; if (k.BiOperator.rechts != NULL) delete k.BiOperator.rechts; break; case UniOperator: if (k.UniOperator.rechts != NULL) delete k.UniOperator.rechts; break; case MIndex: if (k.MatrixIndex.P != NULL) delete k.MatrixIndex.P; break; case Funktion: if (k.func != NULL) delete k.func; break; case IZahl: case FZahl: case IVar: case FVar: break; } memset(&k, 0, sizeof(BBKnoten)); } BBBaumMatrixPoint::BBBaumMatrixPoint() : typ(NoOp) , isMatrix(true) { memset(&k, 0, sizeof(BBKnoten)); } BBBaumMatrixPoint::~BBBaumMatrixPoint() { if (typ == NoOp) return; switch(typ) { case BIOperator: if (k.BiOperator.links != NULL) delete k.BiOperator.links; if (k.BiOperator.rechts != NULL) delete k.BiOperator.rechts; break; case UniOperator: if (k.UniOperator.rechts != NULL) delete k.UniOperator.rechts; break; case IFAusdruck: if (k.IntFloatAusdruck.b != NULL) delete k.IntFloatAusdruck.b; break; case MVar: case PVar: break; } memset(&k, 0, sizeof(BBKnoten)); } bool getFirstCharKlammer(const string& statement, const string& cmp, char& c, int& pos) { if (statement.empty()) return false; int klammer_ebene = 0, klammerE_ebene = 0; for (int i=0; i= 0) int j; for (j=0; j 0) { c = statement[char_found]; pos = char_found; return true; } return false; } bool isKlammer(const string& statement) { // klammer-Level zhlen if (statement.empty()) return false; if (statement[0] != '(' || statement[statement.size()-1] != ')') return false; int klammer_ebene = 0; for (int i=0; i if (getFirstCharKlammer(statement, "%", c, pos)) return true; //<-- return false; } bool isUniOperator(const string& statement, char& c) { c = statement[0]; return (c == '-' || c == '+'); } bool isMatrixIndex(const string& statement, BBMatrix *& bm, BBBaumMatrixPoint *& bp, bool getMem /* = true */) { // wenn X[p] enthlt und X = Matrix und p = Point if (statement.empty()) return false; string s(statement); int pos1, pos2; pos1 = s.find('['); if (pos1 > 0) { pos2 = s.find(']'); if ( pos2 > pos1 && pos2 == s.size()-1 ) { // ersten Teil string m, p; m = s.substr(0, pos1); p = s.substr(pos1+1, pos2-pos1-1); BBTyp *tm; BBBaumMatrixPoint *bmp; if (isMVar(m, tm)) { try { // erst Testen pars_matrix_point(p, bmp, false, false); } catch (BBFehlerException) { return false; } if (!getMem) // falls nichts allokieren -> test erfolgreich return true; try { // dann allokieren pars_matrix_point(p, bmp, false); } catch (BBFehlerException) { return false; } bm = (BBMatrix *) tm; bp = bmp; return true; } /* if (isMVar(m, tm) && isPVar(p, tp)) { bm = (BBMatrix *) tm; bp = (BBPoint *) tp; return true; } */ } } return false; } bool isFZahl(const string& statement) { // Format: [+-]d[d][.[d[dd]][e|E +|- d[d]]] if (statement .size() > 50) return false; char buff[100]; double f; int anz = sscanf(statement.data(), "%f%s", &f, buff); return (anz == 1); } bool isIZahl(const string& statement) { if (statement.empty()) return false; string s(statement); // eventuel voranstehenden +- if (s[0] == '+') s.erase(s.begin()); else if (s[0] == '-') s.erase(s.begin()); if (s.empty()) return false; int p = s.find_first_not_of("1234567890"); if (p >= 0) return false; return true; } bool isFVar(const string& statement, BBTyp * & b) { b = isVar(statement); if (b == NULL) return false; if (b->type == BBTyp::FType) return true; return false; } bool isIVar(const string& statement, BBTyp * & b) { b = isVar(statement); if (b == NULL) return false; if (b->type == BBTyp::IType) return true; return false; } bool isPVar(const string& statement, BBTyp * & b) { b = isVar(statement); if (b == NULL) return false; if (b->type == BBTyp::PType) return true; return false; } bool isMVar(const string& statement, BBTyp * & b) { b = isVar(statement); if (b == NULL) return false; if (b->type == BBTyp::MType) return true; return false; } BBFunktion *isFktName(const string& s) { if (FunktionList.empty()) return NULL; T_FunktionList::iterator it; for (it = FunktionList.begin(); it != FunktionList.end(); it++) { if ((*it)->name == s) return (*it); } return NULL; } bool getNextFktToken(const string& s, int& pos, string& erg) { // Syntax xx[,xx[,xx...]] if (pos >= s.size()) return false; string ss(s.substr(pos)); int pos1 = ss.find_first_of(','); if (pos1 >= 0) { erg = ss.substr(0, pos1); pos += pos1; } else { erg = ss; pos = s.size(); } if (erg.empty()) return false; return true; } bool isFunktion (const string& statement, BBFktExe * & fktexe, bool getMem /* = true */, bool AlleFunktionen /* = true */) { // Syntax: fktname([arg1[, arg2]]) string s(statement); int pos1, pos2; pos1 = s.find_first_of('('); pos2 = s.find_last_of(')'); if (pos1 <= 0 || pos2 != s.size()-1) return false; // Variablen-Name string sub1, sub2; sub1 = s.substr(0, pos1); trim(sub1); sub2 = s.substr(pos1+1, pos2-pos1-1); trim(sub2); if (sub1.empty()) return false; BBFunktion *fkt = isFktName(sub1); if (fkt == NULL) return false; if (!AlleFunktionen) { // nur diejenigen Funktionen mit Return-Typ if (fkt->ret.typ == BBArgumente::NoOp) // kein Return-Typ return false; } if (sub2.empty()) // keine Argumente { if (!fkt->args.empty()) return false; if (getMem) { fktexe = new BBFktExe; fktexe->args = fkt->args; fktexe->f = fkt; // vorher ... = NULL; } return true; } else { // Argumente zhlen // 1. Float/Integer lassen sich konvertieren // 2. Matrix // 3. Point if (getMem) { fktexe = new BBFktExe; fktexe->args = fkt->args; // vector kopieren fktexe->f = fkt; } int anz = fkt->args.size(); int possub2 = 0; for (int i=0; iargs[i].typ == BBArgumente::ITyp || fkt->args[i].typ == BBArgumente::FTyp) { // if (bt->type != BBTyp::IType || // bt->type != BBTyp::FType) // return false; try { BBBaumInteger *b; pars_integer_float(ss, b, getMem); if (getMem) fktexe->args[i].ArgTyp.IF = b; } catch (BBFehlerException) { if (getMem) delete fktexe; return false; } } else { /* if (fkt->args[i].typ == BBArgumente::MTyp && bt->type != BBTyp::MType) return false; if (fkt->args[i].typ == BBArgumente::PTyp && bt->type != BBTyp::PType) return false; */ try { BBBaumMatrixPoint *b; pars_matrix_point(ss, b, fkt->args[i].typ == BBArgumente::MTyp, getMem); if (getMem) fktexe->args[i].ArgTyp.MP = b; } catch (BBFehlerException) { if (getMem) delete fktexe; return false; } } possub2++; // Komma entfernen } if (possub2 < sub2.size()) // zuviel Parameter angegeben { if (getMem) delete fktexe; return false; } } return true; } // ------------- Hauptroutine ------------------- static char c; static BBTyp *b; static BBMatrix *bm; static BBPoint *bp; static BBBaumMatrixPoint *bmp; static int pos; static BBFktExe *bfkt; void pars_integer_float(const string& statement, BBBaumInteger * & Knoten, int getMem /* = true */) { string s(statement); trim(s); if (s.empty()) throw BBFehlerException(); if (isKlammer(s)) { s.erase(s.begin()); s.erase(s.end()-1); pars_integer_float(s, Knoten, getMem); } else if (isMatrixIndex(s, bm, bmp, getMem!=0)) { if (getMem) { Knoten = new BBBaumInteger; Knoten->typ = BBBaumInteger::MIndex; Knoten->k.MatrixIndex.M = bm; Knoten->k.MatrixIndex.P = bmp; } } else if (isBiOperator(s, c, pos)) { string links = s.substr(0, pos); string rechts = s.substr(pos+1, s.size()-pos-1); if (links.empty() || rechts.empty()) throw BBFehlerException(); if (getMem) { Knoten = new BBBaumInteger; Knoten->typ = BBBaumInteger::BIOperator; switch(c) { case '+': Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Plus; break; case '-': Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Minus; break; case '*': Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Mal; break; case '/': Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Geteilt; break; case '^': Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Hoch; break; //--> case '%': Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Modulo; break; //<-- } pars_integer_float(links, Knoten->k.BiOperator.links); pars_integer_float(rechts, Knoten->k.BiOperator.rechts); } else { pars_integer_float(links, Knoten, getMem); pars_integer_float(rechts, Knoten, getMem); } } else if (isUniOperator(s, c)) { s.erase(s.begin()); if (getMem) { Knoten = new BBBaumInteger; Knoten->typ = BBBaumInteger::UniOperator; Knoten->k.UniOperator.OpTyp = (c == '+' ? BBBaumInteger::BBKnoten::BBUniOperator::Plus : BBBaumInteger::BBKnoten::BBUniOperator::Minus); pars_integer_float(s, Knoten->k.UniOperator.rechts); } else pars_integer_float(s, Knoten->k.UniOperator.rechts, getMem); } else if (isFZahl(s)) { if (getMem) { Knoten = new BBBaumInteger; Knoten->typ = BBBaumInteger::FZahl; Knoten->k.FZahl = atof(s.data()); } } else if (isIZahl(s)) { if (getMem) { Knoten = new BBBaumInteger; Knoten->typ = BBBaumInteger::IZahl; Knoten->k.IZahl = (int)atof(s.data()); } } else if (isFVar(s, b)) { if (getMem) { Knoten = new BBBaumInteger; Knoten->typ = BBBaumInteger::FVar; Knoten->k.FVar = getVarF(b); } } else if (isIVar(s, b)) { if (getMem) { Knoten = new BBBaumInteger; Knoten->typ = BBBaumInteger::IVar; Knoten->k.IVar = getVarI(b); } } else if (isFunktion (s, bfkt, getMem!=0, false)) // nur die Funktionen mit Return-Typ { if (getMem) { Knoten = new BBBaumInteger; Knoten->typ = BBBaumInteger::Funktion; Knoten->k.func = bfkt; } } else throw BBFehlerException(); } bool isIntFloatAusdruck(const string& s) { try { BBBaumInteger *knoten = NULL; pars_integer_float(s, knoten, false); } catch (BBFehlerException) { return false; } return true; } //++++++++++++++ Point ++++++++++++++++++++++++++ // Operator p/p + - // Operator p/i i/p p/f f/p * / //++++++++++++++ Matrix ++++++++++++++++++++++++++ // Operator M/M + - // Operator M/i i/M M/f f/M * / void pars_matrix_point(const string& statement, BBBaumMatrixPoint * &Knoten, bool matrix, bool getMem /* = true */) { string s(statement); trim(s); if (s.empty()) throw BBFehlerException(); if (isKlammer(s)) { s.erase(s.begin()); s.erase(s.end()-1); pars_matrix_point(s, Knoten, matrix, getMem); } else if (isUniOperator(s, c)) { s.erase(s.begin()); if (getMem) { Knoten = new BBBaumMatrixPoint; Knoten->typ = BBBaumMatrixPoint::UniOperator; Knoten->k.UniOperator.OpTyp = (c == '+' ? BBBaumMatrixPoint::BBKnoten::BBUniOperator::Plus : BBBaumMatrixPoint::BBKnoten::BBUniOperator::Minus); Knoten->isMatrix = matrix; pars_matrix_point(s, Knoten->k.UniOperator.rechts, matrix); } else pars_matrix_point(s, Knoten, matrix, getMem); } else if (isBiOperator(s, c, pos)) { string links = s.substr(0, pos); string rechts = s.substr(pos+1, s.size()-pos-1); if (links.empty() || rechts.empty()) throw BBFehlerException(); if (getMem) { Knoten = new BBBaumMatrixPoint; Knoten->typ = BBBaumMatrixPoint::BIOperator; Knoten->isMatrix = matrix; switch(c) { case '+': Knoten->k.BiOperator.OpTyp = BBBaumMatrixPoint::BBKnoten::BBBiOperator::Plus; break; case '-': Knoten->k.BiOperator.OpTyp = BBBaumMatrixPoint::BBKnoten::BBBiOperator::Minus; break; case '*': Knoten->k.BiOperator.OpTyp = BBBaumMatrixPoint::BBKnoten::BBBiOperator::Mal; break; case '/': Knoten->k.BiOperator.OpTyp = BBBaumMatrixPoint::BBKnoten::BBBiOperator::Geteilt; break; case '^': throw BBFehlerException(); break; case '%': throw BBFehlerException(); break; } pars_matrix_point(links, Knoten->k.BiOperator.links, matrix); pars_matrix_point(rechts, Knoten->k.BiOperator.rechts, matrix); if (c == '+' || c == '-') { // Operator nur zwischen zwei Points if (matrix && ( (Knoten->k.BiOperator.rechts)->typ != BBBaumMatrixPoint::MVar || (Knoten->k.BiOperator.links )->typ != BBBaumMatrixPoint::MVar )) { throw BBFehlerException(); } if (!matrix && ((Knoten->k.BiOperator.rechts)->typ != BBBaumMatrixPoint::PVar || (Knoten->k.BiOperator.links )->typ != BBBaumMatrixPoint::PVar )) { throw BBFehlerException(); } } if (c == '*' || c == '/') { // Operator nur zwischen i/f und p, Reihenfolge egal int pvar = 0; int mvar = 0; if ((Knoten->k.BiOperator.rechts)->typ == BBBaumMatrixPoint::PVar) pvar++; if ((Knoten->k.BiOperator.rechts)->typ == BBBaumMatrixPoint::MVar) mvar++; if ((Knoten->k.BiOperator.links)->typ == BBBaumMatrixPoint::PVar) pvar++; if ((Knoten->k.BiOperator.links)->typ == BBBaumMatrixPoint::MVar) mvar++; if (matrix && (mvar != 1 || pvar != 0)) throw BBFehlerException(); if (!matrix && (pvar != 1 || mvar != 0)) throw BBFehlerException(); } } else { pars_matrix_point(links, Knoten, matrix, getMem); pars_matrix_point(rechts, Knoten, matrix, getMem); } } else if (matrix && isMVar(s, b)) { if (getMem) { Knoten = new BBBaumMatrixPoint; Knoten->typ = BBBaumMatrixPoint::MVar; Knoten->k.M = getVarM(b); Knoten->isMatrix = matrix; } } else if (!matrix && isPVar(s, b)) { if (getMem) { Knoten = new BBBaumMatrixPoint; Knoten->typ = BBBaumMatrixPoint::PVar; Knoten->k.P = getVarP(b); Knoten->isMatrix = matrix; } } else if (isIntFloatAusdruck(s)) { if (getMem) { Knoten = new BBBaumMatrixPoint; Knoten->typ = BBBaumMatrixPoint::IFAusdruck; Knoten->isMatrix = matrix; pars_integer_float(s, Knoten->k.IntFloatAusdruck.b); } else { BBBaumInteger *k = NULL; pars_integer_float(s, k, getMem); } } else throw BBFehlerException(); } saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/ausdruck.h000066400000000000000000000060521224124640700242070ustar00rootroot00000000000000/********************************************************** * Version $Id: ausdruck.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __AUSDRUCK_H #define __AUSDRUCK_H #include "basistypen.h" // Baum-Struktur fr Integer class BBFunktion; struct BBFktExe; class BBBaumMatrixPoint; class BBBaumInteger { public: enum KnotenTyp { NoOp, BIOperator, UniOperator, MIndex, IZahl, FZahl, Funktion, IVar, FVar } typ; BBBaumInteger(); ~BBBaumInteger(); union BBKnoten { struct BBBiOperator { enum OperatorType {Plus, Minus, Mal, Geteilt, Hoch, Modulo} OpTyp; BBBaumInteger *links; BBBaumInteger *rechts; } BiOperator; struct BBUniOperator { enum OperatorType {Plus, Minus } OpTyp; BBBaumInteger *rechts; } UniOperator; struct BBMatrixIndex { BBMatrix *M; //BBPoint *P; BBBaumMatrixPoint *P; } MatrixIndex; int IZahl; double FZahl; BBFktExe *func; BBInteger *IVar; BBFloat *FVar; } k; // bi-operator + - * / ^ // uni-operator - + // Integer-Zahl // double-Zahl // Integer-Variable // Float-Variable // kommt spter: // Funktion (spter) mit Rckgabewerte Int oder Float }; bool isKlammer(const std::string& statement); bool isBiOperator(const std::string& statement, char& c, int& pos); bool isUniOperator(const std::string& statement, char& c); bool isMatrixIndex(const std::string& statement, BBMatrix *& bm, BBBaumMatrixPoint *& bp, bool getMem = true); bool isFZahl(const std::string& statement); bool isIZahl(const std::string& statement); bool isFVar (const std::string& statement, BBTyp * &b); bool isIVar (const std::string& statement, BBTyp * &b); bool isPVar (const std::string& statement, BBTyp * &b); bool isMVar (const std::string& statement, BBTyp * &b); BBFunktion *isFktName(const std::string& s); bool isFunktion (const std::string& statement, BBFktExe * &b, bool getMem = true, bool AlleFunktionen = true); void pars_integer_float(const std::string& statement, BBBaumInteger * &Knoten, int getmem = true); //***************** Punkt und Matrix ***************** // Operator p/p -> + - // Operator p/i i/p p/f f/p -> * / // uni - Operator nur fr p/f/i //++++++++++++++ Matrix ++++++++++++++++++++++++++ // Operator M/M + - // Operator M/i i/M M/f f/M * / // uni - Operator nur fr f/i class BBBaumMatrixPoint { public: enum KnotenTyp { NoOp, BIOperator, UniOperator, IFAusdruck, MVar, PVar} typ; BBBaumMatrixPoint(); ~BBBaumMatrixPoint(); union BBKnoten { struct BBBiOperator { enum OperatorType {Plus, Minus, Mal, Geteilt} OpTyp; BBBaumMatrixPoint *links; BBBaumMatrixPoint *rechts; } BiOperator; struct BBUniOperator { enum OperatorType {Plus, Minus } OpTyp; BBBaumMatrixPoint *rechts; } UniOperator; struct BBIntFloatAusdruck { BBBaumInteger *b; } IntFloatAusdruck; BBMatrix *M; BBPoint *P; } k; bool isMatrix; // bi-operator + - * / ^ }; void pars_matrix_point(const std::string& statement, BBBaumMatrixPoint * &Knoten, bool matrix = true, bool getMem = true ); #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/auswert_anweisung.cpp000066400000000000000000000014101224124640700264640ustar00rootroot00000000000000/********************************************************** * Version $Id: auswert_anweisung.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //#include "..\stdafx.h" #include "auswert_anweisung.h" void ausfuehren_anweisung(T_AnweisungList& a) { T_AnweisungList::iterator it; for (it = a.begin(); it != a.end(); it++) { switch((*it)->typ) { case BBAnweisung::ForEach: ausfuehren_foreach(*((*it)->AnweisungVar.For)); break; case BBAnweisung::IF: ausfueren_bedingung(*((*it)->AnweisungVar.IF)); break; case BBAnweisung::Zuweisung: ausfuehren_zuweisung(*((*it)->AnweisungVar.Zu)); break; case BBAnweisung::Funktion: auswert_funktion_integer((*it)->AnweisungVar.Fkt); break; } } } saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/auswert_anweisung.h000066400000000000000000000005211224124640700261330ustar00rootroot00000000000000/********************************************************** * Version $Id: auswert_anweisung.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __AUSWERT_ANWEISUNG_H #define __AUSWERT_ANWEISUNG_H #include "auswert_if.h" void ausfuehren_anweisung(T_AnweisungList& a); #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/auswert_foreach.cpp000066400000000000000000000022131224124640700260750ustar00rootroot00000000000000/********************************************************** * Version $Id: auswert_foreach.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #include "auswert_foreach.h" #include "bsl_interpreter.h" void ausfuehren_foreach(BBForEach& f) { int x, y; y = f.M->M->yanz; x = f.M->M->xanz; if (f.type == BBForEach::Point) { // foreach p in M do for (f.P->v.y=0; f.P->v.yv.y)++) { if( g_Set_Progress(f.P->v.y, y) == false ) { throw BBFehlerUserbreak("User Break"); } for (f.P->v.x=0; f.P->v.xv.x)++) { // P setzen //f.P->v.x = j; //f.P->v.y = i; // Anweisungen ausfhren ausfuehren_anweisung(f.z); } } } else { // foreachn n of p in M do for (int i=-1; i<=1; i++) { for (int j=-1; j<=1; j++) { if (i != 0 || j != 0) { int vx, vy; vx = j+f.P->v.x; vy = i+f.P->v.y; if (vx < 0 || vx >= f.M->M->xanz || vy < 0 || vy >= f.M->M->yanz) continue; // n setzen f.N->v.x = vx; f.N->v.y = vy; // Anweisungen ausfhren ausfuehren_anweisung(f.z); } } } } } saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/auswert_foreach.h000066400000000000000000000006051224124640700255450ustar00rootroot00000000000000/********************************************************** * Version $Id: auswert_foreach.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __AUSWERT_FOREACH_H #define __AUSWERT_FOREACH_H #include "auswert_zuweisung.h" extern void ausfuehren_anweisung(T_AnweisungList& a); void ausfuehren_foreach(BBForEach& f); #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/auswert_if.cpp000066400000000000000000000065021224124640700250710ustar00rootroot00000000000000/********************************************************** * Version $Id: auswert_if.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //#include <..\stdafx.h> #include "auswert_if.h" #include bool auswert_bool_IFVar(BBBaumInteger *IF1, BBBaumInteger *IF2, BBBool::T_booloperator b) { switch (b) { case BBBool::Gleich: return auswert_float(*IF1) == auswert_float(*IF2); case BBBool::Ungleich: return auswert_float(*IF1) != auswert_float(*IF2); case BBBool::Kleiner: return auswert_float(*IF1) < auswert_float(*IF2); case BBBool::Groesser: return auswert_float(*IF1) > auswert_float(*IF2); case BBBool::KleinerG: return auswert_float(*IF1) <= auswert_float(*IF2); case BBBool::GroesserG: return auswert_float(*IF1) >= auswert_float(*IF2); } return false; } bool auswert_bool_PVar(BBBaumMatrixPoint *P1, BBBaumMatrixPoint *P2, BBBool::T_booloperator b) { T_Point v1, v2; double f; int ret1 = auswert_point(*P1, v1, f); int ret2 = auswert_point(*P2, v2, f); assert(ret1 && ret2); switch (b) { case BBBool::Gleich: return (v1.x == v2.x && v1.y == v2.y); case BBBool::Ungleich: return (v1.x != v2.x || v1.y != v2.y); case BBBool::Kleiner: return (v1.x < v2.x); case BBBool::Groesser: return (v1.x > v2.x); case BBBool::KleinerG: return (v1.x <= v2.x); case BBBool::GroesserG: return (v1.x >= v2.x); } return false; } bool auswert_bool_MVar(BBBaumMatrixPoint *M1, BBBaumMatrixPoint *M2, BBBool::T_booloperator b) { GridWerte v1, v2; double f; int ret1 = auswert_matrix(*M1, v1, f); int ret2 = auswert_matrix(*M2, v2, f); assert(ret1 && ret2); switch (b) { case BBBool::Gleich: return (v1.xanz == v2.xanz && v1.yanz == v2.yanz); case BBBool::Ungleich: return (v1.xanz != v2.xanz || v1.yanz != v2.yanz); case BBBool::Kleiner: return (v1.xanz < v2.xanz); case BBBool::Groesser: return (v1.xanz > v2.xanz); case BBBool::KleinerG: return (v1.xanz <= v2.xanz); case BBBool::GroesserG: return (v1.xanz >= v2.xanz); } return false; } bool auswert_bool(BBBool& b) { assert(b.type != BBBool::Nothing); switch(b.type) { case BBBool::IFVar: return auswert_bool_IFVar(b.BoolVar1.IF, b.BoolVar2.IF, b.BoolOp); case BBBool::PVar: return auswert_bool_PVar(b.BoolVar1.MP, b.BoolVar2.MP, b.BoolOp); case BBBool::MVar: return auswert_bool_MVar(b.BoolVar1.MP, b.BoolVar2.MP, b.BoolOp); } return false; } bool auswert_bedingung(BBBedingung *b) { assert(b->type != BBBedingung::Nothing); int ret1, ret2; switch (b->type) { case BBBedingung::Bool: return auswert_bool(*(b->BedingungVar.BoolVar.b)); case BBBedingung::Und: return auswert_bedingung(b->BedingungVar.BoolBiOp.b1) && auswert_bedingung(b->BedingungVar.BoolBiOp.b2); case BBBedingung::Oder: return auswert_bedingung(b->BedingungVar.BoolBiOp.b1) || auswert_bedingung(b->BedingungVar.BoolBiOp.b2); case BBBedingung::XOder: ret1 = auswert_bedingung(b->BedingungVar.BoolBiOp.b1); ret2 = auswert_bedingung(b->BedingungVar.BoolBiOp.b2); return ((ret1 && !ret2) || (!ret1 && ret2)); case BBBedingung::Not: return ! auswert_bedingung(b->BedingungVar.BoolUniOp.b); } assert(false); return false; } void ausfueren_bedingung(BBIf& b) { if (auswert_bedingung(b.b)) { ausfuehren_anweisung(b.z); } else { if (b.isElse) ausfuehren_anweisung(b.zelse); } } saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/auswert_if.h000066400000000000000000000005361224124640700245370ustar00rootroot00000000000000/********************************************************** * Version $Id: auswert_if.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __AUSWERT_IF_H #define __AUSWERT_IF_H #include "auswert_foreach.h" bool auswert_bedingung(BBBedingung *b); void ausfueren_bedingung(BBIf& b); #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/auswert_zuweisung.cpp000066400000000000000000000306441224124640700265370ustar00rootroot00000000000000/********************************************************** * Version $Id: auswert_zuweisung.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #include "pars_all.h" #include "auswert_zuweisung.h" #include "diverses.h" #include int auswert_integer(BBBaumInteger& b) { if (b.typ == BBBaumInteger::NoOp) throw BBFehlerAusfuehren(); double f; T_Point p; switch(b.typ) { case BBBaumInteger::BIOperator: switch(b.k.BiOperator.OpTyp) { case BBBaumInteger::BBKnoten::BBBiOperator::Plus: return auswert_integer(*b.k.BiOperator.links) + auswert_integer(*b.k.BiOperator.rechts); case BBBaumInteger::BBKnoten::BBBiOperator::Minus: return auswert_integer(*b.k.BiOperator.links) - auswert_integer(*b.k.BiOperator.rechts); case BBBaumInteger::BBKnoten::BBBiOperator::Mal: return auswert_integer(*b.k.BiOperator.links) * auswert_integer(*b.k.BiOperator.rechts); case BBBaumInteger::BBKnoten::BBBiOperator::Geteilt: return auswert_integer(*b.k.BiOperator.links) / auswert_integer(*b.k.BiOperator.rechts); case BBBaumInteger::BBKnoten::BBBiOperator::Hoch: return fround(pow( (double)auswert_integer(*b.k.BiOperator.links), (double)auswert_integer(*b.k.BiOperator.rechts))); //--> case BBBaumInteger::BBKnoten::BBBiOperator::Modulo: return auswert_integer(*b.k.BiOperator.links) % auswert_integer(*b.k.BiOperator.rechts) ; //<-- } break; case BBBaumInteger::UniOperator: switch (b.k.UniOperator.OpTyp) { case BBBaumInteger::BBKnoten::BBUniOperator::Plus: return auswert_integer(*b.k.UniOperator.rechts); case BBBaumInteger::BBKnoten::BBUniOperator::Minus: return (- auswert_integer(*b.k.UniOperator.rechts)); } break; case BBBaumInteger::MIndex: if (b.k.MatrixIndex.P->isMatrix) //muss Point sein { assert(false); break; } auswert_point(*b.k.MatrixIndex.P, p, f); return fround( (double)(*b.k.MatrixIndex.M->M)(p.x,p.y) ); case BBBaumInteger::IZahl: return b.k.IZahl; case BBBaumInteger::FZahl: return fround(b.k.FZahl); case BBBaumInteger::Funktion: if (b.k.func->f->ret.typ == BBArgumente::ITyp) return auswert_funktion_integer(b.k.func); else if (b.k.func->f->ret.typ == BBArgumente::FTyp) return fround(auswert_funktion_float(b.k.func)); else if (b.k.func->f->ret.typ == BBArgumente::NoOp) { auswert_funktion_integer(b.k.func); return 0; } assert(false); break; case BBBaumInteger::IVar: return *(b.k.IVar->i); case BBBaumInteger::FVar: return fround(*(b.k.FVar->f)); } assert(false); return 0; } // ************ Float ******************* double auswert_float(BBBaumInteger& b) { if (b.typ == BBBaumInteger::NoOp) throw BBFehlerAusfuehren(); double f; T_Point p; switch(b.typ) { case BBBaumInteger::BIOperator: switch(b.k.BiOperator.OpTyp) { case BBBaumInteger::BBKnoten::BBBiOperator::Plus: return auswert_float(*b.k.BiOperator.links) + auswert_float(*b.k.BiOperator.rechts); case BBBaumInteger::BBKnoten::BBBiOperator::Minus: return auswert_float(*b.k.BiOperator.links) - auswert_float(*b.k.BiOperator.rechts); case BBBaumInteger::BBKnoten::BBBiOperator::Mal: return auswert_float(*b.k.BiOperator.links) * auswert_float(*b.k.BiOperator.rechts); case BBBaumInteger::BBKnoten::BBBiOperator::Geteilt: return auswert_float(*b.k.BiOperator.links) / auswert_float(*b.k.BiOperator.rechts); case BBBaumInteger::BBKnoten::BBBiOperator::Hoch: return pow( auswert_float(*b.k.BiOperator.links), auswert_float(*b.k.BiOperator.rechts)); case BBBaumInteger::BBKnoten::BBBiOperator::Modulo: return fmod( auswert_float(*b.k.BiOperator.links), auswert_float(*b.k.BiOperator.rechts)); } break; case BBBaumInteger::UniOperator: switch (b.k.UniOperator.OpTyp) { case BBBaumInteger::BBKnoten::BBUniOperator::Plus: return auswert_float(*b.k.UniOperator.rechts); case BBBaumInteger::BBKnoten::BBUniOperator::Minus: return (- auswert_float(*b.k.UniOperator.rechts)); } break; case BBBaumInteger::MIndex: if (b.k.MatrixIndex.P->isMatrix) //muss Point sein { assert(false); break; } auswert_point(*b.k.MatrixIndex.P, p, f); return (*b.k.MatrixIndex.M->M)(p.x,p.y); //return b.k.MatrixIndex.M->M->Z[p.y][p.x]; case BBBaumInteger::IZahl: return b.k.IZahl; case BBBaumInteger::FZahl: return b.k.FZahl; case BBBaumInteger::Funktion: if (b.k.func->f->ret.typ == BBArgumente::ITyp) return auswert_funktion_integer(b.k.func); else if (b.k.func->f->ret.typ == BBArgumente::FTyp) return auswert_funktion_float(b.k.func); else if (b.k.func->f->ret.typ == BBArgumente::NoOp) { auswert_funktion_integer(b.k.func); return 0; } assert(false); break; case BBBaumInteger::IVar: return *(b.k.IVar->i); case BBBaumInteger::FVar: return *(b.k.FVar->f); } assert(false); return 0; } // ************ Point ******************* bool auswert_point(BBBaumMatrixPoint& b, T_Point& vret, double& fret) { if (b.typ == BBBaumInteger::NoOp) throw BBFehlerAusfuehren(); if (b.isMatrix) throw BBFehlerAusfuehren(); T_Point v, v2; double f, f2; bool ret1, ret2; switch(b.typ) { case BBBaumMatrixPoint::BIOperator: switch (b.k.BiOperator.OpTyp) { case BBBaumMatrixPoint::BBKnoten::BBBiOperator::Plus: ret1 = auswert_point(*b.k.BiOperator.links, v, f); ret2 = auswert_point(*b.k.BiOperator.rechts, v2, f); assert(ret1 && ret2); v.x += v2.x; v.y += v2.y; vret = v; return true; case BBBaumMatrixPoint::BBKnoten::BBBiOperator::Minus: ret1 = auswert_point(*b.k.BiOperator.links, v, f); ret2= auswert_point(*b.k.BiOperator.rechts, v2, f); assert(ret1 && ret2); v.x -= v2.x; v.y -= v2.y; vret = v; return true; case BBBaumMatrixPoint::BBKnoten::BBBiOperator::Mal: ret1 = auswert_point(*b.k.BiOperator.links, v, f); ret2= auswert_point(*b.k.BiOperator.rechts, v2, f2); assert((ret1 && !ret2) || (!ret1 && ret2)); if (ret1) { v.x *= f2; v.y *= f2; } else { v.x = v2.x * f; v.y = v2.y * f; } vret = v; return true; case BBBaumMatrixPoint::BBKnoten::BBBiOperator::Geteilt: ret1 = auswert_point(*b.k.BiOperator.links, v, f); ret2= auswert_point(*b.k.BiOperator.rechts, v2, f2); assert((ret1 && !ret2) || (!ret1 && ret2)); if (ret1) { v.x /= f2; v.y /= f2; } else { v.x = v2.x / f; v.y = v2.y / f; } vret = v; return true; } break; case BBBaumMatrixPoint::UniOperator: switch (b.k.UniOperator.OpTyp) { case BBBaumMatrixPoint::BBKnoten::BBUniOperator::Plus: ret1 = auswert_point(*b.k.UniOperator.rechts, v, f); assert(ret1); vret = v; return true; case BBBaumMatrixPoint::BBKnoten::BBUniOperator::Minus: ret1 = auswert_point(*b.k.UniOperator.rechts, v, f); assert(ret1); vret.x = -v.x; vret.y = -v.y; return true; } break; case BBBaumMatrixPoint::IFAusdruck: fret = auswert_float(*b.k.IntFloatAusdruck.b); return false; case BBBaumMatrixPoint::MVar: assert(false); break; case BBBaumMatrixPoint::PVar: vret = b.k.P->v; return true; } assert(false); return false; } // ************ Matrix ******************* // Groesse von mret bestimmen !! // Aufruf M = m+3*m2; ?? bool auswert_matrix(BBBaumMatrixPoint& b, GridWerte& mret, double& fret) { if (b.typ == BBBaumInteger::NoOp) throw BBFehlerAusfuehren(); if (!b.isMatrix) // ????? throw BBFehlerAusfuehren(); GridWerte m, m2; double f, f2; bool ret1, ret2; switch(b.typ) { case BBBaumMatrixPoint::BIOperator: switch (b.k.BiOperator.OpTyp) { case BBBaumMatrixPoint::BBKnoten::BBBiOperator::Plus: ret1 = auswert_matrix(*b.k.BiOperator.links, m, f); ret2 = auswert_matrix(*b.k.BiOperator.rechts, m2, f); assert(ret1 && ret2); mret = m; mret.getMem(); if (!(m.xanz == m2.xanz && m.yanz == m2.yanz && mret.xanz == m2.xanz && mret.yanz == m2.yanz )) throw BBFehlerMatrixNotEqual(); { for (int i=0; iM), true); return true; // ???? break; case BBBaumMatrixPoint::PVar: assert(false); return true; } assert(false); return false; } // ************ Funktion Integer ******************* int auswert_funktion_integer(BBFktExe *func) { // Argumente kopieren assert(func->f->ret.typ == BBArgumente::ITyp || func->f->ret.typ == BBArgumente::NoOp ); int l; l = func->f->args.size(); for (int i=0; if->args[i].ArgTyp = func->args[i].ArgTyp; func->f->fkt(); // falls kein Argument angegeben if (func->f->ret.typ == BBArgumente::NoOp) return 0; // sonst auswerten return auswert_integer(*(func->f->ret.ArgTyp.IF)); } // ************ Funktion Float ******************* double auswert_funktion_float(BBFktExe *func) { // Argumente kopieren assert(func->f->ret.typ == BBArgumente::FTyp); int l; l = func->f->args.size(); for (int i=0; if->args[i].ArgTyp = func->args[i].ArgTyp; func->f->fkt(); return auswert_float(*(func->f->ret.ArgTyp.IF)); } int fround(double f) { return (floor(f+0.5f)); } // ************ ZUWEISUNG ******************* void ausfuehren_zuweisung(BBZuweisung& z) { double f; if (z.typ == BBZuweisung::NoTyp) throw BBFehlerAusfuehren(); switch(z.typ) { case BBZuweisung::FTyp: *(z.ZuVar.FVar->f) = auswert_float(*z.ZuArt.IF); break; case BBZuweisung::ITyp: *(z.ZuVar.IVar->i) = auswert_integer(*z.ZuArt.IF); break; case BBZuweisung::PTyp: if (!auswert_point(*z.ZuArt.MP, z.ZuVar.PVar->v, f)) throw BBFehlerAusfuehren(); break; case BBZuweisung::MTyp: if (!auswert_matrix(*z.ZuArt.MP, *(z.ZuVar.MVar->M), f)) throw BBFehlerAusfuehren(); break; case BBZuweisung::MIndex: { T_Point p; if (!auswert_point(*z.ZuVar.MatrixIndex.PVar, p, f)) throw BBFehlerAusfuehren(); // z.ZuVar.MatrixIndex.MVar->M->Z[p.y][p.x] = auswert_float(*z.ZuArt.IF); (*z.ZuVar.MatrixIndex.MVar->M).Set_Value(p.x,p.y, auswert_float(*z.ZuArt.IF)); } break; } } saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/auswert_zuweisung.h000066400000000000000000000021411224124640700261730ustar00rootroot00000000000000/********************************************************** * Version $Id: auswert_zuweisung.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __AUSWERT_ZUWEISUNG_H #define __AUSWERT_ZUWEISUNG_H #include "pars_all.h" class BBFehlerAusfuehren { public: BBFehlerAusfuehren() { Text = ""; }; BBFehlerAusfuehren(std::string s) { Text = s; }; ~BBFehlerAusfuehren() {}; std::string Text; }; class BBFehlerUserbreak { public: BBFehlerUserbreak() { Text = ""; }; BBFehlerUserbreak(std::string s) { Text = s; }; ~BBFehlerUserbreak() {}; std::string Text; }; class BBFehlerMatrixNotEqual { public: BBFehlerMatrixNotEqual() {}; ~BBFehlerMatrixNotEqual() {}; }; int fround(double f); int auswert_funktion_integer(BBFktExe *func); double auswert_funktion_float(BBFktExe *func); int auswert_integer(BBBaumInteger& b); double auswert_float(BBBaumInteger& b); bool auswert_point(BBBaumMatrixPoint& b, T_Point& vret, double& fret); bool auswert_matrix(BBBaumMatrixPoint& b, GridWerte& mret, double& fret); void ausfuehren_zuweisung(BBZuweisung& z); #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/basistypen.cpp000066400000000000000000000313761224124640700251110ustar00rootroot00000000000000/********************************************************** * Version $Id: basistypen.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #include #include #include #include #include #include "basistypen.h" #include #define WHITE_SP " \t\n" #define WHITE_SP_TRENNER " ,;\t\n" using namespace std; T_VarList VarList; T_InputText InputText; T_InputText InputGrids; int FehlerZeile; int FehlerPos1; int FehlerPos2; string FehlerString(""); bool isSyntaxCheck; class compare_BB_greater : public greater { public: // o.c. bool operator()(const BBTyp * &x, const BBTyp * &y) const bool operator()(BBTyp *x, BBTyp *y) const { return x->name < y->name; }; };/**/ class compare_BBType { public: bool operator() (const BBTyp *x, const BBTyp *y) { return x->name < y->name; } }; class compare_BBType2 { public: bool operator() (BBTyp *x, BBTyp y) { return x->name < y.name; } }; class compare_BBType3 { public: bool operator() (BBTyp x, BBTyp y) { return x.name < y.name; } }; void GetInputText(string bsl ) // wandelt EditControl-Text in Vector von Strings um { /* size = e.GetLineCount(); char *lpszBuffer = new char [1000]; int buffanz = 1000; lpszBuffer[0] = 0; InputText.clear(); for (int i=0; i buffanz-2) { delete [] lpszBuffer; buffanz = l+2; lpszBuffer = new char [buffanz]; } lpszBuffer[0] = buffanz; charcopied = e.GetLine( i, lpszBuffer ); lpszBuffer[charcopied] = 0; string s(lpszBuffer); InputText.push_back(s); } delete [] lpszBuffer;*/ } void WhiteSpace(string& s, int& pos, bool vorn/* = true*/) // entfertn entweder vorne die Wildcards oder schneidet ab dem // ersten Whitespace/Trenner den Rest ab // // Funktionweise: // vorn == true (default): // Es werden soviele Stellen zu "pos" addiert, wie Wildcards // am Anfang von "s" stehen // vorn == false: // Es wird der String s ab dem ersten vorkommenden Wildcard abgeschnitten // // { if (vorn) { int pos1 = s.find_first_not_of(WHITE_SP); if (pos1 > 0) { s.erase(s.begin(), s.begin() + pos1); // o.c // o.c s.erase(s.begin(), &s[pos1]); pos += pos1; } } else { int pos1 = s.find_first_of(WHITE_SP_TRENNER); if (pos1 > 0) { s.erase(s.begin() + pos1, s.end()); // o.c // o.c s.erase(&s[pos1], s.end()); } } } void trim(string& s) { // vorne Whitespaces entfernen int pos1 = s.find_first_not_of(WHITE_SP); if (pos1 > 0) { s.erase(s.begin(), s.begin() + pos1); } // hinter Whitespaces entfernen pos1 = s.find_last_not_of(WHITE_SP); if (pos1 >= 0) { s.erase(s.begin() + pos1+1, s.end()); // o.c. } } bool isNextToken(int zeile, int pos, string& cmp) { string s = InputText[zeile].substr(pos); if (!isNotEnd(zeile, pos, s)) return false; WhiteSpace(s, pos); return s == cmp; } bool isNextChar(int zeile, int pos, const char c) { string s = InputText[zeile].substr(pos); if (!isNotEnd(zeile, pos, s)) return false; WhiteSpace(s, pos); return s[0] == c; } bool getNextToken(int &zeile, int& pos, string& erg) { string s = InputText[zeile]; erg = InputText[zeile].substr(pos); if (!isNotEnd(zeile, pos, erg)) return false; WhiteSpace(erg, pos); WhiteSpace(erg, pos, false); pos += erg.size(); return true; } bool getNextZeile(int &zeile, int& pos, string& erg) { // Erstellt string von (zeile, pos) bis zum nchsten Komma if (zeile >= (int)InputText.size()) return false; string sub = InputText[zeile].substr(pos); erg = ""; int p; do { if ((p = sub.find_first_of(';')) >= 0) { sub.erase(p, sub.size()); pos = p; erg += sub; return true; } erg += sub; p = sub.size()+pos; if (!isNotEnd(zeile,p, sub)) return false; } while (true); return false; } bool getNextChar(int& zeile, int& pos, char& c) { string s = InputText[zeile].substr(pos); if (!isNotEnd(zeile, pos, s)) return false; WhiteSpace(s, pos); pos++; c = s[0]; return true; } bool isNotEnd(int& zeile, int& pos, string& s) { if (zeile >= (int)InputText.size()) return false; int pos1; if (pos >= (int)InputText[zeile].size() || (pos1 = InputText[zeile].substr(pos).find_first_not_of(WHITE_SP)) < 0) { int p; do { zeile++; if (zeile >= (int)InputText.size()) return false; p = InputText[zeile].find_first_not_of(WHITE_SP); } while (p < 0); pos = 0; s = InputText[zeile]; } else { // berprfen, ob s nur aus Whitespaces besteht } return true; } void DeleteVarList(void) { if (VarList.empty()) return; T_VarList::iterator it; for (it = VarList.begin(); it != VarList.end(); it++) { delete (*it); } VarList.clear(); } // wandelt Strings in Variablen um (aus InputText wird VarList) void ParseVars(int& zeile, int& pos) { // Syntax: Type varname [, varname [...] ] ; string subz; BBTyp::T_type t; char c; DeleteVarList(); int zeile_old = zeile; int pos_old = pos; FehlerZeile = zeile; while (getNextToken(zeile, pos, subz)) { // Typ angeben if (subz == "Integer") t = BBTyp::IType; else if (subz == "Float") t = BBTyp::FType; else if (subz == "Point") t = BBTyp::PType; else if (subz == "Matrix") t = BBTyp::MType; else { zeile = zeile_old; pos = pos_old; break; } // Variablen-Name, durch Komma getrennt while (getNextToken(zeile, pos, subz)) { FehlerZeile = zeile; // einfgen in VarList BBTyp *bt; switch(t) { case BBTyp::IType: bt = new BBInteger; bt->name = subz; bt->type = t; break; case BBTyp::FType: bt = new BBFloat; bt->name = subz; bt->type = t; break; case BBTyp::PType: bt = new BBPoint; bt->name = subz; bt->type = t; break; case BBTyp::MType: // falls Name () { int l = subz.size(); if (subz[l-1] == ')' && subz[l-2] == '(') { // Matrix: M() subz.erase(l-2, 2); bt = new BBMatrix(NULL); } else if (subz[l-1] == ')') { printf("loadig files not suported"); return; /* int posk; // Matrix: M("filename") if ((posk = subz.find('(')) <= 0) throw BBFehlerException(zeile); // Filename herausfinden string filename; filename = subz.substr(posk+1); if (filename.size() < 1) throw BBFehlerException(zeile); filename.erase(filename.size()-1); if (filename[0] !='"' || filename[filename.size()-1] != '"') throw BBFehlerException(zeile); // Variablen-Name herausfinden filename.erase(0, 1); filename.erase(filename.size()-1); subz.erase(posk); // Datei laden bt = new BBMatrix(); // // surferDoc sd; CFile file; if (!file.Open(filename.data(), CFile::modeRead)) { string out; ostringstream ostr(out); ostr << "Die Datei >" << filename << "< existiert nicht!" << ends; AfxMessageBox(ostr.str().data()); delete bt; throw BBFehlerException(zeile); } if (!isSyntaxCheck) { CArchive archive(&file, CArchive::load); // sd.readGrid(archive, *(((BBMatrix *) bt)->M)); } */ } else bt = new BBMatrix; bt->name = subz; bt->type = t; } break; } if (isVar(subz) != NULL) // falls Name bereits vorhanden { delete bt; throw BBFehlerException(zeile); } VarList.push_back(bt); // berprfen auf Komma if (!isNextChar(zeile, pos, ',')) break; // wenn Komma, nochmal if (!getNextChar(zeile, pos, c)) throw BBFehlerException(zeile); } // berprfen auf Semikolon; if (!getNextChar(zeile, pos, c) || c != ';') throw BBFehlerException(zeile); zeile_old = zeile; pos_old = pos; } } // berprft, ob string eine gltige Variable ist BBTyp *isVar(const string& s) { if (VarList.empty()) return NULL; // bool exist; T_VarList::iterator it; for (it = VarList.begin(); it != VarList.end(); it++) { string ss = (*it)->name; if ((*it)->name == s) return (*it); } return NULL; /* BBTyp bt; bt.name = s; exist = binary_search(VarList.begin(), VarList.end(), &bt, compare_BBType() ); if (exist) { it = search(VarList.begin(), VarList.end(), &bt, &bt, compare_BBType2() ); if (it != VarList.end()) return (*it); else return NULL; } else return NULL; */ } // ermittelt den Variablen-Typ einer Variablen BBTyp::T_type getVarType(BBTyp *s) { return s->type; } // liefert die jeweilige Variable zurck BBInteger *getVarI(BBTyp *s) { return ((BBInteger *) s); } BBFloat *getVarF(BBTyp *s) { return ((BBFloat *) s); } BBMatrix *getVarM(BBTyp *s) { return ((BBMatrix *) s); } BBPoint *getVarP(BBTyp *s) { return ((BBPoint *) s); } void setMatrixVariables(BBMatrix *M) { BBInteger *i; BBFloat *f; BBTyp *b; // xanz b = isVar(M->name + ".xanz"); assert(b != NULL); i = getVarI(b); assert(i->i == NULL); i->i = &(M->M->xanz); // yanz b = isVar(M->name + ".yanz"); assert(b != NULL); i = getVarI(b); assert(i->i == NULL); i->i = &(M->M->yanz); // xll b = isVar(M->name + ".xll"); assert(b != NULL); f = getVarF(b); assert(f->f == NULL); f->f = &(M->M->xll); // yll b = isVar(M->name + ".yll"); assert(b != NULL); f = getVarF(b); assert(f->f == NULL); f->f = &(M->M->yll); // dxy b = isVar(M->name + ".dxy"); assert(b != NULL); f = getVarF(b); assert(f->f == NULL); f->f = &(M->M->dxy); } bool GetMemoryGrids(CSG_Parameters *BSLParameters) { T_VarList::iterator it; for (it = VarList.begin(); it != VarList.end(); it++) { BBTyp::T_type t = getVarType(*it); if (t == BBTyp::MType) { BBMatrix *M = getVarM(*it); if (!M->isMem) // falls noch erzeugt werden mu { CSG_Grid *pInput = (*BSLParameters)(M->name.c_str())->asGrid(); GridWerte *pGrid = new GridWerte(); pGrid->Create(*pInput); pGrid->xanz = pGrid->Get_NX(); pGrid->yanz = pGrid->Get_NY(); pGrid->dxy = pGrid->Get_Cellsize(); pGrid->xll = pGrid->Get_XMin(); pGrid->yll = pGrid->Get_YMin(); pGrid->calcMinMax(); M->M = pGrid; M->isMem = true; setMatrixVariables(M); } } } bool ret = (it == VarList.end()); VarList.sort(compare_BB_greater()); return ret; } bool FindMemoryGrids(void) { InputGrids.clear(); T_VarList::iterator it; for (it = VarList.begin(); it != VarList.end(); it++) { BBTyp::T_type t = getVarType(*it); if (t == BBTyp::MType) { BBMatrix *M = getVarM(*it); if (!M->isMem) { InputGrids.push_back(M->name); } } } bool ret = (it == VarList.end()); return ret; } void AddMatrixPointVariables(bool pointer2matrix) { // if (pointer2matrix) // { // Alle anderen Matirx/Point-Variablen hinzu T_VarList::iterator it; for (it = VarList.begin(); it != VarList.end(); it++) { if ((*it)->type == BBTyp::MType) { BBMatrix *m = getVarM(*it); BBTyp *bt; bt = new BBInteger((m->isMem ? &(((BBMatrix *)(*it))->M->xanz) : NULL)); bt->name = (*it)->name + string(".xanz"); VarList.push_back(bt); bt = new BBInteger((m->isMem ? &(((BBMatrix *)(*it))->M->yanz) : NULL)); bt->name = (*it)->name + string(".yanz"); VarList.push_back(bt); bt = new BBFloat((m->isMem ? &(((BBMatrix *)(*it))->M->dxy) : NULL)); bt->name = (*it)->name + string(".dxy"); VarList.push_back(bt); bt = new BBFloat((m->isMem ? &(((BBMatrix *)(*it))->M->xll) : NULL)); bt->name = (*it)->name + string(".xll"); VarList.push_back(bt); bt = new BBFloat((m->isMem ? &(((BBMatrix *)(*it))->M->yll) : NULL)); bt->name = (*it)->name + string(".yll"); VarList.push_back(bt); } else if ((*it)->type == BBTyp::PType) { BBTyp *bt; bt = new BBInteger(&(((BBPoint *)(*it))->v.x)); bt->name = (*it)->name + string(".x"); VarList.push_back(bt); bt = new BBInteger(&(((BBPoint *)(*it))->v.y)); bt->name = (*it)->name + string(".y"); VarList.push_back(bt); } } /* } else { // Alle anderen Matirx/Point-Variablen hinzu T_VarList::iterator it; for (it = VarList.begin(); it != VarList.end(); it++) { if ((*it)->type == BBTyp::MType) { BBTyp *bt; bt = new BBInteger(); bt->name = (*it)->name + string(".xanz"); VarList.push_back(bt); bt = new BBInteger(); bt->name = (*it)->name + string(".yanz"); VarList.push_back(bt); bt = new BBFloat(); bt->name = (*it)->name + string(".dxy"); VarList.push_back(bt); bt = new BBFloat(); bt->name = (*it)->name + string(".xll"); VarList.push_back(bt); bt = new BBFloat(); bt->name = (*it)->name + string(".yll"); VarList.push_back(bt); } else if ((*it)->type == BBTyp::PType) { BBTyp *bt; bt = new BBInteger(); bt->name = (*it)->name + string(".x"); VarList.push_back(bt); bt = new BBInteger(); bt->name = (*it)->name + string(".y"); VarList.push_back(bt); } } } */ // kommt spter //if (!pointer2matrix) VarList.sort(compare_BB_greater()); } saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/basistypen.h000066400000000000000000000066341224124640700245550ustar00rootroot00000000000000/********************************************************** * Version $Id: basistypen.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __BASISTYPEN_H #define __BASISTYPEN_H #include #include #include #include "grid_bsl.h" #include "MLB_Interface.h" //#include "grid.h" //#include "Parameters.h" #pragma warning (disable : 4786 ) extern int FehlerZeile; extern std::string FehlerString; extern int FehlerPos1; extern int FehlerPos2; extern bool isSyntaxCheck; class BBFehlerException { public: BBFehlerException() { FehlerPos1 = 0; FehlerPos2 = 0; }; BBFehlerException(int z, int p1 = 0, int p2 = 0) { FehlerPos1 = p1; FehlerPos2 = p2; }; }; struct T_Point { long x; long y; }; class BBTyp { public: std::string name; enum T_type {IType, FType, PType, MType} type; BBTyp() {}; virtual ~BBTyp() {}; }; class BBInteger : public BBTyp { public: BBInteger() { type = IType; isMem = true; i = new long; *i = 0; }; BBInteger(int ii) { type = IType; isMem = true; i = new long; *i = ii; }; BBInteger(long *ii) { type = IType; isMem = false; i = ii; }; ~BBInteger() { if (isMem) delete i; }; // z.B. M.xanz auch ein int ist und *i auch darauf zeigen soll bool isMem; long *i; }; class BBFloat : public BBTyp { public: BBFloat() { type = FType; isMem = true; f = new double; *f = 0.0; }; BBFloat(double ff) { type = FType; isMem = true; f = new double; *f = ff; }; BBFloat(double *ff) { type = FType; isMem = false; f = ff; }; ~BBFloat() { if (isMem) delete f; }; // Datenelement ist nur ein Pointer, da // z.B. M.dxy auch ein double ist und *f auch darauf zeigen soll bool isMem; double *f; }; class BBPoint : public BBTyp { public: BBPoint() { type = PType; }; BBPoint(const T_Point& vv) : v(vv) { type = PType; }; ~BBPoint() { }; T_Point v; }; class BBMatrix : public BBTyp { public: BBMatrix() { type = MType; isMem = true; M = new GridWerte; }; BBMatrix(GridWerte *m) { type = MType; isMem = false; M = m; }; ~BBMatrix() { if (isMem) delete M; }; bool isMem; GridWerte *M; }; // Liste aller Variablen typedef std::list T_VarList; typedef std::vector T_InputText; extern T_VarList Varlist; extern T_InputText InputText; extern T_InputText InputGrids; void DeleteVarList(void); void WhiteSpace(std::string& s, int& pos, bool vorn = true); void trim(std::string& s); bool isNextToken(int zeile, int pos, std::string& cmp); bool isNextChar(int zeile, int pos, const char c); bool getNextToken(int &zeile, int& pos, std::string& erg); bool getNextZeile(int &zeile, int& pos, std::string& erg); bool getNextChar(int& zeile, int& pos, char& c); bool isNotEnd(int& zeile, int& pos, std::string& s); // wandelt Strings in Variablen um (aus InputText wird VarList) void ParseVars(int& zeile, int& pos); // berprft, ob string eine gltige Variable ist BBTyp *isVar(const std::string& s); // ermittelt den Variablen-Typ einer Variablen BBTyp::T_type getVarType(BBTyp *s); // liefert die jeweilige Variable zurck BBInteger *getVarI(BBTyp *s); BBFloat *getVarF(BBTyp *s); BBMatrix *getVarM(BBTyp *s); BBPoint *getVarP(BBTyp *s); bool GetMemoryGrids(CSG_Parameters *BSLParameters); bool FindMemoryGrids(void); void AddMatrixPointVariables(bool pointer2matrix); #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/bedingung.cpp000066400000000000000000000224301224124640700246610ustar00rootroot00000000000000/********************************************************** * Version $Id: bedingung.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //#include <..\stdafx.h> #include "bedingung.h" #include "pars_all.h" using namespace std; BBBool::BBBool() { type = Nothing; memset(&BoolVar1, 0, sizeof(T_BoolVar)); memset(&BoolVar2, 0, sizeof(T_BoolVar)); } BBBool::~BBBool() { if (type == Nothing) return; switch (type) { case IFVar: if (BoolVar1.IF != NULL) delete BoolVar1.IF; if (BoolVar2.IF != NULL) delete BoolVar2.IF; break; case PVar: case MVar: if (BoolVar1.MP != NULL) delete BoolVar1.MP; if (BoolVar2.MP != NULL) delete BoolVar2.MP; break; } memset(&BoolVar1, 0, sizeof(T_BoolVar)); memset(&BoolVar2, 0, sizeof(T_BoolVar)); } BBBedingung::BBBedingung() { type = Nothing; memset(&BedingungVar, 0, sizeof(T_BedingungVar)); } BBBedingung::~BBBedingung() { if (type == Nothing) return; switch (type) { case Bool: if (BedingungVar.BoolVar.b != NULL) delete BedingungVar.BoolVar.b; break; case Und: case Oder: case XOder: if (BedingungVar.BoolBiOp.b1 != NULL) delete BedingungVar.BoolBiOp.b1; if (BedingungVar.BoolBiOp.b2 != NULL) delete BedingungVar.BoolBiOp.b2; break; case Not: if (BedingungVar.BoolUniOp.b != NULL) delete BedingungVar.BoolUniOp.b; break; } memset(&BedingungVar, 0, sizeof(T_BedingungVar)); } BBIf::BBIf() { b = 0; isElse = false; } BBIf::~BBIf() { if (b != NULL) delete b; DeleteAnweisungList(z); DeleteAnweisungList(zelse); b = 0; } bool getFirstTokenKlammer(const string& statement, int& posvor, int& posnach, string& token) { if (statement.empty()) return false; int klammer_ebene = 0; for (int i=0; i <= >= ausdruck2 // string links, rechts; BBBool::T_booloperator t; //{ Gleich, Ungleich, Kleiner, Groesser, KleinerG, GroesserG} BoolOp; int pos, pos1, pos2; if ((pos = s.find("==")) > 0) { t = BBBool::Gleich; pos2 = pos+1; } else if ((pos = s.find("!=")) > 0) { t = BBBool::Ungleich; pos2 = pos+1; } else if ((pos = s.find(">=")) > 0) { t = BBBool::GroesserG; pos2 = pos+1; } else if ((pos = s.find("<=")) > 0) { t = BBBool::KleinerG; pos2 = pos+1; } else if ((pos = s.find(">")) > 0) { t = BBBool::Groesser; pos2 = pos; } else if ((pos = s.find("<")) > 0) { t = BBBool::Kleiner; pos2 = pos; } else return false; pos1 = pos-1; bool found = true; // bei Fehler immer return false // Auf IntegerFloat pruefen BBBaumInteger *k = NULL; try { pars_integer_float(s.substr(0, pos1+1), k, false); } catch (BBFehlerException) { found = false; } if (found) { b = new BBBool; b->type = BBBool::IFVar; b->BoolOp = t; string links, rechts; links = s.substr(0, pos1+1); rechts = s.substr(pos2+1); try { // erste Variable pars_integer_float(links, b->BoolVar1.IF); pars_integer_float(rechts, b->BoolVar2.IF); } catch (BBFehlerException) { delete b; b = 0; return false; } return true; } else { // Matrix oder Point found = true; BBBool::T_BoolType BType; // Auf Matrix pruefen BBBaumMatrixPoint *k = NULL; BType = BBBool::MVar; try { pars_matrix_point(s.substr(0, pos1+1), k, true, false); } catch (BBFehlerException) { found = false; } if (!found) { found = true; // Auf Point pruefen BType = BBBool::PVar; try { pars_matrix_point(s.substr(0, pos1+1), k, false, false); } catch (BBFehlerException) { found = false; } } if (!found) return false; // Matrix oder Point gefunden b = new BBBool; b->type = BType; b->BoolOp = t; string links, rechts; links = s.substr(0, pos1+1); rechts = s.substr(pos2+1); try { pars_matrix_point(links, b->BoolVar1.MP, BType == BBBool::MVar); pars_matrix_point(rechts, b->BoolVar2.MP, BType == BBBool::MVar); } catch (BBFehlerException) { delete b; b = 0; return false; } return true; } } bool isBedingung(const std::string& statement, BBBedingung * &bed) { string s(statement); string rechts; string links; BBBedingung::T_BedingungType t; BBBool *b; // zuerst uni-, dann bidirektionale Operatoren prfen trim(s); if (isKlammer(s)) { string ss = s; ss.erase(ss.begin()); ss.erase(ss.end()-1); return isBedingung(ss, bed); } else if (isBoolUniOperator(s, rechts)) { bed = new BBBedingung; bed->type = BBBedingung::Not; int ret = isBedingung(rechts, bed->BedingungVar.BoolUniOp.b); if (!ret) { delete bed; bed = 0; } return (ret!=0); } else if (isBoolBiOperator(s, links, rechts, t)) { bed = new BBBedingung; bed->type = t; bool ret1 = isBedingung(links, bed->BedingungVar.BoolBiOp.b2); if (ret1) { int ret2 = isBedingung(rechts, bed->BedingungVar.BoolBiOp.b1); if (ret2) return true; } delete bed; bed = 0; return false; } else if (isBool(s, b)) { bed = new BBBedingung; bed->type = BBBedingung::Bool; bed->BedingungVar.BoolVar.b = b; return true; } else return false; } bool getNextKlammerString(const string& s, int& pos) // liefert den String zwischen der ersten Klammer ( und der // zugehoerigen Klammer ). // z.B. ((hallo(1)) d) liefert (hallo(1)) d { if (pos >= s.size()) return false; if (s[pos] != '(') return false; int klammer_ebene = 1; for (int i=pos+1; i string s(statement.substr(pos)); int pos0; pos0 = s.find_first_not_of(" \t\n"); if (pos0 < 0) return false; s.erase(0, pos0); if (s.size() < 2) return false; // if if (s[0] != 'i' || s[1] != 'f') return false; s.erase(s.begin(), s.begin()+2); // Bedingung herausfinden // passende Klammern suchen int pos1; pos1 = s.find_first_not_of(" \t\n"); if (pos1 < 0) return false; int pos2 = pos1; if (!getNextKlammerString(s, pos2)) return false; string bedstring; bedstring = s.substr(pos1, pos2-pos1+1); BBBedingung * bed; if (isBedingung(bedstring, bed)) { i = new BBIf; i->b = bed; int p = pos2+1; // Klammer ) wegnehmen // Klammer { finden char c; getNextChar(s, p, c); if (c != '{') { delete i; i = 0; return false; } int p2 = p; if (!getStringBetweenKlammer(s, p2)) { delete i; i = 0; return false; } anweisungen = s.substr(p, p2-p); pos += pos0 + p +2; // pos0 sind blanks, p ist ein hinter { und 2 kommt vom if pos += anweisungen.size(); // hier den Else-Zweig abfragen i->isElse = false; int p3 = p2+1; string selse; if (!getNextToken(s, p3, selse)) return true; if (selse != "else") return true; getNextChar(s, p3, c); if (c != '{') { delete i; i = 0; return false; } p = p3; if (!getStringBetweenKlammer(s, p)) { delete i; i = 0; return false; } anweisungen_else = s.substr(p3, p-p3); pos += p-p2; i->isElse = true; return true; } return false; } saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/bedingung.h000066400000000000000000000025651224124640700243350ustar00rootroot00000000000000/********************************************************** * Version $Id: bedingung.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __BEDINGUNG_H #define __BEDINGUNG_H #include "foreach.h" // Syntax: if (bedingung) { anweisungen } // bedingung: bool / (bool && || ^^ ! bool) // bool: 1.) (IF/IF P/P M/M) == != < > class BBBool { public: enum T_BoolType { IFVar, PVar, MVar, Nothing } type; BBBool(); ~BBBool(); union T_BoolVar { BBBaumInteger *IF; BBBaumMatrixPoint *MP; } BoolVar1, BoolVar2; enum T_booloperator { Gleich, Ungleich, Kleiner, Groesser, KleinerG, GroesserG} BoolOp; }; class BBBedingung { public: enum T_BedingungType { Bool, Und, Oder, XOder, Not, Nothing} type; BBBedingung(); ~BBBedingung(); union T_BedingungVar { struct BedBool { BBBool *b; } BoolVar; struct BedBiOperator { BBBedingung *b1; BBBedingung *b2; } BoolBiOp; struct BedUniOperator { BBBedingung *b; } BoolUniOp; } BedingungVar; }; class BBIf { public: BBIf(); ~BBIf(); BBBedingung *b; T_AnweisungList z, zelse; bool isElse; }; bool getNextKlammerString(const std::string& statement, int& pos); bool isBedingung(const std::string& s, BBBedingung * &bed); bool isIf(const std::string& statement, int& pos, BBIf *& i, std::string& anweisungen, std::string& anweisungen_else); #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/bsl_interpreter.cpp000066400000000000000000000150021224124640700261170ustar00rootroot00000000000000/********************************************************** * Version $Id: bsl_interpreter.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "bsl_interpreter.h" #include "basistypen.h" #include "pars_all.h" #include "auswert_anweisung.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CBSL_Interpreter *g_pInterpreter = NULL; void g_Add_Grid (CSG_Grid *pGrid) { if( g_pInterpreter ) { CSG_Grid *p = SG_Create_Grid(*pGrid); p->Set_Name(pGrid->Get_Name()); g_pInterpreter->Get_Parameters()->Get_Parameter("OUTPUT")->asGridList()->Add_Item(p); } } //--------------------------------------------------------- bool g_bProgress = true; bool g_Set_Progress (int i, int n) { return( g_bProgress ? SG_UI_Process_Set_Progress(i, n) : SG_UI_Process_Get_Okay() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CBSL_Interpreter::CBSL_Interpreter(bool bFile) { m_bFile = bFile; //----------------------------------------------------- Set_Name (m_bFile ? _TL("BSL from File") : _TL("BSL")); Set_Author (SG_T("SAGA User Group Associaton (c) 2009")); Set_Description (_TW( "Boehner's Simple Language (BSL) is a macro script language for grid cell based calculations. " "BSL has been developed by C. Trachinow and J. Boehner originally as part of the grid analysis " "software SADO, 'System fuer die Analyse Diskreter Oberflaechen'. \n" "\n" "References:\n" "Boehner, J., Koethe, R., Trachinow, C. (1997): " "Weiterentwicklung der automatischen Reliefanalyse auf der Basis von digitalen Gelaendemodellen. " "Gttinger Geogr. Abh. 100: 3-21." )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL, "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); if( m_bFile ) { Parameters.Add_FilePath( NULL, "BSL" , _TL("BSL Script"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s"), _TL("BSL Files (*.bsl)") , SG_T("*.bsl"), _TL("Text Files (*.txt)") , SG_T("*.txt"), _TL("All Files") , SG_T("*.*") ) ); } else { Parameters.Add_String( NULL, "BSL" , _TL("BSL Script"), _TL(""), _TW( "Matrix R(), NIR(), NDVI, RANGE;\n" "Point p;\n" "\n" "NDVI = R;\n" "RANGE = R;\n" "\n" "foreach p in R do\n" "{\n" " NDVI[p] = (NIR[p] - R[p]) / (NIR[p] + R[p]);\n" " RANGE[p] = max8(p, R) - min8(p, R);\n" "}\n" "\n" "showMatrix(NDVI);\n" "showMatrix(RANGE);\n" ), true ); } Parameters.Add_Value( NULL, "PROGRESS" , _TL("Show Progress"), _TL(""), PARAMETER_TYPE_Bool, true ); } //--------------------------------------------------------- CBSL_Interpreter::~CBSL_Interpreter(void) { g_pInterpreter = NULL; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CBSL_Interpreter::On_Execute(void) { //----------------------------------------------------- Parameters("OUTPUT")->asGridList()->Del_Items(); g_bProgress = Parameters("PROGRESS")->asBool(); if( m_bFile ) { CSG_File Stream; if( !Stream.Open(Parameters("BSL")->asString(), SG_FILE_R, false) ) { return( false ); } Stream.Read(m_BSL, Stream.Length()); } else { m_BSL = Parameters("BSL")->asString(); } //----------------------------------------------------- if( !Parse_Vars(false) ) { return( false ); } //----------------------------------------------------- CSG_Parameters Input(this, _TL("Input"), _TL(""), SG_T("INPUT"), true); FindMemoryGrids(); for(T_InputText::iterator it=InputGrids.begin(); it!=InputGrids.end(); it++) { CSG_String sName(it->c_str()); Input.Add_Grid(NULL, sName, sName, _TL(""), PARAMETER_INPUT, true); } DeleteVarList(); DeleteAnweisungList(AnweisungList); if( Dlg_Parameters(&Input, _TL("Input")) == false ) { return( false ); } //----------------------------------------------------- if( !Parse_Vars(true) ) { return( false ); } //----------------------------------------------------- g_pInterpreter = this; if( GetMemoryGrids(&Input) ) { try { ausfuehren_anweisung(AnweisungList); } catch(BBFehlerAusfuehren x) { if( x.Text == "" ) Message_Add(_TL("unknown error: execution")); else Message_Add(CSG_String::Format(SG_T("error: %s\n"), CSG_String(x.Text.c_str()).c_str())); } catch(BBFehlerUserbreak x) { if( x.Text == "" ) Message_Add(_TL("unknown error: user break")); else Message_Add(CSG_String::Format(SG_T("error: %s\n"), CSG_String(x.Text.c_str()).c_str())); } } g_pInterpreter = NULL; DeleteVarList(); DeleteAnweisungList(AnweisungList); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CBSL_Interpreter::Parse_Vars(bool bFlag) { InputText.clear(); CSG_String s(m_BSL); while( s.Length() > 0 ) { InputText.push_back(s.BeforeFirst('\n').b_str()); s = s.AfterFirst('\n'); } InputText.push_back("\t\n\n"); //----------------------------------------------------- try { int zeile = 0; int p = 0; isSyntaxCheck = true; ParseVars (zeile, p); AddMatrixPointVariables(bFlag); pars_ausdruck (zeile, p); return( true ); } catch (BBFehlerException) { Message_Add(CSG_String::Format(SG_T("error in line %d: %s\n"), FehlerZeile, CSG_String(FehlerString.c_str()).c_str())); DeleteVarList(); DeleteAnweisungList(AnweisungList); return( false ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/bsl_interpreter.h000066400000000000000000000030071224124640700255660ustar00rootroot00000000000000/********************************************************** * Version $Id: bsl_interpreter.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__BSL_Interpreter_H #define HEADER_INCLUDED__BSL_Interpreter_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CBSL_Interpreter : public CSG_Module_Grid { public: CBSL_Interpreter(bool bFile); virtual ~CBSL_Interpreter(void); protected: virtual bool On_Execute(void); private: bool m_bFile; CSG_String m_BSL; bool Parse_Vars (bool bFlag); }; //--------------------------------------------------------- void g_Add_Grid (CSG_Grid *pGrid); bool g_Set_Progress (int i, int n); /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__BSL_Interpreter_H saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/diverses.cpp000066400000000000000000000136131224124640700245460ustar00rootroot00000000000000/********************************************************** * Version $Id: diverses.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ // diverses.cc //#include "../stdafx.h" #include #include #include #include #include #include #include "grid_bsl.h" #include "diverses.h" #include #include using namespace std; #define false 0 #define true 1 #ifdef _DEBUG #define new DEBUG_NEW #endif using namespace std; /*int Rand(const I_Vec& I, const GridWerte& G, int abstand) { IVecWerte W((GridWerte &) G); return Rand(I, W, abstand); } */ /* int Rand(const I_Vec& I, const IVecWerte& W, int abstand) { return Rand(I.X(), I.Y(), W(), abstand); } */ bool Rand(int x, int y, const GridWerte& W, int abstand ) { return (x == abstand || x == W.xanz-1-abstand || y == abstand || y == W.yanz-1-abstand); } /* int innerhalb(const I_Vec& I, const GridWerte& W) { int x = I.X(); int y = I.Y(); return (x >= 0 && x < W.xanz && y >= 0 && y < W.yanz); } int innerhalb(const I_Vec& I, const IVecWerte& W) { int x = I.X(); int y = I.Y(); return (x >= 0 && x < W().xanz && y >= 0 && y < W().yanz); } */ int innerhalb(int x, int y, const GridWerte& W) { return (x >= 0 && x < W.xanz && y >= 0 && y < W.yanz); } ostream& operator << (ostream& o, const C_Vec2& V) { o << "(" << V.X() << ", " << V.Y() << ")"; return o; } void normieren(C_Vec2& G) // Normiert einen Vektor { double r = G.Length(); G /= r; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // min3 max3 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ double max3(double x, double y, double z) { return( x > y ? (x > z ? x : z) : (y > z ? y : z) ); } double min3(double x, double y, double z) { return( x < y ? (x < z ? x : z) : (y < z ? y : z) ); } static int NachbarBesetzt(int y0, int y1, int x0, int x1, int y, int x, GridWerte& G) { for (int i=y0; i<=y1; i++) for (int j=x0; j<=x1; j++) if (i == -1 || i == 1 || j == -1 || j == 1) { if (innerhalb(x+j, y+i, G)) if (G(x+j,y+i) != 0.0) return true; } return false; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // DeleteNotKonvex //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // LinRand //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void LinRand( GridWerte& G, GridWerte& Erg) { Erg = G; Erg.xanz += 2; Erg.yanz += 2; Erg.xll -= Erg.dxy; Erg.yll -= Erg.dxy; Erg.getMem(); int i; int j; long yyy = G.yanz; long xxx = G.xanz; // for (i=0; i M_PI) winkel = 2*M_PI-winkel; Erg.Add_Value(j,i, winkel/M_PI); zaehler++; } } } if (zaehler != 0) Erg.Mul_Value(j,i, 1.0 / zaehler); } } } static double calcMittelwert( GridWerte& H, int x, int y) { if (x != H.xanz-1 && y != H.yanz-1) return (H(x,y) + H(x,y+1) + H(x+1,y) + H(x+1,y+1))/4.0f; else if (x == H.xanz-1) { return (H(x,y) + H(x,y+1))/2.0f; } else { return (H(x,y) + H(x+1,y))/2.0f; } } saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/diverses.h000066400000000000000000000061351224124640700242140ustar00rootroot00000000000000/********************************************************** * Version $Id: diverses.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /* diverses.h */ #ifndef __DIVERSES_H #define __DIVERSES_H #include "grid_bsl.h" #include /* class I_Vec : public C_Vec2 { public: I_Vec(double x = 0.0, double y = 0.0); I_Vec(const C_Vec2& V); ~I_Vec(); int X(void) const; int Y(void) const; double X_binary(void) const; double Y_binary(void) const; void adjust(void); int operator ==(const I_Vec& V); int operator ==(const I_Vec& V) const; }; */ class I_Vec { public: // I_Vec(double x = 0.0, double y = 0.0); I_Vec(int xx = 0, int yy = 0) : x(xx), y(yy) {}; I_Vec(const C_Vec2& V) { x = (int)V.X(); y = (int)V.Y(); }; ~I_Vec() {}; inline int X(void) const {return x; }; inline int Y(void) const {return y; }; // void adjust(void); int operator ==(const I_Vec& V) {return x == V.X() && y == V.Y(); }; int operator ==(const I_Vec& V) const {return x == V.X() && y == V.Y(); }; inline I_Vec operator+(const I_Vec& v) const {return I_Vec(x+v.X(), y+v.Y());}; inline I_Vec operator-(const I_Vec& v) const {return I_Vec(x-v.X(), y-v.Y());}; inline I_Vec& operator = (const I_Vec& v) {x = v.X(); y = v.Y(); return *this;}; inline I_Vec& operator += (const I_Vec& v) { x += v.X(); y += v.Y(); return *this;}; inline I_Vec& operator -= (const I_Vec& v) { x -= v.X(); y -= v.Y(); return *this;}; inline double Length(void) { return double(sqrt((double)(x*x+y*y))); }; protected: int x, y; }; /*class IVecWerte { public: IVecWerte( GridWerte& G) : Grid(G) {}; ~IVecWerte() {}; inline double& operator [] ( I_Vec& I) { return Grid(int(I.X()),int(I.Y())); } const GridWerte& operator () () const { return Grid; } protected: const GridWerte& Grid; }; */ /* class IVecWerteInt { public: IVecWerteInt(GridWerteInt& G) : Grid(G) {}; ~IVecWerteInt() {}; inline int& operator [] (const I_Vec& I) const { return Grid.Z[I.Y()][I.X()]; } GridWerteInt& operator () () const { return Grid; } protected: GridWerteInt& Grid; }; */ bool Rand(int x, int y, const GridWerte& W, int abstand = 0); //int Rand(const I_Vec& I, const IVecWerte& W, int abstand = 0); //int Rand(const I_Vec& I, const GridWerte& W, int abstand = 0); //int innerhalb(const I_Vec& I, const GridWerte& W); //int innerhalb(const I_Vec& I, const IVecWerte& W); int innerhalb(int x, int y, const GridWerte& W); //int isRandPunkt(const I_Vec iv, const GridWerte& G); void normieren(C_Vec2& G); //double WinkelDiff(double x, double y); double max3(double x, double y, double z); double min3(double x, double y, double z); void LinRand( GridWerte& G, GridWerte& Erg); /* Speicher: Erg.getMem */ void DGMGlatt(const GridWerte& G, GridWerte& Erg); /* Speicher: Erg.getMem */ void copyGrid(GridWerte& Dest, GridWerte& Source, bool newmem = true); void calcExpoAbweichung4erFeld(GridWerte& Erg, GridWerte& Hoehe); /* Speicher: Erg.getMem */ void calcExpoAbweichung(GridWerte& Erg, GridWerte& Expo); /* Speicher: Erg.getMem */ #endif /* End of file */ saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/foreach.cpp000066400000000000000000000072551224124640700243360ustar00rootroot00000000000000/********************************************************** * Version $Id: foreach.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //#include <..\stdafx.h> #include "foreach.h" #include "bedingung.h" using namespace std; BBAnweisung::BBAnweisung() { typ = Zuweisung; memset(&AnweisungVar, 0, sizeof(T_AnweisungVar)); } BBAnweisung::~BBAnweisung() { switch(typ) { case ForEach: if (AnweisungVar.For != NULL) delete AnweisungVar.For; break; case IF: if (AnweisungVar.IF != NULL) delete AnweisungVar.IF; break; case Zuweisung: if (AnweisungVar.Zu != NULL) delete AnweisungVar.Zu; break; case Funktion: if (AnweisungVar.Fkt != NULL) delete AnweisungVar.Fkt; break; } memset(&AnweisungVar, 0, sizeof(T_AnweisungVar)); } BBForEach::BBForEach() { M = 0; P = 0; N = 0; type = Point; } BBForEach::~BBForEach() { // if (M != NULL) // delete M; // if (P != NULL) // delete P; // if (N != NULL) // delete N; // M = 0; // P = 0; // N = 0; DeleteAnweisungList(z); } void DeleteAnweisungList(T_AnweisungList& a) { T_AnweisungList::iterator it; for (it = a.begin(); it != a.end(); it++) { if (*it != NULL) delete *it; } a.clear(); } bool getNextToken(const string& ss, int& pos, string& erg) { if (pos >= ss.size()) return false; string s = ss; erg = ss.substr(pos); WhiteSpace(erg, pos); WhiteSpace(erg, pos, false); pos += erg.size(); return true; } bool getNextChar(const string& ss, int& pos, char& c) { string s = ss.substr(pos); WhiteSpace(s, pos); pos++; c = s[0]; return true; } bool getStringBetweenKlammer(const string& s, int& pos) { if (pos >= s.size()) return false; int klammer_ebene = 1; for (int i=pos; itype = (isPoint ? BBForEach::Point : BBForEach::Nachbar); f->M = m; f->P = p1; if (!isPoint) { f->P = p2; f->N = p1; } return true; } saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/foreach.h000066400000000000000000000021061224124640700237710ustar00rootroot00000000000000/********************************************************** * Version $Id: foreach.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __FOREACH_H #define __FOREACH_H #include "zuweisung.h" #include class BBForEach; class BBIf; class BBAnweisung { public: BBAnweisung(); ~BBAnweisung(); enum T_AnweisungTyp {ForEach, IF, Zuweisung, Funktion } typ; union T_AnweisungVar { BBForEach *For; BBIf *IF; BBZuweisung *Zu; BBFktExe *Fkt; } AnweisungVar; }; typedef std::list T_AnweisungList; void DeleteAnweisungList(T_AnweisungList& a); class BBForEach { public: BBForEach(); ~BBForEach(); enum ForEachType { Point, Nachbar } type; BBMatrix *M; BBPoint *P; BBPoint *N; T_AnweisungList z; }; bool getNextToken(const std::string& ss, int& pos, std::string& erg); bool getNextChar(const std::string& ss, int& pos, char& c); bool getStringBetweenKlammer(const std::string& s, int& pos); bool isForEach(const std::string& ins, int& pos, BBForEach *& f, std::string& anweisungen); #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/funktion.cpp000066400000000000000000000420261224124640700245570ustar00rootroot00000000000000/********************************************************** * Version $Id: funktion.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //#include <..\stdafx.h> #include #include #include "funktion.h" #include "auswert_zuweisung.h" #include "diverses.h" #include "interpolation.h" #include "funktion_numerisch.h" #include "funktion_statistisch.h" #include "bsl_interpreter.h" using namespace std; T_FunktionList FunktionList; BBArgumente::BBArgumente() { ArgTyp.IF = NULL; ArgTyp.MP = NULL; typ = NoOp; } BBArgumente::~BBArgumente() { return; } BBFunktion::BBFunktion() { } BBFunktion::~BBFunktion() { } BBFktExe::BBFktExe() { f = 0; } BBFktExe::~BBFktExe() { for (int i=0; iargs.size(); i++) { switch (f->args[i].typ) { case BBArgumente::ITyp: case BBArgumente::FTyp: if (f->args[i].ArgTyp.IF) delete f->args[i].ArgTyp.IF; f->args[i].ArgTyp.IF = NULL; break; case BBArgumente::MTyp: case BBArgumente::PTyp: if (f->args[i].ArgTyp.MP) delete f->args[i].ArgTyp.MP; f->args[i].ArgTyp.MP = NULL; break; } } } //**************************************************************** // Definition von Funktionen //**************************************************************** #define __GET_MIN(a, b) (((a) < (b)) ? (a) : (b)) #define __GET_MAX(a, b) (((a) > (b)) ? (a) : (b)) class BBFunktion_showMatrix : public BBFunktion // // showMatrix: zeigt einen Grid in einem neuen Fenster // { public: BBFunktion_showMatrix() { name = "showMatrix"; // Argumente BBArgumente a; a.typ = BBArgumente::MTyp; args.push_back(a); // Return-Typ ret.typ = BBArgumente::NoOp; }; virtual void fkt(void) { args[0].ArgTyp.MP->k.M->M->Set_Name(CSG_String((char *)args[0].ArgTyp.MP->k.M->name.c_str())); g_Add_Grid( (args[0].ArgTyp.MP->k.M->M) ); }; }; class BBFunktion_saveMatrix : public BBFunktion // // saveMatrix: zeigt einen Grid in einem neuen Fenster // { public: BBFunktion_saveMatrix() { name = "saveMatrix"; // Argumente: Matrix, Pfad BBArgumente a; a.typ = BBArgumente::MTyp; args.push_back(a); a.typ = BBArgumente::ITyp; args.push_back(a); // Return-Typ ret.typ = BBArgumente::NoOp; }; virtual void fkt(void) { if (args[0].ArgTyp.MP->typ != BBBaumMatrixPoint::MVar) throw BBFehlerAusfuehren(); int filename_number = auswert_integer(*(args[1].ArgTyp.IF)); char filename[40]; sprintf(filename, "OutputGrid%03d.grd", filename_number); args[0].ArgTyp.MP->k.M->M->Save(filename,2); }; }; class BBFunktion_getMemory : public BBFunktion // // getMemory: ruft GridWerte.getMem auf // { public: BBFunktion_getMemory() { name = "getMemory"; // Argumente BBArgumente a; a.typ = BBArgumente::MTyp; // x args.push_back(a); a.typ = BBArgumente::ITyp; // x args.push_back(a); a.typ = BBArgumente::ITyp; // y args.push_back(a); // Return-Typ ret.typ = BBArgumente::NoOp; // kein Return-Wert }; virtual void fkt(void) { int x, y; x = auswert_integer(*(args[1].ArgTyp.IF)); y = auswert_integer(*(args[2].ArgTyp.IF)); // MP darf nur aus einer Matrix bestehen if (args[0].ArgTyp.MP->typ != BBBaumMatrixPoint::MVar) throw BBFehlerAusfuehren(); args[0].ArgTyp.MP->k.M->M->xanz = x; args[0].ArgTyp.MP->k.M->M->yanz = y; args[0].ArgTyp.MP->k.M->M->getMem(); }; BBBaumInteger baum; }; class BBFunktion_max3 : public BBFunktion // // max3: ruft (Diverses::) max3 auf // { public: BBFunktion_max3() { name = "max3"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); a.typ = BBArgumente::FTyp; // x2 args.push_back(a); a.typ = BBArgumente::FTyp; // x3 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_max3() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x, y, z; x = auswert_float(*(args[0].ArgTyp.IF)); y = auswert_float(*(args[1].ArgTyp.IF)); z = auswert_float(*(args[2].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = max3(x,y,z); }; }; class BBFunktion_min3 : public BBFunktion // // min3: ruft (Diverses::) min3 auf // { public: BBFunktion_min3() { name = "min3"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); a.typ = BBArgumente::FTyp; // x2 args.push_back(a); a.typ = BBArgumente::FTyp; // x3 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_min3() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x, y, z; x = auswert_float(*(args[0].ArgTyp.IF)); y = auswert_float(*(args[1].ArgTyp.IF)); z = auswert_float(*(args[2].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = min3(x,y,z); }; }; class BBFunktion_max8 : public BBFunktion // // max8: berechnet das Maximum aller Nachbarn // { public: BBFunktion_max8() { name = "max8"; // Argumente BBArgumente a; a.typ = BBArgumente::PTyp; // x1 args.push_back(a); a.typ = BBArgumente::MTyp; // x2 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_max8() { delete ret.ArgTyp.IF; } virtual void fkt(void) { GridWerte *W; // MP darf nur aus einer Matrix bestehen if (args[1].ArgTyp.MP->typ != BBBaumMatrixPoint::MVar) throw BBFehlerAusfuehren("Funktion >max8<"); W = args[1].ArgTyp.MP->k.M->M; // get point p bool ret1; T_Point p; double f; ret1 = auswert_point(*(args[0].ArgTyp.MP), p, f); if (!ret1) throw BBFehlerAusfuehren("Funktion >max8<"); double hoehe = -1e30f; for (int i=-1; i<=1; i++) { for (int j=-1; j<=1; j++) { int x = p.x + i; int y = p.y + j; if (innerhalb(x, y, *W) && (i != 0 || j != 0)) { hoehe = __GET_MAX(hoehe, (*W)(x,y) ); } } } ret.ArgTyp.IF->k.FZahl = hoehe; }; }; class BBFunktion_min8 : public BBFunktion // // max8: berechnet das Maximum aller Nachbarn // { public: BBFunktion_min8() { name = "min8"; // Argumente BBArgumente a; a.typ = BBArgumente::PTyp; // x1 args.push_back(a); a.typ = BBArgumente::MTyp; // x2 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_min8() { delete ret.ArgTyp.IF; } virtual void fkt(void) { GridWerte *W; // MP darf nur aus einer Matrix bestehen if (args[1].ArgTyp.MP->typ != BBBaumMatrixPoint::MVar) throw BBFehlerAusfuehren("Funktion >max8<"); W = args[1].ArgTyp.MP->k.M->M; // get point p bool ret1; T_Point p; double f; ret1 = auswert_point(*(args[0].ArgTyp.MP), p, f); if (!ret1) throw BBFehlerAusfuehren("Funktion >max8<"); double hoehe = 1e30f; for (int i=-1; i<=1; i++) { for (int j=-1; j<=1; j++) { int x = p.x + i; int y = p.y + j; if (innerhalb(x, y, *W) && (i != 0 || j != 0)) { hoehe = __GET_MIN(hoehe, (*W)(x,y)); } } } ret.ArgTyp.IF->k.FZahl = hoehe; }; }; class BBFunktion_max9 : public BBFunktion // // max8: berechnet das Maximum aller Nachbarn // { public: BBFunktion_max9() { name = "max9"; // Argumente BBArgumente a; a.typ = BBArgumente::PTyp; // x1 args.push_back(a); a.typ = BBArgumente::MTyp; // x2 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_max9() { delete ret.ArgTyp.IF; } virtual void fkt(void) { GridWerte *W; // MP darf nur aus einer Matrix bestehen if (args[1].ArgTyp.MP->typ != BBBaumMatrixPoint::MVar) throw BBFehlerAusfuehren("Funktion >max8<"); W = args[1].ArgTyp.MP->k.M->M; // get point p bool ret1; T_Point p; double f; ret1 = auswert_point(*(args[0].ArgTyp.MP), p, f); if (!ret1) throw BBFehlerAusfuehren("Funktion >max8<"); double hoehe = -1e30f; for (int i=-1; i<=1; i++) { for (int j=-1; j<=1; j++) { int x = p.x + i; int y = p.y + j; if (innerhalb(x, y, *W)) { hoehe = __GET_MAX(hoehe, (*W)(x,y)); } } } ret.ArgTyp.IF->k.FZahl = hoehe; }; }; class BBFunktion_min9 : public BBFunktion // // max8: berechnet das Maximum aller Nachbarn // { public: BBFunktion_min9() { name = "min9"; // Argumente BBArgumente a; a.typ = BBArgumente::PTyp; // x1 args.push_back(a); a.typ = BBArgumente::MTyp; // x2 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_min9() { delete ret.ArgTyp.IF; } virtual void fkt(void) { GridWerte *W; // MP darf nur aus einer Matrix bestehen if (args[1].ArgTyp.MP->typ != BBBaumMatrixPoint::MVar) throw BBFehlerAusfuehren("Funktion >max8<"); W = args[1].ArgTyp.MP->k.M->M; // get point p bool ret1; T_Point p; double f; ret1 = auswert_point(*(args[0].ArgTyp.MP), p, f); if (!ret1) throw BBFehlerAusfuehren("Funktion >max8<"); double hoehe = 1e30f; for (int i=-1; i<=1; i++) { for (int j=-1; j<=1; j++) { int x = p.x + i; int y = p.y + j; if (innerhalb(x, y, *W)) { hoehe = __GET_MIN(hoehe, (*W)(x,y)); } } } ret.ArgTyp.IF->k.FZahl = hoehe; }; }; class BBFunktion_isRand : public BBFunktion // // ruft (Diverses::) isRand auf // { public: BBFunktion_isRand() { name = "isRand"; // Argumente BBArgumente a; a.typ = BBArgumente::PTyp; // x1 args.push_back(a); a.typ = BBArgumente::MTyp; // x2 args.push_back(a); // Return-Typ ret.typ = BBArgumente::ITyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::IZahl; ret.ArgTyp.IF->k.IZahl = 0; }; ~BBFunktion_isRand() { delete ret.ArgTyp.IF; } virtual void fkt(void) { int x, y; // MP darf nur aus einer Matrix bestehen if (args[1].ArgTyp.MP->typ != BBBaumMatrixPoint::MVar) throw BBFehlerAusfuehren("Funktion >isRand<"); bool ret1; T_Point p; double f; ret1 = auswert_point(*(args[0].ArgTyp.MP), p, f); if (!ret1) throw BBFehlerAusfuehren("Funktion >isRand<"); x = args[1].ArgTyp.MP->k.M->M->xanz; y = args[1].ArgTyp.MP->k.M->M->yanz; ret.ArgTyp.IF->k.IZahl = ( (p.x <= 0 || p.y <= 0 || p.x >= x-1 || p.y >= y-1) ? 1 : 0); }; }; class BBFunktion_setRandN : public BBFunktion // // setRandN : setzt alle Randpunkte auf den nchsten Nachbarn // { public: BBFunktion_setRandN() { name = "setRandN"; // Argumente BBArgumente a; a.typ = BBArgumente::MTyp; // x2 args.push_back(a); // Return-Typ ret.typ = BBArgumente::NoOp; }; ~BBFunktion_setRandN() { } virtual void fkt(void) { int x, y; // MP darf nur aus einer Matrix bestehen if (args[0].ArgTyp.MP->typ != BBBaumMatrixPoint::MVar) throw BBFehlerAusfuehren("Funktion >setRandN<"); GridWerte *G = args[0].ArgTyp.MP->k.M->M; x = 0; for (y=1; yyanz-1; y++) G->Set_Value(x,y, G->asDouble(x+1,y)); x = G->xanz-1; for (y=1; yyanz-1; y++) G->Set_Value(x,y, G->asDouble(x-1,y)); y = 0; for (x=1; xxanz-1; x++) G->Set_Value(x,y, G->asDouble(x,y+1)); y = G->yanz-1; for (x=1; xxanz-1; x++) G->Set_Value(x,y, G->asDouble(x,y-1)); // die vier Randpunkte setzen G->Set_Value( 0, 0, G->asDouble( 1, 1, false)); G->Set_Value(G->xanz-1, 0, G->asDouble(G->xanz-2, 1, false)); G->Set_Value( 0,G->yanz-1, G->asDouble( 1,G->yanz-2, false)); G->Set_Value(G->xanz-1,G->yanz-1, G->asDouble(G->xanz-2,G->yanz-2, false)); }; }; class BBFunktion_setRandI : public BBFunktion // // setRandI : setzt alle Randpunkte durch lineare extrapolation // { public: BBFunktion_setRandI() { name = "setRandI"; // Argumente BBArgumente a; a.typ = BBArgumente::MTyp; // x2 args.push_back(a); // Return-Typ ret.typ = BBArgumente::NoOp; }; ~BBFunktion_setRandI() { } virtual void fkt(void) { // MP darf nur aus einer Matrix bestehen if (args[0].ArgTyp.MP->typ != BBBaumMatrixPoint::MVar) throw BBFehlerAusfuehren("Funktion >setRandN<"); GridWerte *G = args[0].ArgTyp.MP->k.M->M; GridWerte H; H = *G; H.xanz -= 2; H.yanz -= 2; H.xll += G->dxy; H.yll += G->dxy; H.getMem(); for (int i=1; iyanz-1; i++) for (int j=1; jxanz-1; j++) H.Set_Value(j-1,i-1, G->asDouble(j,j)); LinRand(H, *(args[0].ArgTyp.MP->k.M->M)); }; }; class BBFunktion_showValue : public BBFunktion // // setRandI : setzt alle Randpunkte durch lineare extrapolation // { public: BBFunktion_showValue() { name = "showValue"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x2 args.push_back(a); // Return-Typ ret.typ = BBArgumente::NoOp; }; ~BBFunktion_showValue() { } virtual void fkt(void) { string s(""); ostringstream os1(s); double x; x = auswert_float(*(args[0].ArgTyp.IF)); os1 << "Value = " << x << ends; //Hier in output frnster // AfxMessageBox(os1.str().data()); }; }; /* class BBFunktion_spline : public BBFunktion // // ruft (Diverses::) isRand auf // { public: BBFunktion_spline() { name = "spline"; // Argumente BBArgumente a; a.typ = BBArgumente::MTyp; // x1 args.push_back(a); a.typ = BBArgumente::FTyp; // x2: faktor args.push_back(a); a.typ = BBArgumente::MTyp; // x3: neues Grid args.push_back(a); // Return-Typ ret.typ = BBArgumente::NoOp; }; ~BBFunktion_spline() { } virtual void fkt(void) { int x, y; // MP darf nur aus einer Matrix bestehen if (args[0].ArgTyp.MP->typ != BBBaumMatrixPoint::MVar) throw BBFehlerAusfuehren("Funktion >spline<"); // MP darf nur aus einer Matrix bestehen if (args[2].ArgTyp.MP->typ != BBBaumMatrixPoint::MVar) throw BBFehlerAusfuehren("Funktion >spline<"); // bergabe-Parameter extrahieren GridWerte *sourceGrid = args[0].ArgTyp.MP->k.M->M; GridWerte *destGrid = args[2].ArgTyp.MP->k.M->M; double factor = auswert_float(*(args[1].ArgTyp.IF)); // Anzahl der Punkte berechnen // z.B. Abstand: 3 (=0, 1, 2, 3), faktor 0.4 // --> 0, 0.4, 0.8, 1.2, 1.6, 2.0, 2.4, 2.8 // aber: 3 / 0.4 = 30 / 4 = 7.5 = 7 + 1 // oder // Abstand: 2 (0, 1, 2), faktor 0.4 // --> 0, 0.4, 0.8, 1.2, 1.6, 2.0 // aber 2 / 0.4 = 5 // Abstand 1 (0, 1), faktor 0.4 //--> 0, 0,4, 0.8 // aber 1 / 0.4 = 2,5 // // ==> Formel: floor((xanz-1)/faktor))+1 x = floor( (sourceGrid->xanz-1)/factor ) + 1; y = floor( (sourceGrid->yanz-1)/factor ) + 1; Interpolation *I; I = new QSpline(*sourceGrid); I->setParams(0, 0, factor, x, y); // von 0,0 in factor-Schritten ber x,y Punkte I->interpol(*destGrid); delete I; destGrid->calcMinMax(); }; }; */ //**************************************************************** // Initialisierung der Funktionen //**************************************************************** void InitFunktionen(void) { FunktionList.push_back(new BBFunktion_showMatrix() ); FunktionList.push_back(new BBFunktion_saveMatrix() ); FunktionList.push_back(new BBFunktion_getMemory() ); FunktionList.push_back(new BBFunktion_max3() ); FunktionList.push_back(new BBFunktion_min3() ); FunktionList.push_back(new BBFunktion_max8() ); FunktionList.push_back(new BBFunktion_min8() ); FunktionList.push_back(new BBFunktion_max9() ); FunktionList.push_back(new BBFunktion_min9() ); FunktionList.push_back(new BBFunktion_isRand() ); FunktionList.push_back(new BBFunktion_setRandN() ); FunktionList.push_back(new BBFunktion_setRandI() ); FunktionList.push_back(new BBFunktion_showValue() ); // FunktionList.push_back(new BBFunktion_spline() ); // aus funktion_numerisch.h FunktionList.push_back(new BBFunktion_sin() ); FunktionList.push_back(new BBFunktion_cos() ); FunktionList.push_back(new BBFunktion_tan() ); FunktionList.push_back(new BBFunktion_sinargs() ); FunktionList.push_back(new BBFunktion_cosargs() ); FunktionList.push_back(new BBFunktion_tanargs() ); FunktionList.push_back(new BBFunktion_asin() ); FunktionList.push_back(new BBFunktion_acos() ); FunktionList.push_back(new BBFunktion_atan() ); FunktionList.push_back(new BBFunktion_asinargs() ); FunktionList.push_back(new BBFunktion_acosargs() ); FunktionList.push_back(new BBFunktion_atanargs() ); FunktionList.push_back(new BBFunktion_log() ); FunktionList.push_back(new BBFunktion_ln() ); FunktionList.push_back(new BBFunktion_exp() ); // aus funktion_statistisch.h FunktionList.push_back(new BBFunktion_setStatistikDaten() ); FunktionList.push_back(new BBFunktion_resetStatistikDaten() ); FunktionList.push_back(new BBFunktion_calcMittelwert() ); FunktionList.push_back(new BBFunktion_calcVarianz() ); } void DeleteFunktionen(void) { T_FunktionList::iterator it; for (it = FunktionList.begin(); it != FunktionList.end(); it++) { delete (*it); } } class InitFunktionenOnce { public: InitFunktionenOnce() { InitFunktionen(); } ~InitFunktionenOnce() { DeleteFunktionen(); } }; InitFunktionenOnce initfunktionenonce; saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/funktion.h000066400000000000000000000021651224124640700242240ustar00rootroot00000000000000/********************************************************** * Version $Id: funktion.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __FUNKTION_BB_H #define __FUNKTION_BB_H #include "ausdruck.h" class BBArgumente { public: BBArgumente(); ~BBArgumente(); enum ArgumentTyp { NoOp, ITyp, FTyp, MTyp, PTyp } typ; union BBArgs { BBBaumMatrixPoint *MP; BBBaumInteger *IF; } ArgTyp; }; typedef std::vector T_FktArgumente; class BBFunktion { public: BBFunktion(); virtual ~BBFunktion(); virtual void fkt(void) = 0; T_FktArgumente args; BBArgumente ret; const char *name; }; // Um einen Funktionsaufruf zu speichern, ist folgendes notwending: // BBFunktion *f; // vector args; // struct BBFktExe { BBFktExe(); ~BBFktExe(); BBFunktion *f; T_FktArgumente args; }; typedef std::list T_FunktionList; extern T_FunktionList FunktionList; void InitFunktionen(void); void DeleteFunktionen(void); bool operator<(const BBArgumente& x, const BBArgumente& y); bool operator==(const BBArgumente& x, const BBArgumente& y); #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/funktion_numerisch.h000066400000000000000000000230661224124640700263040ustar00rootroot00000000000000/********************************************************** * Version $Id: funktion_numerisch.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __FUNKTION_NUMERISCH_H #define __FUNKTION_NUMERISCH_H #include //****************** SINUS ************************** class BBFunktion_sin : public BBFunktion // // sin: ruft sinus(...) auf // { public: BBFunktion_sin() { name = "sin"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_sin() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = sin(x); }; }; //****************** COSINUS ************************** class BBFunktion_cos : public BBFunktion // // cos: ruft cosinus(...) auf // { public: BBFunktion_cos() { name = "cos"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_cos() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = cos(x); }; }; //****************** TANGENS ************************** class BBFunktion_tan : public BBFunktion // // tan: ruft tangens(...) auf // { public: BBFunktion_tan() { name = "tan"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_tan() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = tan(x); }; }; //****************** SINUS ************************** class BBFunktion_sinargs : public BBFunktion // // sin: ruft sinus(...) auf // { public: BBFunktion_sinargs() { name = "sinargs"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_sinargs() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = sin(x*M_PI/180.0); }; }; //****************** COSINUS ************************** class BBFunktion_cosargs : public BBFunktion // // cos: ruft cosinus(...) auf // { public: BBFunktion_cosargs() { name = "cosargs"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_cosargs() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = cos(x*M_PI/180.0); }; }; //****************** TANGENS ************************** class BBFunktion_tanargs : public BBFunktion // // tan: ruft tangens(...) auf // { public: BBFunktion_tanargs() { name = "tanargs"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_tanargs() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = tan(x*M_PI/180.0); }; }; //****************** SINUS ************************** class BBFunktion_asin : public BBFunktion // // sin: ruft arcussinus(...) auf // { public: BBFunktion_asin() { name = "asin"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_asin() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = asin(x); }; }; //****************** COSINUS ************************** class BBFunktion_acos : public BBFunktion // // acos: ruft arcuscosinus(...) auf // { public: BBFunktion_acos() { name = "acos"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_acos() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = acos(x); }; }; //****************** TANGENS ************************** class BBFunktion_atan : public BBFunktion // // tan: ruft tangens(...) auf // { public: BBFunktion_atan() { name = "atan"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_atan() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = atan(x); }; }; //****************** SINUS ************************** class BBFunktion_asinargs : public BBFunktion // // asin: ruft sinus(...) auf // { public: BBFunktion_asinargs() { name = "asinargs"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_asinargs() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = asin(x)*180.0/M_PI; }; }; //****************** COSINUS ************************** class BBFunktion_acosargs : public BBFunktion // // cos: ruft cosinus(...) auf // { public: BBFunktion_acosargs() { name = "acosargs"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_acosargs() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = acos(x)/M_PI*180.0; }; }; //****************** TANGENS ************************** class BBFunktion_atanargs : public BBFunktion // // tan: ruft tangens(...) auf // { public: BBFunktion_atanargs() { name = "atanargs"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_atanargs() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = atan(x)/M_PI*180.0; }; }; //****************** LOG ************************** class BBFunktion_log : public BBFunktion // // ruft log10(...) auf // { public: BBFunktion_log() { name = "log"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_log() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); if (x < 0) throw BBFehlerAusfuehren("Argument vom Logarithmus ist negativ!"); ret.ArgTyp.IF->k.FZahl = log10(x); }; }; //****************** LN ************************** class BBFunktion_ln : public BBFunktion // // ruft log(...) auf // { public: BBFunktion_ln() { name = "ln"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_ln() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); if (x < 0) throw BBFehlerAusfuehren("Argument vom Logarithmus ist negativ!"); ret.ArgTyp.IF->k.FZahl = log(x); }; }; //****************** LN ************************** class BBFunktion_exp : public BBFunktion // // ruft exp(...) auf // { public: BBFunktion_exp() { name = "exp"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); // Return-Typ ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_exp() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); ret.ArgTyp.IF->k.FZahl = exp(x); }; }; #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/funktion_statistisch.h000066400000000000000000000045331224124640700266470ustar00rootroot00000000000000/********************************************************** * Version $Id: funktion_statistisch.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __FUNKTION_STATISTISCH_H #define __FUNKTION_STATISTISCH_H std::vector StatistikVektor; //****************** setStatistikDaten ************************** class BBFunktion_setStatistikDaten : public BBFunktion // // setzt den Vektor, von dem die Statistik berechnet wird // { public: BBFunktion_setStatistikDaten() { name = "setStatistikDaten"; // Argumente BBArgumente a; a.typ = BBArgumente::FTyp; // x1 args.push_back(a); ret.typ = BBArgumente::NoOp; }; ~BBFunktion_setStatistikDaten() { } virtual void fkt(void) { double x; x = auswert_float(*(args[0].ArgTyp.IF)); StatistikVektor.push_back(x); }; }; class BBFunktion_resetStatistikDaten : public BBFunktion // // lscht den Vektor, von dem die Statistik berechnet wird // { public: BBFunktion_resetStatistikDaten() { name = "resetStatistikDaten"; ret.typ = BBArgumente::NoOp; }; ~BBFunktion_resetStatistikDaten() { } virtual void fkt(void) { StatistikVektor.clear(); }; }; class BBFunktion_calcMittelwert : public BBFunktion // // { public: BBFunktion_calcMittelwert() { name = "calcMittelwert"; ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_calcMittelwert() { delete ret.ArgTyp.IF; } virtual void fkt(void) { double summe = 0.0f; for (int i=0; ik.FZahl = summe; }; }; class BBFunktion_calcVarianz : public BBFunktion { public: BBFunktion_calcVarianz() { name = "calcVarianz"; ret.typ = BBArgumente::FTyp; ret.ArgTyp.IF = new BBBaumInteger; ret.ArgTyp.IF->typ = BBBaumInteger::FZahl; ret.ArgTyp.IF->k.FZahl = 0; }; ~BBFunktion_calcVarianz() { delete ret.ArgTyp.IF; } virtual void fkt(void) { // Mittelwert double sum_x = 0.0f, sum_x2 = 0.0f; int n = StatistikVektor.size(); for (int i=0; ik.FZahl = (sum_x2 - sum_x/n)/(n-1); }; }; #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/gr_def.h000066400000000000000000000131311224124640700236100ustar00rootroot00000000000000/********************************************************** * Version $Id: gr_def.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //////////////////////////////////////////////////////////////////////////// // Programm : // Bibliothek : // Header-Datei: Gr_def.h // //////////////////////////////////////////////////////////////////////////// // // Autoren : Joerg Dolle // Christian Trachinow // Stephan Westphal // Telefon-Nr. : // Mail-Adresse : jdolle@gwdg.de // //////////////////////////////////////////////////////////////////////////// // // Compiler : Borland C++ V.: 4.00 // Ersterstellung : 09.11.95 // Ueberarbeitung : 22.04.96 // // // Programmversion: 2.00 // //////////////////////////////////////////////////////////////////////////// /****************** Include-Dateien **************/ #ifndef __gr_def__ #define __gr_def__ #include "gr_syst.h" #include "vector.h" #undef HEADER_INCLUDED__DATA #define HEADER_INCLUDED__DATA //DO *Typkonstrukte*************************************************** #define MIN(x,y) ((x) < (y) ? (x) : (y)) #define MAX(x,y) ((x) > (y) ? (x) : (y)) typedef int G_Color; typedef struct { unsigned char red, green, blue; } G_RgbColor; typedef struct { char *name; G_Color index; } G_NamedColors; typedef struct { int NumColors; G_RgbColor *RgbColor; int NumNamedColors; G_NamedColors *NamedColor; } G_ColorDef; typedef struct { double x, y; } G_Point; //DO * Papierformate und Ausrichtungen ****** typedef enum G_PaperFormat { A0P, A0L, A1P, A1L, A2P, A2L, A3P, A3L, A4P, A4L, A5P, A5L}; typedef enum G_PaperOrient { Portrait, Landscape }; typedef enum G_FillType { Hollow, Blank, Filled }; //DO *RGB-Felder******************** #define RGBMAX_DOS 16 #define RGBMAX_REGENBOGEN 256 #define RGBMAX_ATLAS 256 #define RGBMAX_ATLAS_SMALL 64 #define RGBMAX_REGULAR 128 #define RGBMAX_WINDOWS 16 extern G_RgbColor RGBDos[RGBMAX_DOS]; extern G_RgbColor RGBRegenbogen[RGBMAX_REGENBOGEN]; extern G_RgbColor RGBAtlas[RGBMAX_ATLAS]; extern G_RgbColor RGBAtlasSmall[RGBMAX_ATLAS_SMALL]; extern G_RgbColor RGBRegular[RGBMAX_REGULAR]; extern G_RgbColor RGBWindows[RGBMAX_WINDOWS]; #define NAMEDCOLORSMAX 16 extern G_NamedColors NamedColorsDos[NAMEDCOLORSMAX]; extern G_NamedColors NamedColorsRegenbogen[NAMEDCOLORSMAX]; extern G_NamedColors NamedColorsAtlas[NAMEDCOLORSMAX]; extern G_NamedColors NamedColorsAtlasSmall[NAMEDCOLORSMAX]; extern G_NamedColors NamedColorsRegular[NAMEDCOLORSMAX]; extern G_NamedColors NamedColorsWindows[NAMEDCOLORSMAX]; extern G_ColorDef ColorDefDos; extern G_ColorDef ColorDefRegenbogen; extern G_ColorDef ColorDefAtlas; extern G_ColorDef ColorDefAtlasSmall; extern G_ColorDef ColorDefRegular; extern G_ColorDef ColorDefWindows; //DO * Textdefinitionen ***************** typedef enum G_TextOrientX {Left, HCenter, Right }; typedef enum G_TextOrientY {Bottom,VCenter, Top}; typedef enum G_TextFont { TimesRoman, TimesBold, TimesItalic, TimesBoldItalic, Helvetica, HelveticaBold, HelveticaOblique, HelveticaBoldOblique, Greek, Symbol }; //DO *** Clipping Type ****************** typedef enum G_ClipType {NoClip,Clip}; #define CS_TEXT_COLOR 1 #define CS_TEXT_FONT 2 #define CS_TEXT_ORIENT 4 #define CS_TEXT_ANGLE 8 #define CS_TEXT_HEIGHT 16 #define CS_POLY_WIDTH 1 #define CS_POLY_COLOR 2 #define CS_POLY_FILL 4 #define CS_POLYLINE_WIDTH 1 #define CS_POLYLINE_COLOR 2 #define CS_RECT_WIDTH 1 #define CS_RECT_COLOR 2 #define CS_RECT_FILL 4 #define CS_CIRCLE_WIDTH 1 #define CS_CIRCLE_RADIUS 2 #define CS_CIRCLE_COLOR 4 #define CS_CIRCLE_FILL 8 #define CS_TRIANGLE_WIDTH 1 #define CS_TRIANGLE_COLOR 2 #define CS_TRIANGLE_FILL 4 #define CS_LINE_WIDTH 1 #define CS_LINE_COLOR 2 typedef struct { unsigned Text : 5; unsigned TextVector : 5; unsigned Poly : 3; unsigned Polyline : 2; unsigned Rect : 3; unsigned Circle : 4; unsigned Triangle : 3; unsigned Line : 2; unsigned Palette : 1; void setBits(void) { Text = 31; TextVector = 31; Poly = 7; Polyline = 3; Rect = 7; Circle = 15; Triangle = 7; Line = 3; } } ContextStatus; //DO * RGB-Farben in einer Klasse gekapselt class RGBModelle { public: RGBModelle(); ~RGBModelle(); private: void init_dos_colors(void); void init_atlas_colors(void); void init_small_atlas_colors(void); void init_regenbogen_colors(void); void init_regular_colors(void); void init_windows_colors(void); }; #undef HEADER_INCLUDED__DATA #define HEADER_INCLUDED__DATA #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/gr_syst.h000066400000000000000000000006041224124640700240550ustar00rootroot00000000000000/********************************************************** * Version $Id: gr_syst.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __gr_syst_h__ #define __gr_syst_h__ // Elementare Definitionen #define __MFC #define MODELL #define SMODELL // sonstiges //#define M_PI 3.14159265358979323846 //#define M_PI_2 M_PI/2.0 #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/grid_bsl.cpp000066400000000000000000000017331224124640700245070ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_bsl.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #include #include "grid_bsl.h" using namespace std; GridWerte::GridWerte(void) { xanz = 0; yanz = 0; } GridWerte::~GridWerte(void) { freeMem(); } void GridWerte::getMem(void) { Create(SG_DATATYPE_Float, xanz, yanz, dxy, xll, yll); } void GridWerte::freeMem(void) { Destroy(); } GridWerte& GridWerte::operator =(const GridWerte& W) { dxy = W.dxy; xll = W.xll; yll = W.yll; xanz = W.xanz; yanz = W.yanz; maxy = W.maxy; miny = W.miny; return( *this ); } void GridWerte::calcMinMax(void) { maxy = (*this)(0,0); miny = (*this)(0,0); for (int i=0; i #include #include #include "diverses.h" #include "interpolation.h" #define false 0 #define true 1 double LinPol(double x0, double y0, double x1, double y1, double x) { if (x1 == x0) return y0; return (y1-y0)/(x1-x0)*(x-x0) + y0; } Interpolation::Interpolation( GridWerte& I) : W(I) { } void Interpolation::setParams(double minx, double miny, double dx, int anzx, int anzy) { MinX = minx; MinY = miny; DX = dx; AnzahlX = anzx; AnzahlY = anzy; } void Interpolation::setZwischenwerte(void) { MinX = 0.5f; MinY = 0.5f; DX = 1.0f; AnzahlX = W.xanz -1; AnzahlY = W.yanz -1; } void Interpolation::setDoppeltewerte(void) { MinX = 0.0f; MinY = 0.0f; DX = 0.5f; AnzahlX = 2*W.xanz -1; AnzahlY = 2*W.yanz -1; } bool Interpolation::IsOk(void) { return ( (MinX + AnzahlX*DX <= W.xanz) && (MinY + AnzahlY*DX <= W.yanz) && (MinX > 0) && (MinY > 0) && (DX > 0) && (AnzahlX > 0) && (AnzahlY > 0) ); } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Spline + Splinefloat //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /* void QSpline::spline(double x[],double y[],int n, double yp1,double ypn,double y2[], double tmp_u[]) { int i,k; double p,qn,sig,un, *u = tmp_u; if (yp1 > 0.99e30) y2[1]=u[1]=0.0f; else { y2[1] = -0.5f; u[1]=(3.0f/(x[2]-x[1]))*((y[2]-y[1])/(x[2]-x[1])-yp1); } for (i=2;i<=n-1;i++) { sig=(x[i]-x[i-1])/(x[i+1]-x[i-1]); p=sig*y2[i-1]+2.0f; y2[i]=(sig-1.0f)/p; u[i]=(y[i+1]-y[i])/(x[i+1]-x[i]) - (y[i]-y[i-1])/(x[i]-x[i-1]); u[i]=(6.0f*u[i]/(x[i+1]-x[i-1])-sig*u[i-1])/p; } if (ypn > 0.99e30f) qn=un=0.0f; else { qn=0.5f; un=(3.0f/(x[n]-x[n-1]))*(ypn-(y[n]-y[n-1])/(x[n]-x[n-1])); } y2[n]=(un-qn*u[n-1])/(qn*y2[n-1]+1.0f); for (k=n-1;k>=1;k--) y2[k]=y2[k]*y2[k+1]+u[k]; } void QSpline::splint(double xa[],double ya[],double y2a[],int n, double x,double *y) { int klo,khi,k; double h,b,a; klo=1; khi=n; while (khi-klo > 1) { k=(khi+klo) >> 1; if (xa[k] > x) khi=k; else klo=k; } h=xa[khi]-xa[klo]; if (h == 0.0) throw InterpolError("Bad XA input to routine SPLINT"); a=(xa[khi]-x)/h; b=(x-xa[klo])/h; *y=a*ya[klo]+b*ya[khi]+((a*a*a-a)*y2a[klo]+(b*b*b-b)*y2a[khi])*(h*h)/6.0f; } void QSpline::splie2(double x1a[], double x2a[], double **ya, int m, int n, double **y2a) { int j; double *tmp_u = new double [n]; for (j=1;j<=m;j++) spline(x2a,ya[j],n,1.0e30f,1.0e30f,y2a[j], tmp_u); delete[] tmp_u; } void QSpline::splin2(double x1a[], double x2a[], double **ya, double **y2a, int m, int n, double x1, double x2, double *y, double *ytmp, double *yytmp, double *tmp_u) { int j; for (j=1;j<=m;j++) splint(x2a,ya[j],y2a[j],n,x2,&yytmp[j]); spline(x1a,yytmp,m,1.0e30f,1.0e30f,ytmp, tmp_u); splint(x1a,yytmp,ytmp,m,x1,y); } void QSpline::mysplin( double x1a[], double x2a[], double **ya, double **y2a, GridWerte& Erg, int mm, int nn, double *ytmp, double *yytmp, double *tmp_u) { int j, m, n; double y, x1, x2; //m = Erg.yanz+1; // vorher G.yanz //n = Erg.xanz+1; // vorher G.xanz m = AnzahlY+1; n = AnzahlX+1; for (int n2=1; n2 1e-12) { ret = sin(x); ret /= x; } else ret = 1.0f; return ret; /* // qubic polynom x = fabs(x); if (x <= 1.0f) return (1-2*x*x+x*x*x); if (x <= 2.0f) return (4-8*x+5*x*x-x*x*x); return 0.0f; */ } void Resample::interpol(GridWerte& Erg) { int i; Tiefe = W.xanz; int T = Tiefe/2; double sum; // double MinX, MinY, DX; // int AnzahlX, AnzahlY; Erg.yanz = AnzahlY; Erg.xanz = AnzahlX; Erg.xll = MinX*W.dxy + W.xll; Erg.yll = MinY*W.dxy + W.yll; Erg.dxy = W.dxy*DX; Erg.getMem(); double Mittelwert = 0; for (i=0; i wird alte Titelzeile ', & 'genommen)' READ (*,'(A)') TITEL2 IF (LAENGE(TITEL2).EQ.0) TITEL2 = TITEL 30 WRITE (*,*) 'Bitte neue Rasterweite (m) angeben:' READ (*,*,ERR=40) DXY3 GOTO 50 40 WRITE (*,*) '-E- Falsche Eingabe' GOTO 30 50 CONTINUE 60 WRITE (*,*) 'Abstand des neuen ersten Gitterpunktes (lu)', & 'vom alten (Wert >= 1 (< 2 Empf.)): (x,y)' READ (*,*,ERR=70) STARTX3, STARTY3 GOTO 80 70 WRITE (*,*) '-E- Falsche Eingabe' GOTO 60 80 CONTINUE CC Relative Nachbar-Koordinaten einer RZ initialisieren C CALL SET_XYNB C DGM-Datei mit gerundeten Hoehenwerten lesen WRITE (*,*) '-I- Die DGM-Datei mit den gerundeten ', & 'Hhenwerten wird gelesen...' CALL READ_DGMBIN(0,U1,TITEL,HKNFT,DXY,XMIN,YMIN,XOGR,YOGR,DATTYP) WRITE (*,*) HOEHE(1,1) write (*,*) hoehe(2,2) C DGM generalisieren C Programm zum Generalisieren wird gerufen WRITE (*,*) '-I- Die DGM-Datei wird generalisiert' WRITE (*,*) DXY3,STARTX3,STARTY3,xogr,yogr CALL DGM_RESAMPLE(DXY,DXY3,STARTX3,STARTY3,XOGR,YOGR,XMAX3,YMAX3) WRITE (*,*) XMAX3,YMAX3 write (*,*) 'Hoehe3(1,1)=', hoehe3(1,1) C DGM-Datei mit generalisierten Hoehenwerten erzeugen WRITE (*,*) '-I- Die DGM-Datei mit den generalisierten ', & 'Hhenwerten wird erzeugt...' C ...Header schreiben WRITE (U2) TITEL2 WRITE (U2) HKNFT WRITE (U2) DXY3, XMIN+(STARTX3*DXY), & YMIN+(STARTY3*DXY), XMAX3, YMAX3, DATTYP C ...Hoehenwerte schreiben DO 200 Y=1,YMAX3 WRITE (U2) (HOEHE3(X,Y),X=1,XMAX3) 200 CONTINUE C Dateien schliessen CLOSE(U1) CLOSE(U2) STOP C Fehlerbehandlung 910 WRITE (*,*) '-F- Fehler beim ffnen der DGM-Datei mit ', & 'gerundeteten Hhenwerten' STOP 920 WRITE (*,*) '-F- Fehler beim ffnen der DGM-Datei fr ', & 'die aufbereiteten Hhenwerte' STOP END SUBROUTINE DGM_RESAMPLE(DXY2,DXY3,STARTX3,STARTY3,XMAX2,YMAX2, & XMAX3,YMAX3) ************************************************************************ * Autor : Christian Trachinow / Corinna Walther * Geographisches Institut der Universitaet Goettingen * Goldschmidtstr. 5, 3400 Goettingen * Erstellt am : 14-DEC-1995 12:06 * Letzte Aenderung : 15-JAN-1996 16:50 ************************************************************************ C C Kurzbeschreibung: C ----------------- C Programm zur Generalisierung von DGM aus SARADRM C STARTX3 und STARTY3 C C Eingabe: C -------- C ueber Parameterliste: C BINUNIT = I, Unit-Nr. unter der die binaere Datei geoeffnet wurde C DXY3 = R, gewuenschte neue Rasterweite C STARTX3 = R, Abstand des ersten Punktes der gener. Matrix vom C ersten Punkt der alten Matrix (in Rasterzellen), C muss groesser gleich 1 sein (optimal 1 <= ... <2) C STARTY3 = R, siehe STARTX3 C C ueber Common-Block: C /HOEHE_2/ (S.U.): XOGR, YOGR C /MATRIX2/ (s.u.): XMANF, YMANF C C Ausgabe: C -------- C ueber Common-Block: C /HOEHE_3/ (s.u.): XOGR, YOGR C C C----------------------------------------------------------------------- IMPLICIT NONE C----------------------------------------------------------------------- C C Referenzen: C ----------- REAL CUBICP EXTERNAL READ_DGMBIN, CUBICP INTRINSIC INT, ABS C C----------------------------------------------------------------------- C C COMMON-Bloecke: C --------------- C----------------------------------------------------------------------- C Dimensionierung der DRM-Matrizen INTEGER OGR PARAMETER (OGR=961) C----------------------------------------------------------------------- C Common-Block /DGMHOH/ Matrix mit Hoehenwerten des DRM C HOEHE2 = R(OGR,OGR) Hoehe ueber NN in Meter REAL HOEHE2(OGR,OGR) COMMON /DGMHOH/ HOEHE2 C----------------------------------------------------------------------- C Common-Block /HOEHE_3/ Matrix mit Hoehenwerten des DRM C HOEHE3 = R(OGR,OGR) Hoehe ueber NN in Meter REAL HOEHE3(OGR,OGR) COMMON /HOEHE_3/ HOEHE3 C----------------------------------------------------------------------- C es fehlen: die alte Rasterweite DXY2 C die tatsaechlich im Commonblock vorhandene Anzahl der Werte C XMAX2 C YMAX2 C die Gauss-Krueger-Koordinaten der linken unteren Ecke der C alten Matrix XLL2 C YLL2 C Ausgabe: C die vorhandene Anzahl der neuen Werte C XMAX3 C YMAX3 C die Gauss-Krueger-Koordinaten der linken unteren Ecke der C alten Matrix XLL3 C YLL3 C======================================================================= C Eingabe REAL NEWDXY, STARTX3, ABSTANDX2, ABSTANDX3, ABSTANDY2, ABSTANDY3, & N3, STARTY3, XLL2, YLL2, XLL3, YLL3, DM, DN, SUM, MHILF, & NHILF, DXY3, DXY2, SUM2, FELD16(-1:2,-1:2), WERTSUM, WERT INTEGER U, V, XMAX2, YMAX2, XMAX3, YMAX3, N, M, NS, MS, Y, & MESS, BINUNIT, DATTYP CHARACTER TITEL*80, HKNFT*80 C Liest Hoehenwerte in Commonblock HOEHE_2... C CALL READ_DGMBIN(2,BINUNIT,TITEL,HKNFT,DXY2,XLL2,YLL2,XMAX2,YMAX2, C & DATTYP) C Ermittlung der neuen Anzahl von Rasterpunkten (STARTX3 uebergeben C mit einem Wert zwischen 1 und 2) C Berechnung der alten Matrixgroesse... ABSTANDX2 = (XMAX2 - 1) * DXY2 ABSTANDY2 = (YMAX2 - 1) * DXY2 C Berechnung der neuen Matrixgroesse... ABSTANDX3 = ABSTANDX2 - STARTX3 * DXY2 - DXY2 ABSTANDY3 = ABSTANDY2 - STARTY3 * DXY2 - DXY2 C auf geraden Werte runden... C XMAX3 und YMAX3 = Anzahl der neuen Rasterpunkte... XMAX3 = INT(ABSTANDX3 / DXY3) IF (ABSTANDX3 / DXY3 - REAL(XMAX3) .GT. 0.00001) THEN XMAX3 = XMAX3 + 1 END IF YMAX3 = INT(ABSTANDY3 / DXY3) IF (ABSTANDY3 / DXY3 - REAL(YMAX3) .GT. 0.00001) THEN YMAX3 = YMAX3 + 1 END IF C neue Matrixgroesse... ABSTANDX3 = (XMAX3 - 1) * DXY3 ABSTANDY3 = (YMAX3 - 1) * DXY3 WRITE (*,*) 'xmax3=', xmax3 , 'ymax3=', ymax3 WRITE (*,*) 'abstandx3=', abstandx3 , 'abstandy3=', abstandy3 C Bildung der gewichteten Mittel pro neuem Rasterpunkt... DO 10 NS = 1, XMAX3 DO 20 MS = 1, YMAX3 NHILF = STARTX3 + (NS - 1) * DXY3 / DXY2 + 1 MHILF = STARTY3 + (MS - 1) * DXY3 / DXY2 + 1 C write (*,*) 'nhilf=', nhilf, 'mhilf=', mhilf C write (*,*) 'ns=', ns, 'ms=', ms N = INT(NHILF) M = INT(MHILF) DN = NHILF - N DM = MHILF - M C write (*,*) 'dn=', dn, 'dm=', dm SUM = 0.0 C 16 Werte einlesen und auf Missing Values berprfen.... Y = 0 WERTSUM = 0.0 WERT = 0.0 DO 90 U = -1,2 Do 99 V = -1,2 WERT = HOEHE2(N + V, M + U) IF (WERT .EQ. -999.0) THEN Y = Y + 1 ELSE WERTSUM = WERTSUM + WERT END IF FELD16(V,U) = WERT 99 CONTINUE 90 CONTINUE C wenn mehr als 8 Werte MV sind, ist der neue Hhenwert auch ein C MV, wenn weniger vorhanden sind, wird an ihrer Stelle der arithm. C Mittelwert der brigen Hhenwerte eingesetzt... IF (Y .GE. 8) THEN HOEHE3(NS,MS) = -999.0 GOTO 20 ELSE IF (Y .GT. 0) THEN WERT = WERTSUM / (16 - Y) DO 100 U = -1,2 DO 101 V = -1,2 IF (FELD16(V, U) .EQ. -999.0) FELD16(V, U) = WERT 101 CONTINUE 100 CONTINUE END IF DO 30 U = -1,2 SUM2 = 0 DO 40 V = -1,2 SUM2 = SUM2 + CUBICP(V - DN) * FELD16(V, U) C write (*,*) 'cubicp(v-dn)=', cubicp(v - dn) C WRITE (*,*) 'Hoehe2=', hoehe2(n + v, m + u) C write (*,*) 'sum=', sum 40 CONTINUE SUM = SUM + SUM2 * CUBICP(U - DM) C write (*,*) 'cubicp(u-dm)=', cubicp(u - dm) C write (*,*) 'sum=', sum 30 CONTINUE HOEHE3(NS,MS) = SUM C WRITE (*,*) 'Hoehe3=', hoehe3(ns,ms) 20 CONTINUE 10 CONTINUE XLL3 = STARTX3*DXY2 YLL3 = STARTY3*DXY2 RETURN END FUNCTION CUBICP(Z) REAL Z IF (ABS(Z) .GE. 0.0 .AND. ABS(Z) .LE. 1.0) THEN CUBICP = 1 - 2*Z*Z + ABS(Z*Z*Z) ELSE IF (ABS(Z) .GT. 1.0 .AND. ABS(Z) .LE. 2.0) THEN CUBICP = 4 - 8* ABS(Z) + 5*Z*Z - ABS(Z*Z*Z) ELSE CUBICP = 0.0 END IF RETURN END */ saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/interpolation.h000066400000000000000000000034541224124640700252600ustar00rootroot00000000000000/********************************************************** * Version $Id: interpolation.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __INTERPOL_H #define __INTERPOL_H #include "grid_bsl.h" double LinPol(double x0, double y0, double x1, double y1, double x); class MathError { public: MathError(){}; }; class InterpolError: public MathError { public: InterpolError(const char *s) : S(s) {}; const char *S; }; class Interpolation { public: Interpolation( GridWerte& I); virtual ~Interpolation() {}; void setParams(double minx, double miny, double dx, int anzx, int anzy); virtual void interpol(GridWerte& G) = 0; void setZwischenwerte(void); void setDoppeltewerte(void); bool IsOk(void); protected: GridWerte& W; double MinX, MinY, DX; int AnzahlX, AnzahlY; }; class QSpline : public Interpolation { public: QSpline( GridWerte& I) : Interpolation(I) {}; ~QSpline() {}; virtual void interpol(GridWerte& G); private: void spline(double x[],double y[],int n, double yp1,double ypn,double y2[], double tmp_u[]); void splint(double xa[],double ya[],double y2a[],int n, double x,double *y); void splie2(double x1a[], double x2a[], double **ya, int m, int n, double **y2a); void splin2(double x1a[], double x2a[], double **ya, double **y2a, int m, int n, double x1, double x2, double *y, double *ytmp, double *yytmp, double *tmp_u); void mysplin(double x1a[], double x2a[], double **ya, double **y2a, GridWerte& Erg, int mm, int nn, double *ytmp, double *yytmp, double *tmp_u); }; class Resample : public Interpolation { public: Resample( GridWerte& I) : Interpolation(I), Tiefe(4) {}; ~Resample() {}; void setTiefe(int T); virtual void interpol(GridWerte& G); private: double sinc(double x); int Tiefe; }; #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/pars_all.cpp000066400000000000000000000143671224124640700245260ustar00rootroot00000000000000/********************************************************** * Version $Id: pars_all.cpp 962 2011-03-24 23:59:32Z johanvdw $ *********************************************************/ //#include "..\stdafx.h" #include #include "pars_all.h" #include using namespace std; T_AnweisungList AnweisungList; /* Anweisungen sind 1.) foreach 2.) if 3.) Zuweisung 4.) Funktion (ohne Zuweisung aufgerufen) */ bool getNextZuweisung(const string& s, int& pos, string& erg) { // Erstellt string von (zeile, pos) bis zum nchsten Komma string sub = s.substr(pos); erg = ""; int p; if ((p = sub.find_first_of(';')) >= 0) { sub.erase(p, sub.size()); pos += p; erg = sub; return true; } return false; } bool getFunktion(const string& s, int& pos, string& erg) { string zeile; if (!getNextZuweisung(s, pos, zeile)) return false; BBFktExe *f = NULL; if (isFunktion(zeile, f, false)) { erg = zeile; return true; } return false; } bool isKommentar(const string& s, int& p) { char f = s[p], n = s[p+1]; // whitespaces vorne entfernen // !!! #define WHITE_SP " \r\t\n" int pos = s.find_first_not_of(WHITE_SP, p); if (pos >= 0 && s[pos] == '/' && s[pos+1] == '/') { // Kommentar bis Ende der Zeile pos = s.find("\n", pos+2); if (pos > 0) p = pos; else // letzte Zeile p = s.length(); return true; } return false; } void pars_ausdruck_string(const string& s, T_AnweisungList & al) { int pos = 0; BBForEach *f; BBIf *If; string anweisungen, anweisungen_else; int p; do { FehlerString = s.substr(pos); p = pos; if (isKommentar(s, p)) { pos = p; continue; } p = pos; if (isForEach(s, p, f, anweisungen)) { int offset = anweisungen.size(); trim(anweisungen); offset -= anweisungen.size(); // neue AL erzeugen BBAnweisung *a; a = new BBAnweisung; a->typ = BBAnweisung::ForEach; a->AnweisungVar.For = f; FehlerZeile += p + offset + 1 - pos; FehlerString = s.substr(p); try { pars_ausdruck_string(anweisungen, a->AnweisungVar.For->z); } catch (BBFehlerException) { delete a; throw BBFehlerException(pos); } al.push_back(a); pos = p + offset + 1 + anweisungen.size(); } else { p = pos; if (isIf(s, p, If, anweisungen, anweisungen_else)) { //int offset = anweisungen.size(); trim(anweisungen); trim(anweisungen_else); // neue AL erzeugen BBAnweisung *a; a = new BBAnweisung; a->typ = BBAnweisung::IF; a->AnweisungVar.IF = If; //FehlerZeile += p + offset + 1 - pos; FehlerString = anweisungen; FehlerZeile += p + 1 - pos; FehlerZeile -= anweisungen.size(); if (If->isElse) FehlerZeile -= anweisungen_else.size(); try { pars_ausdruck_string(anweisungen, a->AnweisungVar.IF->z); if (If->isElse) { FehlerZeile += anweisungen.size(); FehlerString = anweisungen_else; pars_ausdruck_string(anweisungen_else, a->AnweisungVar.IF->zelse); } } catch (BBFehlerException) { delete a; throw BBFehlerException(pos); } al.push_back(a); // pos = p + offset + 1; pos = p + 1; } else { p = pos; FehlerString = s.substr(p); if (getFunktion(s, p, anweisungen)) { BBFktExe *fkt; if (!isFunktion(anweisungen, fkt, true, true)) // alle Funktionen erwnscht throw BBFehlerException(pos); BBAnweisung *a; a = new BBAnweisung; a->typ = BBAnweisung::Funktion; a->AnweisungVar.Fkt = fkt; al.push_back(a); p++; //Komma entfernen FehlerZeile += p - pos; FehlerString = s.substr(p); pos = p; } else { p = pos; if (getNextZuweisung(s, p, anweisungen)) { BBZuweisung *Z; trim(anweisungen); if (isZuweisung(anweisungen, Z)) { // neue AL erzeugen BBAnweisung *a; a = new BBAnweisung; a->typ = BBAnweisung::Zuweisung; a->AnweisungVar.Zu = Z; al.push_back(a); p++; //Komma entfernen FehlerZeile += p - pos; FehlerString = s.substr(p); pos = p; } else throw BBFehlerException(pos); } else throw BBFehlerException(pos); } } } } while (pos < s.size()); } void pars_ausdruck(int& zeile, int& pos) { int i; int zeile_save = zeile; int pos_save = pos; long size_inputtext; vector InputZeilenNummer; // deque InputZeilenNummer; long size_of_crlf = strlen("\n"); FehlerZeile = 0; FehlerString = ""; size_inputtext = InputText.size(); if (zeile >= InputText.size()) throw BBFehlerException(zeile); // T_AnweisungList a; string s = ""; long size = 0; for (int i1=0; i1 < InputText.size(); i1++) size += InputText[i1].size() + size_of_crlf; //s.reserve(size); InputZeilenNummer.reserve(5000); // wenn (zeile,pos) am Zeilenende -> neue Zeile if (pos >= InputText[zeile].size()) { zeile++; pos = 0; if (zeile >= InputText.size()) return; } // erste Zeile char *s_buff = new char[size+1]; s = InputText[zeile].substr(pos); InputZeilenNummer.push_back(pos); // ???? // alle weiteren Zeilen long size_s_buff = 0; for (i=zeile/*+1*/; i zeile ) InputZeilenNummer.push_back((InputZeilenNummer[i-zeile-1] + InputText[i].size() + 1 /* CR + LF ist nur 1 char ???*/ )); } s_buff[size_s_buff] = 0; s = s_buff; delete[] s_buff; // nur hinten abschneiden int pos1 = s.find_last_not_of(" \t\n"); if (pos1 >= 0) { // s.erase(&s[pos1+1], s.end()); s.erase(s.begin()+pos1+1, s.end()); } try { pars_ausdruck_string(s, AnweisungList); } catch (BBFehlerException) { // bersetzen in Zeilen-Nummer for (i=0; i 0.0f) return double(atan(y/x)); if (x < 0.0f) return double(atan(y/x) + M_PI); if (x == 0.0f || y > 0.0f) return double(M_PI_090); if (x == 0.0f || y < 0.0f) return double(-M_PI_090); return 0.0f; } //**************************************************************** //Do * 3D-Vectorklasse *********************************************** C_Vec3::C_Vec3(double x_neu, double y_neu, double z_neu) { x = x_neu; y = y_neu; z = z_neu; } C_Vec3::C_Vec3(const C_Vec3& V) { x = V.x; y = V.y; z = V.z; } C_Vec3::~C_Vec3() { } void C_Vec3::setPolar(double l, double a_phi, double a_psi) { x = double(l*sin(a_psi)*sin(a_phi)); y = double(l*sin(a_psi)*cos(a_phi)); z = double(l*cos(a_psi)); } C_Vec3& C_Vec3::operator = (const C_Vec3& v) { x = v.x; y = v.y; z = v.z; return *this; } C_Vec3& C_Vec3::operator += (const C_Vec3& v) { x += v.x; y += v.y; z += v.z; return *this; } C_Vec3& C_Vec3::operator -= (const C_Vec3& v) { x -= v.x; y -= v.y; z -= v.z; return *this; } C_Vec3 operator + (const C_Vec3& w,const C_Vec3& v) { return C_Vec3(w.x+v.x, w.y+v.y, w.z+v.z); } C_Vec3 operator - (const C_Vec3& w,const C_Vec3& v) { return C_Vec3(w.x-v.x, w.y-v.y, w.z-v.z); } C_Vec3 C_Vec3::operator - (const C_Vec3 &v) { return C_Vec3(-v.x, -v.y, -v.z); } C_Vec3& C_Vec3::operator /= (double v) { x = x/v; y = y/v; z = z/v; return *this; } C_Vec3& C_Vec3::operator *= (double v) { x = x*v; y = y*v; z = z*v; return *this; } C_Vec3 operator * (const C_Vec3& w, double v) { return C_Vec3(w.x*v, w.y*v, w.z*v); } C_Vec3 operator / (const C_Vec3& w, double v) { return C_Vec3(w.x/v, w.y/v, w.z/v); } C_Vec3 operator * (double v,const C_Vec3& w) { return C_Vec3(w.x*v, w.y*v, w.z*v); } C_Vec3 operator / (double v,const C_Vec3& w) { return C_Vec3(w.x/v, w.y/v, w.z/v); } double operator * (const C_Vec3& v, const C_Vec3& w) { return ((v.x*w.x) + (v.y*w.y) + (v.z*w.z)); } double operator < (const C_Vec3& v, const C_Vec3& w) { return double(acos((v*w) / (v.Length() * w.Length()))); } // *** Funktionen ************** double C_Vec3::X(void) const { return x; } double C_Vec3::Y(void) const { return y; } double C_Vec3::Z(void) const { return z; } double C_Vec3::Length(void) const { return double(sqrt(x*x+y*y+z*z)); } double C_Vec3::Angle_Phi(void)const { // Angabe es Polarwinkels in rad if (x > 0.0f) return double(atan(y/x)); if (x < 0.0f) return double(atan(y/x) + M_PI); if (x == 0.0f || y > 0.0f) return double(M_PI_090); if (x == 0.0f || y < 0.0f) return double(-M_PI_090); return 0.0f; } double C_Vec3::Angle_Psi(void)const { // Angabe es Hhenwinkels in rad return double(asin(z/(sqrt(x*x+y*y)))); } C_Vec3 C_Vec3::Kreuzprod(C_Vec3& v){ return C_Vec3( ( (y *v.Z()) - (z *v.Y()) ) , ( (z *v.X()) - (x *v.Z()) ) , ( (x *v.Y()) - (y *v.X()) ) ); } double C_Vec3::Spatprod(C_Vec3& v, C_Vec3& w){ return (*this * (v.Kreuzprod(w))); } //DO * Rechteck-Klasse *********************************************** C_Rect::C_Rect() { double startx, endx, starty, endy; startx = 0.0f; starty = 0.0f; endx = 0.0f; endy = 0.0f; Start = C_Vec2(startx, starty); End = C_Vec2(endx, endy); } C_Rect::C_Rect(const double startX,const double startY, const double endX, const double endY) { double startx, endx, starty, endy; startx = startX; starty = startY; endx = endX; endy = endY; if (startX > endX) { startx = endX; endx = startX; } if (startY > endY) { starty = endY; endy = startY; } Start = C_Vec2(startx, starty); End = C_Vec2(endx, endy); } C_Rect::C_Rect(const C_Vec2& start, const C_Vec2& end) { double startx, endx, starty, endy; Start = start; End = end; startx = start.X(); starty = start.Y(); endx = end.X(); endy = end.Y(); if (start.X() > end.X()) { startx = end.X(); endx = start.X(); } if (start.Y() > end.Y()) { starty = end.Y(); endy = start.Y(); } Start = C_Vec2(startx, starty); End = C_Vec2(endx, endy); } C_Rect::C_Rect(const C_Rect& r) { Start = r.Start; End = r.End; } C_Rect::~C_Rect() { } C_Rect& C_Rect::operator = (const C_Rect& r) { Start = r.Start; End = r.End; return *this; } C_Rect& C_Rect::operator += (const C_Vec2& v) { Start += v; End += v; return *this; } C_Rect& C_Rect::operator -= (const C_Vec2& v) { Start -= v; End -= v; return *this; } C_Rect operator + (const C_Rect& r, const C_Vec2& v) { return C_Rect(r.Start + v, r.End + v); } C_Rect operator + (const C_Vec2&v, const C_Rect& r) { return C_Rect(r.Start + v, r.End + v); } C_Rect operator - (const C_Rect& r, const C_Vec2& v) { return C_Rect(r.Start - v, r.End - v); } C_Rect operator * (const C_Rect& r, double v) { return C_Rect(r.X1()*v, r.Y1()*v, r.X2()*v, r.Y2()*v); } C_Rect operator * (double v, const C_Rect& r) { return C_Rect(r.X1()*v, r.Y1()*v, r.X2()*v, r.Y2()*v); } C_Rect operator / (const C_Rect& r, double v) { return C_Rect(r.X1()/v, r.Y1()/v, r.X2()/v, r.Y2()/v); } C_Rect C_Rect::intersect(const C_Rect& R) { /* double tx, ty, tw, th; tw = MIN (X2(), R.X2()); th = MIN (Y2(), R.Y2()); tx = MAX (X1(), R.X1()); ty = MAX (Y1(), R.Y1()); if ((tw > tx) && (th > ty)) return C_Rect(tx, ty, tw, th); else return C_Rect(0.0f, 0.0f, 0.0f, 0.0f);*/ return C_Rect(0.0f, 0.0f, 0.0f, 0.0f); } double C_Rect::X(void) const { return Start.X(); } double C_Rect::Y(void) const { return Start.Y(); } double C_Rect::X1(void) const { return Start.X(); } double C_Rect::Y1(void) const { return Start.Y(); } double C_Rect::W(void) const { return End.X() - Start.X(); } double C_Rect::H(void) const { return End.Y() - Start.Y(); } double C_Rect::X2(void) const { return End.X(); } double C_Rect::Y2(void) const { return End.Y(); } double C_Rect::diagonale(void) const { double x = X2() - X1(); double y = Y2() - Y1(); return double(sqrt(x*x+y*y)); } C_Vec2 C_Rect::showStart(void) const { return Start; } C_Vec2 C_Rect::showEnd(void) const { return End; } int C_Rect::Inside(C_Vec2 v) { if( (v.X()>=Start.X())&& (v.X()<=End.X())&& (v.Y()>=Start.Y())&& (v.Y()<=End.Y()) ) return 1; return 0; } saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/vector.h000066400000000000000000000161131224124640700236670ustar00rootroot00000000000000/********************************************************** * Version $Id: vector.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //////////////////////////////////////////////////////////////////////////// // Programm : // Bibliothek : // Header-Datei: vector.h // //////////////////////////////////////////////////////////////////////////// // // Autoren : Joerg Dolle // Christian Trachimow // // Telefon-Nr. : 0561/774807 // Mail-Adresse : jdolle@gwdg.de // //////////////////////////////////////////////////////////////////////////// // // Compiler : Borland C++ V.: 4.00 // Ersterstellung : 16.11.95 // Ueberarbeitung : 22.04.96 // // Programmversion: 2.00 // //////////////////////////////////////////////////////////////////////////// /****************** Include-Dateien **************/ #ifndef __vector_h__ #define __vector_h__ //#include #include //!!#undef HEADER_INCLUDED__DATA //!!#define HEADER_INCLUDED__DATA HEADER_INCLUDED__EXT_CLASS //#define M_PI 3.14159265358979323846 //#define M_PI_2 M_PI/2.0 // Umrechnung von Grad in rad und umgekehrt #define PI_180 (M_PI/180) #define GRAD(arc) (arc/PI_180) #define ARC(grad) (grad*PI_180) //Do * 2D-Vectorklasse *********************************************** class C_Vec2 { public: C_Vec2() : x(0.0f), y(0.0f) {}; C_Vec2(double x_neu, double y_neu); C_Vec2(const C_Vec2& V); ~C_Vec2(); void setPolar(double l, double a); C_Vec2& operator = (const C_Vec2& v); C_Vec2& operator += (const C_Vec2& v); C_Vec2& operator -= (const C_Vec2& v); // friend HEADER_INCLUDED__EXT_API const C_Vec2 operator + (const C_Vec2& w, const C_Vec2& v); // friend HEADER_INCLUDED__EXT_API const C_Vec2 operator - (const C_Vec2& w, const C_Vec2& v); C_Vec2 operator -(); // class C_Vec2 operator -(); C_Vec2& operator /= (double v); C_Vec2& operator *= (double v); friend C_Vec2 operator + (const C_Vec2& w, const C_Vec2& v); friend C_Vec2 operator - (const C_Vec2& w, const C_Vec2& v); friend C_Vec2 operator * (const C_Vec2& w, double v); friend C_Vec2 operator / (const C_Vec2& w, double v); friend C_Vec2 operator * (double v, const C_Vec2& w); friend C_Vec2 operator / (double v, const C_Vec2& w); friend double operator * (const C_Vec2& v, const C_Vec2& w); friend double operator < (const C_Vec2& v, const C_Vec2& w); double X(void) const; double Y(void) const; double Length(void) const; double Angle(void) const; protected: double x, y; }; C_Vec2 operator + (const C_Vec2& w,const C_Vec2& v); C_Vec2 operator - (const C_Vec2& w,const C_Vec2& v); C_Vec2 operator * (const C_Vec2& w, double v); C_Vec2 operator / (const C_Vec2& w, double v); C_Vec2 operator * (double v,const C_Vec2& w); C_Vec2 operator / (double v,const C_Vec2& w); double operator * (const C_Vec2& v, const C_Vec2& w); double operator < (const C_Vec2& v, const C_Vec2& w); //Do * 3D-Vectorklasse *********************************************** class C_Vec3 { public: C_Vec3() : x(0.0f), y(0.0f), z(0.0f) {}; C_Vec3(double x_neu, double y_neu, double z_neu); C_Vec3(const C_Vec3& V); ~C_Vec3(); void setPolar(double l, double a_phi, double a_psi); C_Vec3& operator = (const C_Vec3& v); C_Vec3& operator += (const C_Vec3& v); C_Vec3& operator -= (const C_Vec3& v); friend C_Vec3 operator + (const C_Vec3& w, const C_Vec3& v); friend C_Vec3 operator - (const C_Vec3& w, const C_Vec3& v); C_Vec3 operator - (const C_Vec3 &v); C_Vec3& operator /= (double v); C_Vec3& operator *= (double v); friend C_Vec3 operator * (const C_Vec3& w, double v); friend C_Vec3 operator / (const C_Vec3& w, double v); friend C_Vec3 operator * (double v, const C_Vec3& w); friend C_Vec3 operator / (double v, const C_Vec3& w); friend double operator * (const C_Vec3& v, const C_Vec3& w); friend double operator < (const C_Vec3& v, const C_Vec3& w); double X(void) const; double Y(void) const; double Z(void) const; double Length(void) const; double Angle_Phi(void) const; double Angle_Psi(void) const; C_Vec3 Kreuzprod(C_Vec3& v); double Spatprod(C_Vec3& v, C_Vec3& w); protected: double x, y, z; }; C_Vec3 operator + (const C_Vec3& w,const C_Vec3& v); C_Vec3 operator - (const C_Vec3& w,const C_Vec3& v); C_Vec3 operator * (const C_Vec3& w, double v); C_Vec3 operator / (const C_Vec3& w, double v); C_Vec3 operator * (double v,const C_Vec3& w); C_Vec3 operator / (double v,const C_Vec3& w); double operator * (const C_Vec3& v, const C_Vec3& w); double operator < (const C_Vec3& v, const C_Vec3& w); //DO *einfache Rechteck-Klasse z.B. zum Klipping********************** class C_Rect { public: C_Rect(); C_Rect(const double x1,const double y1,const double x2,const double y2); C_Rect(const C_Vec2& start, const C_Vec2& end); C_Rect(const C_Rect& r); ~C_Rect(); C_Rect& operator = (const C_Rect& r); C_Rect& operator += (const C_Vec2& v); C_Rect& operator -= (const C_Vec2& v); friend C_Rect operator + (const C_Rect& r, const C_Vec2& v); friend C_Rect operator + (const C_Vec2&v, const C_Rect& r); friend C_Rect operator - (const C_Rect& r, const C_Vec2& v); friend C_Rect operator * (const C_Rect& r, double v); friend C_Rect operator * (double v, const C_Rect& r); friend C_Rect operator / (const C_Rect& r, double v); double X(void) const; double Y(void) const; double X1(void) const; double Y1(void) const; double W(void) const; double H(void) const; double X2(void) const; double Y2(void) const; double diagonale(void) const; C_Rect intersect(const C_Rect& R); C_Vec2 showStart(void) const; C_Vec2 showEnd(void) const; int Inside(C_Vec2 v); private: C_Vec2 Start, End; }; C_Rect operator + (const C_Rect& r, const C_Vec2& v); C_Rect operator + (const C_Vec2&v, const C_Rect& r); C_Rect operator - (const C_Rect& r, const C_Vec2& v); C_Rect operator * (const C_Rect& r, double v); C_Rect operator * (double v, const C_Rect& r); C_Rect operator / (const C_Rect& r, double v); //!!#undef HEADER_INCLUDED__DATA //!!#define HEADER_INCLUDED__DATA #endif saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/zuweisung.cpp000066400000000000000000000060201224124640700247540ustar00rootroot00000000000000/********************************************************** * Version $Id: zuweisung.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //#include <..\stdafx.h> #include "zuweisung.h" using namespace std; BBZuweisung::BBZuweisung() { typ = NoTyp; memset(&ZuArt, 0, sizeof(BBZuArt)); memset(&ZuVar, 0, sizeof(BBZuVar)); } BBZuweisung::~BBZuweisung() { if (typ == NoTyp) return; switch(typ) { case FTyp: case ITyp: if (ZuArt.IF != NULL) delete ZuArt.IF; break; case PTyp: case MTyp: if (ZuArt.MP != NULL) delete ZuArt.MP; break; case MIndex: if (ZuArt.MP != NULL) // delete ZuArt.MP; delete ZuArt.IF; if (ZuVar.MatrixIndex.PVar != NULL) delete ZuVar.MatrixIndex.PVar; break; } typ = NoTyp; memset(&ZuArt, 0, sizeof(BBZuArt)); memset(&ZuVar, 0, sizeof(BBZuVar)); } // Verarbeitung der einzelnen Zeilen bool isZuweisung(const string& statement, BBZuweisung *&Z) { // Syntax: Variablen-Name = Audruck if (statement.empty()) return false; string s(statement); int pos = s.find_first_of('='); if (pos <= 0) return false; // erster Substring mu Variablen-Name sein BBZuweisung::BBZuweisungTyp t; BBMatrix *bbm; BBBaumMatrixPoint *bbp; string sub1 = s.substr(0, pos); trim(sub1); BBTyp *b = isVar(sub1); if (b == NULL) { // berprfen, ob erster Token ein MatrixIndex (M[p]) ist if (!isMatrixIndex(sub1, bbm, bbp)) return false; else t = BBZuweisung::MIndex; } string sub2 = s.substr(pos+1); trim(sub2); if (sub2.empty()) return false; if (b != NULL) { // Typ herausfinden switch (b->type) { case BBTyp::IType: t = BBZuweisung::ITyp; break; case BBTyp::FType: t = BBZuweisung::FTyp; break; case BBTyp::MType: t = BBZuweisung::MTyp; break; case BBTyp::PType: t = BBZuweisung::PTyp; break; } } if (t == BBZuweisung::PTyp || t == BBZuweisung::MTyp) { BBBaumMatrixPoint *k = NULL; try { pars_matrix_point(sub2, k, /*false*/ t == BBZuweisung::MTyp); } catch (BBFehlerException) { return false; } Z = new BBZuweisung; Z->typ = t; if (t == BBZuweisung::PTyp) Z->ZuVar.PVar = getVarP(b); else Z->ZuVar.MVar = getVarM(b); try { pars_matrix_point(sub2, Z->ZuArt.MP, /*false*/t == BBZuweisung::MTyp); } catch (BBFehlerException) { return false; } } else if (t == BBZuweisung::ITyp || t == BBZuweisung::FTyp) { BBBaumInteger *k = NULL; try { pars_integer_float(sub2, k, false); } catch (BBFehlerException) { return false; } Z = new BBZuweisung; Z->typ = t; if (t == BBZuweisung::ITyp) Z->ZuVar.IVar = getVarI(b); else Z->ZuVar.FVar = getVarF(b); try { pars_integer_float(sub2, Z->ZuArt.IF); } catch (BBFehlerException) { return false; } } else if (t == BBZuweisung::MIndex) { Z = new BBZuweisung; Z->typ = t; Z->ZuVar.MatrixIndex.PVar = bbp; Z->ZuVar.MatrixIndex.MVar = bbm; try { pars_integer_float(sub2, Z->ZuArt.IF); } catch (BBFehlerException) { return false; } } return true; } saga-2.1.0+dfsg/src/modules/grid/grid_calculus_bsl/zuweisung.h000066400000000000000000000014111224124640700244200ustar00rootroot00000000000000/********************************************************** * Version $Id: zuweisung.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __ZUWEISUNG_H #define __ZUWEISUNG_H #include "funktion.h" //***************** Zuweisung ***************** class BBZuweisung { public: enum BBZuweisungTyp {NoTyp, FTyp, ITyp, PTyp, MTyp, MIndex} typ; BBZuweisung(); ~BBZuweisung(); union BBZuArt { BBBaumMatrixPoint *MP; BBBaumInteger *IF; } ZuArt; union BBZuVar { BBInteger *IVar; BBFloat *FVar; BBPoint *PVar; BBMatrix *MVar; struct BBMatrixIndex { BBBaumMatrixPoint *PVar; BBMatrix *MVar; } MatrixIndex; } ZuVar; }; bool isZuweisung(const std::string& statement, BBZuweisung *&Z); #endif saga-2.1.0+dfsg/src/modules/grid/grid_filter/000077500000000000000000000000001224124640700210245ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter.cpp000066400000000000000000000172331224124640700227630ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Filter.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFilter::CFilter(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Simple Filter")); Set_Author (SG_T("O.Conrad (c) 2003")); Set_Description (_TW( "Simple standard filters for grids." )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Filtered Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL, "MODE" , _TL("Search Mode"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Square"), _TL("Circle") ), 1 ); Parameters.Add_Choice( NULL, "METHOD" , _TL("Filter"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Smooth"), _TL("Sharpen"), _TL("Edge") ), 0 ); Parameters.Add_Value( NULL, "RADIUS" , _TL("Radius"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter::On_Execute(void) { int Mode, Radius, Method; double Mean; CSG_Grid *pResult; //----------------------------------------------------- m_pInput = Parameters("INPUT") ->asGrid(); pResult = Parameters("RESULT") ->asGrid(); Radius = Parameters("RADIUS") ->asInt(); Mode = Parameters("MODE") ->asInt(); Method = Parameters("METHOD") ->asInt(); switch( Mode ) { case 0: break; case 1: m_Radius.Create(Radius); break; } //----------------------------------------------------- if( !pResult || pResult == m_pInput ) { pResult = SG_Create_Grid(m_pInput); } else { pResult->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pInput->Get_Name(), _TL("Filter"))); pResult->Set_NoData_Value(m_pInput->Get_NoData_Value()); } //----------------------------------------------------- for(int y=0; yis_InGrid(x, y) ) { switch( Mode ) { case 0: Mean = Get_Mean_Square(x, y, Radius); break; case 1: Mean = Get_Mean_Circle(x, y); break; } switch( Method ) { case 0: default: // Smooth... pResult->Set_Value(x, y, Mean); break; case 1: // Sharpen... pResult->Set_Value(x, y, m_pInput->asDouble(x, y) + (m_pInput->asDouble(x, y) - Mean)); break; case 2: // Edge... pResult->Set_Value(x, y, m_pInput->asDouble(x, y) - Mean); break; } } else { pResult->Set_NoData(x, y); } } } //----------------------------------------------------- if( !Parameters("RESULT")->asGrid() || Parameters("RESULT")->asGrid() == m_pInput ) { m_pInput->Assign(pResult); delete(pResult); DataObject_Update(m_pInput); } m_Radius.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- double CFilter::Get_Mean_Square(int x, int y, int Radius) { int ix, iy, n; double s; for(n=0, s=0.0, iy=y-Radius; iy<=y+Radius; iy++) { for(ix=x-Radius; ix<=x+Radius; ix++) { if( m_pInput->is_InGrid(ix, iy) ) { s += m_pInput->asDouble(ix, iy); n ++; } } } return( n > 0 ? s / n : m_pInput->Get_NoData_Value() ); } //--------------------------------------------------------- double CFilter::Get_Mean_Circle(int x, int y) { int i, ix, iy, n; double s; for(n=0, s=0.0, i=0; iis_InGrid(ix, iy) ) { s += m_pInput->asDouble(ix, iy); n ++; } } return( n > 0 ? s / n : m_pInput->Get_NoData_Value() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter.h000066400000000000000000000111111224124640700224150ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Filter_H #define HEADER_INCLUDED__Filter_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFilter : public CSG_Module_Grid { public: CFilter(void); protected: virtual bool On_Execute (void); private: CSG_Grid_Radius m_Radius; CSG_Grid *m_pInput; double Get_Mean_Square (int x, int y, int Radius); double Get_Mean_Circle (int x, int y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Filter_H saga-2.1.0+dfsg/src/modules/grid/grid_filter/FilterClumps.cpp000066400000000000000000000114321224124640700241420ustar00rootroot00000000000000/********************************************************** * Version $Id: FilterClumps.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* FilterClumps.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "FilterClumps.h" CFilterClumps::CFilterClumps(void){ Set_Name (_TL("Filter Clumps")); Set_Description (_TW( "(c) 2004 by Victor Olaya. Filter Clumps" )); Parameters.Add_Grid(NULL, "GRID", _TL("Input Grid"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "OUTPUT", _TL("Filtered Grid"), _TL(""), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "THRESHOLD", _TL("Min. Size"), _TL("Min. Size (Cells)"), PARAMETER_TYPE_Int, 10); }//constructor CFilterClumps::~CFilterClumps(void) {} bool CFilterClumps::On_Execute(void){ int x,y; int iArea; m_pInputGrid = Parameters("GRID")->asGrid(); m_pOutputGrid = Parameters("OUTPUT")->asGrid(); m_pMaskGrid = SG_Create_Grid(m_pInputGrid); m_pMaskGridB = SG_Create_Grid(m_pInputGrid); int iThreshold = Parameters("THRESHOLD")->asInt(); m_CentralPoints .Clear(); m_AdjPoints .Clear(); m_pMaskGrid->Assign((double)0); m_pMaskGridB->Assign(1); for (x = 1; x < Get_NX()-1; x++){ for (y = 1; y < Get_NY()-1; y++){ if (!m_pInputGrid->is_NoData(x,y) && m_pMaskGrid->asInt(x,y) == 0){ m_CentralPoints.Clear(); m_CentralPoints.Add(x,y); m_pMaskGrid->Set_Value(x,y,1); iArea = CalculateCellBlockArea(); if (iArea < iThreshold){ m_CentralPoints.Clear(); m_CentralPoints.Add(x,y); m_pMaskGridB->Set_NoData(x,y); EliminateClump(); }//if }//if }//for }//for for (x = 0; x < Get_NX(); x++){ for (y = 0; y < Get_NY(); y++){ if (m_pMaskGridB->is_NoData(x,y)){ m_pOutputGrid->Set_NoData(x,y); }//if else{ m_pOutputGrid->Set_Value(x,y,m_pInputGrid->asDouble(x,y)); }//else }//for }//for return true; }//method int CFilterClumps::CalculateCellBlockArea(){ int iX,iY; int iArea = 1; int iClass; while (m_CentralPoints.Get_Count()!=0){ for (int iPt=0; iPtasInt(iX,iY); for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (i!=0 || j!=0){ if (m_pInputGrid->is_InGrid(iX+i,iY+j)){ if (!m_pInputGrid->is_NoData(iX,iY)){ if (m_pInputGrid->asInt(iX+i,iY+j) == iClass && m_pMaskGrid->asInt(iX+i, iY+j) == 0){ iArea++; m_pMaskGrid->Set_Value(iX+i,iY+j,1); m_AdjPoints.Add(iX+i,iY+j); }//if }//if }//if }//if }// for }// for }//for m_CentralPoints.Clear(); for (int i=0; iasInt(iX,iY); for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (i!=0 || j!=0){ if (m_pInputGrid->is_InGrid(iX+i,iY+j)){ if (!m_pInputGrid->is_NoData(iX,iY)){ if (m_pInputGrid->asInt(iX+i,iY+j) == iClass && m_pMaskGridB->asInt(iX+i, iY+j) == 1){ m_pMaskGridB->Set_NoData(iX+i,iY+j); m_AdjPoints.Add(iX+i,iY+j); }//if }//if }//if }//if }// for }// for }//for m_CentralPoints.Clear(); for (int i=0; iasGrid(); pResult = Parameters("RESULT" )->asGrid(); bAbsolute = Parameters("ABSOLUTE" )->asBool(); pFilter = Parameters("FILTER" )->asTable() ? Parameters("FILTER" )->asTable() : Parameters("FILTER_3X3")->asTable(); if( pFilter->Get_Count() < 1 || pFilter->Get_Field_Count() < 1 ) { Error_Set(_TL("invalid filter matrix")); return( false ); } //----------------------------------------------------- Filter.Create(pFilter->Get_Field_Count(), pFilter->Get_Count()); { for(int iy=0; iyGet_Record(iy); for(int ix=0; ixasDouble(ix); } } } int dx = (Filter.Get_NX() - 1) / 2; int dy = (Filter.Get_NY() - 1) / 2; //----------------------------------------------------- if( !pResult || pResult == pInput ) { pResult = SG_Create_Grid(pInput); } else { pResult->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), _TL("Filter"))); pResult->Set_NoData_Value(pInput->Get_NoData_Value()); } //----------------------------------------------------- for(int y=0; yis_InGrid(x, y) ) { for(int iy=0, jy=y-dy; iyis_InGrid(jx, jy) ) { s += Filter[iy][ix] * pInput->asDouble(jx, jy); n += fabs(Filter[iy][ix]); } } } } if( n > 0.0 ) { pResult->Set_Value(x, y, bAbsolute ? s : s / n); } else { pResult->Set_NoData(x, y); } } } //----------------------------------------------------- if( !Parameters("RESULT")->asGrid() || Parameters("RESULT")->asGrid() == pInput ) { pInput->Assign(pResult); delete(pResult); DataObject_Update(pInput); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_3x3.h000066400000000000000000000101421224124640700231150ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_3x3.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_3x3.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Filter_3x3_H #define HEADER_INCLUDED__Filter_3x3_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFilter_3x3 : public CSG_Module_Grid { public: CFilter_3x3(void); protected: virtual bool On_Execute(void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Filter_3x3_H saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Gauss.cpp000066400000000000000000000206001224124640700241150ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Gauss.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Gauss.cpp // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Filter_Gauss.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFilter_Gauss::CFilter_Gauss(void) { //----------------------------------------------------- // 1. Info... Set_Name(_TL("Gaussian Filter")); Set_Author(_TL("Copyrights (c) 2003 by Andre Ringeler")); Set_Description (_TW( "The Gauss Filter is a smoothing operator that is used to `blur' or 'soften' Grid Data\n" "and remove detail and noise.\n" "The degree of smoothing is determined by the standard deviation.\n" "For higher standard deviations you need a greater Radius\n" )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Filtered Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Value( NULL, "SIGMA" , _TL("Standard Deviation"), _TL(""), PARAMETER_TYPE_Double, 1, 0.0001, true ); Parameters.Add_Choice( NULL, "MODE" , _TL("Search Mode"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Square"), _TL("Circle") ), 1 ); Parameters.Add_Value( NULL, "RADIUS" , _TL("Search Radius"), _TL(""), PARAMETER_TYPE_Int, 2, 1, true ); } //--------------------------------------------------------- CFilter_Gauss::~CFilter_Gauss(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_Gauss::On_Execute(void) { int Mode, Radius; double Sigma; CSG_Grid *pResult; //----------------------------------------------------- m_pInput = Parameters("INPUT") ->asGrid(); pResult = Parameters("RESULT") ->asGrid(); Radius = Parameters("RADIUS") ->asInt(); Mode = Parameters("MODE") ->asInt(); Sigma = Parameters("SIGMA") ->asDouble(); //----------------------------------------------------- if( Initialise(Radius, Sigma, Mode) ) { if( !pResult || pResult == m_pInput ) { pResult = SG_Create_Grid(m_pInput); } else { pResult->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pInput->Get_Name(), _TL("Gaussian Filter"))); pResult->Set_NoData_Value(m_pInput->Get_NoData_Value()); } //------------------------------------------------- for(int y=0; yis_InGrid(x, y) ) { pResult->Set_Value(x, y, Get_Mean(x, y)); } else { pResult->Set_NoData(x, y); } } } //------------------------------------------------- if( !Parameters("RESULT")->asGrid() || Parameters("RESULT")->asGrid() == m_pInput ) { m_pInput->Assign(pResult); delete(pResult); DataObject_Update(m_pInput); } m_Weights.Destroy(); return( true ); } return( false ); } //--------------------------------------------------------- bool CFilter_Gauss::Initialise(int Radius, double Sigma, int Mode) { int x, y; double dx, dy, val, min, max; //----------------------------------------------------- m_Weights.Create(SG_DATATYPE_Double, 1 + 2 * Radius, 1 + 2 * Radius); //----------------------------------------------------- for(y=0, dy=-Radius, min=1.0, max=0.0; y Radius ? 0.0 : exp(-(dx*dx + dy*dy) / (2.0 * Sigma*Sigma)) / (M_PI * 2.0 * Sigma*Sigma); break; case 0: val = exp(-(dx*dx + dy*dy) / (2.0 * Sigma*Sigma)) / (M_PI * 2.0 * Sigma*Sigma); break; } m_Weights.Set_Value(x, y, val); if( min > max ) { min = max = val; } else if( val < min ) { min = val; } else if( val > max ) { max = val; } } } //----------------------------------------------------- if( max == 0.0 ) { Message_Dlg(_TL("Radius is too small")); } else if( min / max > 0.367 / 2.0 ) { Message_Dlg(_TL("Radius is too small for your Standard Deviation"), Get_Name()); } else { return( true ); } m_Weights.Destroy(); return( false ); } //--------------------------------------------------------- double CFilter_Gauss::Get_Mean(int x, int y) { int ix, iy, jx, jy; double s, n, w; for(n=0.0, s=0.0, jy=0, iy=y-(m_Weights.Get_NY()-1)/2; jy 0.0 && m_pInput->is_InGrid(ix, iy) ) { s += w * m_pInput->asDouble(ix, iy); n += w; } } } return( n > 0.0 ? s / n : m_pInput->Get_NoData_Value() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Gauss.h000066400000000000000000000077371224124640700236020ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Gauss.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Gauss.h // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@saga-gis.org // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Filter_Gauss_H #define HEADER_INCLUDED__Filter_Gauss_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CFilter_Gauss : public CSG_Module_Grid { public: CFilter_Gauss(void); virtual ~CFilter_Gauss(void); protected: virtual bool On_Execute (void); private: CSG_Grid *m_pInput, m_Weights; bool Initialise (int Radius, double Sigma, int Mode); double Get_Mean (int x, int y); }; //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Filter_Gauss_H saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_LoG.cpp000066400000000000000000000236571224124640700235330ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_LoG.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_LoG.cpp // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Filter_LoG.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFilter_LoG::CFilter_LoG(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Laplacian Filter")); Set_Author (SG_T("(c) 2003 by A. Ringeler, (c) 2008 by O. Conrad")); Set_Description (_TW( "Other Common Names: Laplacian, Laplacian of Gaussian, LoG, Marr Filter\n" "\n" "Standard kernel 1 (3x3):\n" " 0 | -1 | 0\n" "-- + -- + --\n" "-1 | 4 | -1\n" "-- + -- + --\n" " 0 | -1 | 0\n" "\n" "Standard kernel 2 (3x3):\n" "-1 | -1 | -1\n" "-- + -- + --\n" "-1 | 8 | -1\n" "-- + -- + --\n" "-1 | -1 | -1\n" "\n" "Standard kernel 3 (3x3):\n" "-1 | -2 | -1\n" "-- + -- + --\n" "-2 | 12 | -2\n" "-- + -- + --\n" "-1 | -2 | -1\n" "\n" )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL , "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "RESULT" , _TL("Filtered Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("standard kernel 1"), _TL("standard kernel 2"), _TL("Standard kernel 3"), _TL("user defined kernel") ), 3 ); CSG_Parameter *pNode = Parameters.Add_Node(NULL, "NODE_USER", _TL("User Defined Kernel"), _TL("")); Parameters.Add_Value( pNode , "SIGMA" , _TL("Standard Deviation (Percent of Radius)"), _TL(""), PARAMETER_TYPE_Double, 50.0, 0.00001, true ); Parameters.Add_Value( pNode , "RADIUS" , _TL("Radius"), _TL(""), PARAMETER_TYPE_Int, 3, 1, true ); Parameters.Add_Choice( pNode , "MODE" , _TL("Search Mode"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("square"), _TL("circle") ), 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_LoG::On_Execute(void) { CSG_Grid *pResult; //----------------------------------------------------- m_pInput = Parameters("INPUT") ->asGrid(); pResult = Parameters("RESULT") ->asGrid(); //----------------------------------------------------- if( Initialise() ) { if( !pResult || pResult == m_pInput ) { pResult = SG_Create_Grid(m_pInput); } else { pResult->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pInput->Get_Name(), _TL("Laplace Filter"))); pResult->Set_NoData_Value(m_pInput->Get_NoData_Value()); } //------------------------------------------------- for(int y=0; yis_InGrid(x, y) ) { pResult->Set_Value(x, y, Get_Value(x, y)); } else { pResult->Set_NoData(x, y); } } } //------------------------------------------------- if( !Parameters("RESULT")->asGrid() || Parameters("RESULT")->asGrid() == m_pInput ) { m_pInput->Assign(pResult); delete(pResult); pResult = m_pInput; } DataObject_Set_Colors(pResult, 100, SG_COLORS_BLACK_WHITE); m_Kernel.Destroy(); return( true ); } //----------------------------------------------------- return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_LoG::Initialise(void) { int Method = Parameters("METHOD") ->asInt(); bool bCircle = Parameters("MODE") ->asInt() == 1; double Sigma = Parameters("SIGMA") ->asDouble(); switch( Method ) { case 0: m_Radius = 1; m_Kernel.Create(SG_DATATYPE_Double, 3, 3); m_Kernel.Set_Value(0, 0, 0); m_Kernel.Set_Value(0, 1, -1); m_Kernel.Set_Value(0, 2, 0); m_Kernel.Set_Value(1, 0, -1); m_Kernel.Set_Value(1, 1, 4); m_Kernel.Set_Value(1, 2, -1); m_Kernel.Set_Value(2, 0, 0); m_Kernel.Set_Value(2, 1, -1); m_Kernel.Set_Value(2, 2, 0); break; case 1: m_Radius = 1; m_Kernel.Create(SG_DATATYPE_Double, 3, 3); m_Kernel.Set_Value(0, 0, -1); m_Kernel.Set_Value(0, 1, -1); m_Kernel.Set_Value(0, 2, -1); m_Kernel.Set_Value(1, 0, -1); m_Kernel.Set_Value(1, 1, 8); m_Kernel.Set_Value(1, 2, -1); m_Kernel.Set_Value(2, 0, -1); m_Kernel.Set_Value(2, 1, -1); m_Kernel.Set_Value(2, 2, -1); break; case 2: m_Radius = 1; m_Kernel.Create(SG_DATATYPE_Double, 3, 3); m_Kernel.Set_Value(0, 0, -1); m_Kernel.Set_Value(0, 1, -2); m_Kernel.Set_Value(0, 2, -1); m_Kernel.Set_Value(1, 0, -2); m_Kernel.Set_Value(1, 1, 12); m_Kernel.Set_Value(1, 2, -2); m_Kernel.Set_Value(2, 0, -1); m_Kernel.Set_Value(2, 1, -2); m_Kernel.Set_Value(2, 2, -1); break; case 3: default: m_Radius = Parameters("RADIUS")->asInt(); if( Sigma <= 0.0 ) { return( false ); } m_Kernel.Create(SG_DATATYPE_Double, 1 + 2 * m_Radius, 1 + 2 * m_Radius); Sigma = SG_Get_Square(m_Radius * Sigma * 0.01); for(int y=-m_Radius, iy=0; y<=m_Radius; y++, iy++) { for(int x=-m_Radius, ix=0; x<=m_Radius; x++, ix++) { double d = x * x + y * y; if( bCircle && d > m_Radius*m_Radius ) { m_Kernel.Set_NoData(ix, iy); } else { m_Kernel.Set_Value(ix, iy, 1.0 / (M_PI * Sigma*Sigma) * (1.0 - d / (2.0 * Sigma)) * exp(-d / (2.0 * Sigma))); } } } m_Kernel += -m_Kernel.Get_ArithMean(); break; } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- double CFilter_LoG::Get_Value(int x, int y) { double s = 0.0; //----------------------------------------------------- for(int ky=0, iy=y-m_Radius; kyis_InGrid(ix, iy) ? m_pInput->asDouble(ix, iy) : m_pInput->asDouble(x, y)); } } } //----------------------------------------------------- return( s ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_LoG.h000066400000000000000000000111001224124640700231540ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_LoG.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_LoG.h // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@saga-gis.org // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Filter_LoG_H #define HEADER_INCLUDED__Filter_LoG_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFilter_LoG : public CSG_Module_Grid { public: CFilter_LoG(void); protected: virtual bool On_Execute (void); private: int m_Radius; CSG_Grid *m_pInput, m_Kernel; bool Initialise (void); double Get_Value (int x, int y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Filter_LoG_H saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Majority.cpp000066400000000000000000000166571224124640700246520ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Majority.cpp 1086 2011-06-08 10:12:02Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Majority.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Filter_Majority.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFilter_Majority::CFilter_Majority(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Majority Filter")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Majority filter for grids." )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Filtered Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL, "MODE" , _TL("Search Mode"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Square"), _TL("Circle") ), 1 ); Parameters.Add_Value( NULL, "RADIUS" , _TL("Radius"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); Parameters.Add_Value( NULL, "THRESHOLD" , _TL("Threshold [Percent]"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true, 100.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_Majority::On_Execute(void) { int x, y, ix, iy; CSG_Grid *pResult; //----------------------------------------------------- m_pInput = Parameters("INPUT") ->asGrid(); pResult = Parameters("RESULT") ->asGrid(); m_Radius = Parameters("RADIUS") ->asInt(); //----------------------------------------------------- m_Kernel.Create(SG_DATATYPE_Byte, 1 + 2 * m_Radius, 1 + 2 * m_Radius); m_Kernel.Set_NoData_Value(0.0); m_Kernel.Assign(1.0); m_Kernel.Set_Value(m_Radius, m_Radius, 0.0); if( Parameters("MODE")->asInt() == 1 ) { for(y=-m_Radius, iy=0; y<=m_Radius; y++, iy++) { for(x=-m_Radius, ix=0; x<=m_Radius; x++, ix++) { if( x*x + y*y > m_Radius*m_Radius ) { m_Kernel.Set_Value(ix, iy, 0.0); } } } } m_Majority.Create(); m_Threshold = m_Kernel.Get_NoData_Count(); m_Threshold = 1 + (int)(0.01 * Parameters("THRESHOLD")->asDouble() * (1 + m_Kernel.Get_NCells() - m_Kernel.Get_NoData_Count())); //----------------------------------------------------- if( !pResult || pResult == m_pInput ) { pResult = SG_Create_Grid(m_pInput); } else { pResult->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pInput->Get_Name(), _TL("Majority Filter"))); pResult->Set_NoData_Value(m_pInput->Get_NoData_Value()); } //----------------------------------------------------- for(y=0; yis_InGrid(x, y) ) { pResult->Set_Value(x, y, Get_Majority(x, y)); } else { pResult->Set_NoData(x, y); } } } //----------------------------------------------------- if( !Parameters("RESULT")->asGrid() || Parameters("RESULT")->asGrid() == m_pInput ) { m_pInput->Assign(pResult); delete(pResult); DataObject_Update(m_pInput); } m_Kernel .Destroy(); m_Majority .Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- double CFilter_Majority::Get_Majority(int x, int y) { m_Majority.Reset(); m_Majority.Add_Value(m_pInput->asDouble(x, y)); for(int iy=0, jy=y-m_Radius; iyis_InGrid(jx, jy) ) { m_Majority.Add_Value(m_pInput->asDouble(jx, jy)); } } } int Count; double Value; m_Majority.Get_Majority(Value, Count); return( Count > m_Threshold ? Value : m_pInput->asDouble(x, y) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Majority.h000066400000000000000000000107761224124640700243130ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Majority.h 1086 2011-06-08 10:12:02Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Majority.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Filter_Majority_H #define HEADER_INCLUDED__Filter_Majority_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFilter_Majority : public CSG_Module_Grid { public: CFilter_Majority(void); protected: virtual bool On_Execute (void); private: int m_Radius, m_Threshold; CSG_Grid m_Kernel, *m_pInput; CSG_Class_Statistics m_Majority; double Get_Majority (int x, int y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Filter_Majority_H saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Morphology.cpp000066400000000000000000000200551224124640700251760ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Morphology.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Morphology.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Filter_Morphology.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFilter_Morphology::CFilter_Morphology(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Morphological Filter")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Morphological filter for grids." )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Filtered Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL, "MODE" , _TL("Search Mode"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Square"), _TL("Circle") ), 1 ); Parameters.Add_Value( NULL, "RADIUS" , _TL("Radius"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); Parameters.Add_Choice( NULL, "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("Dilation"), _TL("Erosion"), _TL("Opening"), _TL("Closing") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_Morphology::On_Execute(void) { int x, y, ix, iy, Method; double Minimum, Maximum; CSG_Grid *pResult, Result; //----------------------------------------------------- m_pInput = Parameters("INPUT") ->asGrid(); pResult = Parameters("RESULT") ->asGrid(); m_Radius = Parameters("RADIUS") ->asInt(); Method = Parameters("METHOD") ->asInt(); //----------------------------------------------------- m_Kernel.Create(SG_DATATYPE_Byte, 1 + 2 * m_Radius, 1 + 2 * m_Radius); m_Kernel.Set_NoData_Value(0.0); m_Kernel.Assign(1.0); m_Kernel.Set_Value(m_Radius, m_Radius, 0.0); if( Parameters("MODE")->asInt() == 1 ) { for(y=-m_Radius, iy=0; y<=m_Radius; y++, iy++) { for(x=-m_Radius, ix=0; x<=m_Radius; x++, ix++) { if( x*x + y*y > m_Radius*m_Radius ) { m_Kernel.Set_Value(ix, iy, 0.0); } } } } //----------------------------------------------------- if( !pResult || pResult == m_pInput ) { pResult = SG_Create_Grid(m_pInput); } else { pResult->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pInput->Get_Name(), Parameters("METHOD")->asString())); pResult->Set_NoData_Value(m_pInput->Get_NoData_Value()); } //----------------------------------------------------- if( Method == 2 || Method == 3 ) { Result.Create(*Get_System()); for(y=0; ySet_Value(x, y, Maximum); break; // Dilation case 1: case 3: pResult->Set_Value(x, y, Minimum); break; // Erosion } } else { pResult->Set_NoData(x, y); } } } //----------------------------------------------------- if( !Parameters("RESULT")->asGrid() || Parameters("RESULT")->asGrid() == m_pInput ) { m_pInput->Assign(pResult); delete(pResult); DataObject_Update(m_pInput); } m_Kernel.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_Morphology::Get_Range(int x, int y, double &Minimum, double &Maximum) { if( !m_pInput->is_InGrid(x, y) ) { return( false ); } Minimum = Maximum = m_pInput->asDouble(x, y); for(int iy=0, jy=y-m_Radius; iyis_InGrid(jx, jy) ) { double z = m_pInput->asDouble(jx, jy); if( Minimum > z ) { Minimum = z; } else if( Maximum < z ) { Maximum = z; } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Morphology.h000066400000000000000000000110041224124640700246350ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Morphology.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Morphology.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Filter_Morphology_H #define HEADER_INCLUDED__Filter_Morphology_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFilter_Morphology : public CSG_Module_Grid { public: CFilter_Morphology(void); protected: virtual bool On_Execute (void); private: int m_Radius, m_Threshold; CSG_Grid m_Kernel, *m_pInput; bool Get_Range (int x, int y, double &Minimum, double &Maximum); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Filter_Morphology_H saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.cpp000066400000000000000000000426451224124640700255250ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Multi_Dir_Lee.cpp 1610 2013-02-18 11:25:09Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Multi_Dir_Lee.cpp // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// #include "Filter_Multi_Dir_Lee.h" double Filter_Directions[16][9][9] = { { {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5}, {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}, {0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} }, { {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {1.0, 1.0, 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0}, {0.5, 0.5, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.5}, {0.0, 0.0, 0.0, 0.5, 0.5, 0.5, 0.5, 1.0, 1.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} }, { {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {1.0, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.5, 0.5, 1.0, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.5, 0.5, 1.0, 0.5, 0.5, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 1.0, 0.5, 0.5}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 1.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} }, { {0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {1.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.5, 1.0, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.5, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.5, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 1.0, 0.5}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5} }, { {1.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.5, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.5}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0} }, { {0.5, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.5, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.5} }, { {0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0} }, { {0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 1.0, 0.5, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0} }, { {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 1.0, 0.5, 0.0, 0.0, 0.0} } }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFilter_Multi_Dir_Lee::CFilter_Multi_Dir_Lee(void) { //----------------------------------------------------- Set_Name(_TL("Multi Direction Lee Filter")); Set_Author(_TL("Copyrights (c) 2003 by Andre Ringeler")); Set_Description (_TW( "The module searches for the minium variance within 16 directions " "and applies a Lee Filter in the direction of minimum variance. The " "filter is edge-preserving and can be used to remove speckle noise " "from SAR images or to smooth DTMs. Applied to DTMs, this filter " "will preserve slope breaks and narrow valleys.\n\n" "For more details, please refer to:\n" "Lee, J.S. (1980): Digital image enhancement and noise filtering by use of local statistics. " "IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-2: 165-168\n\n" "Lee, J.S., Papathanassiou, K.P., Ainsworth, T.L., Grunes, M.R., Reigber, A. (1998): A " "New Technique for Noise Filtering of SAR Interferometric Phase Images. IEEE " "Transactions on Geosciences and Remote Sensing 36(5): 1456-1465.\n\n" "Selige, T., Böhner, J., Ringeler, A. (2006): Processing of SRTM X-SAR Data to correct interferometric " "elevation models for land surface process applications. In: Böhner, J., McCloy, K.R., Strobl, J. [Eds.]: " "SAGA - Analysis and Modelling Applications. Göttinger Geographische Abhandlungen, Vol. 115: 97-104 " "<PDF>\n" "\n\n" ) ); //----------------------------------------------------- Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Filtered Grid"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL, "STDDEV" , _TL("Minimum Standard Deviation"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "DIR" , _TL("Direction of Minimum Standard Deviation"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Value( NULL, "NOISE_ABS" , _TL("Estimated Noise (absolute)"), _TL("Estimated noise in units of input data"), PARAMETER_TYPE_Double, 1.0 ); Parameters.Add_Value( NULL, "NOISE_REL" , _TL("Estimated Noise (relative)"), _TL("Estimated noise relative to mean standard deviation"), PARAMETER_TYPE_Double, 1.0 ); Parameters.Add_Value( NULL, "WEIGHTED" , _TL("Weighted"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Choice( NULL, "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("noise variance given as absolute value"), _TL("noise variance given relative to mean standard deviation"), _TL("original calculation (Ringeler)") ), 1 ); //----------------------------------------------------- for(int i=1; i<8; i++) // Mirror the last 8 filter directions { for(int y=0; y<9; y++) { for(int x=0; x<9; x++) { Filter_Directions[i + 8][y][x] = Filter_Directions[i][y][8 - x]; } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_Multi_Dir_Lee::On_Execute(void) { bool bResult = false, bWeighted; m_pInput = Parameters("INPUT") ->asGrid(); m_pFiltered = Parameters("RESULT") ->asGrid(); m_pStdDev = Parameters("STDDEV") ->asGrid(); m_pDirection = Parameters("DIR") ->asGrid(); bWeighted = Parameters("WEIGHTED") ->asBool(); switch( Parameters("METHOD")->asInt() ) { case 0: bResult = Get_Filter(bWeighted, true); break; case 1: bResult = Get_Filter(bWeighted, false); break; case 2: bResult = Get_Filter_Ringeler(); break; } m_pFiltered->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pInput->Get_Name(), _TL("Lee Filter"))); if( m_pStdDev ) { m_pStdDev ->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pInput->Get_Name(), _TL("Lee Filter - Standard Deviation"))); } if( m_pDirection ) { m_pDirection ->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pInput->Get_Name(), _TL("Lee Filter - Direction"))); } return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_Multi_Dir_Lee::Get_Filter(bool bWeighted, bool bAbsolute) { int x, y, ix, iy, k, kx, ky, Best_Direction; double Count, Mean, StdDev, Variance, Best_Mean, Best_StdDev, Noise, Noise2; if( bAbsolute ) { Noise = Parameters("NOISE_ABS")->asDouble(); Noise2 = Noise*Noise; } else if( m_pStdDev == NULL ) { Parameters("STDDEV")->Set_Value(m_pStdDev = SG_Create_Grid(*Get_System(), SG_DATATYPE_Float)); } //----------------------------------------------------- for(y=0; yis_NoData(x, y) ) { m_pFiltered ->Set_NoData(x, y); if( m_pStdDev ) m_pStdDev ->Set_NoData(x, y); if( m_pDirection ) m_pDirection ->Set_NoData(x, y); } else { //----------------------------------------- for(k=0; k<16; k++) { Variance = Mean = Count = 0; for(ky=0, iy=y-4; ky<9; iy++, ky++) { for(kx=0, ix=x-4; kx<9; ix++, kx++) { if( m_pInput->is_InGrid(ix, iy) && Filter_Directions[k][ky][kx] > 0.0 ) { double w = bWeighted ? Filter_Directions[k][ky][kx] : 1.0; double z = m_pInput->asDouble(ix, iy); Mean += w * z; Variance += w * z*z; Count += w; } } } Mean = Mean / Count; Variance = Variance / Count - Mean*Mean; StdDev = sqrt(Variance); if( k == 0 || StdDev < Best_StdDev ) { Best_StdDev = StdDev; Best_Mean = Mean; Best_Direction = k; } } //----------------------------------------- if( bAbsolute && Best_StdDev > Noise ) { double b = Best_StdDev*Best_StdDev; b = (b - Noise2) / b; m_pFiltered->Set_Value(x, y, m_pInput->asDouble(x, y) * b + (1.0 - b) * Best_Mean); } else if( Best_StdDev > 0.0 ) { m_pFiltered->Set_Value(x, y, Best_Mean); } else { m_pFiltered->Set_Value(x, y, m_pInput->asDouble(x, y)); } if( m_pStdDev ) m_pStdDev ->Set_Value(x, y, Best_StdDev); if( m_pDirection ) m_pDirection ->Set_Value(x, y, Best_Direction); } } } //----------------------------------------------------- if( !bAbsolute ) { Noise = Parameters("NOISE_REL")->asDouble() * m_pStdDev->Get_ArithMean(); Noise2 = Noise*Noise; for(y=0; yis_NoData(x, y) && (Best_StdDev = m_pStdDev->asDouble(x, y)) > Noise ) { double b = Best_StdDev*Best_StdDev; b = (b - Noise2) / b; m_pFiltered->Set_Value(x, y, m_pInput->asDouble(x, y) * b + (1.0 - b) * m_pFiltered->asDouble(x, y)); } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- const double corr_norm = 109699939.0; const double corr[16] = { 97694238.970824, 103389994.176977, 109699939.129502, 103392028.763373, 103392435.589500, 103392028.763371, 109699939.129499, 103389994.176979, 97694238.970826, 103389994.200091, 109699939.176253, 103392028.826671, 103392435.659830, 103392028.826669, 109699939.176251, 103389994.200092 }; //--------------------------------------------------------- bool CFilter_Multi_Dir_Lee::Get_Filter_Ringeler(void) { int x, y, ix, iy, k, kx, ky, Count, Best_Direction; double Mean, StdDev, Variance, Best_Mean, Best_StdDev, Noise, Noise2; Noise = Parameters("NOISE_ABS")->asDouble(); Noise2 = Noise*Noise; //----------------------------------------------------- for(y=0; yis_NoData(x, y) ) { m_pFiltered->Set_NoData(x, y); if( m_pDirection ) m_pDirection ->Set_NoData(x, y); if( m_pStdDev ) m_pStdDev ->Set_NoData(x, y); } else { //----------------------------------------- for(k=0; k<16; k++) { Variance = Mean = Count = 0; for(ky=0, iy=y-4; ky<9; iy++, ky++) { for(kx=0, ix=x-4; kx<9; ix++, kx++) { if( m_pInput->is_InGrid(ix, iy) && Filter_Directions[k][ky][kx] > 0.0 ) { Mean += m_pInput->asDouble(ix, iy); Count ++; } } } Mean = Mean / Count; for(ky=0, iy=y-4; ky<9; iy++, ky++) { for(kx=0, ix=x-4; kx<9; ix++, kx++) { if( m_pInput->is_InGrid(ix, iy) && Filter_Directions[k][ky][kx] > 0.0 ) { Variance += M_SQR(Mean - m_pInput->asDouble(ix, iy)); } } } StdDev = corr_norm * sqrt(Variance) / (corr[k] * Count); if( k == 0 || StdDev < Best_StdDev ) { Best_StdDev = StdDev; Best_Mean = Mean; Best_Direction = k; } } //----------------------------------------- if( Best_StdDev > Noise ) { double b = Best_StdDev*Best_StdDev; b = (b - Noise2) / b; m_pFiltered->Set_Value(x, y, m_pInput->asDouble(x, y) * b + (1.0 - b) * Best_Mean); } else if( Best_StdDev > 0.0 ) { m_pFiltered->Set_Value(x, y, Best_Mean); } else { m_pFiltered->Set_Value(x, y, m_pInput->asDouble(x, y)); } if( m_pDirection ) m_pDirection ->Set_Value(x, y, Best_Direction); if( m_pStdDev ) m_pStdDev ->Set_Value(x, y, Best_StdDev); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Multi_Dir_Lee.h000066400000000000000000000105131224124640700251570ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Multi_Dir_Lee.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Multi_Dir_Lee.h // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@saga-gis.org // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Filter_Multi_Dir_Lee_H #define HEADER_INCLUDED__Filter_Multi_Dir_Lee_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFilter_Multi_Dir_Lee : public CSG_Module_Grid { public: CFilter_Multi_Dir_Lee(void); protected: virtual bool On_Execute (void); private: CSG_Grid *m_pInput, *m_pFiltered, *m_pStdDev, *m_pDirection; bool Get_Filter (bool bWeighted, bool bAbsolute); bool Get_Filter_Ringeler (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Filter_Multi_Dir_Lee_H saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Rank.cpp000066400000000000000000000166751224124640700237470ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Rank.cpp 1365 2012-03-30 14:21:53Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Rank.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Filter_Rank.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFilter_Rank::CFilter_Rank(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Rank Filter")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Rank filter for grids. Set rank to fifty percent to apply a median filter." )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Filtered Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL, "MODE" , _TL("Search Mode"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Square"), _TL("Circle") ), 1 ); Parameters.Add_Value( NULL, "RADIUS" , _TL("Radius"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); Parameters.Add_Value( NULL, "RANK" , _TL("Rank [Percent]"), _TL(""), PARAMETER_TYPE_Double, 50.0, 0.0, true, 100.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_Rank::On_Execute(void) { int x, y, ix, iy; double Rank; CSG_Grid *pResult; //----------------------------------------------------- m_pInput = Parameters("INPUT" )->asGrid(); pResult = Parameters("RESULT")->asGrid(); Rank = Parameters("RANK" )->asInt() / 100.0; //----------------------------------------------------- m_Kernel.Set_Radius(Parameters("RADIUS")->asInt(), Parameters("MODE")->asInt() == 0); //----------------------------------------------------- if( !pResult || pResult == m_pInput ) { pResult = SG_Create_Grid(m_pInput); } else { pResult->Set_Name(CSG_String::Format(SG_T("%s [%s: %.1f]"), m_pInput->Get_Name(), _TL("Rank"), 100.0 * Rank)); pResult->Set_NoData_Value(m_pInput->Get_NoData_Value()); } //----------------------------------------------------- for(y=0; ySet_Value(x, y, Value); } else { pResult->Set_NoData(x, y); } } } //----------------------------------------------------- if( !Parameters("RESULT")->asGrid() || Parameters("RESULT")->asGrid() == m_pInput ) { m_pInput->Assign(pResult); delete(pResult); DataObject_Update(m_pInput); } m_Kernel.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_Rank::Get_Value(int x, int y, double Rank, double &Value) { if( m_pInput->is_InGrid(x, y) ) { CSG_Table Values; Values.Add_Field(SG_T("Z"), SG_DATATYPE_Double); for(int i=0; iis_InGrid(ix, iy) ) { Values.Add_Record()->Set_Value(0, m_pInput->asDouble(ix, iy)); } } switch( Values.Get_Count() ) { case 0: return( false ); case 1: Value = Values[0].asDouble(0); return( true ); case 2: Value = (Values[0].asDouble(0) + Values[1].asDouble(0)) / 2.0; return( true ); default: { Values.Set_Index(0, TABLE_INDEX_Ascending); Rank = Rank * (Values.Get_Count() - 1.0); int i = (int)Rank; Value = Values.Get_Record_byIndex(i)->asDouble(0); if( Rank - i > 0.0 && i < Values.Get_Count() - 1 ) { Value = (Value + Values.Get_Record_byIndex(i + 1)->asDouble(0)) / 2.0; } } return( true ); } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Rank.h000066400000000000000000000107221224124640700233770ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Rank.h 1365 2012-03-30 14:21:53Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Rank.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Filter_Rank_H #define HEADER_INCLUDED__Filter_Rank_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFilter_Rank : public CSG_Module_Grid { public: CFilter_Rank(void); protected: virtual bool On_Execute (void); private: CSG_Grid_Cell_Addressor m_Kernel; CSG_Grid *m_pInput; bool Get_Value (int x, int y, double Rank, double &Value); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Filter_Rank_H saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Resample.cpp000066400000000000000000000156171224124640700246170ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Resample.cpp 1086 2011-06-08 10:12:02Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Resample.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Filter_Resample.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFilter_Resample::CFilter_Resample(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Resampling Filter")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "Resampling filter for grids. Resamples in a first step the " "given grid to desired resampling cell size, expressed as " "multiple of the original cell size (scale factor). This is an up-scaling " "through which cell values are aggregated as cell area weighted " "means. Second step is the down-scaling to original cell size " "using spline interpolation. Specially for larger search distances " "this is a comparably fast alternative for simple low and high " "pass filter operations. " )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL, "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "LOPASS" , _TL("Low Pass Filter"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL, "HIPASS" , _TL("High Pass Filter"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL, "SCALE" , _TL("Scale Factor"), _TL(""), PARAMETER_TYPE_Double, 10.0, 1.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_Resample::On_Execute(void) { double Cellsize; CSG_Grid *pGrid, *pLoPass, *pHiPass; //----------------------------------------------------- pGrid = Parameters("GRID" )->asGrid(); pLoPass = Parameters("LOPASS")->asGrid(); pHiPass = Parameters("HIPASS")->asGrid(); Cellsize = Parameters("SCALE" )->asDouble() * Get_Cellsize(); //----------------------------------------------------- if( Cellsize > 0.5 * SG_Get_Length(Get_System()->Get_XRange(), Get_System()->Get_YRange()) ) { Error_Set(_TL("resampling cell size is too large")); return( false ); } //----------------------------------------------------- CSG_Grid Grid(CSG_Grid_System(Cellsize, Get_XMin(), Get_YMin(), Get_XMax(), Get_YMax()), SG_DATATYPE_Float); Grid.Assign(pGrid, GRID_INTERPOLATION_Mean_Cells); //----------------------------------------------------- pLoPass->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pGrid->Get_Name(), _TL("Low Pass"))); pHiPass->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pGrid->Get_Name(), _TL("High Pass"))); CSG_Colors Colors; DataObject_Get_Colors(pGrid , Colors); DataObject_Set_Colors(pLoPass, Colors); DataObject_Set_Colors(pHiPass, 11, SG_COLORS_RED_GREY_BLUE); //----------------------------------------------------- for(int y=0; yis_NoData(x, y) && Grid.Get_Value(px, py, z) ) { pLoPass->Set_Value(x, y, z); pHiPass->Set_Value(x, y, pGrid->asDouble(x, y) - z); } else { pLoPass->Set_NoData(x, y); pHiPass->Set_NoData(x, y); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Resample.h000066400000000000000000000107761224124640700242650ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Resample.h 1086 2011-06-08 10:12:02Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Resample.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Filter_Resample_H #define HEADER_INCLUDED__Filter_Resample_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFilter_Resample : public CSG_Module_Grid { public: CFilter_Resample(void); protected: virtual bool On_Execute (void); private: int m_Radius, m_Threshold; CSG_Grid m_Kernel, *m_pInput; CSG_Class_Statistics m_Majority; double Get_Majority (int x, int y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Filter_Resample_H saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.cpp000066400000000000000000000235431224124640700265510ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Terrain_SlopeBased.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Terrain_SlopeBased.cpp // // // // Copyright (C) 2010 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Filter_Terrain_SlopeBased.h" #include "./../grid_tools/Grid_Gaps.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFilter_Terrain_SlopeBased::CFilter_Terrain_SlopeBased(void) { //----------------------------------------------------- Set_Name(_TL("DTM Filter (slope-based)")); Set_Author(_TL("Volker Wichmann (c) 2010, LASERDATA GmbH")); Set_Description (_TW( "The module can be used to filter a digital surface model (DSM), i.e. to classify " "its cells into bare earth and object cells (ground and nonground cells).\n\n" "The module uses concepts described by VOSSELMAN (2000) and is based on the " "assumption that a large height difference between two nearby cells is unlikely " "to be caused by a steep slope in the terrain. The probability that the higher cell " "could be a ground point decreases if the distance between the two cells decreases. " "Therefore the filter defines the acceptable height difference between two cells as " "a function of the distance between the cells. A cell is classified as terrain if " "there is no other cell within the kernel search radius such that the height difference " "between these cells is larger than the allowed maximum height difference at the distance " "between these cells.\n\n" "The approximate terrain slope parameter is used to modify the filter function to match " "the overall slope in the study area. A confidence interval may be used to reject outliers.\n\n" "Reference:\n" "VOSSELMAN, G. (2000): Slope based filtering of laser altimetry data. IAPRS, Vol. XXXIII, " "Part B3, Amsterdam, The Netherlands. pp. 935-942\n\n") ); //----------------------------------------------------- Parameters.Add_Grid( NULL, "INPUT", _TL("Grid to filter"), _TL("The grid to filter."), PARAMETER_INPUT ); Parameters.Add_Value( NULL, "RADIUS", _TL("Search Radius"), _TL("Search radius of kernel in cells."), PARAMETER_TYPE_Int, 2, 1, true ); /*Parameters.Add_Value( NULL, "ITERATIONS", _TL("Iterations"), _TL("Number of iterations, starts with search radius and increments with one cell by iteration."), PARAMETER_TYPE_Int, 1, 1, true );*/ Parameters.Add_Value( NULL, "TERRAINSLOPE", _TL("Approx. Terrain Slope"), _TL("Approximate Terrain Slope [%]"), PARAMETER_TYPE_Double, 30.0, 0.0, true ); Parameters.Add_Value( NULL, "STDDEV", _TL("Use Confidence Interval"), _TL("Use 5 percent confidence interval"), PARAMETER_TYPE_Bool, false ); Parameters.Add_Grid( NULL, "GROUND", _TL("Bare Earth"), _TL("Filtered DTM"), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL, "NONGROUND", _TL("Removed Objects"), _TL("Objects removed from input grid"), PARAMETER_OUTPUT ); } //--------------------------------------------------------- CFilter_Terrain_SlopeBased::~CFilter_Terrain_SlopeBased(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFilter_Terrain_SlopeBased::On_Execute(void) { CSG_Grid *pInput, *pGround, *pNonGround; CSG_Grid_Radius gridRadius; int sradius; int iterations; double tslope; bool bStdDev; CSG_Grid *pFilter; std::vector dzKernel; int gradius; int x, y, ix, iy, iPoint; double dz; int n; double sum, sumsq, stddev, confInter; double min_z, ie; //--------------------------------------------------------- pInput = Parameters("INPUT")->asGrid(); pGround = Parameters("GROUND")->asGrid(); pNonGround = Parameters("NONGROUND")->asGrid(); sradius = Parameters("RADIUS")->asInt() + 1; iterations = 1; //Parameters("ITERATIONS")->asInt(); tslope = Parameters("TERRAINSLOPE")->asDouble() / 100.0; bStdDev = Parameters("STDDEV")->asBool(); //--------------------------------------------------------- pFilter = SG_Create_Grid(SG_DATATYPE_Double, pInput->Get_NX(), pInput->Get_NY(), pInput->Get_Cellsize(), pInput->Get_XMin(), pInput->Get_YMin()); pGround ->Assign(pInput); pFilter ->Assign_NoData(); pNonGround ->Assign_NoData(); for( int iter=0; iterGet_NY() && Set_Progress(y); y++ ) { for( x=0; xGet_NX(); x++ ) { if( !pGround->is_NoData(x, y) ) { if( bStdDev ) { // calc stddev sum = sumsq = 0.0; n = 0; for( iPoint=1; iPointis_InGrid(ix, iy, true) ) { n++; sum += pGround->asDouble(ix, iy); sumsq += pGround->asDouble(ix, iy) * pGround->asDouble(ix, iy); } } stddev = sqrt(sumsq - n * pow(sum/n, 2)) / (n - 1); //stddev = sqrt((sumsq - sum * sum / n) / n); confInter = 1.65 * sqrt(2 * stddev); } else confInter = 0.0; // calc erosion min_z = 999999.0; for( iPoint=1; iPointis_InGrid(ix, iy, true) ) { ie = pGround->asDouble(ix, iy) + dzKernel[iPoint] + confInter; if( ie < min_z ) min_z = ie; } } // classify if( pGround->asDouble(x, y) <= min_z ) pFilter->Set_Value(x, y, pGround->asDouble(x, y)); else pNonGround->Set_Value(x, y, pGround->asDouble(x, y)); }// if not NoData }// for x }// for y pGround->Assign(pFilter); pFilter->Assign_NoData(); gridRadius.Destroy(); /*CGrid_Gaps CloseGaps; if( !CloseGaps.Get_Parameters()->Set_Parameter(SG_T("INPUT") , PARAMETER_TYPE_Grid, pGround) || !CloseGaps.Execute() ) { return( false ); }*/ }// for iter //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_filter/Filter_Terrain_SlopeBased.h000066400000000000000000000106031224124640700262070ustar00rootroot00000000000000/********************************************************** * Version $Id: Filter_Terrain_SlopeBased.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // Filter_Terrain_SlopeBased.h // // // // Copyright (C) 2010 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Filter_Terrain_SlopeBased_H #define HEADER_INCLUDED__Filter_Terrain_SlopeBased_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFilter_Terrain_SlopeBased : public CSG_Module_Grid { public: CFilter_Terrain_SlopeBased(void); virtual ~CFilter_Terrain_SlopeBased(void); protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Filter_Terrain_SlopeBased_H saga-2.1.0+dfsg/src/modules/grid/grid_filter/MLB_Interface.cpp000066400000000000000000000124401224124640700241230ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1535 2012-11-15 12:18:45Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Grid - Filter") ); case MLB_INFO_Author: return( SG_T("SAGA User Group Associaton (c) 2002-10") ); case MLB_INFO_Description: return( _TL("Tools for the manipulation of gridded data.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Grid|Filter") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Filter.h" #include "Filter_Gauss.h" #include "Filter_LoG.h" #include "Filter_Multi_Dir_Lee.h" #include "Filter_3x3.h" #include "FilterClumps.h" #include "Filter_Majority.h" #include "Filter_Terrain_SlopeBased.h" #include "Filter_Morphology.h" #include "Filter_Rank.h" #include "mesh_denoise.h" #include "Filter_Resample.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CFilter ); case 1: return( new CFilter_Gauss ); case 2: return( new CFilter_LoG ); case 3: return( new CFilter_Multi_Dir_Lee ); case 4: return( new CFilter_3x3 ); case 5: return( new CFilterClumps ); case 6: return( new CFilter_Majority ); case 7: return( new CFilter_Terrain_SlopeBased ); case 8: return( new CFilter_Morphology ); case 9: return( new CFilter_Rank ); case 10: return( new CMesh_Denoise_Grid ); case 11: return( new CFilter_Resample ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/grid/grid_filter/MLB_Interface.h000066400000000000000000000077151224124640700236010ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_filter_H #define HEADER_INCLUDED__grid_filter_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef grid_filter_EXPORTS #define grid_filter_EXPORT _SAGA_DLL_EXPORT #else #define grid_filter_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_filter_H saga-2.1.0+dfsg/src/modules/grid/grid_filter/Makefile.am000066400000000000000000000020111224124640700230520ustar00rootroot00000000000000# # $Id: Makefile.am 1535 2012-11-15 12:18:45Z oconrad $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_filter.la libgrid_filter_la_SOURCES =\ Filter.cpp\ Filter_3x3.cpp\ Filter_Gauss.cpp\ Filter_LoG.cpp\ Filter_Majority.cpp\ Filter_Morphology.cpp\ Filter_Multi_Dir_Lee.cpp\ Filter_Rank.cpp\ Filter_Resample.cpp\ Filter_Terrain_SlopeBased.cpp\ FilterClumps.cpp\ mesh_denoise.cpp\ MLB_Interface.cpp\ Filter.h\ Filter_3x3.h\ Filter_Gauss.h\ Filter_LoG.h\ Filter_Majority.h\ Filter_Morphology.h\ Filter_Multi_Dir_Lee.h\ Filter_Rank.h\ Filter_Resample.h\ Filter_Terrain_SlopeBased.h\ FilterClumps.h\ mesh_denoise.h\ MLB_Interface.h libgrid_filter_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/grid/grid_filter/Makefile.in000066400000000000000000000471041224124640700230770ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/grid/grid_filter DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgrid_filter_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgrid_filter_la_OBJECTS = Filter.lo Filter_3x3.lo Filter_Gauss.lo \ Filter_LoG.lo Filter_Majority.lo Filter_Morphology.lo \ Filter_Multi_Dir_Lee.lo Filter_Rank.lo Filter_Resample.lo \ Filter_Terrain_SlopeBased.lo FilterClumps.lo mesh_denoise.lo \ MLB_Interface.lo libgrid_filter_la_OBJECTS = $(am_libgrid_filter_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgrid_filter_la_SOURCES) DIST_SOURCES = $(libgrid_filter_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1535 2012-11-15 12:18:45Z oconrad $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_filter.la libgrid_filter_la_SOURCES = \ Filter.cpp\ Filter_3x3.cpp\ Filter_Gauss.cpp\ Filter_LoG.cpp\ Filter_Majority.cpp\ Filter_Morphology.cpp\ Filter_Multi_Dir_Lee.cpp\ Filter_Rank.cpp\ Filter_Resample.cpp\ Filter_Terrain_SlopeBased.cpp\ FilterClumps.cpp\ mesh_denoise.cpp\ MLB_Interface.cpp\ Filter.h\ Filter_3x3.h\ Filter_Gauss.h\ Filter_LoG.h\ Filter_Majority.h\ Filter_Morphology.h\ Filter_Multi_Dir_Lee.h\ Filter_Rank.h\ Filter_Resample.h\ Filter_Terrain_SlopeBased.h\ FilterClumps.h\ mesh_denoise.h\ MLB_Interface.h libgrid_filter_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/grid/grid_filter/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/grid/grid_filter/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgrid_filter.la: $(libgrid_filter_la_OBJECTS) $(libgrid_filter_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgrid_filter_la_OBJECTS) $(libgrid_filter_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Filter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FilterClumps.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Filter_3x3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Filter_Gauss.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Filter_LoG.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Filter_Majority.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Filter_Morphology.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Filter_Multi_Dir_Lee.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Filter_Rank.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Filter_Resample.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Filter_Terrain_SlopeBased.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mesh_denoise.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/grid/grid_filter/mesh_denoise.cpp000066400000000000000000000771571224124640700242130ustar00rootroot00000000000000/********************************************************** * Version $Id: template.cpp 911 2011-11-11 11:11:11Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Filter // // // //-------------------------------------------------------// // // // m_denoise_grid.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "mesh_denoise.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CMesh_Denoise_Grid::CMesh_Denoise_Grid(void) { Set_Name (_TL("Mesh Denoise")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "Mesh denoising for grids, using the algorithm of Sun et al. (2007).\n" "References:\n" "Cardiff University: Filtering and Processing of Irregular Meshes with Uncertainties. " "online.\n" "Stevenson, J.A., Sun, X., Mitchell, N.C. (2010): " "Despeckling SRTM and other topographic data with a denoising algorithm, " "Geomorphology, Vol.114, No.3, pp.238-252.\n" "Sun, X., Rosin, P.L., Martin, R.R., Langbein, F.C. (2007): " "Fast and effective feature-preserving mesh denoising. " "IEEE Transactions on Visualization and Computer Graphics, Vol.13, No.5, pp.925-938.\n" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Denoised Grid"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "SIGMA" , _TL("Threshold"), _TL(""), PARAMETER_TYPE_Double, 0.9, 0.0, true, 1.0, true ); Parameters.Add_Value( NULL , "ITER" , _TL("Number of Iterations for Normal Updating"), _TL(""), PARAMETER_TYPE_Int, 5, 1, true ); Parameters.Add_Value( NULL , "VITER" , _TL("Number of Iterations for Vertex Updating"), _TL(""), PARAMETER_TYPE_Int, 50, 1, true ); Parameters.Add_Choice( NULL , "NB_CV" , _TL("Common Edge Type of Face Neighbourhood"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Common Vertex"), _TL("Common Edge") ), 0 ); Parameters.Add_Value( NULL , "ZONLY" , _TL("Only Z-Direction Position is Updated"), _TL(""), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CMesh_Denoise_Grid::On_Execute(void) { CMesh_Denoise Denoise; Denoise.Set_Sigma (Parameters("SIGMA")->asDouble()); Denoise.Set_Iterations (Parameters("ITER" )->asInt ()); Denoise.Set_VIterations (Parameters("VITER")->asInt ()); Denoise.Set_NB_CV (Parameters("NB_CV")->asBool ()); Denoise.Set_ZOnly (Parameters("ZONLY")->asBool ()); return( Denoise.Denoise(Parameters("INPUT")->asGrid(), Parameters("OUTPUT")->asGrid()) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // MDenoise.cpp: Feature-Preserving Mesh Denoising. // Copyright (C) 2007 Cardiff University, UK // // Version: 1.0 // // Author: Xianfang Sun // // Reference: // @article{SRML071, // author = "Xianfang Sun and Paul L. Rosin and Ralph R. Martin and Frank C. Langbein", // title = "Fast and effective feature-preserving mesh denoising", // journal = "IEEE Transactions on Visualization and Computer Graphics", // volume = "13", // number = "5", // pages = "925--938", // year = "2007", // } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CMesh_Denoise::CMesh_Denoise(void) { m_bNeighbourCV = true; m_bZOnly = false; // only z-direction position is updated m_fSigma = 0.4; m_nIterations = 20; m_nVIterations = 50; m_ppnVRing1V = NULL; m_ppnVRing1T = NULL; m_ppnTRing1TCV = NULL; m_ppnTRing1TCE = NULL; m_pf3Vertex = NULL; m_pn3Face = NULL; m_pf3FaceNormal = NULL; m_pf3VertexNormal = NULL; m_pf3VertexP = NULL; m_pn3FaceP = NULL; m_pf3FaceNormalP = NULL; m_pf3VertexNormalP = NULL; } //--------------------------------------------------------- CMesh_Denoise::~CMesh_Denoise(void) { Destroy(); } //--------------------------------------------------------- #define FREE_ARRAY(A, N) if( A ) { for(int i=0; iGet_NCells() * sizeof(int)); m_nNumFace = Set_Data(pInput, index); //----------------------------------------------------- //Denoising Model... MeshDenoise(m_bNeighbourCV, m_fSigma, m_nIterations, m_nVIterations); //----------------------------------------------------- //Saving Model... pOutput->Create(pInput); pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), _TL("Denoised"))); Get_Data(pOutput, index); SG_Free(index); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CMesh_Denoise::Set_Data(CSG_Grid *pGrid, int *index) { int i, x, y; //----------------------------------------------------- m_nNumFace = 0; m_nNumVertex = 0; m_pf3Vertex = (FVECTOR3 *)SG_Malloc(pGrid->Get_NCells() * sizeof(FVECTOR3)); m_pn3Face = (NVECTOR3 *)SG_Malloc(2 * (pGrid->Get_NX() - 1) * (pGrid->Get_NY() - 1) * sizeof(NVECTOR3)); //----------------------------------------------------- for(y=0; yGet_NY(); y++) { for(x=0; xGet_NX(); x++) { int k = x + y * pGrid->Get_NX(); if( pGrid->is_NoData(x, y) ) { index[k] = -1; } else { m_pf3Vertex[m_nNumVertex][0] = y * pGrid->Get_Cellsize(); m_pf3Vertex[m_nNumVertex][1] = x * pGrid->Get_Cellsize(); m_pf3Vertex[m_nNumVertex][2] = pGrid->asDouble(x, y); index[k] = m_nNumVertex++; } } } //----------------------------------------------------- m_pf3Vertex = (FVECTOR3 *)SG_Realloc(m_pf3Vertex, m_nNumVertex * sizeof(FVECTOR3)); for(y=0; yGet_NY()-1; y++) { for(x=0; xGet_NX()-1; x++) { int k = 4, kk[4]; kk[0] = x + y * pGrid->Get_NX(); kk[1] = kk[0] + 1; kk[2] = kk[0] + pGrid->Get_NX(); kk[3] = kk[2] + 1; for(i=0; i<4; i++) { if( index[kk[i]] < 0 ) { if( k < i ) { k = 5; break; } else { k = i; } } } switch( k ) { case 0: m_pn3Face[m_nNumFace][0] = index[kk[1]]; m_pn3Face[m_nNumFace][1] = index[kk[3]]; m_pn3Face[m_nNumFace][2] = index[kk[2]]; m_nNumFace++; break; case 1: m_pn3Face[m_nNumFace][0] = index[kk[0]]; m_pn3Face[m_nNumFace][1] = index[kk[3]]; m_pn3Face[m_nNumFace][2] = index[kk[2]]; m_nNumFace++; break; case 2: m_pn3Face[m_nNumFace][0] = index[kk[1]]; m_pn3Face[m_nNumFace][1] = index[kk[3]]; m_pn3Face[m_nNumFace][2] = index[kk[0]]; m_nNumFace++; break; case 3: m_pn3Face[m_nNumFace][0] = index[kk[0]]; m_pn3Face[m_nNumFace][1] = index[kk[1]]; m_pn3Face[m_nNumFace][2] = index[kk[2]]; m_nNumFace++; break; case 4: //generate two triangles with minimum total area if( ( fabs(pGrid->asDouble(index[kk[2]]) - pGrid->asDouble(index[kk[0]])) > fabs(pGrid->asDouble(index[kk[3]]) - pGrid->asDouble(index[kk[1]])) ) && ( fabs(pGrid->asDouble(index[kk[1]]) - pGrid->asDouble(index[kk[0]])) > fabs(pGrid->asDouble(index[kk[3]]) - pGrid->asDouble(index[kk[2]])) ) ) { m_pn3Face[m_nNumFace][0] = index[kk[0]]; m_pn3Face[m_nNumFace][1] = index[kk[1]]; m_pn3Face[m_nNumFace][2] = index[kk[2]]; m_nNumFace++; m_pn3Face[m_nNumFace][0] = index[kk[1]]; m_pn3Face[m_nNumFace][1] = index[kk[3]]; m_pn3Face[m_nNumFace][2] = index[kk[2]]; m_nNumFace++; } else { m_pn3Face[m_nNumFace][0] = index[kk[1]]; m_pn3Face[m_nNumFace][1] = index[kk[3]]; m_pn3Face[m_nNumFace][2] = index[kk[0]]; m_nNumFace++; m_pn3Face[m_nNumFace][0] = index[kk[0]]; m_pn3Face[m_nNumFace][1] = index[kk[3]]; m_pn3Face[m_nNumFace][2] = index[kk[2]]; m_nNumFace++; } } } } m_pn3Face = (NVECTOR3 *)SG_Realloc(m_pn3Face, m_nNumFace*sizeof(NVECTOR3)); //----------------------------------------------------- ScalingBox(); // scale to a box ComputeNormal(false); m_nNumVertexP = m_nNumVertex; m_nNumFaceP = m_nNumFace; m_pf3VertexP = (FVECTOR3 *)SG_Malloc(m_nNumVertexP * sizeof(FVECTOR3)); m_pn3FaceP = (NVECTOR3 *)SG_Malloc(m_nNumFaceP * sizeof(NVECTOR3)); m_pf3VertexNormalP = (FVECTOR3 *)SG_Malloc(m_nNumVertexP * sizeof(FVECTOR3)); m_pf3FaceNormalP = (FVECTOR3 *)SG_Malloc(m_nNumFaceP * sizeof(FVECTOR3)); for(int i=0; iGet_NY(); y++) { for(int x=0; xGet_NX(); x++) { int k = index[x + y * pGrid->Get_NX()]; if( k < 0 ) { pGrid->Set_NoData(x, y); } else { pGrid->Set_Value(x, y, m_pf3VertexP[k][2]); } } } } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CMesh_Denoise::ScalingBox(void) { int i,j; double box[2][3]; box[0][0] = box[0][1] = box[0][2] = FLT_MAX; box[1][0] = box[1][1] = box[1][2] = -FLT_MAX; for (i=0;im_pf3Vertex[i][j]) box[0][j] = m_pf3Vertex[i][j]; if (box[1][j]4) { tmp--; break; } m_ppnTRing1TCE[k][tmp] = m_ppnVRing1T[tmp0][i]; } } for (i=1; i4) { tmp--; break; } m_ppnTRing1TCE[k][tmp] = m_ppnVRing1T[tmp1][i]; break; } else if((m_pn3Face[m_ppnVRing1T[tmp1][i]][0] == tmp2)&&\ ((m_pn3Face[m_ppnVRing1T[tmp1][i]][1] == tmp1)||(m_pn3Face[m_ppnVRing1T[tmp1][i]][2] == tmp1))) { tmp++; if (tmp>4) { tmp--; break; } m_ppnTRing1TCE[k][tmp] = m_ppnVRing1T[tmp1][i]; break; } else if((m_pn3Face[m_ppnVRing1T[tmp1][i]][1] == tmp2)&&(m_pn3Face[m_ppnVRing1T[tmp1][i]][2] == tmp1)) { tmp++; if (tmp>4) { tmp--; break; } m_ppnTRing1TCE[k][tmp] = m_ppnVRing1T[tmp1][i]; break; } else if((m_pn3Face[m_ppnVRing1T[tmp1][i]][1] == tmp1)&&\ (m_pn3Face[m_ppnVRing1T[tmp1][i]][2] == tmp2)&&(m_pn3Face[m_ppnVRing1T[tmp1][i]][0] != tmp0)) { tmp++; if (tmp>4) { tmp--; break; } m_ppnTRing1TCE[k][tmp] = m_ppnVRing1T[tmp1][i]; break; } } m_ppnTRing1TCE[k][0] = tmp; } } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CMesh_Denoise::MeshDenoise(bool bNeighbourCV, double fSigma, int nIterations, int nVIterations) { int **ttRing; //store the list of triangle neighbours of a triangle FVECTOR3 *Vertex; FVECTOR3 *TNormal; int i,k,m; double tmp3; if (m_nNumFace == 0) return; SG_FREE_SAFE(m_pf3VertexP); SG_FREE_SAFE(m_pf3VertexNormalP); SG_FREE_SAFE(m_pf3FaceNormalP); ComputeVRing1V(); //find the neighbouring vertices of each vertex ComputeVRing1T(); //find the neighbouring triangles of each vertex //find out the neighbouring triangles of each triangle if (bNeighbourCV) { ComputeTRing1TCV(); ttRing = m_ppnTRing1TCV; for (k=0; k 0.0) { VEC3_V_OP_V_OP_S(m_pf3FaceNormalP[k],m_pf3FaceNormalP[k], +, TNormal[ttRing[k][i]], *, tmp3*tmp3); } } V3Normalize(m_pf3FaceNormalP[k]); } for(k=0; k(y) ? (x) : (y)) #define VEC3_ZERO(vec) { (vec)[0]=(vec)[1]=(vec)[2]=0; } #define VEC3_EQ(a,b) (((a)[0]==(b)[0]) && ((a)[1]==(b)[1]) && ((a)[2]==(b)[2])) #define VEC3_V_OP_S(a,b,op,c) {\ (a)[0] = (b)[0] op (c); \ (a)[1] = (b)[1] op (c); \ (a)[2] = (b)[2] op (c); } #define VEC3_V_OP_V(a,b,op,c) {\ (a)[0] = (b)[0] op (c)[0]; \ (a)[1] = (b)[1] op (c)[1]; \ (a)[2] = (b)[2] op (c)[2]; } #define VEC3_V_OP_V_OP_S(a,b,op1,c,op2,d) {\ (a)[0] = (b)[0] op1 (c)[0] op2 (d); \ (a)[1] = (b)[1] op1 (c)[1] op2 (d); \ (a)[2] = (b)[2] op1 (c)[2] op2 (d); } #define VEC3_VOPV_OP_S(a,b,op1,c,op2,d) {\ (a)[0] = ((b)[0] op1 (c)[0]) op2 (d); \ (a)[1] = ((b)[1] op1 (c)[1]) op2 (d); \ (a)[2] = ((b)[2] op1 (c)[2]) op2 (d); } #define VEC3_V_OP_V_OP_V(a,b,op1,c,op2,d) {\ (a)[0] = (b)[0] op1 (c)[0] op2 (d)[0]; \ (a)[1] = (b)[1] op1 (c)[1] op2 (d)[1]; \ (a)[2] = (b)[2] op1 (c)[2] op2 (d)[2]; } #define VEC3_ASN_OP(a,op,b) { a[0] op b[0]; a[1] op b[1]; a[2] op b[2]; } #define DOTPROD3(a, b) ((a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2]) #define CROSSPROD3(a,b,c) {\ (a)[0] = (b)[1]*(c)[2]-(b)[2]*(c)[1]; \ (a)[1] = (b)[2]*(c)[0]-(b)[0]*(c)[2]; \ (a)[2] = (b)[0]*(c)[1]-(b)[1]*(c)[0]; } /////////////////////////////////////////////////////////// // // // Original Mesh // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CMesh_Denoise { public: CMesh_Denoise(void); ~CMesh_Denoise(void); void Destroy (void); bool Denoise (CSG_Grid *pInput, CSG_Grid *pOutput); void Set_Sigma (double d) { if( d >= 0.0 && d <= 1.0 ) m_fSigma = d; } void Set_Iterations (int i) { if( i >= 1 ) m_nIterations = i; } void Set_VIterations (int i) { if( i >= 1 ) m_nVIterations = i; } void Set_NB_CV (bool b) { m_bNeighbourCV = b; } void Set_ZOnly (bool b) { m_bZOnly = b; } private: bool m_bNeighbourCV, m_bZOnly; int m_nIterations, m_nVIterations, m_nNumVertex, m_nNumFace, m_nNumVertexP, m_nNumFaceP; double m_fSigma, m_fScale, m_f3Centre[3]; int **m_ppnVRing1V; // 1-ring neighbouring vertices of each vertex int **m_ppnVRing1T; // 1-ring neighbouring triangles of each vertex int **m_ppnTRing1TCV; // 1-ring neighbouring triangles with common vertex of each triangle int **m_ppnTRing1TCE; // 1-ring neighbouring triangles with common edge of each triangle NVECTOR3 *m_pn3Face, *m_pn3FaceP; FVECTOR3 *m_pf3Vertex , *m_pf3FaceNormal , *m_pf3VertexNormal; FVECTOR3 *m_pf3VertexP, *m_pf3FaceNormalP, *m_pf3VertexNormalP; int Set_Data (CSG_Grid *pGrid, int *Index); void Get_Data (CSG_Grid *pGrid, int *Index); // Preprocessing Operations void ScalingBox (void); void V3Normalize (FVECTOR3 v); void ComputeNormal (bool bProduced); void ComputeVRing1V (void); void ComputeVRing1T (void); void ComputeTRing1TCV (void); void ComputeTRing1TCE (void); // Main Operations void MeshDenoise (bool bNeighbourCV, double fSigma, int nIterations, int nVIterations); void VertexUpdate (int** tRing, int nVIterations); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__mesh_denoise_H saga-2.1.0+dfsg/src/modules/grid/grid_gridding/000077500000000000000000000000001224124640700213265ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Interpolation.cpp000066400000000000000000000203421224124640700246620ustar00rootroot00000000000000/********************************************************** * Version $Id: Interpolation.cpp 1731 2013-06-18 09:35:58Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Interpolation.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Interpolation.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CInterpolation::CInterpolation(void) { CSG_Parameter *pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("") ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TARGET" , _TL("Target Grid"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("user defined"), _TL("grid") ), 0 ); m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid") , _TL(""))); m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid") , _TL(""))); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CInterpolation::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CInterpolation::On_Execute(void) { bool bResult = false; //----------------------------------------------------- m_pShapes = Parameters("SHAPES") ->asShapes(); m_zField = Parameters("FIELD") ->asInt(); //----------------------------------------------------- m_pGrid = NULL; switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... if( m_Grid_Target.Init_User(m_pShapes->Get_Extent()) && Dlg_Parameters("USER") ) { m_pGrid = m_Grid_Target.Get_User(); } break; case 1: // grid... if( Dlg_Parameters("GRID") ) { m_pGrid = m_Grid_Target.Get_Grid(); } break; } //----------------------------------------------------- if( m_pGrid ) { m_pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("FIELD")->asString(), Get_Name().c_str())); bResult = Interpolate(); } //----------------------------------------------------- m_Search.Destroy(); if( m_pShapes != Parameters("SHAPES")->asShapes() ) { delete(m_pShapes); } return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CInterpolation::Interpolate(void) { if( On_Initialize() ) { int ix, iy; double x, y, z; for(iy=0, y=m_pGrid->Get_YMin(); iyGet_NY() && Set_Progress(iy, m_pGrid->Get_NY()); iy++, y+=m_pGrid->Get_Cellsize()) { for(ix=0, x=m_pGrid->Get_XMin(); ixGet_NX(); ix++, x+=m_pGrid->Get_Cellsize()) { if( Get_Value(x, y, z) ) { m_pGrid->Set_Value(ix, iy, z); } else { m_pGrid->Set_NoData(ix, iy); } } } On_Finalize(); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Shapes * CInterpolation::Get_Points(bool bOnlyNonPoints) { m_pShapes = Parameters("SHAPES") ->asShapes(); if( !bOnlyNonPoints || m_pShapes->Get_Type() != SHAPE_TYPE_Point ) { CSG_Shapes *pPoints = SG_Create_Shapes(SHAPE_TYPE_Point); pPoints->Set_NoData_Value_Range(m_pShapes->Get_NoData_Value(), m_pShapes->Get_NoData_hiValue()); pPoints->Add_Field(SG_T("Z"), SG_DATATYPE_Double); for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, m_pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = m_pShapes->Get_Shape(iShape); if( !pShape->is_NoData(m_zField) ) { for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { CSG_Shape *pPoint = pPoints->Add_Shape(); pPoint->Add_Point(pShape->Get_Point(iPoint, iPart)); pPoint->Set_Value(0, pShape->asDouble(m_zField)); } } } } m_zField = 0; m_pShapes = pPoints; } return( m_pShapes ); } //--------------------------------------------------------- bool CInterpolation::Set_Search_Engine(void) { return( m_Search.Create(m_pShapes, m_zField) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Interpolation.h000066400000000000000000000120561224124640700243320ustar00rootroot00000000000000/********************************************************** * Version $Id: Interpolation.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Interpolation.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Interpolation_H #define HEADER_INCLUDED__Interpolation_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_gridding_EXPORT CInterpolation : public CSG_Module { public: CInterpolation(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Interpolation from Points") ); } protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); int m_zField; CSG_PRQuadTree m_Search; CSG_Grid *m_pGrid; CSG_Shapes *m_pShapes; virtual bool Interpolate (void); virtual bool On_Initialize (void) { return( true ); } virtual bool On_Finalize (void) { return( true ); } virtual bool Get_Value (double x, double y, double &z) { return( true ); } CSG_Shapes * Get_Points (bool bOnlyNonPoints = false); bool Set_Search_Engine (void); private: CSG_Parameters_Grid_Target m_Grid_Target; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Interpolation_H saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Interpolation_AngularDistance.cpp000066400000000000000000000252441224124640700300140ustar00rootroot00000000000000/********************************************************** * Version $Id: Interpolation_AngularDistance.cpp 1482 2012-10-08 16:15:45Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Interpolation_AngularDistance.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Interpolation_AngularDistance.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CInterpolation_AngularDistance::CInterpolation_AngularDistance(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Angular Distance Weighted")); Set_Author (SG_T("O.Conrad (c) 2013")); Set_Description (_TW( "Angular Distance Weighted (ADW) grid interpolation from irregular distributed points.\n" "\n" "References:\n" "Shepard, D. (1968): A Two-Dimensional Interpolation Function for Irregularly-Spaced Data. " "Proceedings of the 1968 23rd ACM National Conference, pp.517-524, " "online.\n" )); //----------------------------------------------------- CSG_Parameter *pSearch = Parameters.Add_Node( NULL , "NODE_SEARCH" , _TL("Search Options"), _TL("") ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_RANGE" , _TL("Search Range"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("local"), _TL("global") ) ); Parameters.Add_Value( pNode , "SEARCH_RADIUS" , _TL("Maximum Search Distance"), _TL("local maximum search distance given in map units"), PARAMETER_TYPE_Double , 1000.0, 0, true ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_POINTS_ALL" , _TL("Number of Points"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("maximum number of nearest points"), _TL("all points within search distance") ) ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MAX" , _TL("Maximum Number of Points"), _TL("maximum number of nearest points"), PARAMETER_TYPE_Int, 20, 1, true ); Parameters.Add_Choice( pNode , "SEARCH_DIRECTION" , _TL("Search Direction"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("all directions"), _TL("quadrants") ) ); //----------------------------------------------------- pNode = Parameters.Add_Choice( NULL , "WEIGHTING" , _TL("Distance Weighting"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("inverse distance to a power"), _TL("linearly decreasing within search radius"), _TL("exponential weighting scheme"), _TL("gaussian weighting scheme") ), 0 ); Parameters.Add_Value( pNode , "WEIGHT_POWER" , _TL("Power"), _TL(""), PARAMETER_TYPE_Double , 2.0 ); Parameters.Add_Value( pNode , "WEIGHT_BANDWIDTH" , _TL("Bandwidth"), _TL(""), PARAMETER_TYPE_Double , 1.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CInterpolation_AngularDistance::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) ) { pParameters->Get_Parameter("SEARCH_RADIUS" )->Set_Enabled(pParameter->asInt() == 0); // local } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) ) { pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0); // maximum number of points pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0); // maximum number of points per quadrant } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("WEIGHTING")) ) { pParameters->Get_Parameter("WEIGHT_POWER" )->Set_Enabled(pParameter->asInt() == 0); // idw to a power pParameters->Get_Parameter("WEIGHT_BANDWIDTH" )->Set_Enabled(pParameter->asInt() >= 2); // exponential or gaussian } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CInterpolation_AngularDistance::On_Initialize(void) { m_Weighting = Parameters("WEIGHTING" )->asInt(); m_Power = Parameters("WEIGHT_POWER" )->asDouble(); m_Bandwidth = Parameters("WEIGHT_BANDWIDTH" )->asDouble(); m_nPoints_Max = Parameters("SEARCH_POINTS_ALL")->asInt() == 0 ? Parameters("SEARCH_POINTS_MAX")->asInt () : 0; m_Radius = Parameters("SEARCH_RANGE" )->asInt() == 0 ? Parameters("SEARCH_RADIUS" )->asDouble() : 0.0; m_iQuadrant = Parameters("SEARCH_DIRECTION" )->asInt() == 0 ? -1 : 4; return( (m_nPoints_Max <= 0 && m_Radius <= 0.0) || Set_Search_Engine() ); } //--------------------------------------------------------- inline double CInterpolation_AngularDistance::Get_Weight(double Distance) { switch( m_Weighting ) { default: return( Distance > 0.0 ? pow(Distance, -m_Power) : -1.0 ); case 1: return( Distance < m_Radius ? (1.0 - Distance / m_Radius) : 0.0 ); case 2: return( exp(-Distance / m_Bandwidth) ); case 3: return( exp(-0.5 * SG_Get_Square(Distance / m_Bandwidth)) ); } } //--------------------------------------------------------- int CInterpolation_AngularDistance::Get_Count(double x, double y) { if( m_nPoints_Max > 0 || m_Radius > 0.0 ) // using search engine { return( m_Search.Select_Nearest_Points(x, y, m_nPoints_Max, m_Radius, m_iQuadrant) ); } return( m_pShapes->Get_Count() ); // without search engine } //--------------------------------------------------------- inline bool CInterpolation_AngularDistance::Get_Point(int iPoint, double x, double y, double &ix, double &iy, double &id, double &iw, double &iz) { if( m_nPoints_Max > 0 || m_Radius > 0.0 ) // using search engine { if( m_Search.Get_Selected_Point(iPoint, ix, iy, iz) ) { id = SG_Get_Distance(x, y, ix, iy); iw = Get_Weight(id); return( true ); } } //----------------------------------------------------- CSG_Shape *pPoint = m_pShapes->Get_Shape(iPoint); // without search engine if( pPoint ) { TSG_Point p = pPoint->Get_Point(0); ix = p.x; iy = p.y; iz = pPoint->asDouble(m_zField); id = SG_Get_Distance(x, y, ix, iy); iw = Get_Weight(id); return( true ); } return( false ); } //--------------------------------------------------------- bool CInterpolation_AngularDistance::Get_Value(double x, double y, double &z) { int i, j, n; if( (n = Get_Count(x, y)) <= 0 ) { return( false ); } //----------------------------------------------------- CSG_Vector X(n), Y(n), D(n), W(n), Z(n); for(i=0; iGet_Identifier(), SG_T("SEARCH_RANGE")) ) { pParameters->Get_Parameter("SEARCH_RADIUS" )->Set_Enabled(pParameter->asInt() == 0); // local } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) ) { pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0); // maximum number of points pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0); // maximum number of points per quadrant } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("WEIGHTING")) ) { pParameters->Get_Parameter("WEIGHT_POWER" )->Set_Enabled(pParameter->asInt() == 0); // idw to a power pParameters->Get_Parameter("WEIGHT_BANDWIDTH" )->Set_Enabled(pParameter->asInt() >= 2); // exponential or gaussian } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CInterpolation_InverseDistance::On_Initialize(void) { m_Weighting = Parameters("WEIGHTING" )->asInt(); m_Power = Parameters("WEIGHT_POWER" )->asDouble(); m_Bandwidth = Parameters("WEIGHT_BANDWIDTH" )->asDouble(); m_nPoints_Max = Parameters("SEARCH_POINTS_ALL")->asInt() == 0 ? Parameters("SEARCH_POINTS_MAX")->asInt () : 0; m_Radius = Parameters("SEARCH_RANGE" )->asInt() == 0 ? Parameters("SEARCH_RADIUS" )->asDouble() : 0.0; m_iQuadrant = Parameters("SEARCH_DIRECTION" )->asInt() == 0 ? -1 : 4; return( (m_nPoints_Max <= 0 && m_Radius <= 0.0) || Set_Search_Engine() ); } //--------------------------------------------------------- inline double CInterpolation_InverseDistance::Get_Weight(double Distance) { switch( m_Weighting ) { default: return( Distance > 0.0 ? pow(Distance, -m_Power) : -1.0 ); case 1: return( Distance < m_Radius ? (1.0 - Distance / m_Radius) : 0.0 ); case 2: return( exp(-Distance / m_Bandwidth) ); case 3: return( exp(-0.5 * SG_Get_Square(Distance / m_Bandwidth)) ); } } //--------------------------------------------------------- int CInterpolation_InverseDistance::Get_Count(double x, double y) { if( m_nPoints_Max > 0 || m_Radius > 0.0 ) // using search engine { return( m_Search.Select_Nearest_Points(x, y, m_nPoints_Max, m_Radius, m_iQuadrant) ); } return( m_pShapes->Get_Count() ); // without search engine } //--------------------------------------------------------- inline bool CInterpolation_InverseDistance::Get_Point(int iPoint, double x, double y, double &w, double &z) { TSG_Point p; if( m_nPoints_Max > 0 || m_Radius > 0.0 ) // using search engine { if( !m_Search.Get_Selected_Point(iPoint, p.x, p.y, z) ) { return( false ); } } else // without search engine { CSG_Shape *pPoint = m_pShapes->Get_Shape(iPoint); if( !pPoint ) { return( false ); } p = pPoint->Get_Point(0); z = pPoint->asDouble(m_zField); } w = Get_Weight(SG_Get_Distance(x, y, p.x, p.y)); return( true ); } //--------------------------------------------------------- bool CInterpolation_InverseDistance::Get_Value(double x, double y, double &z) { int nPoints = Get_Count(x, y); if( nPoints <= 0 ) { return( false ); } //----------------------------------------------------- CSG_Simple_Statistics s; for(int iPoint=0; iPointasBool() ? SIBSON : NON_SIBSONIAN; //----------------------------------------------------- point *pSrc = (point *)SG_Malloc(m_pShapes->Get_Count() * sizeof(point)); double *zSrc = (double *)SG_Malloc(m_pShapes->Get_Count() * sizeof(double)); for(i=0, n=0; iGet_Count() && Set_Progress(i, m_pShapes->Get_Count()); i++) { CSG_Shape *pShape = m_pShapes->Get_Shape(i); if( !pShape->is_NoData(m_zField) ) { pSrc[n].x = pShape->Get_Point(0).x; pSrc[n].y = pShape->Get_Point(0).y; pSrc[n].z = zSrc[n] = pShape->asDouble(m_zField); if( n == 0 ) zMin = zMax = pSrc[n].z; else if( zMin > pSrc[n].z ) zMin = pSrc[n].z; else if( zMax < pSrc[n].z ) zMax = pSrc[n].z; n++; } } Process_Set_Text(_TL("triangulating")); delaunay *pTIN = delaunay_build(n, pSrc, 0, NULL, 0, NULL); //----------------------------------------------------- double *xDst = (double *)SG_Malloc((long) m_pGrid->Get_NCells() * sizeof(double)); double *yDst = (double *)SG_Malloc((long) m_pGrid->Get_NCells() * sizeof(double)); double *zDst = (double *)SG_Malloc((long) m_pGrid->Get_NCells() * sizeof(double)); for(y=0, i=0, p.y=m_pGrid->Get_YMin(); yGet_NY() && Set_Progress(y, m_pGrid->Get_NY()); y++, p.y+=m_pGrid->Get_Cellsize()) { for(x=0, p.x=m_pGrid->Get_XMin(); xGet_NX(); x++, p.x+=m_pGrid->Get_Cellsize(), i++) { xDst[i] = p.x; yDst[i] = p.y; zDst[i] = NaN; } } //----------------------------------------------------- Process_Set_Text(_TL("creating interpolator")); nnai *pNN = nnai_build(pTIN, m_pGrid->Get_NCells(), xDst, yDst); Process_Set_Text(_TL("interpolating")); nnai_interpolate(pNN, zSrc, zDst); //----------------------------------------------------- for(y=0, i=0; yGet_NY() && Set_Progress(y, m_pGrid->Get_NY()); y++) { for(x=0; xGet_NX(); x++, i++) { double z = zDst[i]; if( zMin <= z && z <= zMax ) { m_pGrid->Set_Value(x, y, z); } else { m_pGrid->Set_NoData(x, y); } } } //----------------------------------------------------- nnai_destroy(pNN); delaunay_destroy(pTIN); SG_Free(xDst); SG_Free(yDst); SG_Free(zDst); SG_Free(zSrc); SG_Free(pSrc); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Interpolation_NaturalNeighbour.h000066400000000000000000000107061224124640700276630ustar00rootroot00000000000000/********************************************************** * Version $Id: Interpolation_NaturalNeighbour.h 1130 2011-07-14 07:42:46Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Interpolation_NaturalNeighbour.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Interpolation_NaturalNeighbour.h // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Interpolation_NaturalNeighbour_H #define HEADER_INCLUDED__Interpolation_NaturalNeighbour_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Interpolation.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_gridding_EXPORT CInterpolation_NaturalNeighbour : public CInterpolation { public: CInterpolation_NaturalNeighbour(void); protected: virtual bool Interpolate (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Interpolation_NaturalNeighbour_H saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.cpp000066400000000000000000000112561224124640700302120ustar00rootroot00000000000000/********************************************************** * Version $Id: Interpolation_NearestNeighbour.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Interpolation_NearestNeighbour.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Interpolation_NearestNeighbour.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CInterpolation_NearestNeighbour::CInterpolation_NearestNeighbour(void) { Set_Name (_TL("Nearest Neighbour")); Set_Author (SG_T("(c) 2003 by O.Conrad")); Set_Description (_TW( "Nearest Neighbour method for grid interpolation from irregular distributed points.") ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CInterpolation_NearestNeighbour::On_Initialize(void) { return( Set_Search_Engine() ); } //--------------------------------------------------------- bool CInterpolation_NearestNeighbour::Get_Value(double x, double y, double &z) { double Distance; TSG_Point Point; return( m_Search.Get_Nearest_Point(x, y, Point, z, Distance) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Interpolation_NearestNeighbour.h000066400000000000000000000110011224124640700276430ustar00rootroot00000000000000/********************************************************** * Version $Id: Interpolation_NearestNeighbour.h 1130 2011-07-14 07:42:46Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Interpolation_NearestNeighbour.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Interpolation_NearestNeighbour.h // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Interpolation_NearestNeighbour_H #define HEADER_INCLUDED__Interpolation_NearestNeighbour_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Interpolation.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_gridding_EXPORT CInterpolation_NearestNeighbour : public CInterpolation { public: CInterpolation_NearestNeighbour(void); protected: virtual bool On_Initialize (void); virtual bool Get_Value (double x, double y, double &z); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Interpolation_NearestNeighbour_H saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Interpolation_Shepard.cpp000066400000000000000000000204201224124640700263250ustar00rootroot00000000000000/********************************************************** * Version $Id: Interpolation_Shepard.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Interpolation_Shepard.cpp // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Interpolation_Shepard.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CInterpolation_Shepard::CInterpolation_Shepard(void) { Set_Name (_TL("Modifed Quadratic Shepard")); Set_Author (_TL("Copyrights (c) 2003 by Andre Ringeler")); Set_Description (_TW( "Modified Quadratic Shepard method for grid interpolation " "from irregular distributed points. This module is based on " "Module 660 in TOMS.\n" "QSHEP2D: Fortran routines implementing the Quadratic Shepard " "method for bivariate interpolation of scattered data " "(see R. J. Renka, ACM TOMS 14 (1988) pp.149-150).\n" "Classes: E2b. Interpolation of scattered, non-gridded multivariate data." )); Parameters.Add_Value( NULL , "QUADRATIC_NEIGHBORS" , _TL("Quadratic Neighbors"), _TL(""), PARAMETER_TYPE_Int , 13, 5, true ); Parameters.Add_Value( NULL , "WEIGHTING_NEIGHBORS" , _TL("Weighting Neighbors"), _TL(""), PARAMETER_TYPE_Int , 19, 3, true ); } //--------------------------------------------------------- CInterpolation_Shepard::~CInterpolation_Shepard(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CInterpolation_Shepard::On_Initialize(void) { m_Quadratic_Neighbors = Parameters("QUADRATIC_NEIGHBORS") ->asInt(); m_Weighting_Neighbors = Parameters("WEIGHTING_NEIGHBORS") ->asInt(); m_pShapes = Get_Points(); m_MaxPoints = 0; if( m_pShapes->Get_Count() > 1 ) { x_vals = (double *)malloc(m_pShapes->Get_Count() * sizeof(double)); y_vals = (double *)malloc(m_pShapes->Get_Count() * sizeof(double)); f_vals = (double *)malloc(m_pShapes->Get_Count() * sizeof(double)); for(int iPoint=0; iPointGet_Count(); iPoint++) { CSG_Shape *pShape = m_pShapes->Get_Shape(iPoint); if( !pShape->is_NoData(m_zField) ) { x_vals[m_MaxPoints] = pShape->Get_Point(0).x; y_vals[m_MaxPoints] = pShape->Get_Point(0).y; f_vals[m_MaxPoints] = pShape->asDouble(m_zField); m_MaxPoints++; } } Remove_Duplicate(); Interpolator.Interpolate(x_vals, y_vals, f_vals, m_MaxPoints - 1, m_Quadratic_Neighbors, m_Weighting_Neighbors); } return( m_MaxPoints > 1 ); } //--------------------------------------------------------- bool CInterpolation_Shepard::On_Finalize(void) { if( m_pShapes->Get_Count() > 1 ) { free(x_vals); free(y_vals); free(f_vals); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CInterpolation_Shepard::Get_Value(double x, double y, double &z) { Interpolator.GetValue(x, y, z); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- static int Comp_Func(const void * vData1, const void * vData2) { Data_Point * val_1 = (Data_Point *)vData1; Data_Point * val_2 = (Data_Point *)vData2; if (val_1->y < val_2->y) { return (-1); } if (val_1->y > val_2->y) { return (1); } if (val_1->x < val_2->x) { return (-1); } if (val_1->x > val_2->x) { return (1); } return (0); } //--------------------------------------------------------- #define eps 1e-7 //--------------------------------------------------------- void CInterpolation_Shepard::Remove_Duplicate() { Data_Point * Data; int i,j; Data = (Data_Point * ) malloc (m_MaxPoints * sizeof(Data_Point) ); for (i = 0; i < m_MaxPoints; i++) { Data[i].x = x_vals[i]; Data[i].y = y_vals[i]; Data[i].val = f_vals[i]; } qsort((void *)Data, m_MaxPoints, sizeof(Data_Point), Comp_Func); bool durty = true; while (durty) { durty = false; for (i = 0; i < m_MaxPoints -1; ++i) { if( fabs(Data[i].y - Data[i + 1].y) < eps && fabs(Data[i].x - Data[i + 1].x) < eps ) { for (j = i; j < m_MaxPoints -1; j++) { Data[j].x = Data[j + 1].x; Data[j].y = Data[j + 1].y; Data[j].val = Data[j + 1].val; } m_MaxPoints--; durty = true; } } qsort((void *)Data, m_MaxPoints, sizeof(Data_Point), Comp_Func); } for (i = 0; i < m_MaxPoints; i++) { x_vals[i] = Data[i].x; y_vals[i] = Data[i].y; f_vals[i] = Data[i].val; } free( Data ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Interpolation_Shepard.h000066400000000000000000000120451224124640700257760ustar00rootroot00000000000000/********************************************************** * Version $Id: Interpolation_Shepard.h 1130 2011-07-14 07:42:46Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Interpolation_Shepard.h // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Interpolation_Shepard.h // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Interpolation_Shepard_H #define HEADER_INCLUDED__Interpolation_Shepard_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Interpolation.h" #include "Shepard.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- typedef struct { double x ; double y ; double val; } Data_Point; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_gridding_EXPORT CInterpolation_Shepard : public CInterpolation { public: CInterpolation_Shepard(void); virtual ~CInterpolation_Shepard(void); protected: virtual bool On_Initialize (void); virtual bool On_Finalize (void); virtual bool Get_Value (double x, double y, double &z); private: int m_MaxPoints, m_Quadratic_Neighbors, m_Weighting_Neighbors; double *x_vals, *y_vals, *f_vals; CShepard2d Interpolator; void Remove_Duplicate (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Interpolation_Shepard_H saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Interpolation_Triangulation.cpp000066400000000000000000000200541224124640700275620ustar00rootroot00000000000000/********************************************************** * Version $Id: Interpolation_Triangulation.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Triangulation.cpp // // // // Copyright (C) 2004 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Interpolation_Triangulation.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CInterpolation_Triangulation::CInterpolation_Triangulation(void) { Set_Name (_TL("Triangulation")); Set_Author (SG_T("O.Conrad (c) 2004")); Set_Description (_TW( "Gridding of a shapes layer using Delaunay Triangulation." )); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CInterpolation_Triangulation::Interpolate(void) { CSG_TIN TIN; if( TIN.Create(Get_Points()) ) { m_pGrid->Assign_NoData(); for(int iTriangle=0; iTriangleGet_Extent().Intersects(pTriangle->Get_Extent()) != INTERSECTION_None ) { TSG_Point_Z p[3]; for(int iPoint=0; iPoint<3; iPoint++) { p[iPoint].x = (pTriangle->Get_Node(iPoint)->Get_X() - m_pGrid->Get_XMin()) / m_pGrid->Get_Cellsize(); p[iPoint].y = (pTriangle->Get_Node(iPoint)->Get_Y() - m_pGrid->Get_YMin()) / m_pGrid->Get_Cellsize(); p[iPoint].z = pTriangle->Get_Node(iPoint)->asDouble(m_zField); } Set_Triangle(p); } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CInterpolation_Triangulation::Set_Triangle(TSG_Point_Z p[3]) { //----------------------------------------------------- if( p[1].y < p[0].y ) { TSG_Point_Z pp = p[1]; p[1] = p[0]; p[0] = pp; } if( p[2].y < p[0].y ) { TSG_Point_Z pp = p[2]; p[2] = p[0]; p[0] = pp; } if( p[2].y < p[1].y ) { TSG_Point_Z pp = p[2]; p[2] = p[1]; p[1] = pp; } //----------------------------------------------------- TSG_Rect r; r.yMin = p[0].y; r.yMax = p[2].y; r.xMin = p[0].x < p[1].x ? (p[0].x < p[2].x ? p[0].x : p[2].x) : (p[1].x < p[2].x ? p[1].x : p[2].x); r.xMax = p[0].x > p[1].x ? (p[0].x > p[2].x ? p[0].x : p[2].x) : (p[1].x > p[2].x ? p[1].x : p[2].x); if( r.yMin >= r.yMax || r.xMin >= r.xMax ) { return; // no area } if( (r.yMin < 0.0 && r.yMax < 0.0) || (r.yMin >= m_pGrid->Get_NY() && r.yMax >= m_pGrid->Get_NY()) || (r.xMin < 0.0 && r.xMax < 0.0) || (r.xMin >= m_pGrid->Get_NX() && r.xMax >= m_pGrid->Get_NX()) ) { return; // completely outside grid } //----------------------------------------------------- TSG_Point_Z d[3]; if( (d[0].y = p[2].y - p[0].y) != 0.0 ) { d[0].x = (p[2].x - p[0].x) / d[0].y; d[0].z = (p[2].z - p[0].z) / d[0].y; } if( (d[1].y = p[1].y - p[0].y) != 0.0 ) { d[1].x = (p[1].x - p[0].x) / d[1].y; d[1].z = (p[1].z - p[0].z) / d[1].y; } if( (d[2].y = p[2].y - p[1].y) != 0.0 ) { d[2].x = (p[2].x - p[1].x) / d[2].y; d[2].z = (p[2].z - p[1].z) / d[2].y; } //----------------------------------------------------- int ay = (int)r.yMin; if( ay < 0 ) ay = 0; if( ay < r.yMin ) ay++; int by = (int)r.yMax; if( by >= m_pGrid->Get_NY() ) by = m_pGrid->Get_NY() - 1; for(int y=ay; y<=by; y++) { if( y <= p[1].y && d[1].y > 0.0 ) { Set_Triangle_Line(y, p[0].x + (y - p[0].y) * d[0].x, p[0].z + (y - p[0].y) * d[0].z, p[0].x + (y - p[0].y) * d[1].x, p[0].z + (y - p[0].y) * d[1].z ); } else if( d[2].y > 0.0 ) { Set_Triangle_Line(y, p[0].x + (y - p[0].y) * d[0].x, p[0].z + (y - p[0].y) * d[0].z, p[1].x + (y - p[1].y) * d[2].x, p[1].z + (y - p[1].y) * d[2].z ); } } } //--------------------------------------------------------- inline void CInterpolation_Triangulation::Set_Triangle_Line(int y, double xa, double za, double xb, double zb) { if( xb < xa ) { double d; d = xa; xa = xb; xb = d; d = za; za = zb; zb = d; } if( xb > xa ) { double dz = (zb - za) / (xb - xa); int ax = (int)xa; if( ax < 0 ) ax = 0; if( ax < xa ) ax++; int bx = (int)xb; if( bx >= m_pGrid->Get_NX() ) bx = m_pGrid->Get_NX() - 1; for(int x=ax; x<=bx; x++) { double z = za + dz * (x - xa); if( m_pGrid->is_NoData(x, y) || m_pGrid->asDouble(x, y) < z ) { m_pGrid->Set_Value(x, y, z); } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Interpolation_Triangulation.h000066400000000000000000000105641224124640700272340ustar00rootroot00000000000000/********************************************************** * Version $Id: Interpolation_Triangulation.h 1130 2011-07-14 07:42:46Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Interpolation_Triangulation.h // // // // Copyright (C) 2004 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Interpolation_Triangulation_H #define HEADER_INCLUDED__Interpolation_Triangulation_H //--------------------------------------------------------- #include "Interpolation.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_gridding_EXPORT CInterpolation_Triangulation : public CInterpolation { public: CInterpolation_Triangulation(void); protected: virtual bool Interpolate (void); private: void Set_Triangle (TSG_Point_Z p[3]); void Set_Triangle_Line (int y, double xa, double za, double xb, double zb); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Interpolation_Triangulation_H saga-2.1.0+dfsg/src/modules/grid/grid_gridding/MLB_Interface.cpp000066400000000000000000000124351224124640700244310ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1731 2013-06-18 09:35:58Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Grid - Gridding") ); case MLB_INFO_Author: return( SG_T("O. Conrad (c) 2002-10") ); case MLB_INFO_Description: return( _TL("Tools for the gridding of points and other vector data.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Grid|Gridding") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Interpolation_InverseDistance.h" #include "Interpolation_AngularDistance.h" #include "Interpolation_NearestNeighbour.h" #include "Interpolation_NaturalNeighbour.h" #include "Interpolation_Shepard.h" #include "Interpolation_Triangulation.h" #include "Shapes2Grid.h" #include "kernel_density.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CShapes2Grid ); case 1: return( new CInterpolation_InverseDistance ); case 7: return( new CInterpolation_AngularDistance ); case 2: return( new CInterpolation_NearestNeighbour ); case 3: return( new CInterpolation_NaturalNeighbour ); case 4: return( new CInterpolation_Shepard ); case 5: return( new CInterpolation_Triangulation ); case 6: return( new CKernel_Density ); //----------------------------------------------------- case 10: return( NULL ); default: return( MLB_INTERFACE_SKIP_MODULE ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/grid/grid_gridding/MLB_Interface.h000066400000000000000000000077311224124640700241010ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_gridding_H #define HEADER_INCLUDED__grid_gridding_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef grid_gridding_EXPORTS #define grid_gridding_EXPORT _SAGA_DLL_EXPORT #else #define grid_gridding_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_gridding_H saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Makefile.am000066400000000000000000000025571224124640700233730ustar00rootroot00000000000000# # $Id: Makefile.am 1738 2013-06-20 11:15:45Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE DEP_DEFS = -D_SAGA_UNICODE endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEP_DEFS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_gridding.la libgrid_gridding_la_SOURCES =\ Interpolation.cpp\ Interpolation_AngularDistance.cpp\ Interpolation_InverseDistance.cpp\ Interpolation_NaturalNeighbour.cpp\ Interpolation_NearestNeighbour.cpp\ Interpolation_Shepard.cpp\ Interpolation_Triangulation.cpp\ kernel_density.cpp\ MLB_Interface.cpp\ Shapes2Grid.cpp\ Shepard.cpp\ ./nn/delaunay.c\ ./nn/hash.c\ ./nn/istack.c\ ./nn/lpi.c\ ./nn/nnai.c\ ./nn/nncommon.c\ ./nn/nnpi.c\ ./nn/triangle.c\ Interpolation.h\ Interpolation_AngularDistance.h\ Interpolation_InverseDistance.h\ Interpolation_NaturalNeighbour.h\ Interpolation_NearestNeighbour.h\ Interpolation_Shepard.h\ Interpolation_Triangulation.h\ kernel_density.h\ MLB_Interface.h\ Shapes2Grid.h\ Shepard.h\ ./nn/delaunay.h\ ./nn/hash.h\ ./nn/istack.h\ ./nn/nan.h\ ./nn/nn.h\ ./nn/triangle.h\ ./nn/version.h libgrid_gridding_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Makefile.in000066400000000000000000000706721224124640700234070ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/grid/grid_gridding DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgrid_gridding_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgrid_gridding_la_OBJECTS = Interpolation.lo \ Interpolation_AngularDistance.lo \ Interpolation_InverseDistance.lo \ Interpolation_NaturalNeighbour.lo \ Interpolation_NearestNeighbour.lo Interpolation_Shepard.lo \ Interpolation_Triangulation.lo kernel_density.lo \ MLB_Interface.lo Shapes2Grid.lo Shepard.lo delaunay.lo hash.lo \ istack.lo lpi.lo nnai.lo nncommon.lo nnpi.lo triangle.lo libgrid_gridding_la_OBJECTS = $(am_libgrid_gridding_la_OBJECTS) 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) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgrid_gridding_la_SOURCES) DIST_SOURCES = $(libgrid_gridding_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1738 2013-06-20 11:15:45Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@DEP_DEFS = -D_SAGA_UNICODE @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEP_DEFS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_gridding.la libgrid_gridding_la_SOURCES = \ Interpolation.cpp\ Interpolation_AngularDistance.cpp\ Interpolation_InverseDistance.cpp\ Interpolation_NaturalNeighbour.cpp\ Interpolation_NearestNeighbour.cpp\ Interpolation_Shepard.cpp\ Interpolation_Triangulation.cpp\ kernel_density.cpp\ MLB_Interface.cpp\ Shapes2Grid.cpp\ Shepard.cpp\ ./nn/delaunay.c\ ./nn/hash.c\ ./nn/istack.c\ ./nn/lpi.c\ ./nn/nnai.c\ ./nn/nncommon.c\ ./nn/nnpi.c\ ./nn/triangle.c\ Interpolation.h\ Interpolation_AngularDistance.h\ Interpolation_InverseDistance.h\ Interpolation_NaturalNeighbour.h\ Interpolation_NearestNeighbour.h\ Interpolation_Shepard.h\ Interpolation_Triangulation.h\ kernel_density.h\ MLB_Interface.h\ Shapes2Grid.h\ Shepard.h\ ./nn/delaunay.h\ ./nn/hash.h\ ./nn/istack.h\ ./nn/nan.h\ ./nn/nn.h\ ./nn/triangle.h\ ./nn/version.h libgrid_gridding_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .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) --gnu src/modules/grid/grid_gridding/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/grid/grid_gridding/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgrid_gridding.la: $(libgrid_gridding_la_OBJECTS) $(libgrid_gridding_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgrid_gridding_la_OBJECTS) $(libgrid_gridding_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Interpolation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Interpolation_AngularDistance.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Interpolation_InverseDistance.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Interpolation_NaturalNeighbour.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Interpolation_NearestNeighbour.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Interpolation_Shepard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Interpolation_Triangulation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shapes2Grid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shepard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delaunay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/istack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_density.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lpi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nnai.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nncommon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nnpi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/triangle.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< delaunay.lo: ./nn/delaunay.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT delaunay.lo -MD -MP -MF $(DEPDIR)/delaunay.Tpo -c -o delaunay.lo `test -f './nn/delaunay.c' || echo '$(srcdir)/'`./nn/delaunay.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/delaunay.Tpo $(DEPDIR)/delaunay.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./nn/delaunay.c' object='delaunay.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o delaunay.lo `test -f './nn/delaunay.c' || echo '$(srcdir)/'`./nn/delaunay.c hash.lo: ./nn/hash.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hash.lo -MD -MP -MF $(DEPDIR)/hash.Tpo -c -o hash.lo `test -f './nn/hash.c' || echo '$(srcdir)/'`./nn/hash.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/hash.Tpo $(DEPDIR)/hash.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./nn/hash.c' object='hash.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hash.lo `test -f './nn/hash.c' || echo '$(srcdir)/'`./nn/hash.c istack.lo: ./nn/istack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT istack.lo -MD -MP -MF $(DEPDIR)/istack.Tpo -c -o istack.lo `test -f './nn/istack.c' || echo '$(srcdir)/'`./nn/istack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/istack.Tpo $(DEPDIR)/istack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./nn/istack.c' object='istack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o istack.lo `test -f './nn/istack.c' || echo '$(srcdir)/'`./nn/istack.c lpi.lo: ./nn/lpi.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lpi.lo -MD -MP -MF $(DEPDIR)/lpi.Tpo -c -o lpi.lo `test -f './nn/lpi.c' || echo '$(srcdir)/'`./nn/lpi.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/lpi.Tpo $(DEPDIR)/lpi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./nn/lpi.c' object='lpi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lpi.lo `test -f './nn/lpi.c' || echo '$(srcdir)/'`./nn/lpi.c nnai.lo: ./nn/nnai.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nnai.lo -MD -MP -MF $(DEPDIR)/nnai.Tpo -c -o nnai.lo `test -f './nn/nnai.c' || echo '$(srcdir)/'`./nn/nnai.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nnai.Tpo $(DEPDIR)/nnai.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./nn/nnai.c' object='nnai.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nnai.lo `test -f './nn/nnai.c' || echo '$(srcdir)/'`./nn/nnai.c nncommon.lo: ./nn/nncommon.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nncommon.lo -MD -MP -MF $(DEPDIR)/nncommon.Tpo -c -o nncommon.lo `test -f './nn/nncommon.c' || echo '$(srcdir)/'`./nn/nncommon.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nncommon.Tpo $(DEPDIR)/nncommon.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./nn/nncommon.c' object='nncommon.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nncommon.lo `test -f './nn/nncommon.c' || echo '$(srcdir)/'`./nn/nncommon.c nnpi.lo: ./nn/nnpi.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nnpi.lo -MD -MP -MF $(DEPDIR)/nnpi.Tpo -c -o nnpi.lo `test -f './nn/nnpi.c' || echo '$(srcdir)/'`./nn/nnpi.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nnpi.Tpo $(DEPDIR)/nnpi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./nn/nnpi.c' object='nnpi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nnpi.lo `test -f './nn/nnpi.c' || echo '$(srcdir)/'`./nn/nnpi.c triangle.lo: ./nn/triangle.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT triangle.lo -MD -MP -MF $(DEPDIR)/triangle.Tpo -c -o triangle.lo `test -f './nn/triangle.c' || echo '$(srcdir)/'`./nn/triangle.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/triangle.Tpo $(DEPDIR)/triangle.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./nn/triangle.c' object='triangle.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o triangle.lo `test -f './nn/triangle.c' || echo '$(srcdir)/'`./nn/triangle.c .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Shapes2Grid.cpp000066400000000000000000000521741224124640700241560ustar00rootroot00000000000000/********************************************************** * Version $Id: Shapes2Grid.cpp 1560 2012-12-07 12:53:00Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Shapes2Grid.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Shapes2Grid.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define X_WORLD_TO_GRID(X) (((X) - m_pGrid->Get_XMin()) / m_pGrid->Get_Cellsize()) #define Y_WORLD_TO_GRID(Y) (((Y) - m_pGrid->Get_YMin()) / m_pGrid->Get_Cellsize()) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes2Grid::CShapes2Grid(void) { CSG_Parameter *pNode_0, *pNode_1; //----------------------------------------------------- Set_Name (_TL("Shapes to Grid")); Set_Author (SG_T("O.Conrad (c) 2003")); Set_Description (_TW( "Gridding of a shapes layer. If some shapes are selected, only these will be gridded." )); //----------------------------------------------------- pNode_0 = Parameters.Add_Shapes( NULL , "INPUT" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); pNode_1 = Parameters.Add_Table_Field( pNode_0 , "FIELD" , _TL("Attribute"), _TL("") ); Parameters.Add_Choice( NULL , "OUTPUT" , _TL("Output Values"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("data / no-data"), _TL("index number"), _TL("attribute") ), 2 ); pNode_0 = Parameters.Add_Choice( NULL , "MULTIPLE" , _TL("Method for Multiple Values"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("first"), _TL("last"), _TL("minimum"), _TL("maximum"), _TL("mean") ), 1 ); pNode_0 = Parameters.Add_Choice( NULL , "LINE_TYPE" , _TL("Lines"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("thin"), _TL("thick") ), 1 ); pNode_0 = Parameters.Add_Choice( NULL , "POLY_TYPE" , _TL("Polygon"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("node"), _TL("cell") ), 1 ); pNode_0 = Parameters.Add_Choice( NULL , "GRID_TYPE" , _TL("Preferred Target Grid Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Integer (1 byte)"), _TL("Integer (2 byte)"), _TL("Integer (4 byte)"), _TL("Floating Point (4 byte)"), _TL("Floating Point (8 byte)") ), 3 ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TARGET" , _TL("Target Grid"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("user defined"), _TL("grid") ), 0 ); m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid") , _TL(""))); m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid") , _TL(""))); m_Grid_Target.Add_Grid_Parameter(SG_T("COUNT"), _TL("Number of Values"), true); Get_Parameters("USER")->Add_Value( NULL , "BCOUNT" , _TL("Number of Values"), _TL(""), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CShapes2Grid::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 ); } //--------------------------------------------------------- int CShapes2Grid::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("INPUT")) ) { pParameters->Get_Parameter("LINE_TYPE")->Set_Enabled(pParameter->asShapes() && pParameter->asShapes()->Get_Type() == SHAPE_TYPE_Line); pParameters->Get_Parameter("POLY_TYPE")->Set_Enabled(pParameter->asShapes() && pParameter->asShapes()->Get_Type() == SHAPE_TYPE_Polygon); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("OUTPUT")) ) { pParameters->Get_Parameter("FIELD" )->Set_Enabled(pParameter->asInt() == 2); pParameters->Get_Parameter("MULTIPLE" )->Set_Enabled(pParameter->asInt() == 2); } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- TSG_Data_Type CShapes2Grid::Get_Grid_Type(int iType) { switch( iType ) { case 0: return( SG_DATATYPE_Byte ); case 1: return( SG_DATATYPE_Short ); case 2: return( SG_DATATYPE_Int ); case 3: return( SG_DATATYPE_Float ); case 4: return( SG_DATATYPE_Double ); } return( SG_DATATYPE_Float ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes2Grid::On_Execute(void) { int iField, iType, iShape; //----------------------------------------------------- m_pShapes = Parameters("INPUT" )->asShapes(); m_Method_Lines = Parameters("LINE_TYPE")->asInt(); m_Method_Polygon = Parameters("POLY_TYPE")->asInt(); m_Method_Multi = Parameters("MULTIPLE" )->asInt(); iType = Parameters("GRID_TYPE")->asInt(); switch( Parameters("OUTPUT")->asInt() ) { case 0: iField = -1; break; case 1: iField = -2; break; case 2: if( (iField = Parameters("FIELD")->asInt()) < 0 || !SG_Data_Type_is_Numeric(m_pShapes->Get_Field_Type(iField)) ) { iField = -2; Message_Add(_TL("WARNING: selected attribute is not numeric; generating unique identifiers instead.")); } break; } //----------------------------------------------------- m_pGrid = NULL; m_pCount = NULL; switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... if( m_Grid_Target.Init_User(m_pShapes->Get_Extent()) && Dlg_Parameters("USER") ) { m_pGrid = m_Grid_Target.Get_User(Get_Grid_Type(iType)); m_pCount = Get_Parameters("USER")->Get_Parameter("BCOUNT")->asBool() ? m_Grid_Target.Get_User(SG_T("COUNT")) : NULL; } break; case 1: // grid... if( Dlg_Parameters("GRID") ) { m_pGrid = m_Grid_Target.Get_Grid(Get_Grid_Type(iType)); m_pCount = m_Grid_Target.Get_Grid(SG_T("COUNT")); } break; } if( m_pGrid == NULL ) { return( false ); } //------------------------------------------------- if( iField < 0 ) { m_pGrid->Set_NoData_Value(0.0); } m_pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pShapes->Get_Name(), iField < 0 ? _TL("ID") : m_pShapes->Get_Field_Name(iField))); m_pGrid->Assign_NoData(); if( m_pCount == NULL ) { m_Count.Create(m_pGrid->Get_System(), SG_DATATYPE_Int); m_pCount = &m_Count; } m_pCount->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pShapes->Get_Name(), _TL("Count"))); m_pCount->Set_NoData_Value(0.0); m_pCount->Assign(0.0); //----------------------------------------------------- if( m_pShapes->Get_Type() == SHAPE_TYPE_Polygon && m_Method_Polygon == 1 ) // all cells intersected have to be marked { m_Method_Lines = 1; // thick, each cell crossed by polygon boundary will be marked additionally } //----------------------------------------------------- for(iShape=0; iShapeGet_Count() && Set_Progress(iShape, m_pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = m_pShapes->Get_Shape(iShape); if( m_pShapes->Get_Selection_Count() <= 0 || pShape->is_Selected() ) { if( iField < 0 || !pShape->is_NoData(iField) ) { m_Value = iField >= 0 ? pShape->asDouble(iField) : iField == -2 ? iShape + 1 : 1; if( pShape->Intersects(m_pGrid->Get_Extent()) ) { switch( m_pShapes->Get_Type() ) { case SHAPE_TYPE_Point: case SHAPE_TYPE_Points: Set_Points (pShape); break; case SHAPE_TYPE_Line: Set_Line (pShape); break; case SHAPE_TYPE_Polygon: Set_Polygon (pShape); if( m_Method_Polygon == 1 ) // all cells intersected have to be marked { Set_Line(pShape); // thick, each cell crossed by polygon boundary will be marked additionally } break; } } } } } //----------------------------------------------------- if( m_Method_Multi == 4 ) // mean { for(int y=0; yGet_NY() && Set_Progress(y, m_pGrid->Get_NY()); y++) { for(int x=0; xGet_NX(); x++) { if( m_pCount->asInt(x, y) > 1 ) { m_pGrid->Mul_Value(x, y, 1.0 / m_pCount->asDouble(x, y)); } } } } //----------------------------------------------------- m_Count.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void CShapes2Grid::Set_Value(int x, int y) { if( m_pGrid->is_InGrid(x, y, false) ) { if( m_pCount->asInt(x, y) == 0 ) { m_pGrid->Set_Value(x, y, m_Value); } else switch( m_Method_Multi ) { case 0: // first break; case 1: // last m_pGrid->Set_Value(x, y, m_Value); break; case 2: // minimum if( m_pGrid->asDouble(x, y) > m_Value ) { m_pGrid->Set_Value(x, y, m_Value); } break; case 3: // maximum if( m_pGrid->asDouble(x, y) < m_Value ) { m_pGrid->Set_Value(x, y, m_Value); } break; case 4: // mean m_pGrid->Add_Value(x, y, m_Value); break; } m_pCount->Add_Value(x, y, 1); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CShapes2Grid::Set_Points(CSG_Shape *pShape) { for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { TSG_Point p = pShape->Get_Point(iPoint, iPart); Set_Value( (int)(0.5 + X_WORLD_TO_GRID(p.x)), (int)(0.5 + Y_WORLD_TO_GRID(p.y)) ); } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CShapes2Grid::Set_Line(CSG_Shape *pShape) { TSG_Point a, b; for(int iPart=0; iPartGet_Part_Count(); iPart++) { b = pShape->Get_Point(0, iPart); b.x = X_WORLD_TO_GRID(b.x); b.y = Y_WORLD_TO_GRID(b.y); for(int iPoint=1; iPointGet_Point_Count(iPart); iPoint++) { a = b; b = pShape->Get_Point(iPoint, iPart); b.x = X_WORLD_TO_GRID(b.x); b.y = Y_WORLD_TO_GRID(b.y); switch( m_Method_Lines ) { case 0: Set_Line_A(a, b); break; case 1: Set_Line_B(a, b); break; } } } } //--------------------------------------------------------- void CShapes2Grid::Set_Line_A(TSG_Point a, TSG_Point b) { double ix, iy, sig; double dx, dy; TSG_Point_Int A, B; A.x = (int)(a.x += 0.5); A.y = (int)(a.y += 0.5); B.x = (int)(b.x += 0.5); B.y = (int)(b.y += 0.5); //----------------------------------------------------- if( A.x != B.x || A.y != B.y ) { dx = b.x - a.x; dy = b.y - a.y; if( fabs(dx) > fabs(dy) ) { sig = dx < 0 ? -1 : 1; dx = fabs(dx); dy /= dx; for(ix=0; ix<=dx; ix++, a.x+=sig, a.y+=dy) { Set_Value((int)a.x, (int)a.y); } } else if( fabs(dy) >= fabs(dx) && dy != 0 ) { sig = dy < 0 ? -1 : 1; dy = fabs(dy); dx /= dy; for(iy=0; iy<=dy; iy++, a.x+=dx, a.y+=sig) { Set_Value((int)a.x, (int)a.y); } } } else { Set_Value(A.x, A.y); } } /*/--------------------------------------------------------- void CShapes2Grid::Set_Line_A(TSG_Point a, TSG_Point b) { TSG_Point_Int A, B; A.x = (int)(a.x + 0.5); A.y = (int)(a.y + 0.5); B.x = (int)(b.x + 0.5); B.y = (int)(b.y + 0.5); //----------------------------------------------------- if( A.x != B.x || A.y != B.y ) { int d, dx, dy; double m, t; dx = B.x - A.x; dy = B.y - A.y; if( fabs(dx) > fabs(dy) ) { d = dx < 0 ? -1 : 1; m = d * (double)dy / (double)dx; for(t=A.y; A.x!=B.x; A.x+=d, t+=m) { Set_Value(A.x, (int)t); } } else // if( fabs(dy) >= fabs(dx) ) { d = dy < 0 ? -1 : 1; m = d * (double)dx / (double)dy; for(t=A.x; A.y!=B.y; A.y+=d, t+=m) { Set_Value((int)t, A.y); } } } else { Set_Value(A.x, A.y); } }/**/ //--------------------------------------------------------- void CShapes2Grid::Set_Line_B(TSG_Point a, TSG_Point b) { int ix, iy; double e, d, dx, dy; TSG_Point_Int A, B; A.x = (int)(a.x += 0.5); A.y = (int)(a.y += 0.5); B.x = (int)(b.x += 0.5); B.y = (int)(b.y += 0.5); Set_Value(A.x, A.y); //----------------------------------------------------- if( A.x != B.x || A.y != B.y ) { dx = b.x - a.x; dy = b.y - a.y; a.x = a.x > 0.0 ? a.x - (int)a.x : 1.0 + (a.x - (int)a.x); a.y = a.y > 0.0 ? a.y - (int)a.y : 1.0 + (a.y - (int)a.y); //------------------------------------------------- if( fabs(dx) > fabs(dy) ) { ix = dx > 0.0 ? 1 : -1; iy = dy > 0.0 ? 1 : -1; d = fabs(dy / dx); dx = ix < 0 ? a.x : 1.0 - a.x; e = iy > 0 ? a.y : 1.0 - a.y; e += d * dx; while( e > 1.0 ) { e -= 1.0; A.y += iy; Set_Value(A.x, A.y); } while( A.x != B.x ) { A.x += ix; e += d; Set_Value(A.x, A.y); if( A.x != B.x ) { while( e > 1.0 ) { e -= 1.0; A.y += iy; Set_Value(A.x, A.y); } } } if( A.y != B.y ) { iy = A.y < B.y ? 1 : -1; while( A.y != B.y ) { A.y += iy; Set_Value(A.x, A.y); } } } //------------------------------------------------- else // if( fabs(dy) > fabs(dx) ) { ix = dx > 0.0 ? 1 : -1; iy = dy > 0.0 ? 1 : -1; d = fabs(dx / dy); dy = iy < 0 ? a.y : 1.0 - a.y; e = ix > 0 ? a.x : 1.0 - a.x; e += d * dy; while( e > 1.0 ) { e -= 1.0; A.x += ix; Set_Value(A.x, A.y); } while( A.y != B.y ) { A.y += iy; e += d; Set_Value(A.x, A.y); if( A.y != B.y ) { while( e > 1.0 ) { e -= 1.0; A.x += ix; Set_Value(A.x, A.y); } } } if( A.x != B.x ) { ix = A.x < B.x ? 1 : -1; while( A.x != B.x ) { A.x += ix; Set_Value(A.x, A.y); } } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CShapes2Grid::Set_Polygon(CSG_Shape *pShape) { Set_Polygon_Node((CSG_Shape_Polygon *)pShape); } //--------------------------------------------------------- void CShapes2Grid::Set_Polygon_Node(CSG_Shape_Polygon *pPolygon) { bool bFill, *bCrossing; int x, y, xStart, xStop; TSG_Point A, B, a, b, c; CSG_Rect Extent; //----------------------------------------------------- bCrossing = (bool *)SG_Malloc(m_pGrid->Get_NX() * sizeof(bool)); Extent = pPolygon->Get_Extent(); xStart = (int)((Extent.m_rect.xMin - m_pGrid->Get_XMin()) / m_pGrid->Get_Cellsize()) - 1; if( xStart < 0 ) xStart = 0; xStop = (int)((Extent.m_rect.xMax - m_pGrid->Get_XMin()) / m_pGrid->Get_Cellsize()) + 1; if( xStop >= m_pGrid->Get_NX() ) xStop = m_pGrid->Get_NX() - 1; A.x = m_pGrid->Get_XMin() - 1.0; B.x = m_pGrid->Get_XMax() + 1.0; //----------------------------------------------------- for(y=0, A.y=m_pGrid->Get_YMin(); yGet_NY(); y++, A.y+=m_pGrid->Get_Cellsize()) { if( A.y >= Extent.m_rect.yMin && A.y <= Extent.m_rect.yMax ) { B.y = A.y; memset(bCrossing, 0, m_pGrid->Get_NX() * sizeof(bool)); for(int iPart=0; iPartGet_Part_Count(); iPart++) { if( pPolygon->Get_Part(iPart)->Get_Extent().Intersects(m_pGrid->Get_Extent(true)) ) { b = pPolygon->Get_Point(pPolygon->Get_Point_Count(iPart) - 1, iPart); for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { a = b; b = pPolygon->Get_Point(iPoint, iPart); if( ((a.y <= A.y && A.y < b.y) || (a.y > A.y && A.y >= b.y)) ) { SG_Get_Crossing(c, a, b, A, B, false); x = (int)(1.0 + X_WORLD_TO_GRID(c.x)); if( x < 0 ) { x = 0; } else if( x >= m_pGrid->Get_NX() ) { continue; } bCrossing[x] = !bCrossing[x]; } } } } //--------------------------------------------- for(x=xStart, bFill=false; x<=xStop; x++) { if( bCrossing[x] ) { bFill = !bFill; } if( bFill ) { Set_Value(x, y); } } } } //----------------------------------------------------- SG_Free(bCrossing); } //--------------------------------------------------------- void CShapes2Grid::Set_Polygon_Cell(CSG_Shape_Polygon *pPolygon) { //----------------------------------------------------- CSG_Grid_System s(m_pGrid->Get_System()); int xA = s.Get_xWorld_to_Grid(pPolygon->Get_Extent().Get_XMin()); if( xA < 0 ) xA = 0; int xB = s.Get_xWorld_to_Grid(pPolygon->Get_Extent().Get_XMax()); if( xB >= s.Get_NX() ) xB = s.Get_NX() - 1; int yA = s.Get_yWorld_to_Grid(pPolygon->Get_Extent().Get_YMin()); if( yA < 0 ) yA = 0; int yB = s.Get_yWorld_to_Grid(pPolygon->Get_Extent().Get_YMax()); if( yB >= s.Get_NY() ) yB = s.Get_NY() - 1; //----------------------------------------------------- TSG_Rect r; r.yMax = s.Get_yGrid_to_World(yA) - 0.5 * s.Get_Cellsize(); for(int y=yA; y<=yB; y++) { r.yMin = r.yMax; r.yMax += s.Get_Cellsize(); r.xMax = s.Get_xGrid_to_World(xA) - 0.5 * s.Get_Cellsize(); for(int x=xA; x<=xB; x++) { r.xMin = r.xMax; r.xMax += s.Get_Cellsize(); if( pPolygon->Intersects(r) ) { Set_Value(x, y); } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Shapes2Grid.h000066400000000000000000000122731224124640700236170ustar00rootroot00000000000000/********************************************************** * Version $Id: Shapes2Grid.h 1390 2012-05-02 15:37:51Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Shapes2Grid.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes2Grid_H #define HEADER_INCLUDED__Shapes2Grid_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_gridding_EXPORT CShapes2Grid : public CSG_Module { public: CShapes2Grid(void); protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_Method_Multi, m_Method_Lines, m_Method_Polygon; double m_Value; CSG_Parameters_Grid_Target m_Grid_Target; CSG_Grid *m_pGrid, *m_pCount, m_Count; CSG_Shapes *m_pShapes; TSG_Data_Type Get_Grid_Type (int iType); void Set_Value (int x, int y); void Set_Points (CSG_Shape *pShape); void Set_Line (CSG_Shape *pShape); void Set_Line_A (TSG_Point a, TSG_Point b); void Set_Line_B (TSG_Point a, TSG_Point b); void Set_Polygon (CSG_Shape *pShape); void Set_Polygon_Node (CSG_Shape_Polygon *pPolygon); void Set_Polygon_Cell (CSG_Shape_Polygon *pPolygon); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shapes2Grid_H saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Shepard.cpp000066400000000000000000001715111224124640700234260ustar00rootroot00000000000000/********************************************************** * Version $Id: Shepard.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // Shepard.cpp // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include #include "Shepard.h" double _missing_; CShepard2d::CShepard2d (void) { m_cells = NULL; m_next = NULL; m_rsq = NULL; m_a = NULL; _missing_ = -9999.99; } CShepard2d::~CShepard2d (void) { if (m_cells) { free (m_cells); m_cells = NULL; } if (m_next) { free (m_next); m_next = NULL; } if (m_rsq) { free (m_rsq); m_rsq = NULL; } if (m_a) { free (m_a); m_a = NULL; } } void CShepard2d::Set_Missing(double missing) { _missing_ = missing; } int CShepard2d::Interpolate (double *X, double * Y, double * F, int N_Points, int Quadratic_Neighbors, int Weighting_Neighbors ) { int nr, lmax; int status; if (N_Points < 6) return -1; lmax = min(40, N_Points - 1); if (Quadratic_Neighbors < 5 || Quadratic_Neighbors > lmax) return -1; if (Weighting_Neighbors < 1 || Weighting_Neighbors > lmax) return -1; nr = (int)(sqrt(N_Points / 3.0)); if (nr < 1) nr = 1; this->CShepard2d::~CShepard2d(); m_cells = (int *) malloc(nr * nr * sizeof(int)); m_next = (int *) malloc(N_Points * sizeof(int)); m_rsq = (double *) malloc(N_Points * sizeof(double)); m_a = (double *) malloc(N_Points * 5 * sizeof(double)); m_x = X; m_y = Y; m_f = F; m_nPoints = N_Points; m_nr = nr; qshep2_(&N_Points, X, Y, F, &Quadratic_Neighbors, &Weighting_Neighbors, &nr, m_cells, m_next, &xmin, &ymin, &dx, &dy, &rmax, m_rsq, m_a, &status); return status; } void CShepard2d::GetValue(double px, double py, double &q) { if ( ! m_a ) q = _missing_; else q = qs2val_(&px, &py, &m_nPoints , m_x, m_y, m_f, &m_nr, m_cells, m_next, &xmin, &ymin, &dx, &dy, &rmax, m_rsq, m_a); } /*///////////////////////////////////////////////////////////////////////////////////// The folowing source ist an automatic translation with f2c of Module 660 in TOMS QSHEP2D: Fortran routines implementing the quadratic Shepard method for bivariate interpolation of scattered data. (See R. J. Renka, ACM TOMS 14 (1988) pp. 149-150.). Classes : E2b . Interpolation of scattered, non-gridded multivariate data Type : Fortran software in TOMS collection. Access : Some uses prohibited. Portable. Precision: Single. Details : Fullsource Sites : (1) NETLIB //////////////////////////////////////////////////////////////////////////////////////*/ struct { double y; } stcom_; #define stcom_1 stcom_ /* Table of constant values */ static int c__1 = 1; int qshep2_(int *n, double *x, double *y, double *f, int * nq, int *nw, int *nr, int *lcell, int *lnext, double * xmin, double *ymin, double *dx, double *dy, double *rmax, double *rsq, double *a, int *ier) { static double rtol = 1e-5f; static double dtol = .01f; static double sf = 1.f; int lcell_dim1, lcell_offset, i__1, i__2, i__3; double r__1, r__2; // double sqrt(double); static double b[36] /* was[6][6] */, c__; static int i__, j, k; static double s, t; static int ib; static double fk, av; static int nn, np; static double rq, xk, rs, yk; static int ip1, jp1; static double ddx, ddy; static int neq, lnp, nnq, nnr, nnw; static double xmn, sum, ymn, rws; static int irm1; static double dmin__; static int ierr, lmax; static double avsq; static int irow, npts[40]; static double rsmx, rsold; extern int getnp2_(double *, double *, double *, double *, int *, int *, int *, double *, double *, double *, double *, int *, double *), store2_(int *, double *, double *, int *, int *, int *, double *, double *, double *, double *, int *), setup2_(double *, double *, double *, double *, double *, double *, double *, double *, double *, double *), givens_(double *, double *, double *, double *), rotate_(int *, double *, double *, double *, double *); static int nqwmax; /****************************************************************/ /* */ /* ROBERT RENKA */ /* UNIV. OF NORTH TEXAS */ /*(817) 565 - 2767 */ /* 01/08/90 */ /* */ /* THIS SUBROUTINE COMPUTES A SET OF PARAMETERS A AND RSQ */ /* DEFINING A SMOOTH(ONCE CONTINUOUSLY DIFFERENTIABLE) BI- */ /* VARIATE FUNCTION Q(X, Y) WHICH INTERPOLATES DATA VALUES F */ /* AT SCATTERED NODES(X, Y). THE INTERPOLANT Q MAY BE EVAL- */ /* UATED AT AN ARBITRARY POINT BY FUNCTION QS2VAL, AND ITS */ /* FIRST DERIVATIVES ARE COMPUTED BY SUBROUTINE QS2GRD. */ /* THE INTERPOLATION SCHEME IS A MODIFIED QUADRATIC SHEPARD */ /* METHOD -- */ /* */ /* Q =(W(1)*Q(1) + W(2)*Q(2)+..+W(N)*Q(N))/(W(1) + W(2)+..+W(N))*/ /* */ /* FOR BIVARIATE FUNCTIONS W(K) AND Q(K). THE NODAL FUNC- */ /* TIONS ARE GIVEN BY */ /* */ /* Q(K)(X, Y) = A(1, K)*(X - X(K))**2 */ /* + A(2, K)*(X - X(K))*(Y - Y(K)) */ /* + A(3, K)*(Y - Y(K))**2 + A(4, K)*(X - X(K)) */ /* + A(5, K)*(Y - Y(K)) + F(K) . */ /* */ /* THUS, Q(K) IS A QUADRATIC FUNCTION WHICH INTERPOLATES THE */ /* DATA VALUE AT NODE K. ITS COEFFICIENTS A(, K) ARE OBTAINED */ /* BY A WEIGHTED LEAST SQUARES FIT TO THE CLOSEST NQ DATA */ /* POINTS WITH WEIGHTS SIMILAR TO W(K). NOTE THAT THE RADIUS */ /* OF INFLUENCE FOR THE LEAST SQUARES FIT IS FIXED FOR EACH */ /* K, BUT VARIES WITH K. */ /* THE WEIGHTS ARE TAKEN TO BE */ /* */ /* W(K)(X, Y) =((R(K) - D(K))+ / R(K)*D(K))**2 */ /* */ /* WHERE(R(K) - D(K))+ = 0 IF R(K) .LE. D(K) AND D(K)(X, Y) IS */ /* THE EUCLIDEAN DISTANCE BETWEEN(X, Y) AND(X(K), Y(K)). THE */ /* RADIUS OF INFLUENCE R(K) VARIES WITH K AND IS CHOSEN SO */ /* THAT NW NODES ARE WITHIN THE RADIUS. NOTE THAT W(K) IS */ /* NOT DEFINED AT NODE(X(K), Y(K)), BUT Q(X, Y) HAS LIMIT F(K) */ /* AS(X, Y) APPROACHES(X(K), Y(K)). */ /* */ /* ON INPUT -- */ /* */ /* N = NUMBER OF NODES AND ASSOCIATED DATA VALUES. */ /* N .GE. 6. */ /* */ /* X, Y = ARRAYS OF LENGTH N CONTAINING THE CARTESIAN */ /* COORDINATES OF THE NODES. */ /* */ /* F = ARRAY OF LENGTH N CONTAINING THE DATA VALUES */ /* IN ONE - TO - ONE CORRESPONDENCE WITH THE NODES. */ /* */ /* NQ = NUMBER OF DATA POINTS TO BE USED IN THE LEAST */ /* SQUARES FIT FOR COEFFICIENTS DEFINING THE NODAL */ /* FUNCTIONS Q(K). A HIGHLY RECOMMENDED VALUE IS */ /* NQ = 13. 5 .LE. NQ .LE. MIN(40, N - 1). */ /* */ /* NW = NUMBER OF NODES WITHIN(AND DEFINING) THE RADII */ /* OF INFLUENCE R(K) WHICH ENTER INTO THE WEIGHTS */ /* W(K). FOR N SUFFICIENTLY LARGE, A RECOMMENDED */ /* VALUE IS NW = 19. 1 .LE. NW .LE. MIN(40, N - 1). */ /* */ /* NR = NUMBER OF ROWS AND COLUMNS IN THE CELL GRID DE- */ /* FINED IN SUBROUTINE STORE2. A RECTANGLE CON- */ /* TAINING THE NODES IS PARTITIONED INTO CELLS IN */ /* ORDER TO INCREASE SEARCH EFFICIENCY. NR = */ /* SQRT(N/3) IS RECOMMENDED. NR .GE. 1. */ /* */ /* THE ABOVE PARAMETERS ARE NOT ALTERED BY THIS ROUTINE. */ /* */ /* LCELL = ARRAY OF LENGTH .GE. NR**2. */ /* */ /* LNEXT = ARRAY OF LENGTH .GE. N. */ /* */ /* RSQ = ARRAY OF LENGTH .GE. N. */ /* */ /* A = ARRAY OF LENGTH .GE. 5N. */ /* */ /* ON OUTPUT -- */ /* */ /* LCELL = NR BY NR ARRAY OF NODAL INDICES ASSOCIATED */ /* WITH CELLS. REFER TO STORE2. */ /* */ /* LNEXT = ARRAY OF LENGTH N CONTAINING NEXT - NODE INDI- */ /* CES. REFER TO STORE2. */ /* */ /* XMIN, YMIN, DX, DY = MINIMUM NODAL COORDINATES AND CELL */ /* DIMENSIONS. REFER TO STORE2. */ /* */ /* RMAX = SQUARE ROOT OF THE LARGEST ELEMENT IN RSQ -- */ /* MAXIMUM RADIUS R(K). */ /* */ /* RSQ = ARRAY CONTAINING THE SQUARES OF THE RADII R(K) */ /* WHICH ENTER INTO THE WEIGHTS W(K). */ /* */ /* A = 5 BY N ARRAY CONTAINING THE COEFFICIENTS FOR */ /* QUADRATIC NODAL FUNCTION Q(K) IN COLUMN K. */ /* */ /* NOTE THAT THE ABOVE OUTPUT PARAMETERS ARE NOT DEFINED */ /* UNLESS IER = 0. */ /* */ /* IER = ERROR INDICATOR -- */ /* IER = 0 IF NO ERRORS WERE ENCOUNTERED. */ /* IER = 1 IF N, NQ, NW, OR NR IS OUT OF RANGE. */ /* IER = 2 IF DUPLICATE NODES WERE ENCOUNTERED. */ /* IER = 3 IF ALL NODES ARE COLLINEAR. */ /* */ /* MODULES REQUIRED BY QSHEP2 -- GETNP2, GIVENS, ROTATE, */ /* SETUP2, STORE2 */ /* */ /* INTRINSIC FUNCTIONS CALLED BY QSHEP2 -- ABS, AMIN1, FLOAT, */ /* MAX0, MIN0, SQRT */ /* */ /****************************************************************/ a -= 6; --rsq; --lnext; --f; --y; --x; lcell_dim1 = *nr; lcell_offset = 1 + lcell_dim1; lcell -= lcell_offset; /* LOCAL PARAMETERS -- */ /* */ /* AV = ROOT - MEAN - SQUARE DISTANCE BETWEEN K AND THE */ /* NODES IN THE LEAST SQUARES SYSTEM(UNLESS */ /* ADDITIONAL NODES ARE INTRODUCED FOR STABIL- */ /* ITY). THE FIRST 3 COLUMNS OF THE MATRIX */ /* ARE SCALED BY 1/AVSQ, THE LAST 2 BY 1/AV */ /* AVSQ = AV*AV */ /* B = TRANSPOSE OF THE AUGMENTED REGRESSION MATRIX */ /* C = FIRST COMPONENT OF THE PLANE ROTATION USED TO */ /* ZERO THE LOWER TRIANGLE OF B**T -- COMPUTED */ /* BY SUBROUTINE GIVENS */ /* DDX, DDY = LOCAL VARIABLES FOR DX AND DY */ /* DMIN = MINIMUM OF THE MAGNITUDES OF THE DIAGONAL */ /* ELEMENTS OF THE REGRESSION MATRIX AFTER */ /* ZEROS ARE INTRODUCED BELOW THE DIAGONAL */ /* DTOL = TOLERANCE FOR DETECTING AN ILL - CONDITIONED */ /* SYSTEM. THE SYSTEM IS ACCEPTED WHEN DMIN */ /* .GE. DTOL */ /* FK = DATA VALUE AT NODE K -- F(K) */ /* I = INDEX FOR A, B, AND NPTS */ /* IB = DO - LOOP INDEX FOR BACK SOLVE */ /* IERR = ERROR FLAG FOR THE CALL TO STORE2 */ /* IP1 = I + 1 */ /* IRM1 = IROW - 1 */ /* IROW = ROW INDEX FOR B */ /* J = INDEX FOR A AND B */ /* JP1 = J + 1 */ /* K = NODAL FUNCTION INDEX AND COLUMN INDEX FOR A */ /* LMAX = MAXIMUM NUMBER OF NPTS ELEMENTS(MUST BE CON- */ /* SISTENT WITH THE DIMENSION STATEMENT ABOVE) */ /* LNP = CURRENT LENGTH OF NPTS */ /* NEQ = NUMBER OF EQUATIONS IN THE LEAST SQUARES FIT */ /* NN, NNQ, NNR = LOCAL COPIES OF N, NQ, AND NR */ /* NNW = LOCAL COPY OF NW */ /* NP = NPTS ELEMENT */ /* NPTS = ARRAY CONTAINING THE INDICES OF A SEQUENCE OF */ /* NODES TO BE USED IN THE LEAST SQUARES FIT */ /* OR TO COMPUTE RSQ. THE NODES ARE ORDERED */ /* BY DISTANCE FROM K AND THE LAST ELEMENT */ /*(USUALLY INDEXED BY LNP) IS USED ONLY TO */ /* DETERMINE RQ, OR RSQ(K) IF NW .GT. NQ */ /* NQWMAX = MAX(NQ, NW) */ /* RQ = RADIUS OF INFLUENCE WHICH ENTERS INTO THE */ /* WEIGHTS FOR Q(K)(SEE SUBROUTINE SETUP2) */ /* RS = SQUARED DISTANCE BETWEEN K AND NPTS(LNP) -- */ /* USED TO COMPUTE RQ AND RSQ(K) */ /* RSMX = MAXIMUM RSQ ELEMENT ENCOUNTERED */ /* RSOLD = SQUARED DISTANCE BETWEEN K AND NPTS(LNP - 1) -- */ /* USED TO COMPUTE A RELATIVE CHANGE IN RS */ /* BETWEEN SUCCEEDING NPTS ELEMENTS */ /* RTOL = TOLERANCE FOR DETECTING A SUFFICIENTLY LARGE */ /* RELATIVE CHANGE IN RS. IF THE CHANGE IS */ /* NOT GREATER THAN RTOL, THE NODES ARE */ /* TREATED AS BEING THE SAME DISTANCE FROM K */ /* RWS = CURRENT VALUE OF RSQ(K) */ /* S = SECOND COMPONENT OF THE PLANE GIVENS ROTATION */ /* SF = MARQUARDT STABILIZATION FACTOR USED TO DAMP */ /* OUT THE FIRST 3 SOLUTION COMPONENTS(SECOND */ /* PARTIALS OF THE QUADRATIC) WHEN THE SYSTEM */ /* IS ILL - CONDITIONED. AS SF INCREASES, THE */ /* FITTING FUNCTION APPROACHES A LINEAR */ /* SUM = SUM OF SQUARED EUCLIDEAN DISTANCES BETWEEN */ /* NODE K AND THE NODES USED IN THE LEAST */ /* SQUARES FIT(UNLESS ADDITIONAL NODES ARE */ /* ADDED FOR STABILITY) */ /* T = TEMPORARY VARIABLE FOR ACCUMULATING A SCALAR */ /* PRODUCT IN THE BACK SOLVE */ /* XK, YK = COORDINATES OF NODE K -- X(K), Y(K) */ /* XMN, YMN = LOCAL VARIABLES FOR XMIN AND YMIN */ nn = *n; nnq = *nq; nnw = *nw; nnr = *nr; nqwmax = max(nnq, nnw); /* Computing MIN */ i__1 = 40, i__2 = nn - 1; lmax = min(i__1, i__2); if (5 > nnq || 1 > nnw || nqwmax > lmax || nnr < 1) { goto L20; } /* CREATE THE CELL DATA STRUCTURE, AND INITIALIZE RSMX. */ store2_(&nn, &x[1], &y[1], &nnr, &lcell[lcell_offset], &lnext[1], &xmn, & ymn, &ddx, &ddy, &ierr); if (ierr != 0) { goto L22; } rsmx = 0.f; /* OUTER LOOP ON NODE K */ i__1 = nn; for (k = 1; k <= i__1; ++k) { xk = x[k]; yk = y[k]; fk = f[k]; /* MARK NODE K TO EXCLUDE IT FROM THE SEARCH FOR NEAREST */ /* NEIGHBORS. */ lnext[k] = -lnext[k]; /* INITIALIZE FOR LOOP ON NPTS. */ rs = 0.f; sum = 0.f; rws = 0.f; rq = 0.f; lnp = 0; /* COMPUTE NPTS, LNP, RWS, NEQ, RQ, AND AVSQ. */ L1: sum += rs; if (lnp == lmax) { goto L3; } ++lnp; rsold = rs; getnp2_(&xk, &yk, &x[1], &y[1], &nnr, &lcell[lcell_offset], &lnext[1], &xmn, &ymn, &ddx, &ddy, &np, &rs); if (rs == 0.f) { goto L21; } npts[lnp - 1] = np; if ((rs - rsold) / rs < rtol) { goto L1; } if (rws == 0.f && lnp > nnw) { rws = rs; } if (rq != 0.f || lnp <= nnq) { goto L2; } /* RQ = 0(NOT YET COMPUTED) AND LNP .GT. NQ. RQ = */ /* SQRT(RS) IS SUFFICIENTLY LARGE TO(STRICTLY) INCLUDE */ /* NQ NODES. THE LEAST SQUARES FIT WILL INCLUDE NEQ = */ /* LNP - 1 EQUATIONS FOR 5 .LE. NQ .LE. NEQ .LT. LMAX */ /* .LE. N - 1. */ neq = lnp - 1; rq = sqrt(rs); avsq = sum / (double) neq; /* BOTTOM OF LOOP -- TEST FOR TERMINATION. */ L2: if (lnp > nqwmax) { goto L4; } goto L1; /* ALL LMAX NODES ARE INCLUDED IN NPTS. RWS AND/OR RQ**2 IS */ /*(ARBITRARILY) TAKEN TO BE 10 PERCENT LARGER THAN THE */ /* DISTANCE RS TO THE LAST NODE INCLUDED. */ L3: if (rws == 0.f) { rws = rs * 1.1f; } if (rq != 0.f) { goto L4; } neq = lmax; rq = sqrt(rs * 1.1f); avsq = sum / (double) neq; /* STORE RSQ(K), UPDATE RSMX IF NECESSARY, AND COMPUTE AV. */ L4: rsq[k] = rws; if (rws > rsmx) { rsmx = rws; } av = sqrt(avsq); /* SET UP THE AUGMENTED REGRESSION MATRIX(TRANSPOSED) AS THE */ /* COLUMNS OF B, AND ZERO OUT THE LOWER TRIANGLE(UPPER */ /* TRIANGLE OF B) WITH GIVENS ROTATIONS -- QR DECOMPOSITION */ /* WITH ORTHOGONAL MATRIX Q NOT STORED. */ i__ = 0; L5: ++i__; np = npts[i__ - 1]; irow = min(i__, 6); setup2_(&xk, &yk, &fk, &x[np], &y[np], &f[np], &av, &avsq, &rq, &b[ irow * 6 - 6]); if (i__ == 1) { goto L5; } irm1 = irow - 1; i__2 = irm1; for (j = 1; j <= i__2; ++j) { jp1 = j + 1; givens_(&b[j + j * 6 - 7], &b[j + irow * 6 - 7], &c__, &s); /* L6: */ i__3 = 6 - j; rotate_(&i__3, &c__, &s, &b[jp1 + j * 6 - 7], &b[jp1 + irow * 6 - 7]); } if (i__ < neq) { goto L5; } /* TEST THE SYSTEM FOR ILL - CONDITIONING. */ /* Computing MIN */ r__1 = dabs(b[0]), r__2 = dabs(b[7]), r__1 = min(r__1, r__2), r__2 = dabs(b[14]), r__1 = min(r__1, r__2), r__2 = dabs(b[21]), r__1 = min(r__1, r__2), r__2 = dabs(b[28]); dmin__ = dmin(r__1, r__2); if (dmin__ * rq >= dtol) { goto L13; } if (neq == lmax) { goto L10; } /* INCREASE RQ AND ADD ANOTHER EQUATION TO THE SYSTEM TO */ /* IMPROVE THE CONDITIONING. THE NUMBER OF NPTS ELEMENTS */ /* IS ALSO INCREASED IF NECESSARY. */ L7: rsold = rs; ++neq; if (neq == lmax) { goto L9; } if (neq == lnp) { goto L8; } /* NEQ .LT. LNP */ np = npts[neq]; /* Computing 2nd power */ r__1 = x[np] - xk; /* Computing 2nd power */ r__2 = y[np] - yk; rs = r__1 * r__1 + r__2 * r__2; if ((rs - rsold) / rs < rtol) { goto L7; } rq = sqrt(rs); goto L5; /* ADD AN ELEMENT TO NPTS. */ L8: ++lnp; getnp2_(&xk, &yk, &x[1], &y[1], &nnr, &lcell[lcell_offset], &lnext[1], &xmn, &ymn, &ddx, &ddy, &np, &rs); if (np == 0) { goto L21; } npts[lnp - 1] = np; if ((rs - rsold) / rs < rtol) { goto L7; } rq = sqrt(rs); goto L5; L9: rq = sqrt(rs * 1.1f); goto L5; /* STABILIZE THE SYSTEM BY DAMPING SECOND PARTIALS -- ADD */ /* MULTIPLES OF THE FIRST THREE UNIT VECTORS TO THE FIRST */ /* THREE EQUATIONS. */ L10: for (i__ = 1; i__ <= 3; ++i__) { b[i__ + 29] = sf; ip1 = i__ + 1; for (j = ip1; j <= 6; ++j) { /* L11: */ b[j + 29] = 0.f; } for (j = i__; j <= 5; ++j) { jp1 = j + 1; givens_(&b[j + j * 6 - 7], &b[j + 29], &c__, &s); /* L12: */ i__3 = 6 - j; rotate_(&i__3, &c__, &s, &b[jp1 + j * 6 - 7], &b[jp1 + 29]); } } /* TEST THE STABILIZED SYSTEM FOR ILL - CONDITIONING. */ /* Computing MIN */ r__1 = dabs(b[0]), r__2 = dabs(b[7]), r__1 = min(r__1, r__2), r__2 = dabs(b[14]), r__1 = min(r__1, r__2), r__2 = dabs(b[21]), r__1 = min(r__1, r__2), r__2 = dabs(b[28]); dmin__ = dmin(r__1, r__2); if (dmin__ * rq < dtol) { goto L22; } /* SOLVE THE 5 BY 5 TRIANGULAR SYSTEM FOR THE COEFFICIENTS */ L13: for (ib = 1; ib <= 5; ++ib) { i__ = 6 - ib; t = 0.f; if (i__ == 5) { goto L15; } ip1 = i__ + 1; for (j = ip1; j <= 5; ++j) { /* L14: */ t += b[j + i__ * 6 - 7] * a[j + k * 5]; } L15: a[i__ + k * 5] = (b[i__ * 6 - 1] - t) / b[i__ + i__ * 6 - 7]; } /* SCALE THE COEFFICIENTS TO ADJUST FOR THE COLUMN SCALING. */ for (i__ = 1; i__ <= 3; ++i__) { /* L16: */ a[i__ + k * 5] /= avsq; } a[k * 5 + 4] /= av; a[k * 5 + 5] /= av; /* UNMARK K AND THE ELEMENTS OF NPTS. */ lnext[k] = -lnext[k]; i__3 = lnp; for (i__ = 1; i__ <= i__3; ++i__) { np = npts[i__ - 1]; /* L17: */ lnext[np] = -lnext[np]; } /* L18: */ } /* NO ERRORS ENCOUNTERED. */ *xmin = xmn; *ymin = ymn; *dx = ddx; *dy = ddy; *rmax = sqrt(rsmx); *ier = 0; return 0; /* N, NQ, NW, OR NR IS OUT OF RANGE. */ L20: *ier = 1; return 0; /* DUPLICATE NODES WERE ENCOUNTERED BY GETNP2. */ L21: *ier = 2; return 0; /* NO UNIQUE SOLUTION DUE TO COLLINEAR NODES. */ L22: *xmin = xmn; *ymin = ymn; *dx = ddx; *dy = ddy; *ier = 3; return 0; } /* qshep2_ */ double qs2val_(double *px, double *py, int *n, double *x, double *y, double *f, int *nr, int *lcell, int *lnext, double *xmin, double *ymin, double *dx, double *dy, double *rmax, double *rsq, double *a) { int lcell_dim1, lcell_offset, i__1, i__2; double ret_val; // double sqrt(double); static int i__, j, k; static double w, rd, ds; static int kp; static double rs, xp, yp, sw, rds, swq; static int imin, jmin, imax, jmax; static double delx, dely, dxsq, dysq; /****************************************************************/ /* */ /* ROBERT RENKA */ /* UNIV. OF NORTH TEXAS */ /*(817) 565 - 2767 */ /* 10/28/87 */ /* */ /* THIS FUNCTION RETURNS THE VALUE Q(PX, PY) WHERE Q IS THE */ /* WEIGHTED SUM OF QUADRATIC NODAL FUNCTIONS DEFINED IN SUB- */ /* ROUTINE QSHEP2. QS2GRD MAY BE CALLED TO COMPUTE A GRADI- */ /* ENT OF Q ALONG WITH THE VALUE, AND/OR TO TEST FOR ERRORS. */ /* */ /* ON INPUT -- */ /* */ /* PX, PY = CARTESIAN COORDINATES OF THE POINT P AT */ /* WHICH Q IS TO BE EVALUATED. */ /* */ /* N = NUMBER OF NODES AND DATA VALUES DEFINING Q. */ /* N .GE. 6. */ /* */ /* X, Y, F = ARRAYS OF LENGTH N CONTAINING THE NODES AND */ /* DATA VALUES INTERPOLATED BY Q. */ /* */ /* NR = NUMBER OF ROWS AND COLUMNS IN THE CELL GRID. */ /* REFER TO STORE2. NR .GE. 1. */ /* */ /* LCELL = NR BY NR ARRAY OF NODAL INDICES ASSOCIATED */ /* WITH CELLS. REFER TO STORE2. */ /* */ /* LNEXT = ARRAY OF LENGTH N CONTAINING NEXT - NODE INDI- */ /* CES. REFER TO STORE2. */ /* */ /* XMIN, YMIN, DX, DY = MINIMUM NODAL COORDINATES AND CELL */ /* DIMENSIONS. DX AND DY MUST BE */ /* POSITIVE. REFER TO STORE2. */ /* */ /* RMAX = SQUARE ROOT OF THE LARGEST ELEMENT IN RSQ -- */ /* MAXIMUM RADIUS. */ /* */ /* RSQ = ARRAY OF LENGTH N CONTAINING THE SQUARED RADII */ /* WHICH ENTER INTO THE WEIGHTS DEFINING Q. */ /* */ /* A = 5 BY N ARRAY CONTAINING THE COEFFICIENTS FOR THE */ /* NODAL FUNCTIONS DEFINING Q. */ /* */ /* INPUT PARAMETERS ARE NOT ALTERED BY THIS FUNCTION. THE */ /* PARAMETERS OTHER THAN PX AND PY SHOULD BE INPUT UNALTERED */ /* FROM THEIR VALUES ON OUTPUT FROM QSHEP2. THIS FUNCTION */ /* SHOULD NOT BE CALLED IF A NONZERO ERROR FLAG WAS RETURNED */ /* BY QSHEP2. */ /* */ /* ON OUTPUT -- */ /* */ /* QS2VAL = FUNCTION VALUE Q(PX, PY) UNLESS N, NR, DX, */ /* DY, OR RMAX IS INVALID, IN WHICH CASE NO */ /* VALUE IS RETURNED. */ /* */ /* MODULES REQUIRED BY QS2VAL -- NONE */ /* */ /* INTRINSIC FUNCTIONS CALLED BY QS2VAL -- IFIX, SQRT */ /* */ /****************************************************************/ /* Parameter adjustments */ a -= 6; --rsq; --lnext; --f; --y; --x; lcell_dim1 = *nr; lcell_offset = 1 + lcell_dim1; lcell -= lcell_offset; /* Function Body */ xp = *px; yp = *py; if (*n < 6 || *nr < 1 || *dx <= 0.f || *dy <= 0.f || *rmax < 0.f) { return _missing_; } /* SET IMIN, IMAX, JMIN, AND JMAX TO CELL INDICES DEFINING */ /* THE RANGE OF THE SEARCH FOR NODES WHOSE RADII INCLUDE */ /* P. THE CELLS WHICH MUST BE SEARCHED ARE THOSE INTER- */ /* SECTED BY(OR CONTAINED IN) A CIRCLE OF RADIUS RMAX */ /* CENTERED AT P. */ imin = (int)((xp - *xmin - *rmax) / *dx) + 1; imax = (int)((xp - *xmin + *rmax) / *dx) + 1; if (imin < 1) { imin = 1; } if (imax > *nr) { imax = *nr; } jmin = (int)((yp - *ymin - *rmax) / *dy) + 1; jmax = (int)((yp - *ymin + *rmax) / *dy) + 1; if (jmin < 1) { jmin = 1; } if (jmax > *nr) { jmax = *nr; } /* THE FOLLOWING IS A TEST FOR NO CELLS WITHIN THE CIRCLE */ /* OF RADIUS RMAX. */ if (imin > imax || jmin > jmax) { goto L5; } /* ACCUMULATE WEIGHT VALUES IN SW AND WEIGHTED NODAL FUNCTION */ /* VALUES IN SWQ. THE WEIGHTS ARE W(K) =((R - D)+/(R*D))**2 */ /* FOR R**2 = RSQ(K) AND D = DISTANCE BETWEEN P AND NODE K. */ sw = 0.f; swq = 0.f; /* OUTER LOOP ON CELLS(I, J). */ i__1 = jmax; for (j = jmin; j <= i__1; ++j) { i__2 = imax; for (i__ = imin; i__ <= i__2; ++i__) { k = lcell[i__ + j * lcell_dim1]; if (k == 0) { goto L3; } /* INNER LOOP ON NODES K. */ L1: delx = xp - x[k]; dely = yp - y[k]; dxsq = delx * delx; dysq = dely * dely; ds = dxsq + dysq; rs = rsq[k]; if (ds >= rs) { goto L2; } if (ds == 0.f) { goto L4; } rds = rs * ds; rd = sqrt(rds); w = (rs + ds - rd - rd) / rds; sw += w; swq += w * (a[k * 5 + 1] * dxsq + a[k * 5 + 2] * delx * dely + a[ k * 5 + 3] * dysq + a[k * 5 + 4] * delx + a[k * 5 + 5] * dely + f[k]); /* BOTTOM OF LOOP ON NODES IN CELL(I, J). */ L2: kp = k; k = lnext[kp]; if (k != kp) { goto L1; } L3: ; } } /* SW = 0 IFF P IS NOT WITHIN THE RADIUS R(K) FOR ANY NODE K. */ if (sw == 0.f) { goto L5; } ret_val = swq / sw; return ret_val; /*(PX, PY) =(X(K), Y(K)) */ L4: ret_val = f[k]; return ret_val; /* ALL WEIGHTS ARE 0 AT P. */ L5: ret_val = _missing_; return ret_val; } int qs2grd_(double *px, double *py, int *n, double *x, double *y, double *f, int *nr, int *lcell, int *lnext, double *xmin, double *ymin, double *dx, double *dy, double *rmax, double *rsq, double *a, double * q, double *qx, double *qy, int *ier) { int lcell_dim1, lcell_offset, i__1, i__2; // double sqrt(double); static int i__, j, k; static double t, w, rd, ds; static int kp; static double qk, rs, xp, yp, sw, wx, wy, rds, qkx, qky, swq, sws, swx, swy; static int imin, jmin, imax, jmax; static double delx, dely, dxsq, dysq, swqx, swqy; /****************************************************************/ /* */ /* ROBERT RENKA */ /* UNIV. OF NORTH TEXAS */ /*(817) 565 - 2767 */ /* 10/28/87 */ /* */ /* THIS SUBROUTINE COMPUTES THE VALUE AND GRADIENT AT */ /*(PX, PY) OF THE INTERPOLATORY FUNCTION Q DEFINED IN SUB- */ /* ROUTINE QSHEP2. Q(X, Y) IS A WEIGHTED SUM OF QUADRATIC */ /* NODAL FUNCTIONS. */ /* */ /* ON INPUT -- */ /* */ /* PX, PY = CARTESIAN COORDINATES OF THE POINT AT WHICH */ /* Q AND ITS PARTIALS ARE TO BE EVALUATED. */ /* */ /* N = NUMBER OF NODES AND DATA VALUES DEFINING Q. */ /* N .GE. 6. */ /* */ /* X, Y, F = ARRAYS OF LENGTH N CONTAINING THE NODES AND */ /* DATA VALUES INTERPOLATED BY Q. */ /* */ /* NR = NUMBER OF ROWS AND COLUMNS IN THE CELL GRID. */ /* REFER TO STORE2. NR .GE. 1. */ /* */ /* LCELL = NR BY NR ARRAY OF NODAL INDICES ASSOCIATED */ /* WITH CELLS. REFER TO STORE2. */ /* */ /* LNEXT = ARRAY OF LENGTH N CONTAINING NEXT - NODE INDI- */ /* CES. REFER TO STORE2. */ /* */ /* XMIN, YMIN, DX, DY = MINIMUM NODAL COORDINATES AND CELL */ /* DIMENSIONS. DX AND DY MUST BE */ /* POSITIVE. REFER TO STORE2. */ /* */ /* RMAX = SQUARE ROOT OF THE LARGEST ELEMENT IN RSQ -- */ /* MAXIMUM RADIUS. */ /* */ /* RSQ = ARRAY OF LENGTH N CONTAINING THE SQUARED RADII */ /* WHICH ENTER INTO THE WEIGHTS DEFINING Q. */ /* */ /* A = 5 BY N ARRAY CONTAINING THE COEFFICIENTS FOR THE */ /* NODAL FUNCTIONS DEFINING Q. */ /* */ /* INPUT PARAMETERS ARE NOT ALTERED BY THIS SUBROUTINE. */ /* THE PARAMETERS OTHER THAN PX AND PY SHOULD BE INPUT UNAL- */ /* TERED FROM THEIR VALUES ON OUTPUT FROM QSHEP2. THIS SUB- */ /* ROUTINE SHOULD NOT BE CALLED IF A NONZERO ERROR FLAG WAS */ /* RETURNED BY QSHEP2. */ /* */ /* ON OUTPUT -- */ /* */ /* Q = VALUE OF Q AT(PX, PY) UNLESS IER .EQ. 1, IN */ /* WHICH CASE NO VALUES ARE RETURNED. */ /* */ /* QX, QY = FIRST PARTIAL DERIVATIVES OF Q AT(PX, PY) */ /* UNLESS IER .EQ. 1. */ /* */ /* IER = ERROR INDICATOR */ /* IER = 0 IF NO ERRORS WERE ENCOUNTERED. */ /* IER = 1 IF N, NR, DX, DY OR RMAX IS INVALID. */ /* IER = 2 IF NO ERRORS WERE ENCOUNTERED BUT */ /*(PX, PY) IS NOT WITHIN THE RADIUS R(K) */ /* FOR ANY NODE K(AND THUS Q = QX = QY = 0). */ /* */ /* MODULES REQUIRED BY QS2GRD -- NONE */ /* */ /* INTRINSIC FUNCTIONS CALLED BY QS2GRD -- IFIX, SQRT */ /* */ /* **************************************************************/ a -= 6; --rsq; --lnext; --f; --y; --x; lcell_dim1 = *nr; lcell_offset = 1 + lcell_dim1; lcell -= lcell_offset; xp = *px; yp = *py; if (*n < 6 || *nr < 1 || *dx <= 0.f || *dy <= 0.f || *rmax < 0.f) { goto L5; } /* SET IMIN, IMAX, JMIN, AND JMAX TO CELL INDICES DEFINING */ /* THE RANGE OF THE SEARCH FOR NODES WHOSE RADII INCLUDE */ /* P. THE CELLS WHICH MUST BE SEARCHED ARE THOSE INTER- */ /* SECTED BY(OR CONTAINED IN) A CIRCLE OF RADIUS RMAX */ /* CENTERED AT P. */ imin = (int)((xp - *xmin - *rmax) / *dx) + 1; imax = (int)((xp - *xmin + *rmax) / *dx) + 1; if (imin < 1) { imin = 1; } if (imax > *nr) { imax = *nr; } jmin = (int)((yp - *ymin - *rmax) / *dy) + 1; jmax = (int)((yp - *ymin + *rmax) / *dy) + 1; if (jmin < 1) { jmin = 1; } if (jmax > *nr) { jmax = *nr; } /* THE FOLLOWING IS A TEST FOR NO CELLS WITHIN THE CIRCLE */ /* OF RADIUS RMAX. */ if (imin > imax || jmin > jmax) { goto L6; } /* Q = SWQ/SW = SUM(W(K)*Q(K))/SUM(W(K)) WHERE THE SUM IS */ /* FROM K = 1 TO N, Q(K) IS THE QUADRATIC NODAL FUNCTION, */ /* AND W(K) =((R - D)+/(R*D))**2 FOR RADIUS R(K) AND DIST- */ /* ANCE D(K). THUS */ /* QX =(SWQX*SW - SWQ*SWX)/SW**2 AND */ /* QY =(SWQY*SW - SWQ*SWY)/SW**2 */ /* WHERE SWQX AND SWX ARE PARTIAL DERIVATIVES WITH RESPECT */ /* TO X OF SWQ AND SW, RESPECTIVELY. SWQY AND SWY ARE DE- */ /* FINED SIMILARLY. */ sw = 0.f; swx = 0.f; swy = 0.f; swq = 0.f; swqx = 0.f; swqy = 0.f; /* OUTER LOOP ON CELLS(I, J). */ i__1 = jmax; for (j = jmin; j <= i__1; ++j) { i__2 = imax; for (i__ = imin; i__ <= i__2; ++i__) { k = lcell[i__ + j * lcell_dim1]; if (k == 0) { goto L3; } /* INNER LOOP ON NODES K. */ L1: delx = xp - x[k]; dely = yp - y[k]; dxsq = delx * delx; dysq = dely * dely; ds = dxsq + dysq; rs = rsq[k]; if (ds >= rs) { goto L2; } if (ds == 0.f) { goto L4; } rds = rs * ds; rd = sqrt(rds); w = (rs + ds - rd - rd) / rds; t = (rd - rs) * 2.f / (ds * rds); wx = delx * t; wy = dely * t; qkx = a[k * 5 + 1] * 2.f * delx + a[k * 5 + 2] * dely; qky = a[k * 5 + 2] * delx + a[k * 5 + 3] * 2.f * dely; qk = (qkx * delx + qky * dely) / 2.f; qkx += a[k * 5 + 4]; qky += a[k * 5 + 5]; qk = qk + a[k * 5 + 4] * delx + a[k * 5 + 5] * dely + f[k]; sw += w; swx += wx; swy += wy; swq += w * qk; swqx = swqx + wx * qk + w * qkx; swqy = swqy + wy * qk + w * qky; /* BOTTOM OF LOOP ON NODES IN CELL(I, J). */ L2: kp = k; k = lnext[kp]; if (k != kp) { goto L1; } L3: ; } } /* SW = 0 IFF P IS NOT WITHIN THE RADIUS R(K) FOR ANY NODE K. */ if (sw == 0.f) { goto L6; } *q = swq / sw; sws = sw * sw; *qx = (swqx * sw - swq * swx) / sws; *qy = (swqy * sw - swq * swy) / sws; *ier = 0; return 0; /*(PX, PY) =(X(K), Y(K)) */ L4: *q = f[k]; *qx = a[k * 5 + 4]; *qy = a[k * 5 + 5]; *ier = 0; return 0; /* INVALID INPUT PARAMETER. */ L5: *ier = 1; return 0; /* NO CELLS CONTAIN A POINT WITHIN RMAX OF P, OR */ /* SW = 0 AND THUS DS .GE. RSQ(K) FOR ALL K. */ L6: *q = 0.f; *qx = 0.f; *qy = 0.f; *ier = 2; return 0; } /* qs2grd_ */ /* Subroutine */ int getnp2_(double *px, double *py, double *x, double *y, int * nr, int *lcell, int *lnext, double *xmin, double *ymin, double *dx, double *dy, int *np, double *dsq) { int lcell_dim1, lcell_offset, i__1, i__2; double r__1, r__2; // double sqrt(double); static int i__, j, l; static double r__; static int i0, j0, i1, i2, j1, j2, ln; static double xp, yp, rsq; static int imin, jmin, imax, jmax; static double delx, dely; static int lmin; static bool first; static double rsmin; /****************************************************************/ /* */ /* ROBERT RENKA */ /* UNIV. OF NORTH TEXAS */ /*(817) 565 - 2767 */ /* */ /* GIVEN A SET OF N NODES AND THE DATA STRUCTURE DEFINED IN */ /* SUBROUTINE STORE2, THIS SUBROUTINE USES THE CELL METHOD TO */ /* FIND THE CLOSEST UNMARKED NODE NP TO A SPECIFIED POINT P. */ /* NP IS THEN MARKED BY SETTING LNEXT(NP) TO -LNEXT(NP).(A */ /* NODE IS MARKED IF AND ONLY IF THE CORRESPONDING LNEXT ELE- */ /* MENT IS NEGATIVE. THE ABSOLUTE VALUES OF LNEXT ELEMENTS, */ /* HOWEVER, MUST BE PRESERVED.) THUS, THE CLOSEST M NODES TO */ /* P MAY BE DETERMINED BY A SEQUENCE OF M CALLS TO THIS ROU- */ /* TINE. NOTE THAT IF THE NEAREST NEIGHBOR TO NODE K IS TO */ /* BE DETERMINED(PX = X(K) AND PY = Y(K)), THEN K SHOULD BE */ /* MARKED BEFORE THE CALL TO THIS ROUTINE. */ /* THE SEARCH IS BEGUN IN THE CELL CONTAINING(OR CLOSEST */ /* TO) P AND PROCEEDS OUTWARD IN RECTANGULAR LAYERS UNTIL ALL */ /* CELLS WHICH CONTAIN POINTS WITHIN DISTANCE R OF P HAVE */ /* BEEN SEARCHED, WHERE R IS THE DISTANCE FROM P TO THE FIRST */ /* UNMARKED NODE ENCOUNTERED(INFINITE IF NO UNMARKED NODES */ /* ARE PRESENT). */ /* */ /* ON INPUT -- */ /* */ /* PX, PY = CARTESIAN COORDINATES OF THE POINT P WHOSE */ /* NEAREST UNMARKED NEIGHBOR IS TO BE FOUND. */ /* */ /* X, Y = ARRAYS OF LENGTH N, FOR N .GE. 2, CONTAINING */ /* THE CARTESIAN COORDINATES OF THE NODES. */ /* */ /* NR = NUMBER OF ROWS AND COLUMNS IN THE CELL GRID. */ /* NR .GE. 1. */ /* */ /* LCELL = NR BY NR ARRAY OF NODAL INDICES ASSOCIATED */ /* WITH CELLS. */ /* */ /* LNEXT = ARRAY OF LENGTH N CONTAINING NEXT - NODE INDI- */ /* CES(OR THEIR NEGATIVES). */ /* */ /* XMIN, YMIN, DX, DY = MINIMUM NODAL COORDINATES AND CELL */ /* DIMENSIONS. DX AND DY MUST BE */ /* POSITIVE. */ /* */ /* INPUT PARAMETERS OTHER THAN LNEXT ARE NOT ALTERED BY */ /* THIS ROUTINE. WITH THE EXCEPTION OF(PX, PY) AND THE SIGNS */ /* OF LNEXT ELEMENTS, THESE PARAMETERS SHOULD BE UNALTERED */ /* FROM THEIR VALUES ON OUTPUT FROM SUBROUTINE STORE2. */ /* */ /* ON OUTPUT -- */ /* */ /* NP = INDEX(FOR X AND Y) OF THE NEAREST UNMARKED */ /* NODE TO P, OR 0 IF ALL NODES ARE MARKED OR NR */ /* .LT. 1 OR DX .LE. 0 OR DY .LE. 0. LNEXT(NP) */ /* .LT. 0 IF NP .NE. 0. */ /* */ /* DSQ = SQUARED EUCLIDEAN DISTANCE BETWEEN P AND NODE */ /* NP, OR 0 IF NP = 0. */ /* */ /* MODULES REQUIRED BY GETNP2 -- NONE */ /* */ /* INTRINSIC FUNCTIONS CALLED BY GETNP2 -- IABS, IFIX, SQRT */ /* */ /****************************************************************/ --x; --y; lcell_dim1 = *nr; lcell_offset = 1 + lcell_dim1; lcell -= lcell_offset; --lnext; xp = *px; yp = *py; /* TEST FOR INVALID INPUT PARAMETERS. */ if (*nr < 1 || *dx <= 0.f || *dy <= 0.f) { goto L9; } /* INITIALIZE PARAMETERS -- */ /* FIRST = TRUE IFF THE FIRST UNMARKED NODE HAS YET TO BE */ /* ENCOUNTERED, */ /* IMIN, IMAX, JMIN, JMAX = CELL INDICES DEFINING THE RANGE OF */ /* THE SEARCH, */ /* DELX, DELY = PX - XMIN AND PY - YMIN, */ /* I0, J0 = CELL CONTAINING OR CLOSEST TO P, */ /* I1, I2, J1, J2 = CELL INDICES OF THE LAYER WHOSE INTERSEC- */ /* TION WITH THE RANGE DEFINED BY IMIN,..., */ /* JMAX IS CURRENTLY BEING SEARCHED. */ first = true; imin = 1; imax = *nr; jmin = 1; jmax = *nr; delx = xp - *xmin; dely = yp - *ymin; i0 = (int)(delx / *dx) + 1; if (i0 < 1) { i0 = 1; } if (i0 > *nr) { i0 = *nr; } j0 = (int)(dely / *dy) + 1; if (j0 < 1) { j0 = 1; } if (j0 > *nr) { j0 = *nr; } i1 = i0; i2 = i0; j1 = j0; j2 = j0; /* OUTER LOOP ON LAYERS, INNER LOOP ON LAYER CELLS, EXCLUDING */ /* THOSE OUTSIDE THE RANGE(IMIN, IMAX) X(JMIN, JMAX). */ L1: i__1 = j2; for (j = j1; j <= i__1; ++j) { if (j > jmax) { goto L7; } if (j < jmin) { goto L6; } i__2 = i2; for (i__ = i1; i__ <= i__2; ++i__) { if (i__ > imax) { goto L6; } if (i__ < imin) { goto L5; } if (j != j1 && j != j2 && i__ != i1 && i__ != i2) { goto L5; } /* SEARCH CELL(I, J) FOR UNMARKED NODES L. */ l = lcell[i__ + j * lcell_dim1]; if (l == 0) { goto L5; } /* LOOP ON NODES IN CELL(I, J). */ L2: ln = lnext[l]; if (ln < 0) { goto L4; } /* NODE L IS NOT MARKED. */ /* Computing 2nd power */ r__1 = x[l] - xp; /* Computing 2nd power */ r__2 = y[l] - yp; rsq = r__1 * r__1 + r__2 * r__2; if (! first) { goto L3; } /* NODE L IS THE FIRST UNMARKED NEIGHBOR OF P ENCOUNTERED. */ /* INITIALIZE LMIN TO THE CURRENT CANDIDATE FOR NP, AND */ /* RSMIN TO THE SQUARED DISTANCE FROM P TO LMIN. IMIN, */ /* IMAX, JMIN, AND JMAX ARE UPDATED TO DEFINE THE SMAL- */ /* LEST RECTANGLE CONTAINING A CIRCLE OF RADIUS R = */ /* SQRT(RSMIN) CENTERED AT P, AND CONTAINED IN(1, NR) X */ /*(1, NR)(EXCEPT THAT, IF P IS OUTSIDE THE RECTANGLE */ /* DEFINED BY THE NODES, IT IS POSSIBLE THAT IMIN .GT. */ /* NR, IMAX .LT. 1, JMIN .GT. NR, OR JMAX .LT. 1). FIRST */ /* IS RESET TO FALSE. */ lmin = l; rsmin = rsq; r__ = sqrt(rsmin); imin = (int)((delx - r__) / *dx) + 1; if (imin < 1) { imin = 1; } imax = (int)((delx + r__) / *dx) + 1; if (imax > *nr) { imax = *nr; } jmin = (int)((dely - r__) / *dy) + 1; if (jmin < 1) { jmin = 1; } jmax = (int)((dely + r__) / *dy) + 1; if (jmax > *nr) { jmax = *nr; } first = false; goto L4; /* TEST FOR NODE L CLOSER THAN LMIN TO P. */ L3: if (rsq >= rsmin) { goto L4; } /* UPDATE LMIN AND RSMIN. */ lmin = l; rsmin = rsq; /* TEST FOR TERMINATION OF LOOP ON NODES IN CELL(I, J). */ L4: if (abs(ln) == l) { goto L5; } l = abs(ln); goto L2; L5: ; } L6: ; } /* TEST FOR TERMINATION OF LOOP ON CELL LAYERS. */ L7: if (i1 <= imin && i2 >= imax && j1 <= jmin && j2 >= jmax) { goto L8; } --i1; ++i2; --j1; ++j2; goto L1; /* UNLESS NO UNMARKED NODES WERE ENCOUNTERED, LMIN IS THE */ /* CLOSEST UNMARKED NODE TO P. */ L8: if (first) { goto L9; } *np = lmin; *dsq = rsmin; lnext[lmin] = -lnext[lmin]; return 0; /* ERROR -- NR, DX, OR DY IS INVALID OR ALL NODES ARE MARKED. */ L9: *np = 0; *dsq = 0.f; return 0; } /* getnp2_ */ /* Subroutine */ int givens_(double *a, double *b, double *c__, double *s) { /* Builtin functions */ // double sqrt(double); /* Local variables */ static double r__, u, v, aa, bb; /****************************************************************/ /* */ /* ROBERT RENKA */ /* UNIV. OF NORTH TEXAS */ /*(817) 565 - 2767 */ /* */ /* THIS ROUTINE CONSTRUCTS THE GIVENS PLANE ROTATION -- */ /*(C S) */ /* G =() WHERE C*C + S*S = 1 -- WHICH ZEROS THE SECOND */ /*(-S C) */ /* ENTRY OF THE 2 - VECTOR(A B) - TRANSPOSE. A CALL TO GIVENS */ /* IS NORMALLY FOLLOWED BY A CALL TO ROTATE WHICH APPLIES */ /* THE TRANSFORMATION TO A 2 BY N MATRIX. THIS ROUTINE WAS */ /* TAKEN FROM LINPACK. */ /* */ /* ON INPUT -- */ /* */ /* A, B = COMPONENTS OF THE 2 - VECTOR TO BE ROTATED. */ /* */ /* ON OUTPUT -- */ /* */ /* A = VALUE OVERWRITTEN BY R = +/-SQRT(A*A + B*B) */ /* */ /* B = VALUE OVERWRITTEN BY A VALUE Z WHICH ALLOWS C */ /* AND S TO BE RECOVERED AS FOLLOWS -- */ /* C = SQRT(1 - Z*Z), S = Z IF ABS(Z) .LE. 1. */ /* C = 1/Z, S = SQRT(1 - C*C) IF ABS(Z) .GT. 1. */ /* */ /* C = +/-(A/R) */ /* */ /* S = +/-(B/R) */ /* */ /* MODULES REQUIRED BY GIVENS -- NONE */ /* */ /* INTRINSIC FUNCTIONS CALLED BY GIVENS - ABS, SQRT */ /* */ /****************************************************************/ /* LOCAL PARAMETERS -- */ /* AA, BB = LOCAL COPIES OF A AND B */ /* R = C*A + S*B = +/-SQRT(A*A + B*B) */ /* U, V = VARIABLES USED TO SCALE A AND B FOR COMPUTING R */ aa = *a; bb = *b; if (dabs(aa) <= dabs(bb)) { goto L1; } /* ABS(A) .GT. ABS(B) */ u = aa + aa; v = bb / u; r__ = sqrt(v * v + .25f) * u; *c__ = aa / r__; *s = v * (*c__ + *c__); /* NOTE THAT R HAS THE SIGN OF A, C .GT. 0, AND S HAS */ /* SIGN(A)*SIGN(B). */ *b = *s; *a = r__; return 0; /* ABS(A) .LE. ABS(B) */ L1: if (bb == 0.f) { goto L2; } u = bb + bb; v = aa / u; /* STORE R IN A. */ *a = sqrt(v * v + .25f) * u; *s = bb / *a; *c__ = v * (*s + *s); /* NOTE THAT R HAS THE SIGN OF B, S .GT. 0, AND C HAS */ /* SIGN(A)*SIGN(B). */ *b = 1.f; if (*c__ != 0.f) { *b = 1.f / *c__; } return 0; /* A = B = 0. */ L2: *c__ = 1.f; *s = 0.f; return 0; } /* givens_ */ int rotate_(int *n, double *c__, double *s, double *x, double *y) { int i__1; static int i__; static double xi, yi; /****************************************************************/ /* */ /* ROBERT RENKA */ /* UNIV. OF NORTH TEXAS */ /*(817) 565 - 2767 */ /* */ /*(C S) */ /* THIS ROUTINE APPLIES THE GIVENS ROTATION() TO THE */ /*(-S C) */ /*(X(1) ... X(N)) */ /* 2 BY N MATRIX(). */ /*(Y(1) ... Y(N)) */ /* */ /* ON INPUT -- */ /* */ /* N = NUMBER OF COLUMNS TO BE ROTATED. */ /* */ /* C, S = ELEMENTS OF THE GIVENS ROTATION. THESE MAY BE */ /* DETERMINED BY SUBROUTINE GIVENS. */ /* */ /* X, Y = ARRAYS OF LENGTH .GE. N CONTAINING THE VECTORS */ /* TO BE ROTATED. */ /* */ /* PARAMETERS N, C, AND S ARE NOT ALTERED BY THIS ROUTINE. */ /* */ /* ON OUTPUT -- */ /* */ /* X, Y = ROTATED VECTORS. */ /* */ /* MODULES REQUIRED BY ROTATE -- NONE */ /* */ /****************************************************************/ /* LOCAL PARAMETERS -- */ /* I = DO - LOOP INDEX */ /* XI, YI = X(I), Y(I) */ /* Parameter adjustments */ --y; --x; /* Function Body */ if (*n <= 0 || *c__ == 1.f && *s == 0.f) { return 0; } i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { xi = x[i__]; yi = y[i__]; x[i__] = *c__ * xi + *s * yi; y[i__] = -(*s) * xi + *c__ * yi; /* L1: */ } return 0; } /* rotate_ */ /* Subroutine */ int setup2_(double *xk, double *yk, double *fk, double *xi, double *yi, double *fi, double *s1, double *s2, double *r__, double *row) { // double sqrt(double); static double d__; static int i__; static double w, w1, w2, dx, dy, dxsq, dysq; /****************************************************************/ /* */ /* ROBERT RENKA */ /* UNIV. OF NORTH TEXAS */ /*(817) 565 - 2767 */ /* */ /* THIS ROUTINE SETS UP THE I - TH ROW OF AN AUGMENTED RE- */ /* GRESSION MATRIX FOR A WEIGHTED LEAST - SQUARES FIT OF A */ /* QUADRATIC FUNCTION Q(X, Y) TO A SET OF DATA VALUES F, WHERE */ /* Q(XK, YK) = FK. THE FIRST 3 COLUMNS(QUADRATIC TERMS) ARE */ /* SCALED BY 1/S2 AND THE FOURTH AND FIFTH COLUMNS(LINEAR */ /* TERMS) ARE SCALED BY 1/S1. THE WEIGHT IS(R - D)/(R*D) IF */ /* R .GT. D AND 0 IF R .LE. D, WHERE D IS THE DISTANCE */ /* BETWEEN NODES I AND K. */ /* */ /* ON INPUT -- */ /* */ /* XK, YK, FK = COORDINATES AND DATA VALUE AT NODE K -- */ /* INTERPOLATED BY Q. */ /* */ /* XI, YI, FI = COORDINATES AND DATA VALUE AT NODE I. */ /* */ /* S1, S2 = RECIPROCALS OF THE SCALE FACTORS. */ /* */ /* R = RADIUS OF INFLUENCE ABOUT NODE K DEFINING THE */ /* WEIGHT. */ /* */ /* ROW = ARRAY OF LENGTH 6. */ /* */ /* INPUT PARAMETERS ARE NOT ALTERED BY THIS ROUTINE. */ /* */ /* ON OUTPUT -- */ /* */ /* ROW = VECTOR CONTAINING A ROW OF THE AUGMENTED */ /* REGRESSION MATRIX. */ /* */ /* MODULES REQUIRED BY SETUP2 -- NONE */ /* */ /* INTRINSIC FUNCTION CALLED BY SETUP2 -- SQRT */ /* */ /****************************************************************/ /* LOCAL PARAMETERS - */ /* I = DO - LOOP INDEX */ /* DX = XI - XK */ /* DY = YI - YK */ /* DXSQ = DX*DX */ /* DYSQ = DY*DY */ /* D = DISTANCE BETWEEN NODES K AND I */ /* W = WEIGHT ASSOCIATED WITH THE ROW */ /* W1 = W/S1 */ /* W2 = W/S2 */ --row; dx = *xi - *xk; dy = *yi - *yk; dxsq = dx * dx; dysq = dy * dy; d__ = sqrt(dxsq + dysq); if (d__ <= 0.f || d__ >= *r__) { goto L1; } w = (*r__ - d__) / *r__ / d__; w1 = w / *s1; w2 = w / *s2; row[1] = dxsq * w2; row[2] = dx * dy * w2; row[3] = dysq * w2; row[4] = dx * w1; row[5] = dy * w1; row[6] = (*fi - *fk) * w; return 0; /* NODES K AND I COINCIDE OR NODE I IS OUTSIDE OF THE RADIUS */ /* OF INFLUENCE. SET ROW TO THE ZERO VECTOR. */ L1: for (i__ = 1; i__ <= 6; ++i__) { /* L2: */ row[i__] = 0.f; } return 0; } /* setup2_ */ /* Subroutine */ int store2_(int *n, double *x, double *y, int *nr, int *lcell, int *lnext, double *xmin, double *ymin, double *dx, double *dy, int *ier) { int lcell_dim1, lcell_offset, i__1, i__2; static int i__, j, k, l, kb, nn, np1, nnr; static double xmn, ymn, xmx, ymx, delx, dely; /****************************************************************/ /* */ /* ROBERT RENKA */ /* UNIV. OF NORTH TEXAS */ /*(817) 565 - 2767 */ /* */ /* GIVEN A SET OF N ARBITRARILY DISTRIBUTED NODES IN THE */ /* PLANE, THIS SUBROUTINE CREATES A DATA STRUCTURE FOR A */ /* CELL - BASED METHOD OF SOLVING CLOSEST - POINT PROBLEMS. THE */ /* SMALLEST RECTANGLE CONTAINING THE NODES IS PARTITIONED */ /* INTO AN NR BY NR UNIFORM GRID OF CELLS, AND NODES ARE AS- */ /* SOCIATED WITH CELLS. IN PARTICULAR, THE DATA STRUCTURE */ /* STORES THE INDICES OF THE NODES CONTAINED IN EACH CELL. */ /* FOR A UNIFORM RANDOM DISTRIBUTION OF NODES, THE NEAREST */ /* NODE TO AN ARBITRARY POINT CAN BE DETERMINED IN CONSTANT */ /* EXPECTED TIME. */ /* */ /* ON INPUT -- */ /* */ /* N = NUMBER OF NODES. N .GE. 2. */ /* */ /* X, Y = ARRAYS OF LENGTH N CONTAINING THE CARTESIAN */ /* COORDINATES OF THE NODES. */ /* */ /* NR = NUMBER OF ROWS AND COLUMNS IN THE GRID. THE */ /* CELL DENSITY(AVERAGE NUMBER OF NODES PER CELL) */ /* IS D = N/(NR**2). A RECOMMENDED VALUE, BASED */ /* ON EMPIRICAL EVIDENCE, IS D = 3 -- NR = */ /* SQRT(N/3). NR .GE. 1. */ /* */ /* THE ABOVE PARAMETERS ARE NOT ALTERED BY THIS ROUTINE. */ /* */ /* LCELL = ARRAY OF LENGTH .GE. NR**2. */ /* */ /* LNEXT = ARRAY OF LENGTH .GE. N. */ /* */ /* ON OUTPUT -- */ /* */ /* LCELL = NR BY NR CELL ARRAY SUCH THAT LCELL(I, J) */ /* CONTAINS THE INDEX(FOR X AND Y) OF THE */ /* FIRST NODE(NODE WITH SMALLEST INDEX) IN */ /* CELL(I, J), OR LCELL(I, J) = 0 IF NO NODES */ /* ARE CONTAINED IN THE CELL. THE UPPER RIGHT */ /* CORNER OF CELL(I, J) HAS COORDINATES(XMIN+ */ /* I*DX, YMIN + J*DY). LCELL IS NOT DEFINED IF */ /* IER .NE. 0. */ /* */ /* LNEXT = ARRAY OF NEXT - NODE INDICES SUCH THAT */ /* LNEXT(K) CONTAINS THE INDEX OF THE NEXT NODE */ /* IN THE CELL WHICH CONTAINS NODE K, OR */ /* LNEXT(K) = K IF K IS THE LAST NODE IN THE */ /* CELL FOR K = 1,..., N.(THE NODES CONTAINED */ /* IN A CELL ARE ORDERED BY THEIR INDICES.) */ /* IF, FOR EXAMPLE, CELL(I, J) CONTAINS NODES */ /* 2, 3, AND 5(AND NO OTHERS), THEN LCELL(I, J) */ /* = 2, LNEXT(2) = 3, LNEXT(3) = 5, AND */ /* LNEXT(5) = 5. LNEXT IS NOT DEFINED IF */ /* IER .NE. 0. */ /* */ /* XMIN, YMIN = CARTESIAN COORDINATES OF THE LOWER LEFT */ /* CORNER OF THE RECTANGLE DEFINED BY THE */ /* NODES(SMALLEST NODAL COORDINATES) UN- */ /* LESS IER = 1. THE UPPER RIGHT CORNER IS */ /*(XMAX, YMAX) FOR XMAX = XMIN + NR*DX AND */ /* YMAX = YMIN + NR*DY. */ /* */ /* DX, DY = DIMENSIONS OF THE CELLS UNLESS IER = 1. DX */ /* =(XMAX - XMIN)/NR AND DY =(YMAX - YMIN)/NR */ /* WHERE XMIN, XMAX, YMIN, AND YMAX ARE THE */ /* EXTREMA OF X AND Y. */ /* */ /* IER = ERROR INDICATOR -- */ /* IER = 0 IF NO ERRORS WERE ENCOUNTERED. */ /* IER = 1 IF N .LT. 2 OR NR .LT. 1. */ /* IER = 2 IF DX = 0 OR DY = 0. */ /* */ /* MODULES REQUIRED BY STORE2 -- NONE */ /* */ /* INTRINSIC FUNCTIONS CALLED BY STORE2 -- FLOAT, IFIX */ /* */ /****************************************************************/ /* Parameter adjustments */ --lnext; --y; --x; lcell_dim1 = *nr; lcell_offset = 1 + lcell_dim1; lcell -= lcell_offset; /* Function Body */ nn = *n; nnr = *nr; if (nn < 2 || nnr < 1) { goto L4; } /* COMPUTE THE DIMENSIONS OF THE RECTANGLE CONTAINING THE */ /* NODES. */ xmn = x[1]; xmx = xmn; ymn = y[1]; ymx = ymn; i__1 = nn; for (k = 2; k <= i__1; ++k) { if (x[k] < xmn) { xmn = x[k]; } if (x[k] > xmx) { xmx = x[k]; } if (y[k] < ymn) { ymn = y[k]; } /* L1: */ if (y[k] > ymx) { ymx = y[k]; } } *xmin = xmn; *ymin = ymn; /* COMPUTE CELL DIMENSIONS AND TEST FOR ZERO AREA. */ delx = (xmx - xmn) / (double) nnr; dely = (ymx - ymn) / (double) nnr; *dx = delx; *dy = dely; if (delx == 0.f || dely == 0.f) { goto L5; } /* INITIALIZE LCELL. */ i__1 = nnr; for (j = 1; j <= i__1; ++j) { i__2 = nnr; for (i__ = 1; i__ <= i__2; ++i__) { /* L2: */ lcell[i__ + j * lcell_dim1] = 0; } } /* LOOP ON NODES, STORING INDICES IN LCELL AND LNEXT. */ np1 = nn + 1; i__2 = nn; for (k = 1; k <= i__2; ++k) { kb = np1 - k; i__ = (int)((x[kb] - xmn) / delx) + 1; if (i__ > nnr) { i__ = nnr; } j = (int)((y[kb] - ymn) / dely) + 1; if (j > nnr) { j = nnr; } l = lcell[i__ + j * lcell_dim1]; lnext[kb] = l; if (l == 0) { lnext[kb] = kb; } /* L3: */ lcell[i__ + j * lcell_dim1] = kb; } /* NO ERRORS ENCOUNTERED */ *ier = 0; return 0; /* INVALID INPUT PARAMETER */ L4: *ier = 1; return 0; /* DX = 0 OR DY = 0 */ L5: *ier = 2; return 0; } saga-2.1.0+dfsg/src/modules/grid/grid_gridding/Shepard.h000066400000000000000000000035351224124640700230730ustar00rootroot00000000000000/********************************************************** * Version $Id: Shepard.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shepard_H #define HEADER_INCLUDED__Shepard_H //--------------------------------------------------------- #define abs(x)((x) >= 0 ?(x) : -(x)) #define dabs(x)(double)abs(x) #ifndef min #define min(a, b) ((a) <= (b) ? (a) : (b)) #endif #ifndef max #define max(a, b) ((a) >= (b) ? (a) : (b)) #endif #define dmin(a, b) (double)min(a, b) #define dmax(a, b) (double)max(a, b) static int qshep2_(int *n, double *x, double *y, double *f, int * nq, int *nw, int *nr, int *lcell, int *lnext, double * xmin, double *ymin, double *dx, double *dy, double *rmax, double *rsq, double *a, int *ier); static double qs2val_(double *px, double *py, int *n, double *x, double *y, double *f, int *nr, int *lcell, int *lnext, double *xmin, double *ymin, double *dx, double *dy, double *rmax, double *rsq, double *a); class CShepard2d { public: CShepard2d (void); ~CShepard2d (void); int Interpolate (double *X, double * Y, double * F, int N_Points, int Quadratic_Neighbors, int Weighting_Neighbors ); void GetValue (double px, double py, double &q); void Set_Missing(double missing); protected: double *m_x, *m_y, *m_f; int *m_cells; int *m_next; double *m_rsq; double *m_a; double xmin, ymin, dx, dy, rmax; int m_nPoints; int m_nr; void Remove (void) { this->CShepard2d::~CShepard2d(); } int GetGradient (double px, double py, double &q, double &qx, double &qy); }; #endif // #ifndef HEADER_INCLUDED__Shepard_H saga-2.1.0+dfsg/src/modules/grid/grid_gridding/kernel_density.cpp000066400000000000000000000230371224124640700250560ustar00rootroot00000000000000/********************************************************** * Version $Id: kernel_density.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // kernel_density.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "kernel_density.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define X_WORLD_TO_GRID(X) (((X) - m_pGrid->Get_XMin()) / m_pGrid->Get_Cellsize()) #define Y_WORLD_TO_GRID(Y) (((Y) - m_pGrid->Get_YMin()) / m_pGrid->Get_Cellsize()) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CKernel_Density::CKernel_Density(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Kernel Density Estimation")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Kernel density estimation. If any point is currently in selection only selected points are taken into account.\n" "\n" "References:\n" "- Fotheringham, A.S., Brunsdon, C., Charlton, M. (2000): Quantitative Geography. Sage. 270p.\n" "- Lloyd, C.D. (2010): Spatial data analysis - An introduction for GIS users. Oxford. 206p.\n" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "POPULATION" , _TL("Population"), _TL(""), true ); Parameters.Add_Value( NULL , "RADIUS" , _TL("Radius"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); Parameters.Add_Choice( NULL , "KERNEL" , _TL("Kernel"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("quartic kernel"), _TL("gaussian kernel") ), 0 ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TARGET" , _TL("Target Grid"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("user defined"), _TL("grid") ), 0 ); m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid") , _TL(""))); m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid") , _TL(""))); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CKernel_Density::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CKernel_Density::On_Execute(void) { int Population; double Radius; CSG_Shapes *pPoints; //----------------------------------------------------- pPoints = Parameters("POINTS") ->asShapes(); Population = Parameters("POPULATION") ->asInt(); Radius = Parameters("RADIUS") ->asDouble(); m_Kernel = Parameters("KERNEL") ->asInt(); if( Population < 0 || Population >= pPoints->Get_Field_Count() || pPoints->Get_Field_Type(Population) == SG_DATATYPE_String ) { Population = -1; } //----------------------------------------------------- m_pGrid = NULL; switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... { CSG_Rect Extent(pPoints->Get_Extent()); Extent.Inflate(Radius, false); if( m_Grid_Target.Init_User(Extent) && Dlg_Parameters("USER") ) { m_pGrid = m_Grid_Target.Get_User(); } } break; case 1: // grid... if( Dlg_Parameters("GRID") ) { m_pGrid = m_Grid_Target.Get_Grid(); } break; } if( m_pGrid == NULL ) { return( false ); } //------------------------------------------------- m_pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Kernel Density"))); m_pGrid->Set_NoData_Value(0.0); m_pGrid->Assign(0.0); DataObject_Set_Colors(m_pGrid, 100, SG_COLORS_BLACK_WHITE, true); m_dRadius = Radius / m_pGrid->Get_Cellsize(); m_iRadius = 1 + (int)m_dRadius; //----------------------------------------------------- if( pPoints->Get_Selection_Count() > 0 ) { for(int iPoint=0; iPointGet_Selection_Count() && Set_Progress(iPoint, pPoints->Get_Selection_Count()); iPoint++) { CSG_Shape *pPoint = pPoints->Get_Selection(iPoint); Set_Kernel(pPoint->Get_Point(0), Population < 0 ? 1.0 : pPoint->asDouble(Population)); } } else { for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { CSG_Shape *pPoint = pPoints->Get_Shape(iPoint); Set_Kernel(pPoint->Get_Point(0), Population < 0 ? 1.0 : pPoint->asDouble(Population)); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CKernel_Density::Set_Kernel(const TSG_Point &Point, double Population) { double x = (Point.x - m_pGrid->Get_XMin()) / m_pGrid->Get_Cellsize(); double y = (Point.y - m_pGrid->Get_YMin()) / m_pGrid->Get_Cellsize(); for(int iy=(int)y-m_iRadius; iy<=y+m_iRadius; iy++) { if( iy >= 0 && iy < m_pGrid->Get_NY() ) { for(int ix=(int)x-m_iRadius; ix<=x+m_iRadius; ix++) { if( ix >= 0 && ix < m_pGrid->Get_NX() ) { m_pGrid->Add_Value(ix, iy, Population * Get_Kernel(x - ix, y - iy)); } } } } } //--------------------------------------------------------- inline double CKernel_Density::Get_Kernel(double dx, double dy) { double d = SG_Get_Length(dx, dy); if( d >= m_dRadius ) { return( 0.0 ); } d /= m_dRadius; switch( m_Kernel ) { default: case 0: // quartic kernel return( (3.0 / (M_PI * m_dRadius*m_dRadius)) * SG_Get_Square(1.0 - d*d) ); case 1: // gaussian kernel d *= 2.0; return( exp(-0.5 * d*d) ); case 2: // exponential d *= 2.0; return( exp(-d) ); case 3: // inverse distance return( pow(1.0 + d, -1.0) ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_gridding/kernel_density.h000066400000000000000000000111361224124640700245200ustar00rootroot00000000000000/********************************************************** * Version $Id: kernel_density.h 1130 2011-07-14 07:42:46Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Gridding // // // //-------------------------------------------------------// // // // kernel_density.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__kernel_density_H #define HEADER_INCLUDED__kernel_density_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_gridding_EXPORT CKernel_Density : public CSG_Module { public: CKernel_Density(void); protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_iRadius, m_Kernel; double m_dRadius; CSG_Parameters_Grid_Target m_Grid_Target; CSG_Grid *m_pGrid; void Set_Kernel (const TSG_Point &Point, double Population); double Get_Kernel (double dx, double dy); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__kernel_density_H saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/000077500000000000000000000000001224124640700217415ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/delaunay.c000066400000000000000000000503221224124640700237110ustar00rootroot00000000000000/********************************************************** * Version $Id: delaunay.c 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: delaunay.c * * Created: 04/08/2000 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: Delaunay triangulation - a wrapper to triangulate() * * Description: None * * Revisions: 10/06/2003 PS: delaunay_build(); delaunay_destroy(); * struct delaunay: from now on, only shallow copy of the * input data is contained in struct delaunay. This saves * memory and is consistent with libcsa. * * Modified: Joao Cardoso, 4/2/2003 * Adapted for use with Qhull instead of "triangle". * *****************************************************************************/ //#define USE_QHULL #include #include #include #include #include #include #include #ifdef USE_QHULL #include #else #include "triangle.h" #endif #include "istack.h" #include "nan.h" #include "delaunay.h" int circle_build(circle* c, point* p0, point* p1, point* p2); int circle_contains(circle* c, point* p); #ifdef USE_QHULL static int cw(delaunay *d, triangle *t); #endif #ifndef USE_QHULL static void tio_init(struct triangulateio* tio) { tio->pointlist = NULL; tio->pointattributelist = NULL; tio->pointmarkerlist = NULL; tio->numberofpoints = 0; tio->numberofpointattributes = 0; tio->trianglelist = NULL; tio->triangleattributelist = NULL; tio->trianglearealist = NULL; tio->neighborlist = NULL; tio->numberoftriangles = 0; tio->numberofcorners = 0; tio->numberoftriangleattributes = 0; tio->segmentlist = 0; tio->segmentmarkerlist = NULL; tio->numberofsegments = 0; tio->holelist = NULL; tio->numberofholes = 0; tio->regionlist = NULL; tio->numberofregions = 0; tio->edgelist = NULL; tio->edgemarkerlist = NULL; tio->normlist = NULL; tio->numberofedges = 0; } static void tio_destroy(struct triangulateio* tio) { if (tio->pointlist != NULL) free(tio->pointlist); if (tio->pointattributelist != NULL) free(tio->pointattributelist); if (tio->pointmarkerlist != NULL) free(tio->pointmarkerlist); if (tio->trianglelist != NULL) free(tio->trianglelist); if (tio->triangleattributelist != NULL) free(tio->triangleattributelist); if (tio->trianglearealist != NULL) free(tio->trianglearealist); if (tio->neighborlist != NULL) free(tio->neighborlist); if (tio->segmentlist != NULL) free(tio->segmentlist); if (tio->segmentmarkerlist != NULL) free(tio->segmentmarkerlist); if (tio->holelist != NULL) free(tio->holelist); if (tio->regionlist != NULL) free(tio->regionlist); if (tio->edgelist != NULL) free(tio->edgelist); if (tio->edgemarkerlist != NULL) free(tio->edgemarkerlist); if (tio->normlist != NULL) free(tio->normlist); } static delaunay* delaunay_create() { delaunay* d = (delaunay *)malloc(sizeof(delaunay)); d->npoints = 0; d->points = NULL; d->xmin = DBL_MAX; d->xmax = -DBL_MAX; d->ymin = DBL_MAX; d->ymax = -DBL_MAX; d->ntriangles = 0; d->triangles = NULL; d->circles = NULL; d->neighbours = NULL; d->n_point_triangles = NULL; d->point_triangles = NULL; d->nedges = 0; d->edges = NULL; d->flags = NULL; d->first_id = -1; d->t_in = NULL; d->t_out = NULL; return d; } static void tio2delaunay(struct triangulateio* tio_out, delaunay* d) { int i, j; /* * I assume that all input points appear in tio_out in the same order as * they were written to tio_in. I have seen no exceptions so far, even * if duplicate points were presented. Just in case, let us make a couple * of checks. */ assert(tio_out->numberofpoints == d->npoints); assert(tio_out->pointlist[2 * d->npoints - 2] == d->points[d->npoints - 1].x && tio_out->pointlist[2 * d->npoints - 1] == d->points[d->npoints - 1].y); for (i = 0, j = 0; i < d->npoints; ++i) { point* p = &d->points[i]; if (p->x < d->xmin) d->xmin = p->x; if (p->x > d->xmax) d->xmax = p->x; if (p->y < d->ymin) d->ymin = p->y; if (p->y > d->ymax) d->ymax = p->y; } if (nn_verbose) { fprintf(stderr, "input:\n"); for (i = 0, j = 0; i < d->npoints; ++i) { point* p = &d->points[i]; fprintf(stderr, " %d: %15.7g %15.7g %15.7g\n", i, p->x, p->y, p->z); } } d->ntriangles = tio_out->numberoftriangles; if (d->ntriangles > 0) { d->triangles = (triangle *)malloc(d->ntriangles * sizeof(triangle)); d->neighbours = (triangle_neighbours *)malloc(d->ntriangles * sizeof(triangle_neighbours)); d->circles = (circle *)malloc(d->ntriangles * sizeof(circle)); d->n_point_triangles = (int *)calloc(d->npoints, sizeof(int)); d->point_triangles = (int **)malloc(d->npoints * sizeof(int*)); d->flags = (int *)calloc(d->ntriangles, sizeof(int)); } if (nn_verbose) fprintf(stderr, "triangles:\n"); for (i = 0; i < d->ntriangles; ++i) { int offset = i * 3; triangle* t = &d->triangles[i]; triangle_neighbours* n = &d->neighbours[i]; circle* c = &d->circles[i]; t->vids[0] = tio_out->trianglelist[offset]; t->vids[1] = tio_out->trianglelist[offset + 1]; t->vids[2] = tio_out->trianglelist[offset + 2]; n->tids[0] = tio_out->neighborlist[offset]; n->tids[1] = tio_out->neighborlist[offset + 1]; n->tids[2] = tio_out->neighborlist[offset + 2]; circle_build(c, &d->points[t->vids[0]], &d->points[t->vids[1]], &d->points[t->vids[2]]); if (nn_verbose) fprintf(stderr, " %d: (%d,%d,%d)\n", i, t->vids[0], t->vids[1], t->vids[2]); } for (i = 0; i < d->ntriangles; ++i) { triangle* t = &d->triangles[i]; for (j = 0; j < 3; ++j) d->n_point_triangles[t->vids[j]]++; } if (d->ntriangles > 0) { for (i = 0; i < d->npoints; ++i) { if (d->n_point_triangles[i] > 0) d->point_triangles[i] = (int *)malloc(d->n_point_triangles[i] * sizeof(int)); else d->point_triangles[i] = NULL; d->n_point_triangles[i] = 0; } } for (i = 0; i < d->ntriangles; ++i) { triangle* t = &d->triangles[i]; for (j = 0; j < 3; ++j) { int vid = t->vids[j]; d->point_triangles[vid][d->n_point_triangles[vid]] = i; d->n_point_triangles[vid]++; } } if (tio_out->edgelist != NULL) { d->nedges = tio_out->numberofedges; d->edges = (int *)malloc(d->nedges * 2 * sizeof(int)); memcpy(d->edges, tio_out->edgelist, d->nedges * 2 * sizeof(int)); } } #endif /* Builds Delaunay triangulation of the given array of points. * * @param np Number of points * @param points Array of points [np] (input) * @param ns Number of forced segments * @param segments Array of (forced) segment endpoint indices [2*ns] * @param nh Number of holes * @param holes Array of hole (x,y) coordinates [2*nh] * @return Delaunay triangulation structure with triangulation results */ delaunay* delaunay_build(int np, point points[], int ns, int segments[], int nh, double holes[]) #ifndef USE_QHULL { delaunay* d = delaunay_create(); struct triangulateio tio_in; struct triangulateio tio_out; char cmd[64] = "eznC"; int i, j; assert(sizeof(REAL) == sizeof(double)); tio_init(&tio_in); if (np == 0) { free(d); return NULL; } tio_in.pointlist = (double *)malloc(np * 2 * sizeof(double)); tio_in.numberofpoints = np; for (i = 0, j = 0; i < np; ++i) { tio_in.pointlist[j++] = points[i].x; tio_in.pointlist[j++] = points[i].y; } if (ns > 0) { tio_in.segmentlist = (int *)malloc(ns * 2 * sizeof(int)); tio_in.numberofsegments = ns; memcpy(tio_in.segmentlist, segments, ns * 2 * sizeof(int)); } if (nh > 0) { tio_in.holelist = (double *)malloc(nh * 2 * sizeof(double)); tio_in.numberofholes = nh; memcpy(tio_in.holelist, holes, nh * 2 * sizeof(double)); } tio_init(&tio_out); if (!nn_verbose) strcat(cmd, "Q"); else if (nn_verbose > 1) strcat(cmd, "VV"); if (ns != 0) strcat(cmd, "p"); if (nn_verbose) fflush(stderr); /* * climax */ triangulate(cmd, &tio_in, &tio_out, NULL); if (nn_verbose) fflush(stderr); d->npoints = np; d->points = points; tio2delaunay(&tio_out, d); tio_destroy(&tio_in); tio_destroy(&tio_out); return d; } #else /* USE_QHULL */ { delaunay* d = (delaunay *)malloc(sizeof(delaunay)); coordT *qpoints; /* array of coordinates for each point */ boolT ismalloc = False; /* True if qhull should free points */ char flags[64] = "qhull d Qbb Qt"; /* option flags for qhull */ facetT *facet,*neighbor,**neighborp; /* variables to walk through facets */ vertexT *vertex, **vertexp; /* variables to walk through vertex */ int curlong, totlong; /* memory remaining after qh_memfreeshort */ FILE *outfile = stdout; FILE *errfile = stderr; /* error messages from qhull code */ int i, j; int exitcode; int dim, ntriangles; int numfacets, numsimplicial, numridges, totneighbors, numcoplanars, numtricoplanars; dim = 2; assert(sizeof(realT) == sizeof(double)); /* Qhull was compiled with doubles? */ if (np == 0 || ns > 0 || nh > 0) { fprintf(stderr, "segments=%d holes=%d\n, aborting Qhull implementation, use 'triangle' instead.\n", ns, nh); free(d); return NULL; } qpoints = (coordT *) malloc(np * (dim+1) * sizeof(coordT)); for (i=0; i 1) strcat(flags, " Ts"); if (nn_verbose) fflush(stderr); /* * climax */ exitcode = qh_new_qhull (dim, np, qpoints, ismalloc, flags, outfile, errfile); if(!exitcode) { if (nn_verbose) fflush(stderr); d->xmin = DBL_MAX; d->xmax = -DBL_MAX; d->ymin = DBL_MAX; d->ymax = -DBL_MAX; d->npoints = np; d->points = malloc(np * sizeof(point)); for (i = 0; i < np; ++i) { point* p = &d->points[i]; p->x = points[i].x; p->y = points[i].y; p->z = points[i].z; if (p->x < d->xmin) d->xmin = p->x; if (p->x > d->xmax) d->xmax = p->x; if (p->y < d->ymin) d->ymin = p->y; if (p->y > d->ymax) d->ymax = p->y; } if (nn_verbose) { fprintf(stderr, "input:\n"); for (i = 0; i < np; ++i) { point* p = &d->points[i]; fprintf(stderr, " %d: %15.7g %15.7g %15.7g\n", i, p->x, p->y, p->z); } } qh_findgood_all (qh facet_list); qh_countfacets (qh facet_list, NULL, !qh_ALL, &numfacets, &numsimplicial, &totneighbors, &numridges, &numcoplanars, &numtricoplanars); ntriangles = 0; FORALLfacets { if (!facet->upperdelaunay && facet->simplicial) ntriangles++; } d->ntriangles = ntriangles; d->triangles = malloc(d->ntriangles * sizeof(triangle)); d->neighbours = malloc(d->ntriangles * sizeof(triangle_neighbours)); d->circles = malloc(d->ntriangles * sizeof(circle)); if (nn_verbose) fprintf(stderr, "triangles:\tneighbors:\n"); i = 0; FORALLfacets { if (!facet->upperdelaunay && facet->simplicial) { triangle* t = &d->triangles[i]; triangle_neighbours* n = &d->neighbours[i]; circle* c = &d->circles[i]; j = 0; FOREACHvertex_(facet->vertices) t->vids[j++] = qh_pointid(vertex->point); j = 0; FOREACHneighbor_(facet) n->tids[j++] = neighbor->visitid ? neighbor->visitid - 1 : - 1; /* Put triangle vertices in counterclockwise order, as * 'triangle' do. * The same needs to be done with the neighbors. * * The following works, i.e., it seems that Qhull maintains a * relationship between the vertices and the neighbors * triangles, but that is not said anywhere, so if this stop * working in a future Qhull release, you know what you have * to do, reorder the neighbors. */ if(cw(d, t)) { int tmp = t->vids[1]; t->vids[1] = t->vids[2]; t->vids[2] = tmp; tmp = n->tids[1]; n->tids[1] = n->tids[2]; n->tids[2] = tmp; } circle_build(c, &d->points[t->vids[0]], &d->points[t->vids[1]], &d->points[t->vids[2]]); if (nn_verbose) fprintf(stderr, " %d: (%d,%d,%d)\t(%d,%d,%d)\n", i, t->vids[0], t->vids[1], t->vids[2], n->tids[0], n->tids[1], n->tids[2]); i++; } } d->flags = calloc(d->ntriangles, sizeof(int)); d->n_point_triangles = calloc(d->npoints, sizeof(int)); for (i = 0; i < d->ntriangles; ++i) { triangle* t = &d->triangles[i]; for (j = 0; j < 3; ++j) d->n_point_triangles[t->vids[j]]++; } d->point_triangles = malloc(d->npoints * sizeof(int*)); for (i = 0; i < d->npoints; ++i) { if (d->n_point_triangles[i] > 0) d->point_triangles[i] = malloc(d->n_point_triangles[i] * sizeof(int)); else d->point_triangles[i] = NULL; d->n_point_triangles[i] = 0; } for (i = 0; i < d->ntriangles; ++i) { triangle* t = &d->triangles[i]; for (j = 0; j < 3; ++j) { int vid = t->vids[j]; d->point_triangles[vid][d->n_point_triangles[vid]] = i; d->n_point_triangles[vid]++; } } d->nedges = 0; d->edges = NULL; d->t_in = NULL; d->t_out = NULL; d->first_id = -1; } else { free(d); d = NULL; } free(qpoints); qh_freeqhull(!qh_ALL); /* free long memory */ qh_memfreeshort (&curlong, &totlong); /* free short memory and memory allocator */ if (curlong || totlong) fprintf (errfile, "qhull: did not free %d bytes of long memory (%d pieces)\n", totlong, curlong); return d; } /* returns 1 if a,b,c are clockwise ordered */ static int cw(delaunay *d, triangle *t) { point* pa = &d->points[t->vids[0]]; point* pb = &d->points[t->vids[1]]; point* pc = &d->points[t->vids[2]]; return ((pb->x - pa->x)*(pc->y - pa->y) < (pc->x - pa->x)*(pb->y - pa->y)); } #endif /* Releases memory engaged in the Delaunay triangulation structure. * * @param d Structure to be destroyed */ void delaunay_destroy(delaunay* d) { if (d == NULL) return; if (d->point_triangles != NULL) { int i; for (i = 0; i < d->npoints; ++i) if (d->point_triangles[i] != NULL) free(d->point_triangles[i]); free(d->point_triangles); } if (d->nedges > 0) free(d->edges); #ifdef USE_QHULL /* This is a shallow copy if we're not using qhull so we don't * need to free it */ if (d->points != NULL) free(d->points); #endif if (d->n_point_triangles != NULL) free(d->n_point_triangles); if (d->flags != NULL) free(d->flags); if (d->circles != NULL) free(d->circles); if (d->neighbours != NULL) free(d->neighbours); if (d->triangles != NULL) free(d->triangles); if (d->t_in != NULL) istack_destroy(d->t_in); if (d->t_out != NULL) istack_destroy(d->t_out); free(d); } /* Returns whether the point p is on the right side of the vector (p0, p1). */ static int on_right_side(point* p, point* p0, point* p1) { return (p1->x - p->x) * (p0->y - p->y) > (p0->x - p->x) * (p1->y - p->y); } /* Finds triangle specified point belongs to (if any). * * @param d Delaunay triangulation * @param p Point to be mapped * @param seed Triangle index to start with * @return Triangle id if successful, -1 otherwhile */ int delaunay_xytoi(delaunay* d, point* p, int id) { triangle* t; int i; if (p->x < d->xmin || p->x > d->xmax || p->y < d->ymin || p->y > d->ymax) return -1; if (id < 0 || id > d->ntriangles) id = 0; t = &d->triangles[id]; do { for (i = 0; i < 3; ++i) { int i1 = (i + 1) % 3; if (on_right_side(p, &d->points[t->vids[i]], &d->points[t->vids[i1]])) { id = d->neighbours[id].tids[(i + 2) % 3]; if (id < 0) return id; t = &d->triangles[id]; break; } } } while (i < 3); return id; } /* Finds all tricircles specified point belongs to. * * @param d Delaunay triangulation * @param p Point to be mapped * @param n Pointer to the number of tricircles within `d' containing `p' * (output) * @param out Pointer to an array of indices of the corresponding triangles * [n] (output) * * There is a standard search procedure involving search through triangle * neighbours (not through vertex neighbours). It must be a bit faster due to * the smaller number of triangle neighbours (3 per triangle) but can fail * for a point outside convex hall. * * We may wish to modify this procedure in future: first check if the point * is inside the convex hall, and depending on that use one of the two * search algorithms. It not 100% clear though whether this will lead to a * substantial speed gains because of the check on convex hall involved. */ void delaunay_circles_find(delaunay* d, point* p, int* n, int** out) { int i; if (d->t_in == NULL) { d->t_in = istack_create(); d->t_out = istack_create(); } /* * It is important to have a reasonable seed here. If the last search * was successful -- start with the last found tricircle, otherwhile (i) * try to find a triangle containing (x,y); if fails then (ii) check * tricircles from the last search; if fails then (iii) make linear * search through all tricircles */ if (d->first_id < 0 || !circle_contains(&d->circles[d->first_id], p)) { /* * if any triangle contains (x,y) -- start with this triangle */ d->first_id = delaunay_xytoi(d, p, d->first_id); /* * if no triangle contains (x,y), there still is a chance that it is * inside some of circumcircles */ if (d->first_id < 0) { int nn = d->t_out->n; int tid = -1; /* * first check results of the last search */ for (i = 0; i < nn; ++i) { tid = d->t_out->v[i]; if (circle_contains(&d->circles[tid], p)) break; } /* * if unsuccessful, search through all circles */ if (tid < 0 || tid == nn) { double nt = d->ntriangles; for (tid = 0; tid < nt; ++tid) { if (circle_contains(&d->circles[tid], p)) break; } if (tid == nt) { istack_reset(d->t_out); *n = 0; *out = NULL; return; /* failed */ } } d->first_id = tid; } } istack_reset(d->t_in); istack_reset(d->t_out); istack_push(d->t_in, d->first_id); d->flags[d->first_id] = 1; /* * main cycle */ while (d->t_in->n > 0) { int tid = istack_pop(d->t_in); triangle* t = &d->triangles[tid]; if (circle_contains(&d->circles[tid], p)) { istack_push(d->t_out, tid); for (i = 0; i < 3; ++i) { int vid = t->vids[i]; int nt = d->n_point_triangles[vid]; int j; for (j = 0; j < nt; ++j) { int ntid = d->point_triangles[vid][j]; if (d->flags[ntid] == 0) { istack_push(d->t_in, ntid); d->flags[ntid] = 1; } } } } } *n = d->t_out->n; *out = d->t_out->v; } saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/delaunay.h000066400000000000000000000037011224124640700237150ustar00rootroot00000000000000/********************************************************** * Version $Id: delaunay.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: delaunay.h * * Created: 04/08/2000 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: Header for delaunay triangulation wrapper * * Description: None * * Revisions: None * *****************************************************************************/ #if !defined(_DELAUNAY_H) #define _DELAUNAY_H #include "nn.h" typedef struct { int vids[3]; } triangle; typedef struct { int tids[3]; } triangle_neighbours; typedef struct { double x; double y; double r; } circle; #if !defined(_ISTACK_H) struct istack; typedef struct istack istack; #endif struct delaunay { int npoints; point* points; double xmin; double xmax; double ymin; double ymax; int ntriangles; triangle* triangles; circle* circles; triangle_neighbours* neighbours; /* for delaunay_xytoi() */ int* n_point_triangles; /* n_point_triangles[i] is number of * triangles i-th point belongs to */ int** point_triangles; /* point_triangles[i][j] is index of j-th * triangle i-th point belongs to */ int nedges; int* edges; /* n-th edge is formed by points[edges[n*2]] * and points[edges[n*2+1]] */ /* * Work data for delaunay_circles_find(). Placed here for efficiency * reasons. Should be moved to the procedure if parallelizable code * needed. */ int* flags; int first_id; /* last search result, used in start up of a * new search */ istack* t_in; istack* t_out; }; #endif saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/hash.c000066400000000000000000000451311224124640700230340ustar00rootroot00000000000000/********************************************************** * Version $Id: hash.c 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: hash.c * * Purpose: Hash table implementation * * Author: Jerry Coffin * * Description: Public domain code by Jerry Coffin, with improvements by * HenkJan Wolthuis. * Date last modified: 05-Jul-1997 * * Revisions: 18-09-2002 -- modified by Pavel Sakov * *****************************************************************************/ #include #include #include #include "hash.h" #define INT_PER_DOUBLE 2 /** A hash table consists of an array of these buckets. */ typedef struct ht_bucket { void* key; void* data; int id; /* unique id -- just in case */ struct ht_bucket* next; } ht_bucket; /** Hash table structure. * Note that more nodes than `size' can be inserted in the table, * but performance degrades as this happens. */ struct hashtable { int size; /* table size */ int n; /* current number of entries */ int naccum; /* number of inserted entries */ int nhash; /* number of used table elements */ ht_keycp cp; ht_keyeq eq; ht_key2hash hash; ht_bucket** table; }; /* Creates a hashtable of specified size. */ hashtable* ht_create(int size, ht_keycp cp, ht_keyeq eq, ht_key2hash hash) { hashtable* table = (hashtable *)malloc(sizeof(hashtable)); ht_bucket** bucket; int i; assert(sizeof(double) == INT_PER_DOUBLE * sizeof(int)); /* * (used in d1hash() and d2hash()) */ if (table == NULL) return NULL; if (size <= 0) { free(table); return NULL; } table->size = size; table->table = (ht_bucket **)malloc(sizeof(ht_bucket*) * size); bucket = table->table; if (bucket == NULL) { free(table); return NULL; } for (i = 0; i < size; ++i) bucket[i] = NULL; table->n = 0; table->naccum = 0; table->nhash = 0; table->eq = eq; table->cp = cp; table->hash = hash; return table; } /* Destroys a hash table. * (Take care of deallocating data by ht_process() prior to destroying the * table if necessary.) * * @param table Hash table to be destroyed */ void ht_destroy(hashtable* table) { int i; if (table == NULL) return; for (i = 0; i < table->size; ++i) { ht_bucket* bucket; for (bucket = (table->table)[i]; bucket != NULL;) { ht_bucket* prev = bucket; free(bucket->key); bucket = bucket->next; free(prev); } } free(table->table); free(table); } /* Inserts a new entry into the hash table. * * @param table The hash table * @param key Ponter to entry's key * @param data Pointer to associated data * @return Pointer to the old data associated with the key, NULL if the key * wasn't in the table previously */ void* ht_insert(hashtable* table, void* key, void* data) { unsigned int val = table->hash(key) % table->size; ht_bucket* bucket; /* * NULL means this bucket hasn't been used yet. We'll simply allocate * space for our new bucket and put our data there, with the table * pointing at it. */ if ((table->table)[val] == NULL) { bucket = (ht_bucket *)malloc(sizeof(ht_bucket)); if (bucket == NULL) return NULL; bucket->key = table->cp(key); bucket->next = NULL; bucket->data = data; bucket->id = table->naccum; (table->table)[val] = bucket; table->n++; table->naccum++; table->nhash++; return bucket->data; } /* * This spot in the table is already in use. See if the current string * has already been inserted, and if so, return corresponding data. */ for (bucket = (table->table)[val]; bucket != NULL; bucket = bucket->next) if (table->eq(key, bucket->key) == 1) { void* old_data = bucket->data; bucket->data = data; bucket->id = table->naccum; table->naccum++; return old_data; } /* * This key must not be in the table yet. We'll add it to the head of * the list at this spot in the hash table. Speed would be slightly * improved if the list was kept sorted instead. In this case, this * code would be moved into the loop above, and the insertion would take * place as soon as it was determined that the present key in the list * was larger than this one. */ bucket = (ht_bucket*) malloc(sizeof(ht_bucket)); if (bucket == NULL) return 0; bucket->key = table->cp(key); bucket->data = data; bucket->next = (table->table)[val]; bucket->id = table->naccum; (table->table)[val] = bucket; table->n++; table->naccum++; return data; } /* Returns a pointer to the data associated with a key. If the key has * not been inserted in the table, returns NULL. * * @param table The hash table * @param key The key * @return The associated data or NULL */ void* ht_find(hashtable* table, void* key) { unsigned int val = table->hash(key) % table->size; ht_bucket* bucket; if ((table->table)[val] == NULL) return NULL; for (bucket = (table->table)[val]; bucket != NULL; bucket = bucket->next) if (table->eq(key, bucket->key) == 1) return bucket->data; return NULL; } /* Deletes an entry from the table. Returns a pointer to the data that * was associated with the key so that the calling code can dispose it * properly. * * @param table The hash table * @param key The key * @return The associated data or NULL */ void* ht_delete(hashtable* table, void* key) { unsigned int val = table->hash(key) % table->size; ht_bucket* prev; ht_bucket* bucket; void* data; if ((table->table)[val] == NULL) return NULL; /* * Traverse the list, keeping track of the previous node in the list. * When we find the node to delete, we set the previous node's next * pointer to point to the node after ourself instead. We then delete * the key from the present node, and return a pointer to the data it * contains. */ for (prev = NULL, bucket = (table->table)[val]; bucket != NULL; prev = bucket, bucket = bucket->next) { if (table->eq(key, bucket->key) == 1) { data = bucket->data; if (prev != NULL) prev->next = bucket->next; else { /* * If 'prev' still equals NULL, it means that we need to * delete the first node in the list. This simply consists * of putting our own 'next' pointer in the array holding * the head of the list. We then dispose of the current * node as above. */ (table->table)[val] = bucket->next; table->nhash--; } free(bucket->key); free(bucket); table->n--; return data; } } /* * If we get here, it means we didn't find the item in the table. Signal * this by returning NULL. */ return NULL; } /* For each entry, calls a specified function with corresponding data as a * parameter. * * @param table The hash table * @param func The action function */ void ht_process(hashtable* table, void (*func) (void*)) { int i; for (i = 0; i < table->size; ++i) if ((table->table)[i] != NULL) { ht_bucket* bucket; for (bucket = (table->table)[i]; bucket != NULL; bucket = bucket->next) func(bucket->data); } } /* * functions for for string keys */ static unsigned int strhash(void* key) { char* str = (char*) key; unsigned int hashvalue = 0; while (*str != 0) { hashvalue ^= *(unsigned int*) str; hashvalue <<= 1; str++; } return hashvalue; } static void* strcp(void* key) { return strdup((const char *)key); } static int streq(void* key1, void* key2) { return !strcmp((const char *)key1, (const char *)key2); } /* functions for for double keys */ static unsigned int d1hash(void* key) { unsigned int* v = (unsigned int*) key; #if INT_PER_DOUBLE == 2 return v[0] + v[1]; #else #error not implemented #endif } static void* d1cp(void* key) { double* newkey = (double *)malloc(sizeof(double)); *newkey = *(double*) key; return newkey; } int d1eq(void* key1, void* key2) { return *(double*) key1 == *(double*) key2; } /* * functions for for double[2] keys */ #include "math.h" static unsigned int d2hash(void* key) { unsigned int* v = (unsigned int*) key; #if INT_PER_DOUBLE == 2 /* * PS: here multiplications suppose to make (a,b) and (b,a) generate * different hash values */ return v[0] + v[1] + v[2] * 3 + v[3] * 7; #else #error not implemented #endif } static void* d2cp(void* key) { double* newkey = (double *)malloc(sizeof(double) * 2); newkey[0] = ((double*) key)[0]; newkey[1] = ((double*) key)[1]; return newkey; } static int d2eq(void* key1, void* key2) { return (((double*) key1)[0] == ((double*) key2)[0]) && (((double*) key1)[1] == ((double*) key2)[1]); } hashtable* ht_create_d1(int size) { return ht_create(size, d1cp, d1eq, d1hash); } hashtable* ht_create_d2(int size) { return ht_create(size, d2cp, d2eq, d2hash); } hashtable* ht_create_str(int size) { return ht_create(size, strcp, streq, strhash); } #ifdef HT_TEST #include #include #define BUFSIZE 1024 static void print_double(void* data) { printf(" \"%d\"", (int)* (double*) data); } static void print_string(void* data) { printf(" \"%s\"", (char*) data); } int main() { double points[] = { 922803.7855, 7372394.688, 0, 922849.2037, 7372307.027, 1, 922894.657, 7372219.306, 2, 922940.1475, 7372131.528, 3, 922985.6777, 7372043.692, 4, 923031.2501, 7371955.802, 5, 923076.8669, 7371867.857, 6, 923122.5307, 7371779.861, 7, 923168.2439, 7371691.816, 8, 923214.0091, 7371603.722, 9, 923259.8288, 7371515.583, 10, 922891.3958, 7372440.117, 11, 922936.873, 7372352.489, 12, 922982.3839, 7372264.804, 13, 923027.9308, 7372177.064, 14, 923073.5159, 7372089.268, 15, 923119.1415, 7372001.42, 16, 923164.8099, 7371913.521, 17, 923210.5233, 7371825.572, 18, 923256.2841, 7371737.575, 19, 923302.0946, 7371649.534, 20, 923347.9572, 7371561.45, 21, 922978.9747, 7372485.605, 22, 923024.5085, 7372398.009, 23, 923070.0748, 7372310.358, 24, 923115.6759, 7372222.654, 25, 923161.3136, 7372134.897, 26, 923206.9903, 7372047.09, 27, 923252.7079, 7371959.233, 28, 923298.4686, 7371871.33, 29, 923344.2745, 7371783.381, 30, 923390.1279, 7371695.389, 31, 923436.0309, 7371607.357, 32, 923066.5232, 7372531.148, 33, 923112.1115, 7372443.583, 34, 923157.7311, 7372355.966, 35, 923203.3842, 7372268.296, 36, 923249.0725, 7372180.577, 37, 923294.7981, 7372092.808, 38, 923340.5628, 7372004.993, 39, 923386.3686, 7371917.132, 40, 923432.2176, 7371829.229, 41, 923478.1116, 7371741.284, 42, 923524.0527, 7371653.302, 43, 923154.0423, 7372576.746, 44, 923199.6831, 7372489.211, 45, 923245.3541, 7372401.625, 46, 923291.0572, 7372313.989, 47, 923336.7941, 7372226.305, 48, 923382.5667, 7372138.574, 49, 923428.3766, 7372050.798, 50, 923474.2256, 7371962.978, 51, 923520.1155, 7371875.118, 52, 923566.0481, 7371787.218, 53, 923612.0252, 7371699.282, 54, 923241.533, 7372622.396, 55, 923287.2244, 7372534.889, 56, 923332.9449, 7372447.334, 57, 923378.6963, 7372359.731, 58, 923424.4801, 7372272.081, 59, 923470.2979, 7372184.385, 60, 923516.1513, 7372096.646, 61, 923562.0418, 7372008.866, 62, 923607.9709, 7371921.046, 63, 923653.9402, 7371833.188, 64, 923699.9514, 7371745.296, 65, 923328.9962, 7372668.095, 66, 923374.7365, 7372580.617, 67, 923420.5049, 7372493.091, 68, 923466.303, 7372405.519, 69, 923512.1321, 7372317.901, 70, 923557.9936, 7372230.24, 71, 923603.8889, 7372142.536, 72, 923649.8192, 7372054.793, 73, 923695.786, 7371967.011, 74, 923741.7905, 7371879.193, 75, 923787.8341, 7371791.342, 76, 923416.4327, 7372713.844, 77, 923462.2204, 7372626.393, 78, 923508.0353, 7372538.895, 79, 923553.8787, 7372451.353, 80, 923599.7517, 7372363.766, 81, 923645.6555, 7372276.137, 82, 923691.5914, 7372188.467, 83, 923737.5603, 7372100.757, 84, 923783.5634, 7372013.011, 85, 923829.6017, 7371925.231, 86, 923875.6763, 7371837.419, 87, 923503.8433, 7372759.64, 88, 923549.6771, 7372672.214, 89, 923595.5372, 7372584.744, 90, 923641.4246, 7372497.23, 91, 923687.3404, 7372409.673, 92, 923733.2855, 7372322.074, 93, 923779.2608, 7372234.436, 94, 923825.2672, 7372146.759, 95, 923871.3056, 7372059.047, 96, 923917.3766, 7371971.301, 97, 923963.4812, 7371883.524, 98, 923591.2288, 7372805.481, 99, 923637.1076, 7372718.081, 100, 923683.0118, 7372630.638, 101, 923728.9423, 7372543.151, 102, 923774.8998, 7372455.622, 103, 923820.8852, 7372368.052, 104, 923866.8991, 7372280.443, 105, 923912.9422, 7372192.797, 106, 923959.015, 7372105.116, 107, 924005.118, 7372017.402, 108, 924051.2518, 7371929.657, 109, 923678.5898, 7372851.367, 110, 923724.5126, 7372763.992, 111, 923770.46, 7372676.574, 112, 923816.4328, 7372589.113, 113, 923862.4314, 7372501.611, 114, 923908.4564, 7372414.069, 115, 923954.5083, 7372326.488, 116, 924000.5875, 7372238.87, 117, 924046.6941, 7372151.218, 118, 924092.8286, 7372063.533, 119, 924138.9911, 7371975.818, 120 }; int size = sizeof(points) / sizeof(double) / 3; hashtable* ht; int i; /* * double[2] key */ printf("\n1. Testing a table with key of double[2] type\n\n"); printf(" creating a table..."); ht = ht_create_d2(size); printf("done\n"); printf(" inserting %d values from a file...", size); for (i = 0; i < size; ++i) ht_insert(ht, &points[i * 3], &points[i * 3 + 2]); printf("done\n"); printf(" stats:\n"); printf(" %d entries, %d table elements, %d filled elements\n", ht->n, ht->size, ht->nhash); printf(" %f entries per hash value in use\n", (double) ht->n / ht->nhash); printf(" finding and printing each 10th data:\n"); for (i = 0; i < size; i += 10) { double* point = &points[i * 3]; double* data = ht_find(ht, point); if (data != NULL) printf(" i = %d; data = \"%d\"\n", i, (int)* data); else printf(" i = %d; data = \n", i); } printf(" removing every 3rd element..."); for (i = 0; i < size; i += 3) { double* point = &points[i * 3]; ht_delete(ht, point); } printf("done\n"); printf(" stats:\n"); printf(" %d entries, %d table elements, %d filled elements\n", ht->n, ht->size, ht->nhash); printf(" %f entries per hash value in use\n", (double) ht->n / ht->nhash); printf(" finding and printing each 10th data:\n"); for (i = 0; i < size; i += 10) { double* point = &points[i * 3]; double* data = ht_find(ht, point); if (data != NULL) printf(" i = %d; data = \"%d\"\n", i, (int)* data); else printf(" i = %d; data = \n", i); } printf(" printing all data by calling ht_process():\n "); ht_process(ht, print_double); printf("\n destroying the hash table..."); ht_destroy(ht); printf("done\n"); /* * char* key */ printf("\n2. Testing a table with key of char* type\n\n"); printf(" creating a table..."); ht = ht_create_str(size); printf("done\n"); printf(" inserting %d elements with deep copy of each data string...", size); for (i = 0; i < size; ++i) { char key[BUFSIZE]; char str[BUFSIZE]; char* data; sprintf(key, "%d-th key", i); sprintf(str, "%d-th data", i); data = strdup(str); ht_insert(ht, key, data); } printf("done\n"); printf(" stats:\n"); printf(" %d entries, %d table elements, %d filled elements\n", ht->n, ht->size, ht->nhash); printf(" %f entries per hash value in use\n", (double) ht->n / ht->nhash); printf(" finding and printing each 10th data:\n"); for (i = 0; i < size; i += 10) { char key[BUFSIZE]; char* data; sprintf(key, "%d-th key", i); data = ht_find(ht, key); if (data != NULL) printf(" i = %d; data = \"%s\"\n", i, data); else printf(" i = %d; data = \n", i); } printf(" removing every 3rd element..."); for (i = 0; i < size; i += 3) { char key[BUFSIZE]; sprintf(key, "%d-th key", i); free(ht_delete(ht, key)); } printf("done\n"); printf(" stats:\n"); printf(" %d entries, %d table elements, %d filled elements\n", ht->n, ht->size, ht->nhash); printf(" %f entries per hash value in use\n", (double) ht->n / ht->nhash); printf(" finding and printing each 10th data:\n"); for (i = 0; i < size; i += 10) { char key[BUFSIZE]; char* data; sprintf(key, "%d-th key", i); data = ht_find(ht, key); if (data != NULL) printf(" i = %d; data = \"%s\"\n", i, data); else printf(" i = %d; data = \n", i); } printf(" printing all data by calling ht_process():\n "); ht_process(ht, print_string); printf("\n freeing the remaining data by calling ht_process()..."); ht_process(ht, free); printf("done\n"); printf(" destroying the hash table..."); ht_destroy(ht); printf("done\n"); return 0; } #endif /* HT_TEST */ saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/hash.h000066400000000000000000000056571224124640700230520ustar00rootroot00000000000000/********************************************************** * Version $Id: hash.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: hash.h * * Purpose: Hash table header * * Author: Jerry Coffin * * Description: Public domain code by Jerry Coffin, with improvements by * HenkJan Wolthuis. * Date last modified: 05-Jul-1997 * * Revisions: 18-09-2002 -- modified by Pavel Sakov * *****************************************************************************/ #ifndef _HASH_H #define _HASH_H struct hashtable; typedef struct hashtable hashtable; /** Copies a key. The key must be able to be deallocated by free(). */ typedef void* (*ht_keycp) (void*); /** Returns 1 if two keys are equal, 0 otherwise. */ typedef int (*ht_keyeq) (void*, void*); /** Converts key to an unsigned integer (not necessarily unique). */ typedef unsigned int (*ht_key2hash) (void*); /** Creates a hash table of specified size. * * @param size Size of hash table for output points * @param cp Key copy function * @param eq Key equality check function * @param hash Hash value calculation function */ hashtable* ht_create(int size, ht_keycp cp, ht_keyeq eq, ht_key2hash hash); /** Create a hash table of specified size and key type. */ hashtable* ht_create_d1(int size); /* double[1] */ hashtable* ht_create_d2(int size); /* double[2] */ hashtable* ht_create_str(int size); /* char* */ /** Destroys a hash table. * (Take care of deallocating data by ht_process() prior to destroying the * table if necessary.) * * @param table Hash table to be destroyed */ void ht_destroy(hashtable* table); /** Inserts a new entry into the hash table. * * @param table The hash table * @param key Ponter to entry's key * @param data Pointer to associated data * @return Pointer to the old data associated with the key, NULL if the key * wasn't in the table previously */ void* ht_insert(hashtable* table, void* key, void* data); /** Returns a pointer to the data associated with a key. If the key has * not been inserted in the table, returns NULL. * * @param table The hash table * @param key The key * @return The associated data or NULL */ void* ht_find(hashtable* table, void* key); /** Deletes an entry from the table. Returns a pointer to the data that * was associated with the key so that the calling code can dispose it * properly. * * @param table The hash table * @param key The key * @return The associated data or NULL */ void* ht_delete(hashtable* table, void* key); /** For each entry, calls a specified function with corresponding data as a * parameter. * * @param table The hash table * @param func The action function */ void ht_process(hashtable* table, void (*func) (void*)); #endif /* _HASH_H */ saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/istack.c000066400000000000000000000030061224124640700233620ustar00rootroot00000000000000/********************************************************** * Version $Id: istack.c 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: istack.c * * Created: 06/06/2001 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: Handling stack of integers * * Description: None * * Revisions: None * *****************************************************************************/ #define STACK_NSTART 50 #define STACK_NINC 50 #include #include #include "istack.h" static void istack_init(istack* s) { s->n = 0; s->nallocated = STACK_NSTART; s->v = (int *)malloc(STACK_NSTART * sizeof(int)); } istack* istack_create() { istack* s = (istack *)malloc(sizeof(istack)); istack_init(s); return s; } void istack_reset(istack* s) { s->n = 0; } int istack_contains(istack* s, int v) { int i; for (i = 0; i < s->n; ++i) if (s->v[i] == v) return 1; return 0; } void istack_push(istack* s, int v) { if (s->n == s->nallocated) { s->v = (int *)realloc(s->v, (s->nallocated + STACK_NINC) * sizeof(int)); s->nallocated += STACK_NINC; } s->v[s->n] = v; s->n++; } int istack_pop(istack* s) { s->n--; return s->v[s->n]; } void istack_destroy(istack* s) { if (s != NULL) { free(s->v); free(s); } } saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/istack.h000066400000000000000000000016161224124640700233740ustar00rootroot00000000000000/********************************************************** * Version $Id: istack.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: istack.h * * Created: 06/06/2001 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: Header for handling stack of integers. * * Description: None * * Revisions: None * *****************************************************************************/ #if !defined(_ISTACK_H) #define _ISTACK_H typedef struct { int n; int nallocated; int* v; } istack; int istack_contains(istack* s, int v); istack* istack_create(); void istack_destroy(istack* s); void istack_push(istack* s, int v); int istack_pop(istack* s); void istack_reset(istack* s); #endif saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/lpi.c000066400000000000000000000104521224124640700226730ustar00rootroot00000000000000/********************************************************** * Version $Id: lpi.c 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: linear.c * * Created: 04/08/2000 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: 2D linear interpolation * * Description: `lpi' -- "Linear Point Interpolator" -- is * a structure for conducting linear interpolation on a given * data on a "point-to-point" basis. It interpolates linearly * within each triangle resulted from the Delaunay * triangluation of input data. `lpi' is much * faster than all Natural Neighbours interpolators in `nn' * library. * * Revisions: None * *****************************************************************************/ #include #include #include "nan.h" #include "delaunay.h" typedef struct { double w[3]; } lweights; struct lpi { delaunay* d; lweights* weights; }; int delaunay_xytoi(delaunay* d, point* p, int seed); /* Builds linear interpolator. * * @param d Delaunay triangulation * @return Linear interpolator */ lpi* lpi_build(delaunay* d) { int i; lpi* l = (lpi *)malloc(sizeof(lpi)); l->d = d; l->weights = (lweights *)malloc(d->ntriangles * sizeof(lweights)); for (i = 0; i < d->ntriangles; ++i) { triangle* t = &d->triangles[i]; lweights* lw = &l->weights[i]; double x0 = d->points[t->vids[0]].x; double y0 = d->points[t->vids[0]].y; double z0 = d->points[t->vids[0]].z; double x1 = d->points[t->vids[1]].x; double y1 = d->points[t->vids[1]].y; double z1 = d->points[t->vids[1]].z; double x2 = d->points[t->vids[2]].x; double y2 = d->points[t->vids[2]].y; double z2 = d->points[t->vids[2]].z; double x02 = x0 - x2; double y02 = y0 - y2; double z02 = z0 - z2; double x12 = x1 - x2; double y12 = y1 - y2; double z12 = z1 - z2; if (y12 != 0.0) { double y0212 = y02 / y12; lw->w[0] = (z02 - z12 * y0212) / (x02 - x12 * y0212); lw->w[1] = (z12 - lw->w[0] * x12) / y12; lw->w[2] = (z2 - lw->w[0] * x2 - lw->w[1] * y2); } else { double x0212 = x02 / x12; lw->w[1] = (z02 - z12 * x0212) / (y02 - y12 * x0212); lw->w[0] = (z12 - lw->w[1] * y12) / x12; lw->w[2] = (z2 - lw->w[0] * x2 - lw->w[1] * y2); } } return l; } /* Destroys linear interpolator. * * @param l Structure to be destroyed */ void lpi_destroy(lpi* l) { free(l->weights); free(l); } /* Finds linearly interpolated value in a point. * * @param l Linear interpolation * @param p Point to be interpolated (p->x, p->y -- input; p->z -- output) */ void lpi_interpolate_point(lpi* l, point* p) { delaunay* d = l->d; int tid = delaunay_xytoi(d, p, d->first_id); if (tid >= 0) { lweights* lw = &l->weights[tid]; d->first_id = tid; p->z = p->x * lw->w[0] + p->y * lw->w[1] + lw->w[2]; } else p->z = NaN; } /* Linearly interpolates data from one array of points for another array of * points. * * @param nin Number of input points * @param pin Array of input points [pin] * @param nout Number of ouput points * @param pout Array of output points [nout] */ void lpi_interpolate_points(int nin, point pin[], int nout, point pout[]) { delaunay* d = delaunay_build(nin, pin, 0, NULL, 0, NULL); lpi* l = lpi_build(d); int seed = 0; int i; if (nn_verbose) { fprintf(stderr, "xytoi:\n"); for (i = 0; i < nout; ++i) { point* p = &pout[i]; fprintf(stderr, "(%.7g,%.7g) -> %d\n", p->x, p->y, delaunay_xytoi(d, p, seed)); } } for (i = 0; i < nout; ++i) lpi_interpolate_point(l, &pout[i]); if (nn_verbose) { fprintf(stderr, "output:\n"); for (i = 0; i < nout; ++i) { point* p = &pout[i];; fprintf(stderr, " %d:%15.7g %15.7g %15.7g\n", i, p->x, p->y, p->z); } } lpi_destroy(l); delaunay_destroy(d); } saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/nan.h000066400000000000000000000021051224124640700226640ustar00rootroot00000000000000/********************************************************** * Version $Id: nan.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: nan.h * * Created: 18/10/2001 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: NaN definition * * Description: Should cover machines with 64 bit doubles or other machines * with GCC * * Revisions: None * *****************************************************************************/ #if !defined(_NAN_H) #define _NAN_H #if defined(__GNUC__) static const double NaN = 0.0 / 0.0; #elif defined(BIG_ENDIAN) || defined(_BIG_ENDIAN) static const long long lNaN = 0x7fffffffffffffff; #define NaN (*(double*)&lNaN) #elif defined(_SAGA_VC) static const __int64 lNaN = 0xfff8000000000000; #define NaN (*(double*)&lNaN) #else static const long long lNaN = 0xfff8000000000000; #define NaN (*(double*)&lNaN) #endif #endif saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/nn.h000066400000000000000000000251741224124640700225360ustar00rootroot00000000000000/********************************************************** * Version $Id: nn.h 1082 2011-06-08 08:07:00Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: nn.h * * Created: 04/08/2000 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: Header file for nn library * * Description: None * * Revisions: None * *****************************************************************************/ #if !defined(_NN_H) #define _NN_H //--------------------------------------------------------- #ifdef __cplusplus extern "C" { #endif //--------------------------------------------------------- typedef enum { SIBSON, NON_SIBSONIAN } NN_RULE; #if !defined(_POINT_STRUCT) #define _POINT_STRUCT typedef struct { double x; double y; double z; } point; #endif /** Smoothes the input point array by averaging the input x,y and z values ** for each cell within virtual rectangular nx by ny grid. The corners of the ** grid are created from min and max values of the input array. It also frees ** the original array and returns results and new dimension via original ** data and size pointers. * * @param pn Pointer to number of points (input/output) * @param ppoints Pointer to array of points (input/output) [*pn] * @param nx Number of x nodes in decimation * @param ny Number of y nodes in decimation */ void points_thin(int* n, point** points, int nx, int ny); /** Generates rectangular grid nx by ny using min and max x and y values from ** the input point array. Allocates space for the output point array, be sure ** to free it when necessary! * * @param n Number of points * @param points Array of points [n] * @param nx Number of x nodes * @param ny Number of y nodes * @param nout Pointer to number of output points * @param pout Ppointer to array of output points [*nout] */ void points_generate1(int n, point points[], int nx, int ny, double zoom, int* nout, point** pout); /** Generates rectangular grid nx by ny using specified min and max x and y ** values. Allocates space for the output point array, be sure to free it ** when necessary! * * @param xmin Min x value * @param xmax Max x value * @param ymin Min y value * @param ymax Max y value * @param nx Number of x nodes * @param ny Number of y nodes * @param zoom Zoom coefficient * @param nout Pointer to number of output points * @param pout Pointer to array of output points [*nout] */ void points_generate2(double xmin, double xmax, double ymin, double ymax, int nx, int ny, int* nout, point** pout); /** Reads array of points from a columnar file. * * @param fname File name (can be "stdin" dor stndard input) * @param dim Number of dimensions (must be 2 or 3) * @param n Pointer to number of points (output) * @param points Pointer to array of points [*n] (output) */ void points_read(char* fname, int dim, int* n, point** points); /** Scales Y coordinate so that the resulting set fits into square: ** xmax - xmin = ymax - ymin * * @param n Number of points * @param points The points to scale * @return Y axis compression coefficient */ double points_scaletosquare(int n, point* points); /** Compresses Y domain by a given multiple. * * @param n Number of points * @param points The points to scale * @param Y axis compression coefficient as returned by points_scaletosquare() */ void points_scale(int n, point* points, double k); /** Structure to perform the Delaunay triangulation of a given array of points. * * Contains a deep copy of the input array of points. * Contains triangles, circles and edges resulted from the triangulation. * Contains neighbour triangles for each triangle. * Contains point to triangle map. */ struct delaunay; typedef struct delaunay delaunay; /** Builds Delaunay triangulation of the given array of points. * * @param np Number of points * @param points Array of points [np] (input) * @param ns Number of forced segments * @param segments Array of (forced) segment endpoint indices [2*ns] * @param nh Number of holes * @param holes Array of hole (x,y) coordinates [2*nh] * @return Delaunay triangulation with triangulation results */ delaunay* delaunay_build(int np, point points[], int ns, int segments[], int nh, double holes[]); /** Destroys Delaunay triangulation. * * @param d Structure to be destroyed */ void delaunay_destroy(delaunay* d); /** `lpi' -- "linear point interpolator" is a structure for * conducting linear interpolation on a given data on a "point-to-point" basis. * It interpolates linearly within each triangle resulted from the Delaunay * triangluation of input data. `lpi' is much faster than all * Natural Neighbours interpolators below. */ struct lpi; typedef struct lpi lpi; /** Builds linear interpolator. * * @param d Delaunay triangulation * @return Linear interpolator */ lpi* lpi_build(delaunay* d); /** Destroys linear interpolator. * * @param l Structure to be destroyed */ void lpi_destroy(lpi* l); /** Finds linearly interpolated value in a point. * * @param l Linear point interpolator * @param p Point to be interpolated (p->x, p->y -- input; p->z -- output) */ void lpi_interpolate_point(lpi* l, point* p); /* Linearly interpolates data from one array of points for another array of * points. * * @param nin Number of input points * @param pin Array of input points [pin] * @param nout Number of ouput points * @param pout Array of output points [nout] */ void lpi_interpolate_points(int nin, point pin[], int nout, point pout[]); /** `nnpi' -- "Natural Neighbours point interpolator" is a * structure for conducting Natural Neighbours interpolation on a given data on * a "point-to-point" basis. Because it involves weight calculation for each * next output point, it is not particularly suitable for consequitive * interpolations on the same set of observation points -- use * `nnhpi' or `nnai' in these cases. */ struct nnpi; typedef struct nnpi nnpi; /** Creates Natural Neighbours point interpolator. * * @param d Delaunay triangulation * @return Natural Neighbours interpolation */ nnpi* nnpi_create(delaunay* d); /** Destroys Natural Neighbours point interpolation. * * @param nn Structure to be destroyed */ void nnpi_destroy(nnpi* nn); /** Finds Natural Neighbours-interpolated value in a point. * * @param nn NN point interpolator * @param p Point to be interpolated (p->x, p->y -- input; p->z -- output) */ void nnpi_interpolate_point(nnpi* nn, point* p); /** Natural Neighbours-interpolates data in one array of points for another ** array of points. * * @param nin Number of input points * @param pin Array of input points [pin] * @param wmin Minimal allowed weight * @param nout Number of output points * @param pout Array of output points [nout] */ void nnpi_interpolate_points(int nin, point pin[], double wmin, int nout, point pout[]); /** Sets minimal allowed weight for Natural Neighbours interpolation. * @param nn Natural Neighbours point interpolator * @param wmin Minimal allowed weight */ void nnpi_setwmin(nnpi* nn, double wmin); /** `nnhpi' is a structure for conducting consequitive * Natural Neighbours interpolations on a given spatial data set in a random * sequence of points from a set of finite size, taking advantage of repeated * interpolations in the same point. It allows to modify Z * coordinate of data between interpolations. */ struct nnhpi; typedef struct nnhpi nnhpi; /** Creates Natural Neighbours hashing point interpolator. * * @param d Delaunay triangulation * @param size Hash table size (should be of order of number of output points) * @return Natural Neighbours interpolation */ nnhpi* nnhpi_create(delaunay* d, int size); /** Destroys Natural Neighbours hashing point interpolation. * * @param nn Structure to be destroyed */ void nnhpi_destroy(nnhpi* nn); /** Finds Natural Neighbours-interpolated value in a point. * * @param nnhpi NN hashing point interpolator * @param p Point to be interpolated (p->x, p->y -- input; p->z -- output) */ void nnhpi_interpolate(nnhpi* nn, point* p); /** Modifies interpolated data. * Finds point* pd in the underlying Delaunay triangulation such that * pd->x = p->x and pd->y = p->y, and copies p->z to pd->z. Exits with error * if the point is not found. * * @param nn Natural Neighbours hashing point interpolator * @param p New data */ void nnhpi_modify_data(nnhpi* nn, point* p); /** Sets minimal allowed weight for Natural Neighbours interpolation. * @param nn Natural Neighbours point hashing interpolator * @param wmin Minimal allowed weight */ void nnhpi_setwmin(nnhpi* nn, double wmin); /* `nnai' is a tructure for conducting consequitive Natural * Neighbours interpolations on a given spatial data set in a given array of * points. It allows to modify Z coordinate of data between interpolations. * `nnai' is the fastest of the three Natural Neighbours * interpolators here. */ struct nnai; typedef struct nnai nnai; /** Builds Natural Neighbours array interpolator. This includes calculation of * weights used in nnai_interpolate(). * * @param d Delaunay triangulation * @return Natural Neighbours interpolation */ nnai* nnai_build(delaunay* d, long n, double* x, double* y); /** Destroys Natural Neighbours array interpolator. * * @param nn Structure to be destroyed */ void nnai_destroy(nnai* nn); /** Conducts NN interpolation in a fixed array of output points using * data specified for a fixed array of input points. Uses pre-calculated * weights. * * @param nn NN array interpolator * @param zin input data [nn->d->npoints] * @param zout output data [nn->n]. Must be pre-allocated! */ void nnai_interpolate(nnai* nn, double* zin, double* zout); /** Sets minimal allowed weight for Natural Neighbours interpolation. * @param nn Natural Neighbours array interpolator * @param wmin Minimal allowed weight */ void nnai_setwmin(nnai* nn, double wmin); /* Sets the verbosity level within nn package. * 0 (default) - silent * 1 - verbose * 2 - very verbose */ extern int nn_verbose; /* Switches between weight calculation methods. * SIBSON -- classic Sibson method * NON_SIBSONIAN -- simpler and (I think) more robust method */ extern NN_RULE nn_rule; /* Contains version string for the nn package. */ extern char* nn_version; /* Limits verbose information to a particular vertex (used mainly for * debugging purposes). */ extern int nn_test_vertice; //--------------------------------------------------------- #include #include "delaunay.h" #include "nan.h" #ifdef __cplusplus } // extern "C" { #endif //--------------------------------------------------------- #endif /* _NN_H */ saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/nnai.c000066400000000000000000000257421224124640700230440ustar00rootroot00000000000000/********************************************************** * Version $Id: nnai.c 1082 2011-06-08 08:07:00Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: nnai.c * * Created: 15/11/2002 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: Code for: * -- Natural Neighbours Array Interpolator * * Description: `nnai' is a tructure for conducting * consequitive Natural Neighbours interpolations on a given * spatial data set in a given array of points. It allows to * modify Z coordinate of data in between interpolations. * `nnai' is the fastest of the three Natural * Neighbours interpolators in `nn' library. * * Revisions: None * *****************************************************************************/ #include #include #include #include #include "nn.h" #include "delaunay.h" #include "nan.h" typedef struct { int nvertices; int* vertices; /* vertex indices [nvertices] */ double* weights; /* vertex weights [nvertices] */ } nn_weights; struct nnai { delaunay* d; double wmin; double n; /* number of output points */ double* x; /* [n] */ double* y; /* [n] */ nn_weights* weights; }; void nn_quit(char* format, ...); void nnpi_calculate_weights(nnpi* nn); int nnpi_get_nvertices(nnpi* nn); int* nnpi_get_vertices(nnpi* nn); double* nnpi_get_weights(nnpi* nn); void nnpi_normalize_weights(nnpi* nn); void nnpi_reset(nnpi* nn); void nnpi_set_point(nnpi* nn, point* p); /* Builds Natural Neighbours array interpolator. This includes calculation of * weights used in nnai_interpolate(). * * @param d Delaunay triangulation * @return Natural Neighbours interpolation */ nnai* nnai_build(delaunay* d, long n, double* x, double* y) { nnai* nn = (nnai *)malloc(sizeof(nnai)); nnpi* nnpi = nnpi_create(d); int* vertices; double* weights; int i; if (n <= 0) nn_quit("nnai_create(): n = %d\n", n); nn->d = d; nn->n = n; nn->x = (double *)malloc(n * sizeof(double)); memcpy(nn->x, x, n * sizeof(double)); nn->y = (double *)malloc(n * sizeof(double)); memcpy(nn->y, y, n * sizeof(double)); nn->weights = (nn_weights *)malloc(n * sizeof(nn_weights)); for (i = 0; i < n; ++i) { nn_weights* w = &nn->weights[i]; point p; p.x = x[i]; p.y = y[i]; nnpi_reset(nnpi); nnpi_set_point(nnpi, &p); nnpi_calculate_weights(nnpi); nnpi_normalize_weights(nnpi); vertices = nnpi_get_vertices(nnpi); weights = nnpi_get_weights(nnpi); w->nvertices = nnpi_get_nvertices(nnpi); w->vertices = (int *)malloc(w->nvertices * sizeof(int)); memcpy(w->vertices, vertices, w->nvertices * sizeof(int)); w->weights = (double *)malloc(w->nvertices * sizeof(double)); memcpy(w->weights, weights, w->nvertices * sizeof(double)); } nnpi_destroy(nnpi); return nn; } /* Destroys Natural Neighbours array interpolator. * * @param nn Structure to be destroyed */ void nnai_destroy(nnai* nn) { int i; for (i = 0; i < nn->n; ++i) { nn_weights* w = &nn->weights[i]; free(w->vertices); free(w->weights); } free(nn->x); free(nn->y); free(nn->weights); free(nn); } /* Conducts NN interpolation in a fixed array of output points using * data specified for a fixed array of input points. Uses pre-calculated * weights. * * @param nn NN array interpolator * @param zin input data [nn->d->npoints] * @param zout output data [nn->n]. Must be pre-allocated! */ void nnai_interpolate(nnai* nn, double* zin, double* zout) { int i; for (i = 0; i < nn->n; ++i) { nn_weights* w = &nn->weights[i]; double z = 0.0; int j; for (j = 0; j < w->nvertices; ++j) { double weight = w->weights[j]; if (weight < nn->wmin) { z = NaN; break; } z += weight * zin[w->vertices[j]]; } zout[i] = z; } } /** Sets minimal allowed weight for Natural Neighbours interpolation. * @param nn Natural Neighbours array interpolator * @param wmin Minimal allowed weight */ void nnai_setwmin(nnai* nn, double wmin) { nn->wmin = wmin; } /* The rest of this file contains a number of test programs. */ #if defined(NNAI_TEST) #include #define NPOINTSIN 10000 #define NMIN 10 #define NX 101 #define NXMIN 1 #define SQ(x) ((x) * (x)) static double franke(double x, double y) { x *= 9.0; y *= 9.0; return 0.75 * exp((-SQ(x - 2.0) - SQ(y - 2.0)) / 4.0) + 0.75 * exp(-SQ(x - 2.0) / 49.0 - (y - 2.0) / 10.0) + 0.5 * exp((-SQ(x - 7.0) - SQ(y - 3.0)) / 4.0) - 0.2 * exp(-SQ(x - 4.0) - SQ(y - 7.0)); } /* *INDENT-OFF* */ static void usage() { printf( "Usage: nn_test [-v|-V] [-n ]\n" "Options:\n" " -a -- use non-Sibsonian interpolation rule\n" " -n :\n" " -- number of input points (default = 10000)\n" " -- number of output points per side (default = 64)\n" " -v -- verbose\n" " -V -- very verbose\n" ); } /* *INDENT-ON* */ int main(int argc, char* argv[]) { int nin = NPOINTSIN; int nx = NX; int nout = 0; point* pin = NULL; delaunay* d = NULL; point* pout = NULL; nnai* nn = NULL; double* zin = NULL; double* xout = NULL; double* yout = NULL; double* zout = NULL; int cpi = -1; /* control point index */ struct timeval tv0, tv1, tv2; struct timezone tz; int i; i = 1; while (i < argc) { switch (argv[i][1]) { case 'a': i++; nn_rule = NON_SIBSONIAN; break; case 'n': i++; if (i >= argc) nn_quit("no number of data points found after -i\n"); nin = atoi(argv[i]); i++; if (i >= argc) nn_quit("no number of ouput points per side found after -i\n"); nx = atoi(argv[i]); i++; break; case 'v': i++; nn_verbose = 1; break; case 'V': i++; nn_verbose = 2; break; default: usage(); break; } } if (nin < NMIN) nin = NMIN; if (nx < NXMIN) nx = NXMIN; printf("\nTest of Natural Neighbours array interpolator:\n\n"); printf(" %d data points\n", nin); printf(" %d output points\n", nx * nx); /* * generate data */ printf(" generating data:\n"); fflush(stdout); pin = (point *)malloc(nin * sizeof(point)); zin = (double *)malloc(nin * sizeof(double)); for (i = 0; i < nin; ++i) { point* p = &pin[i]; p->x = (double) random() / RAND_MAX; p->y = (double) random() / RAND_MAX; p->z = franke(p->x, p->y); zin[i] = p->z; if (nn_verbose) printf(" (%f, %f, %f)\n", p->x, p->y, p->z); } /* * triangulate */ printf(" triangulating:\n"); fflush(stdout); d = delaunay_build(nin, pin, 0, NULL, 0, NULL); /* * generate output points */ points_generate2(-0.1, 1.1, -0.1, 1.1, nx, nx, &nout, &pout); xout = (double *)malloc(nout * sizeof(double)); yout = (double *)malloc(nout * sizeof(double)); zout = (double *)malloc(nout * sizeof(double)); for (i = 0; i < nout; ++i) { point* p = &pout[i]; xout[i] = p->x; yout[i] = p->y; zout[i] = NaN; } cpi = (nx / 2) * (nx + 1); gettimeofday(&tv0, &tz); /* * create interpolator */ printf(" creating interpolator:\n"); fflush(stdout); nn = nnai_build(d, nout, xout, yout); fflush(stdout); gettimeofday(&tv1, &tz); { long dt = 1000000 * (tv1.tv_sec - tv0.tv_sec) + tv1.tv_usec - tv0.tv_usec; printf(" interpolator creation time = %ld us (%.2f us / point)\n", dt, (double) dt / nout); } /* * interpolate */ printf(" interpolating:\n"); fflush(stdout); nnai_interpolate(nn, zin, zout); if (nn_verbose) for (i = 0; i < nout; ++i) printf(" (%f, %f, %f)\n", xout[i], yout[i], zout[i]); fflush(stdout); gettimeofday(&tv2, &tz); { long dt = 1000000.0 * (tv2.tv_sec - tv1.tv_sec) + tv2.tv_usec - tv1.tv_usec; printf(" interpolation time = %ld us (%.2f us / point)\n", dt, (double) dt / nout); } if (!nn_verbose) printf(" control point: (%f, %f, %f) (expected z = %f)\n", xout[cpi], yout[cpi], zout[cpi], franke(xout[cpi], yout[cpi])); printf(" interpolating one more time:\n"); fflush(stdout); nnai_interpolate(nn, zin, zout); if (nn_verbose) for (i = 0; i < nout; ++i) printf(" (%f, %f, %f)\n", xout[i], yout[i], zout[i]); fflush(stdout); gettimeofday(&tv0, &tz); { long dt = 1000000.0 * (tv0.tv_sec - tv2.tv_sec) + tv0.tv_usec - tv2.tv_usec; printf(" interpolation time = %ld us (%.2f us / point)\n", dt, (double) dt / nout); } if (!nn_verbose) printf(" control point: (%f, %f, %f) (expected z = %f)\n", xout[cpi], yout[cpi], zout[cpi], franke(xout[cpi], yout[cpi])); printf(" entering new data:\n"); fflush(stdout); for (i = 0; i < nin; ++i) { point* p = &pin[i]; p->z = p->x * p->x - p->y * p->y; zin[i] = p->z; if (nn_verbose) printf(" (%f, %f, %f)\n", p->x, p->y, p->z); } printf(" interpolating:\n"); fflush(stdout); nnai_interpolate(nn, zin, zout); if (nn_verbose) for (i = 0; i < nout; ++i) printf(" (%f, %f, %f)\n", xout[i], yout[i], zout[i]); if (!nn_verbose) printf(" control point: (%f, %f, %f) (expected z = %f)\n", xout[cpi], yout[cpi], zout[cpi], xout[cpi] * xout[cpi] - yout[cpi] * yout[cpi]); printf(" restoring data:\n"); fflush(stdout); for (i = 0; i < nin; ++i) { point* p = &pin[i]; p->z = franke(p->x, p->y); zin[i] = p->z; if (nn_verbose) printf(" (%f, %f, %f)\n", p->x, p->y, p->z); } printf(" interpolating:\n"); fflush(stdout); nnai_interpolate(nn, zin, zout); if (nn_verbose) for (i = 0; i < nout; ++i) printf(" (%f, %f, %f)\n", xout[i], yout[i], zout[i]); if (!nn_verbose) printf(" control point: (%f, %f, %f) (expected z = %f)\n", xout[cpi], yout[cpi], zout[cpi], franke(xout[cpi], yout[cpi])); printf("\n"); nnai_destroy(nn); free(zin); free(xout); free(yout); free(zout); free(pout); delaunay_destroy(d); free(pin); return 0; } #endif saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/nncommon.c000066400000000000000000000312701224124640700237340ustar00rootroot00000000000000/********************************************************** * Version $Id: nncommon.c 968 2011-03-25 13:26:46Z oconrad $ *********************************************************/ /****************************************************************************** * * File: nncommon.c * * Created: 04/08/2000 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: Common stuff for NN interpolation library * * Description: None * * Revisions: 15/11/2002 PS: Changed name from "utils.c" * 28/02/2003 PS: Modified points_read() to do the job without * rewinding the file. This allows to read from stdin when * necessary. * 09/04/2003 PS: Modified points_read() to read from a * file specified by name, not by handle. * *****************************************************************************/ #ifdef _SAGA_MSW #define isnan _isnan #endif #include #include #include #include #include #include #include #include #include #include "nan.h" #include "delaunay.h" #define BUFSIZE 1024 int nn_verbose = 0; int nn_test_vertice = -1; NN_RULE nn_rule = SIBSON; #include "version.h" void nn_quit(char* format, ...) { va_list args; fflush(stdout); /* just in case, to have the exit message * last */ fprintf(stderr, "error: nn: "); va_start(args, format); vfprintf(stderr, format, args); va_end(args); exit(1); } int circle_build(circle* c, point* p1, point* p2, point* p3) { double x1sq = p1->x * p1->x; double x2sq = p2->x * p2->x; double x3sq = p3->x * p3->x; double y1sq = p1->y * p1->y; double y2sq = p2->y * p2->y; double y3sq = p3->y * p3->y; double t1 = x3sq - x2sq + y3sq - y2sq; double t2 = x1sq - x3sq + y1sq - y3sq; double t3 = x2sq - x1sq + y2sq - y1sq; double D = (p1->x * (p2->y - p3->y) + p2->x * (p3->y - p1->y) + p3->x * (p1->y - p2->y)) * 2.0; if (D == 0.0) return 0; c->x = (p1->y * t1 + p2->y * t2 + p3->y * t3) / D; c->y = -(p1->x * t1 + p2->x * t2 + p3->x * t3) / D; c->r = hypot(c->x - p1->x, c->y - p1->y); return 1; } /* This procedure has taken it final shape after a number of tries. The problem * was to have the calculated and stored radii being the same if (x,y) is * exactly on the circle border (i.e. not to use FCPU extended precision in * the radius calculation). This may have little effect in practice but was * important in some tests when both input and output data were placed * in rectangular grid nodes. */ int circle_contains(circle* c, point* p) { return hypot(c->x - p->x, c->y - p->y) <= c->r; } /* Smoothes the input point array by averaging the input x,y and z values * for each cell within virtual rectangular nx by ny grid. The corners of the * grid are created from min and max values of the input array. It also frees * the original array and returns results and new dimension via original * data and size pointers. * * @param pn Pointer to number of points (input/output) * @param ppoints Pointer to array of points (input/output) [*pn] * @param nx Number of x nodes in decimation * @param ny Number of y nodes in decimation */ void points_thin(int* pn, point** ppoints, int nx, int ny) { int n = *pn; point* points = *ppoints; double xmin = DBL_MAX; double xmax = -DBL_MAX; double ymin = DBL_MAX; double ymax = -DBL_MAX; int nxy = nx * ny; double* sumx = (double *)calloc(nxy, sizeof(double)); double* sumy = (double *)calloc(nxy, sizeof(double)); double* sumz = (double *)calloc(nxy, sizeof(double)); int* count = (int *)calloc(nxy, sizeof(int)); double stepx = 0.0; double stepy = 0.0; int nnew = 0; point* pointsnew = NULL; int i, j, ii; if (nn_verbose) fprintf(stderr, "thinned: %d points -> ", *pn); if (nx < 1 || ny < 1) { free(points); *ppoints = NULL; *pn = 0; if (nn_verbose) fprintf(stderr, "0 points"); free(sumx); free(sumy); free(sumz); free(count); return; } for (ii = 0; ii < n; ++ii) { point* p = &points[ii]; if (p->x < xmin) xmin = p->x; if (p->x > xmax) xmax = p->x; if (p->y < ymin) ymin = p->y; if (p->y > ymax) ymax = p->y; } stepx = (nx > 1) ? (xmax - xmin) / nx : 0.0; stepy = (ny > 1) ? (ymax - ymin) / ny : 0.0; for (ii = 0; ii < n; ++ii) { point* p = &points[ii]; int index; /* * Following is the portion of the code which really depends on the * floating point particulars. Do not be surprised if different * compilers/options give different results here. */ i = (nx == 1) ? 0 : (int)((p->x - xmin) / stepx); j = (ny == 1) ? 0 : (int)((p->y - ymin) / stepy); if (i == nx) i--; if (j == ny) j--; index = i + j * nx; sumx[index] += p->x; sumy[index] += p->y; sumz[index] += p->z; count[index]++; } for (j = 0; j < ny; ++j) { for (i = 0; i < nx; ++i) { int index = i + j * nx; if (count[index] > 0) nnew++; } } pointsnew = (point *)malloc(nnew * sizeof(point)); ii = 0; for (j = 0; j < ny; ++j) { for (i = 0; i < nx; ++i) { int index = i + j * nx; int nn = count[index]; if (nn > 0) { point* p = &pointsnew[ii]; p->x = sumx[index] / nn; p->y = sumy[index] / nn; p->z = sumz[index] / nn; ii++; } } } if (nn_verbose) fprintf(stderr, "%d points\n", nnew); free(sumx); free(sumy); free(sumz); free(count); free(points); *ppoints = pointsnew; *pn = nnew; } /* Generates rectangular grid nx by ny using min and max x and y values from * the input point array. Allocates space for the output point array, be sure * to free it when necessary! * * @param n Number of points * @param points Array of points [n] * @param nx Number of x nodes * @param ny Number of y nodes * @param zoom Zoom coefficient * @param nout Pointer to number of output points * @param pout Pointer to array of output points [*nout] */ void points_generate1(int nin, point pin[], int nx, int ny, double zoom, int* nout, point** pout) { double xmin = DBL_MAX; double xmax = -DBL_MAX; double ymin = DBL_MAX; double ymax = -DBL_MAX; double stepx, stepy; double x0, xx, yy; int i, j, ii; if (nx < 1 || ny < 1) { *pout = NULL; *nout = 0; return; } for (ii = 0; ii < nin; ++ii) { point* p = &pin[ii]; if (p->x < xmin) xmin = p->x; if (p->x > xmax) xmax = p->x; if (p->y < ymin) ymin = p->y; if (p->y > ymax) ymax = p->y; } if (isnan(zoom) || zoom <= 0.0) zoom = 1.0; if (zoom != 1.0) { double xdiff2 = (xmax - xmin) / 2.0; double ydiff2 = (ymax - ymin) / 2.0; double xav = (xmax + xmin) / 2.0; double yav = (ymax + ymin) / 2.0; xmin = xav - xdiff2 * zoom; xmax = xav + xdiff2 * zoom; ymin = yav - ydiff2 * zoom; ymax = yav + ydiff2 * zoom; } *nout = nx * ny; *pout = (point *)malloc(*nout * sizeof(point)); stepx = (nx > 1) ? (xmax - xmin) / (nx - 1) : 0.0; stepy = (ny > 1) ? (ymax - ymin) / (ny - 1) : 0.0; x0 = (nx > 1) ? xmin : (xmin + xmax) / 2.0; yy = (ny > 1) ? ymin : (ymin + ymax) / 2.0; ii = 0; for (j = 0; j < ny; ++j) { xx = x0; for (i = 0; i < nx; ++i) { point* p = &(*pout)[ii]; p->x = xx; p->y = yy; xx += stepx; ii++; } yy += stepy; } } /* Generates rectangular grid nx by ny using specified min and max x and y * values. Allocates space for the output point array, be sure to free it * when necessary! * * @param xmin Min x value * @param xmax Max x value * @param ymin Min y value * @param ymax Max y value * @param nx Number of x nodes * @param ny Number of y nodes * @param nout Pointer to number of output points * @param pout Pointer to array of output points [*nout] */ void points_generate2(double xmin, double xmax, double ymin, double ymax, int nx, int ny, int* nout, point** pout) { double stepx, stepy; double x0, xx, yy; int i, j, ii; if (nx < 1 || ny < 1) { *pout = NULL; *nout = 0; return; } *nout = nx * ny; *pout = (point *)malloc(*nout * sizeof(point)); stepx = (nx > 1) ? (xmax - xmin) / (nx - 1) : 0.0; stepy = (ny > 1) ? (ymax - ymin) / (ny - 1) : 0.0; x0 = (nx > 1) ? xmin : (xmin + xmax) / 2.0; yy = (ny > 1) ? ymin : (ymin + ymax) / 2.0; ii = 0; for (j = 0; j < ny; ++j) { xx = x0; for (i = 0; i < nx; ++i) { point* p = &(*pout)[ii]; p->x = xx; p->y = yy; xx += stepx; ii++; } yy += stepy; } } static int str2double(char* token, double* value) { char* end = NULL; if (token == NULL) { *value = NaN; return 0; } *value = strtod(token, &end); if (end == token) { *value = NaN; return 0; } return 1; } #define NALLOCATED_START 1024 /* Reads array of points from a columnar file. * * @param fname File name (can be "stdin" for standard input) * @param dim Number of dimensions (must be 2 or 3) * @param n Pointer to number of points (output) * @param points Pointer to array of points [*n] (output) (to be freed) */ void points_read(char* fname, int dim, int* n, point** points) { FILE* f = NULL; int nallocated = NALLOCATED_START; char buf[BUFSIZE]; char seps[] = " ,;\t"; char* token; if (dim < 2 || dim > 3) { *n = 0; *points = NULL; return; } if (fname == NULL) f = stdin; else { if (strcmp(fname, "stdin") == 0 || strcmp(fname, "-") == 0) f = stdin; else { f = fopen(fname, "r"); if (f == NULL) nn_quit("%s: %s\n", fname, strerror(errno)); } } *points = (point *)malloc(nallocated * sizeof(point)); *n = 0; while (fgets(buf, BUFSIZE, f) != NULL) { point* p; if (*n == nallocated) { nallocated *= 2; *points = (point *)realloc(*points, nallocated * sizeof(point)); } p = &(*points)[*n]; if (buf[0] == '#') continue; if ((token = strtok(buf, seps)) == NULL) continue; if (!str2double(token, &p->x)) continue; if ((token = strtok(NULL, seps)) == NULL) continue; if (!str2double(token, &p->y)) continue; if (dim == 2) p->z = NaN; else { if ((token = strtok(NULL, seps)) == NULL) continue; if (!str2double(token, &p->z)) continue; } (*n)++; } if (*n == 0) { free(*points); *points = NULL; } else *points = (point *)realloc(*points, *n * sizeof(point)); if (f != stdin) if (fclose(f) != 0) nn_quit("%s: %s\n", fname, strerror(errno)); } /** Scales Y coordinate so that the resulting set fits into square: ** xmax - xmin = ymax - ymin * * @param n Number of points * @param points The points to scale * @return Y axis compression coefficient */ double points_scaletosquare(int n, point* points) { double xmin, ymin, xmax, ymax; double k; int i; if (n <= 0) return NaN; xmin = xmax = points[0].x; ymin = ymax = points[0].y; for (i = 1; i < n; ++i) { point* p = &points[i]; if (p->x < xmin) xmin = p->x; else if (p->x > xmax) xmax = p->x; if (p->y < ymin) ymin = p->y; else if (p->y > ymax) ymax = p->y; } if (xmin == xmax || ymin == ymax) return NaN; else k = (ymax - ymin) / (xmax - xmin); for (i = 0; i < n; ++i) points[i].y /= k; return k; } /** Compresses Y domain by a given multiple. * * @param n Number of points * @param points The points to scale * @param Y axis compression coefficient as returned by points_scaletosquare() */ void points_scale(int n, point* points, double k) { int i; for (i = 0; i < n; ++i) points[i].y /= k; } saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/nnpi.c000066400000000000000000000560161224124640700230610ustar00rootroot00000000000000/********************************************************** * Version $Id: nnpi.c 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /***************************************************************************** * * File: nnpi.c * * Created: 15/11/2002 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: Code for: * -- Natural Neighbours Point Interpolator * -- Natural Neighbours Point Hashing Interpolator * * Description: `nnpi' -- "Natural Neighbours Point * Interpolator" -- is a structure for conducting Natural * Neighbours interpolation on a given data on a * "point-to-point" basis. Because it involves weight * calculation for each next output point, it is not * particularly suitable for consequitive interpolations on * the same set of observation points -- use * `nnhpi' or `nnai' * in these cases. * * `nnhpi' is a structure for * conducting consequitive Natural Neighbours interpolations * on a given spatial data set in a random sequence of points * from a set of finite size, taking advantage of repeated * interpolations in the same point. It allows to modify Z * coordinate of data in between interpolations. * * * Revisions: 01/04/2003 PS: modified nnpi_triangle_process(): for * Sibson interpolation, if circle_build fails(), now a * local copy of a point is moved slightly rather than the * data point itself. The later approach have found leading * to inconsistencies of the new point position with the * earlier built triangulation. * *****************************************************************************/ #include #include #include #include #include #include #include #include "nn.h" #include "delaunay.h" #include "nan.h" #include "hash.h" struct nnpi { delaunay* d; point* p; double wmin; /* * work variables */ int nvertices; int nallocated; int* vertices; /* vertex indices */ double* weights; int n; /* number of points processed */ }; int circle_build(circle* c, point* p0, point* p1, point* p2); int circle_contains(circle* c, point* p); void delaunay_circles_find(delaunay* d, point* p, int* n, int** out); int delaunay_xytoi(delaunay* d, point* p, int seed); void nn_quit(char* format, ...); #define NSTART 10 #define NINC 10 #define EPS_SHIFT 1.0e-9 #define N_SEARCH_TURNON 20 #define BIGNUMBER 1.0e+100 #ifndef min #define min(x,y) ((x) < (y) ? (x) : (y)) #endif #ifndef max #define max(x,y) ((x) > (y) ? (x) : (y)) #endif /* Creates Natural Neighbours point interpolator. * * @param d Delaunay triangulation * @return Natural Neighbours interpolation */ nnpi* nnpi_create(delaunay* d) { nnpi* nn = (nnpi *)malloc(sizeof(nnpi)); nn->d = d; nn->wmin = -DBL_MAX; nn->vertices = (int *)calloc(NSTART, sizeof(int)); nn->weights = (double *)calloc(NSTART, sizeof(double)); nn->nvertices = 0; nn->nallocated = NSTART; nn->p = NULL; nn->n = 0; return nn; } /* Destroys Natural Neighbours point interpolator. * * @param nn Structure to be destroyed */ void nnpi_destroy(nnpi* nn) { free(nn->weights); free(nn->vertices); free(nn); } void nnpi_reset(nnpi* nn) { nn->nvertices = 0; nn->p = NULL; memset(nn->d->flags, 0, nn->d->ntriangles * sizeof(int)); } static void nnpi_add_weight(nnpi* nn, int vertex, double w) { int i; /* * find whether the vertex is already in the list */ for (i = 0; i < nn->nvertices; ++i) if (nn->vertices[i] == vertex) break; if (i == nn->nvertices) { /* not in the list */ /* * get more memory if necessary */ if (nn->nvertices == nn->nallocated) { nn->vertices = (int *)realloc(nn->vertices, (nn->nallocated + NINC) * sizeof(int)); nn->weights = (double *)realloc(nn->weights, (nn->nallocated + NINC) * sizeof(double)); nn->nallocated += NINC; } /* * add the vertex to the list */ nn->vertices[i] = vertex; nn->weights[i] = w; nn->nvertices++; } else { /* in the list */ if (nn_rule == SIBSON) nn->weights[i] += w; else if (w > nn->weights[i]) nn->weights[i] = w; } } static double triangle_scale_get(delaunay* d, triangle* t) { double x0 = d->points[t->vids[0]].x; double x1 = d->points[t->vids[1]].x; double x2 = d->points[t->vids[2]].x; double y0 = d->points[t->vids[0]].y; double y1 = d->points[t->vids[1]].y; double y2 = d->points[t->vids[2]].y; double xmin = min(min(x0, x1), x2); double xmax = max(max(x0, x1), x2); double ymin = min(min(y0, y1), y2); double ymax = max(max(y0, y1), y2); return xmax - xmin + ymax - ymin; } /* This is a central procedure for the Natural Neighbours interpolation. It * uses the Watson's algorithm for the required areas calculation and implies * that the vertices of the delaunay triangulation are listed in uniform * (clockwise or counterclockwise) order. */ static void nnpi_triangle_process(nnpi* nn, point* p, int i) { delaunay* d = nn->d; triangle* t = &d->triangles[i]; circle* c = &d->circles[i]; circle cs[3]; int j; assert(circle_contains(c, p)); if (nn_rule == SIBSON) { point pp; pp.x = p->x; pp.y = p->y; /* * Sibson interpolation by using Watson's algorithm */ do { for (j = 0; j < 3; ++j) { int j1 = (j + 1) % 3; int j2 = (j + 2) % 3; int v1 = t->vids[j1]; int v2 = t->vids[j2]; if (!circle_build(&cs[j], &d->points[v1], &d->points[v2], &pp)) { double scale = triangle_scale_get(d, t); if (d->points[v1].y == d->points[v2].y) pp.y += EPS_SHIFT * scale; else pp.x += EPS_SHIFT * scale; break; } } } while (j != 3); for (j = 0; j < 3; ++j) { int j1 = (j + 1) % 3; int j2 = (j + 2) % 3; double det = ((cs[j1].x - c->x) * (cs[j2].y - c->y) - (cs[j2].x - c->x) * (cs[j1].y - c->y)); nnpi_add_weight(nn, t->vids[j], det); } } else if (nn_rule == NON_SIBSONIAN) { double d1 = c->r - hypot(p->x - c->x, p->y - c->y); for (i = 0; i < 3; ++i) { int vid = t->vids[i]; point* pp = &d->points[vid]; double d2 = hypot(p->x - pp->x, p->y - pp->y); if (d2 == 0.0) nnpi_add_weight(nn, vid, BIGNUMBER); else nnpi_add_weight(nn, vid, d1 / d2); } } else nn_quit("unknown rule\n"); } void nnpi_calculate_weights(nnpi* nn) { point* p = nn->p; int n = nn->d->ntriangles; int i; if (n > N_SEARCH_TURNON) { int* tids; delaunay_circles_find(nn->d, p, &n, &tids); for (i = 0; i < n; ++i) nnpi_triangle_process(nn, p, tids[i]); } else for (i = 0; i < n; ++i) if (circle_contains(&nn->d->circles[i], p)) nnpi_triangle_process(nn, p, i); } void nnpi_normalize_weights(nnpi* nn) { int n = nn->nvertices; double sum = 0.0; int i; for (i = 0; i < n; ++i) sum += nn->weights[i]; for (i = 0; i < n; ++i) nn->weights[i] /= sum; } /* Finds Natural Neighbours-interpolated value for a point. * * @param nn NN interpolation * @param p Point to be interpolated (p->x, p->y -- input; p->z -- output) */ void nnpi_interpolate_point(nnpi* nn, point* p) { delaunay* d = nn->d; int i; nnpi_reset(nn); nn->p = p; nnpi_calculate_weights(nn); nnpi_normalize_weights(nn); if (nn_verbose) { if (nn_test_vertice == -1) { if (nn->n == 0) fprintf(stderr, "weights:\n"); fprintf(stderr, " %d: {", nn->n); for (i = 0; i < nn->nvertices; ++i) { fprintf(stderr, "(%d,%.5g)", nn->vertices[i], nn->weights[i]); if (i < nn->nvertices - 1) fprintf(stderr, ", "); } fprintf(stderr, "}\n"); } else { double w = 0.0; if (nn->n == 0) fprintf(stderr, "weights for vertex %d:\n", nn_test_vertice); for (i = 0; i < nn->nvertices; ++i) { if (nn->vertices[i] == nn_test_vertice) { w = nn->weights[i]; break; } } fprintf(stderr, "%15.7g %15.7g %15.7g\n", p->x, p->y, w); } } nn->n++; if (nn->nvertices == 0) { p->z = NaN; return; } p->z = 0.0; for (i = 0; i < nn->nvertices; ++i) { double weight = nn->weights[i]; if (weight < nn->wmin) { p->z = NaN; return; } p->z += d->points[nn->vertices[i]].z * weight; } } /* Performs Natural Neighbours interpolation for an array of points. * * @param nin Number of input points * @param pin Array of input points [pin] * @param wmin Minimal allowed weight * @param nout Number of output points * @param pout Array of output points [nout] */ void nnpi_interpolate_points(int nin, point pin[], double wmin, int nout, point pout[]) { delaunay* d = delaunay_build(nin, pin, 0, NULL, 0, NULL); nnpi* nn = nnpi_create(d); int seed = 0; int i; nn->wmin = wmin; if (nn_verbose) { fprintf(stderr, "xytoi:\n"); for (i = 0; i < nout; ++i) { point* p = &pout[i]; fprintf(stderr, "(%.7g,%.7g) -> %d\n", p->x, p->y, delaunay_xytoi(d, p, seed)); } } for (i = 0; i < nout; ++i) nnpi_interpolate_point(nn, &pout[i]); if (nn_verbose) { fprintf(stderr, "output:\n"); for (i = 0; i < nout; ++i) { point* p = &pout[i]; fprintf(stderr, " %d:%15.7g %15.7g %15.7g\n", i, p->x, p->y, p->z); } } nnpi_destroy(nn); delaunay_destroy(d); } /* Sets minimal allowed weight for Natural Neighbours interpolation. * @param nn Natural Neighbours point interpolator * @param wmin Minimal allowed weight */ void nnpi_setwmin(nnpi* nn, double wmin) { nn->wmin = wmin; } /* Sets point to interpolate in. * @param nn Natural Neighbours point interpolator * @param p Point to interpolate in */ void nnpi_set_point(nnpi* nn, point* p) { nn->p = p; } /* Gets number of data points involved in current interpolation. * @return Number of data points involved in current interpolation */ int nnpi_get_nvertices(nnpi* nn) { return nn->nvertices; } /* Gets indices of data points involved in current interpolation. * @return indices of data points involved in current interpolation */ int* nnpi_get_vertices(nnpi* nn) { return nn->vertices; } /* Gets weights of data points involved in current interpolation. * @return weights of data points involved in current interpolation */ double* nnpi_get_weights(nnpi* nn) { return nn->weights; } /* * nnhpi */ struct nnhpi { struct nnpi* nnpi; hashtable* ht_data; hashtable* ht_weights; int n; /* number of points processed */ }; typedef struct { int nvertices; int* vertices; /* vertex indices [nvertices] */ double* weights; /* vertex weights [nvertices] */ } nn_weights; /* Creates Natural Neighbours hashing point interpolator. * * @param d Delaunay triangulation * @param size Hash table size (should be of order of number of output points) * @return Natural Neighbours interpolation */ nnhpi* nnhpi_create(delaunay* d, int size) { nnhpi* nn = (nnhpi *)malloc(sizeof(nnhpi)); int i; nn->nnpi = nnpi_create(d); nn->ht_data = ht_create_d2(d->npoints); nn->ht_weights = ht_create_d2(size); nn->n = 0; for (i = 0; i < d->npoints; ++i) ht_insert(nn->ht_data, &d->points[i], &d->points[i]); return nn; } static void free_nn_weights(void* data) { nn_weights* weights = (nn_weights*) data; free(weights->vertices); free(weights->weights); free(weights); } /* Destroys Natural Neighbours hashing point interpolation. * * @param nn Structure to be destroyed */ void nnhpi_destroy(nnhpi* nn) { ht_destroy(nn->ht_data); ht_process(nn->ht_weights, free_nn_weights); ht_destroy(nn->ht_weights); nnpi_destroy(nn->nnpi); } /* Finds Natural Neighbours-interpolated value in a point. * * @param nnhpi NN point hashing interpolator * @param p Point to be interpolated (p->x, p->y -- input; p->z -- output) */ void nnhpi_interpolate(nnhpi* nnhpi, point* p) { nnpi* nnpi = nnhpi->nnpi; delaunay* d = nnpi->d; hashtable* ht_weights = nnhpi->ht_weights; nn_weights* weights; int i; if (ht_find(ht_weights, p) != NULL) { weights = (nn_weights *)ht_find(ht_weights, p); if (nn_verbose) fprintf(stderr, " \n"); } else { nnpi_reset(nnpi); nnpi->p = p; nnpi_calculate_weights(nnpi); nnpi_normalize_weights(nnpi); weights = (nn_weights *)malloc(sizeof(nn_weights)); weights->vertices = (int *)malloc(sizeof(int) * nnpi->nvertices); weights->weights = (double *)malloc(sizeof(double) * nnpi->nvertices); weights->nvertices = nnpi->nvertices; for (i = 0; i < nnpi->nvertices; ++i) { weights->vertices[i] = nnpi->vertices[i]; weights->weights[i] = nnpi->weights[i]; } ht_insert(ht_weights, p, weights); if (nn_verbose) { if (nn_test_vertice == -1) { if (nnpi->n == 0) fprintf(stderr, "weights:\n"); fprintf(stderr, " %d: {", nnpi->n); for (i = 0; i < nnpi->nvertices; ++i) { fprintf(stderr, "(%d,%.5g)", nnpi->vertices[i], nnpi->weights[i]); if (i < nnpi->nvertices - 1) fprintf(stderr, ", "); } fprintf(stderr, "}\n"); } else { double w = 0.0; if (nnpi->n == 0) fprintf(stderr, "weights for vertex %d:\n", nn_test_vertice); for (i = 0; i < nnpi->nvertices; ++i) { if (nnpi->vertices[i] == nn_test_vertice) { w = nnpi->weights[i]; break; } } fprintf(stderr, "%15.7g %15.7g %15.7g\n", p->x, p->y, w); } } nnpi->n++; } nnhpi->n++; if (weights->nvertices == 0) { p->z = NaN; return; } p->z = 0.0; for (i = 0; i < weights->nvertices; ++i) { if (weights->weights[i] < nnpi->wmin) { p->z = NaN; return; } p->z += d->points[weights->vertices[i]].z * weights->weights[i]; } } /* Modifies interpolated data. * Finds point* pd in the underlying Delaunay triangulation such that * pd->x = p->x and pd->y = p->y, and copies p->z to pd->z. Exits with error * if the point is not found. * * @param nnhpi Natural Neighbours hashing point interpolator * @param p New data */ void nnhpi_modify_data(nnhpi* nnhpi, point* p) { point* orig = (point *)ht_find(nnhpi->ht_data, p); assert(orig != NULL); orig->z = p->z; } /* Sets minimal allowed weight for Natural Neighbours interpolation. * @param nn Natural Neighbours point hashing interpolator * @param wmin Minimal allowed weight */ void nnhpi_setwmin(nnhpi* nn, double wmin) { nn->nnpi->wmin = wmin; } #if defined(NNPHI_TEST) #include #define NPOINTSIN 10000 #define NMIN 10 #define NX 101 #define NXMIN 1 #define SQ(x) ((x) * (x)) static double franke(double x, double y) { x *= 9.0; y *= 9.0; return 0.75 * exp((-SQ(x - 2.0) - SQ(y - 2.0)) / 4.0) + 0.75 * exp(-SQ(x - 2.0) / 49.0 - (y - 2.0) / 10.0) + 0.5 * exp((-SQ(x - 7.0) - SQ(y - 3.0)) / 4.0) - 0.2 * exp(-SQ(x - 4.0) - SQ(y - 7.0)); } static void usage() { printf("Usage: nnhpi_test [-a] [-n ] [-v|-V]\n"); printf("Options:\n"); printf(" -a -- use non-Sibsonian interpolation rule\n"); printf(" -n :\n"); printf(" -- number of input points (default = 10000)\n"); printf(" -- number of output points per side (default = 64)\n"); printf(" -v -- verbose\n"); printf(" -V -- very verbose\n"); exit(0); } int main(int argc, char* argv[]) { int nin = NPOINTSIN; int nx = NX; int nout = 0; point* pin = NULL; delaunay* d = NULL; point* pout = NULL; nnhpi* nn = NULL; int cpi = -1; /* control point index */ struct timeval tv0, tv1; struct timezone tz; int i; i = 1; while (i < argc) { switch (argv[i][1]) { case 'a': i++; nn_rule = NON_SIBSONIAN; break; case 'n': i++; if (i >= argc) nn_quit("no number of data points found after -n\n"); nin = atoi(argv[i]); i++; if (i >= argc) nn_quit("no number of ouput points per side found after -i\n"); nx = atoi(argv[i]); i++; break; case 'v': i++; nn_verbose = 1; break; case 'V': i++; nn_verbose = 2; break; default: usage(); break; } } if (nin < NMIN) nin = NMIN; if (nx < NXMIN) nx = NXMIN; printf("\nTest of Natural Neighbours hashing point interpolator:\n\n"); printf(" %d data points\n", nin); printf(" %d output points\n", nx * nx); /* * generate data */ printf(" generating data:\n"); fflush(stdout); pin = (point *)malloc(nin * sizeof(point)); for (i = 0; i < nin; ++i) { point* p = &pin[i]; p->x = (double) random() / RAND_MAX; p->y = (double) random() / RAND_MAX; p->z = franke(p->x, p->y); if (nn_verbose) printf(" (%f, %f, %f)\n", p->x, p->y, p->z); } /* * triangulate */ printf(" triangulating:\n"); fflush(stdout); d = delaunay_build(nin, pin, 0, NULL, 0, NULL); /* * generate output points */ points_generate2(-0.1, 1.1, -0.1, 1.1, nx, nx, &nout, &pout); cpi = (nx / 2) * (nx + 1); gettimeofday(&tv0, &tz); /* * create interpolator */ printf(" creating interpolator:\n"); fflush(stdout); nn = nnhpi_create(d, nout); fflush(stdout); gettimeofday(&tv1, &tz); { long dt = 1000000 * (tv1.tv_sec - tv0.tv_sec) + tv1.tv_usec - tv0.tv_usec; printf(" interpolator creation time = %ld us (%.2f us / point)\n", dt, (double) dt / nout); } /* * interpolate */ printf(" interpolating:\n"); fflush(stdout); gettimeofday(&tv1, &tz); for (i = 0; i < nout; ++i) { point* p = &pout[i]; nnhpi_interpolate(nn, p); if (nn_verbose) printf(" (%f, %f, %f)\n", p->x, p->y, p->z); } fflush(stdout); gettimeofday(&tv0, &tz); { long dt = 1000000.0 * (tv0.tv_sec - tv1.tv_sec) + tv0.tv_usec - tv1.tv_usec; printf(" interpolation time = %ld us (%.2f us / point)\n", dt, (double) dt / nout); } if (!nn_verbose) printf(" control point: (%f, %f, %f) (expected z = %f)\n", pout[cpi].x, pout[cpi].y, pout[cpi].z, franke(pout[cpi].x, pout[cpi].y)); printf(" interpolating one more time:\n"); fflush(stdout); gettimeofday(&tv0, &tz); for (i = 0; i < nout; ++i) { point* p = &pout[i]; nnhpi_interpolate(nn, p); if (nn_verbose) printf(" (%f, %f, %f)\n", p->x, p->y, p->z); } fflush(stdout); gettimeofday(&tv1, &tz); { long dt = 1000000.0 * (tv1.tv_sec - tv0.tv_sec) + tv1.tv_usec - tv0.tv_usec; printf(" interpolation time = %ld us (%.2f us / point)\n", dt, (double) dt / nout); } if (!nn_verbose) printf(" control point: (%f, %f, %f) (expected z = %f)\n", pout[cpi].x, pout[cpi].y, pout[cpi].z, franke(pout[cpi].x, pout[cpi].y)); printf(" entering new data:\n"); fflush(stdout); for (i = 0; i < nin; ++i) { point* p = &pin[i]; p->z = p->x * p->x - p->y * p->y; nnhpi_modify_data(nn, p); if (nn_verbose) printf(" (%f, %f, %f)\n", p->x, p->y, p->z); } printf(" interpolating:\n"); fflush(stdout); gettimeofday(&tv1, &tz); for (i = 0; i < nout; ++i) { point* p = &pout[i]; nnhpi_interpolate(nn, p); if (nn_verbose) printf(" (%f, %f, %f)\n", p->x, p->y, p->z); } fflush(stdout); gettimeofday(&tv0, &tz); { long dt = 1000000.0 * (tv0.tv_sec - tv1.tv_sec) + tv0.tv_usec - tv1.tv_usec; printf(" interpolation time = %ld us (%.2f us / point)\n", dt, (double) dt / nout); } if (!nn_verbose) printf(" control point: (%f, %f, %f) (expected z = %f)\n", pout[cpi].x, pout[cpi].y, pout[cpi].z, pout[cpi].x * pout[cpi].x - pout[cpi].y * pout[cpi].y); printf(" restoring data:\n"); fflush(stdout); for (i = 0; i < nin; ++i) { point* p = &pin[i]; p->z = franke(p->x, p->y); nnhpi_modify_data(nn, p); if (nn_verbose) printf(" (%f, %f, %f)\n", p->x, p->y, p->z); } printf(" interpolating:\n"); fflush(stdout); gettimeofday(&tv0, &tz); for (i = 0; i < nout; ++i) { point* p = &pout[i]; nnhpi_interpolate(nn, p); if (nn_verbose) printf(" (%f, %f, %f)\n", p->x, p->y, p->z); } fflush(stdout); gettimeofday(&tv1, &tz); { long dt = 1000000.0 * (tv1.tv_sec - tv0.tv_sec) + tv1.tv_usec - tv0.tv_usec; printf(" interpolation time = %ld us (%.2f us / point)\n", dt, (double) dt / nout); } if (!nn_verbose) printf(" control point: (%f, %f, %f) (expected z = %f)\n", pout[cpi].x, pout[cpi].y, pout[cpi].z, franke(pout[cpi].x, pout[cpi].y)); printf(" hashtable stats:\n"); fflush(stdout); { hashtable* ht = nn->ht_data; printf(" input points: %d entries, %d table elements, %d filled elements\n", ht->n, ht->size, ht->nhash); ht = nn->ht_weights; printf(" weights: %d entries, %d table elements, %d filled elements\n", ht->n, ht->size, ht->nhash); } printf("\n"); nnhpi_destroy(nn); free(pout); delaunay_destroy(d); free(pin); return 0; } #endif saga-2.1.0+dfsg/src/modules/grid/grid_gridding/nn/version.h000066400000000000000000000011441224124640700235770ustar00rootroot00000000000000/********************************************************** * Version $Id: version.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: version.h * * Created: 18/10/2001 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: Contains version string * *****************************************************************************/ #if !defined(_VERSION_H) #define _VERSION_H char* nn_version = "1.38"; #endif saga-2.1.0+dfsg/src/modules/grid/grid_spline/000077500000000000000000000000001224124640700210315ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/grid/grid_spline/Gridding_Spline_BA.cpp000066400000000000000000000211361224124640700251430ustar00rootroot00000000000000/********************************************************** * Version $Id: Gridding_Spline_BA.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // Gridding_Spline_BA.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Gridding_Spline_BA.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGridding_Spline_BA::CGridding_Spline_BA(void) : CGridding_Spline_Base() { Set_Name (_TL("B-Spline Approximation")); Set_Author (SG_T("(c) 2006 by O.Conrad")); Set_Description (_TW( "Calculates B-spline functions for choosen level of detail. " "This module serves as basis for the 'Multilevel B-Spline Interpolation' " "and is not suited as it is for spatial data interpolation from " "scattered data. " "\n\n" "Reference:\n" " - Lee, S., Wolberg, G., Shin, S.Y. (1997):" " 'Scattered Data Interpolation with Multilevel B-Splines'," " IEEE Transactions On Visualisation And Computer Graphics, Vol.3, No.3\n" )); //----------------------------------------------------- Parameters.Add_Value( NULL , "LEVEL" , _TL("Resolution"), _TL(""), PARAMETER_TYPE_Double , 1, 0.001, true ); } //--------------------------------------------------------- CGridding_Spline_BA::~CGridding_Spline_BA(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_BA::On_Execute(void) { bool bResult = false; int nx, ny; double d; CSG_Grid Phi; if( Initialise(m_Points, true) ) { d = m_pGrid->Get_Cellsize() * Parameters("LEVEL")->asDouble(); nx = (int)((m_pGrid->Get_XRange()) / d); ny = (int)((m_pGrid->Get_YRange()) / d); Phi.Create(SG_DATATYPE_Float, nx + 4, ny + 4, d, m_pGrid->Get_XMin(), m_pGrid->Get_YMin()); BA_Get_Phi (Phi); BA_Set_Grid (Phi); bResult = true; } m_Points.Clear(); return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGridding_Spline_BA::BA_Set_Grid(CSG_Grid &Phi, bool bAdd) { int ix, iy; double x, y, d = m_pGrid->Get_Cellsize() / Phi.Get_Cellsize(); for(iy=0, y=0.0; iyGet_NY() && Set_Progress(iy, m_pGrid->Get_NY()); iy++, y+=d) { for(ix=0, x=0.0; ixGet_NX(); ix++, x+=d) { if( bAdd ) { m_pGrid->Add_Value(ix, iy, BA_Get_Value(x, y, Phi)); } else { m_pGrid->Set_Value(ix, iy, BA_Get_Value(x, y, Phi)); } } } } //--------------------------------------------------------- inline double CGridding_Spline_BA::BA_Get_Value(double x, double y, CSG_Grid &Phi) { int _x, _y, ix, iy; double z = 0.0, bx[4], by; if( (_x = (int)x) >= 0 && _x < Phi.Get_NX() - 3 && (_y = (int)y) >= 0 && _y < Phi.Get_NY() - 3 ) { x -= _x; y -= _y; for(ix=0; ix<4; ix++) { bx[ix] = BA_Get_B(ix, x); } for(iy=0; iy<4; iy++) { by = BA_Get_B(iy, y); for(ix=0; ix<4; ix++) { z += by * bx[ix] * Phi.asDouble(_x + ix, _y + iy); } } } return( z ); } //--------------------------------------------------------- bool CGridding_Spline_BA::BA_Get_Phi(CSG_Grid &Phi) { int iPoint, _x, _y, ix, iy; double x, y, z, dx, dy, wxy, wy, SW2, W[4][4]; CSG_Grid Delta; //----------------------------------------------------- Phi .Assign(0.0); Delta .Create(Phi.Get_System()); //----------------------------------------------------- for(iPoint=0; iPoint= 0 && _x < Phi.Get_NX() - 3 && (_y = (int)y) >= 0 && _y < Phi.Get_NY() - 3 ) { dx = x - _x; dy = y - _y; for(iy=0, SW2=0.0; iy<4; iy++) // compute W[k,l] and Sum[a=0-3, b=0-3](W[a,b]) { wy = BA_Get_B(iy, dy); for(ix=0; ix<4; ix++) { wxy = W[iy][ix] = wy * BA_Get_B(ix, dx); SW2 += wxy*wxy; } } for(iy=0; iy<4; iy++) { for(ix=0; ix<4; ix++) { wxy = W[iy][ix]; Delta.Add_Value(_x + ix, _y + iy, wxy*wxy * ((wxy * z) / SW2)); // Numerator Phi .Add_Value(_x + ix, _y + iy, wxy*wxy); // Denominator } } } } //----------------------------------------------------- for(iy=0; iyasGrid () : NULL; CSG_Shapes *pShapes = !m_bGridPoints ? Parameters("SHAPES") ->asShapes() : NULL; //----------------------------------------------------- m_pGrid = NULL; switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... if( m_Grid_Target.Init_User(m_bGridPoints ? pGrid->Get_Extent() : pShapes->Get_Extent()) && Dlg_Parameters("USER") ) { m_pGrid = m_Grid_Target.Get_User(); } break; case 1: // grid... if( Dlg_Parameters("GRID") ) { m_pGrid = m_Grid_Target.Get_Grid(); } break; } //------------------------------------------------- if( m_pGrid ) { m_pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_bGridPoints ? pGrid->Get_Name() : Parameters("FIELD")->asString(), Get_Name().c_str())); m_pGrid->Assign_NoData(); } //----------------------------------------------------- return( m_pGrid != NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_Base::_Get_Points(CSG_Points_Z &Points, bool bInGridOnly) { Points.Clear(); if( m_bGridPoints ) { int x, y; TSG_Point p; CSG_Grid *pGrid = Parameters("GRIDPOINTS") ->asGrid(); for(y=0, p.y=pGrid->Get_YMin(); yGet_NY() && Set_Progress(y, pGrid->Get_NY()); y++, p.y+=pGrid->Get_Cellsize()) { for(x=0, p.x=pGrid->Get_XMin(); xGet_NX(); x++, p.x+=pGrid->Get_Cellsize()) { if( !pGrid->is_NoData(x, y) && (!bInGridOnly || m_pGrid->is_InGrid_byPos(p, false)) ) { Points.Add(p.x, p.y, pGrid->asDouble(x, y)); } } } } else { CSG_Shapes *pShapes = Parameters("SHAPES") ->asShapes(); int zField = Parameters("FIELD") ->asInt(); for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); if( !pShape->is_NoData(zField) ) { double zValue = pShape->asDouble(zField); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { TSG_Point p = pShape->Get_Point(iPoint, iPart); if( !bInGridOnly || m_pGrid->is_InGrid_byPos(p, false) ) { Points.Add(p.x, p.y, zValue); } } } } } } return( Points.Get_Count() >= 3 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_spline/Gridding_Spline_Base.h000066400000000000000000000116611224124640700252020ustar00rootroot00000000000000/********************************************************** * Version $Id: Gridding_Spline_Base.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // Gridding_Spline_Base.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Gridding_Spline_Base_H #define HEADER_INCLUDED__Gridding_Spline_Base_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_spline_EXPORT CGridding_Spline_Base : public CSG_Module { public: CGridding_Spline_Base(bool bGridPoints = false); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Spline Interpolation") ); } protected: CSG_Grid *m_pGrid; virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); bool Initialise (void); bool Initialise (CSG_Points_Z &Points, bool bInGridOnly = false); virtual bool On_Initialise (void) { return( true ); } private: bool m_bGridPoints; CSG_Parameters_Grid_Target m_Grid_Target; bool _Get_Grid (void); bool _Get_Points (CSG_Points_Z &Points, bool bInGridOnly); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Gridding_Spline_Base_H saga-2.1.0+dfsg/src/modules/grid/grid_spline/Gridding_Spline_CSA.cpp000066400000000000000000000226411224124640700252710ustar00rootroot00000000000000/********************************************************** * Version $Id: Gridding_Spline_CSA.cpp 1081 2011-06-08 08:05:26Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // Gridding_Spline_CSA.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Gridding_Spline_CSA.h" #include "csa.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifdef _SAGA_MSW #define isnan _isnan #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGridding_Spline_CSA::CGridding_Spline_CSA(void) : CGridding_Spline_Base() { //----------------------------------------------------- Set_Name (_TL("Cubic Spline Approximation")); Set_Author (SG_T("O. Conrad (c) 2008")); Set_Description (_TW( "This module approximates irregular scalar 2D data in specified points using " "C1-continuous bivariate cubic spline." "\n" "Minimal Number of Points:" " minimal number of points locally involved" " in spline calculation (normally = 3)\n" "\n" "Maximal Number of Points:" "npmax: maximal number of points locally involved" " in spline calculation (required > 10," " recommended 20 < npmax < 60)" "\n" "Tolerance:" " relative tolerance multiple in fitting" " spline coefficients: the higher this" " value, the higher degree of the locally" " fitted spline (recommended 80 < k < 200)\n" "\n" "Points per square:" " average number of points per square" " (increase if the point distribution is strongly non-uniform" " to get larger cells)\n" "\n" "Author: Pavel Sakov," " CSIRO Marine Research\n" "\n" "Purpose: 2D data approximation with bivariate C1 cubic spline." " A set of library functions + standalone utility.\n" "\n" "Description: See J. Haber, F. Zeilfelder, O.Davydov and H.-P. Seidel," " Smooth approximation and rendering of large scattered data" " sets, in 'Proceedings of IEEE Visualization 2001'" " (Th.Ertl, K.Joy and A.Varshney, Eds.), pp.341-347, 571," " IEEE Computer Society, 2001.\n" "" "www.uni-giessen.de/www-Numerische-Mathematik/davydov/VIS2001.ps.gz\n" "" "www.math.uni-mannheim.de/~lsmath4/paper/VIS2001.pdf.gz\n" )); //----------------------------------------------------- Parameters.Add_Value( NULL , "NPMIN" , _TL("Minimal Number of Points"), _TL(""), PARAMETER_TYPE_Int , 3, 0, true ); Parameters.Add_Value( NULL , "NPMAX" , _TL("Maximal Number of Points"), _TL(""), PARAMETER_TYPE_Int , 20, 11, true, 59, true ); Parameters.Add_Value( NULL , "NPPC" , _TL("Points per Square"), _TL(""), PARAMETER_TYPE_Double , 5, 1, true ); Parameters.Add_Value( NULL , "K" , _TL("Tolerance"), _TL("Spline sensitivity, reduce to get smoother results, recommended: 80 < Tolerance < 200"), PARAMETER_TYPE_Int , 140, 0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_CSA::On_Initialise(void) { return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_CSA::On_Execute(void) { //----------------------------------------------------- if( Initialise(m_Points, true) == false ) { return( false ); } //----------------------------------------------------- int i, x, y; TSG_Point p; csa *pCSA = csa_create(); csa_setnpmin(pCSA, Parameters("NPMIN") ->asInt()); csa_setnpmax(pCSA, Parameters("NPMAX") ->asInt()); csa_setk (pCSA, Parameters("K") ->asInt()); csa_setnppc (pCSA, Parameters("NPPC") ->asDouble()); //----------------------------------------------------- point *pSrc = (point *)SG_Malloc(m_Points.Get_Count() * sizeof(point)); for(i=0; iGet_NCells() * sizeof(point)); for(y=0, i=0, p.y=m_pGrid->Get_YMin(); yGet_NY() && Set_Progress(y, m_pGrid->Get_NY()); y++, p.y+=m_pGrid->Get_Cellsize()) { for(x=0, p.x=m_pGrid->Get_XMin(); xGet_NX(); x++, p.x+=m_pGrid->Get_Cellsize(), i++) { pDst[i].x = p.x; pDst[i].y = p.y; } } //----------------------------------------------------- Process_Set_Text(_TL("calculating splines...")); csa_calculatespline (pCSA); Process_Set_Text(_TL("approximating points...")); csa_approximate_points (pCSA, m_pGrid->Get_NCells(), pDst); //----------------------------------------------------- for(y=0, i=0; yGet_NY() && Set_Progress(y, m_pGrid->Get_NY()); y++) { for(x=0; xGet_NX(); x++, i++) { if( isnan(pDst[i].z) ) { m_pGrid->Set_NoData(x, y); } else { m_pGrid->Set_Value(x, y, pDst[i].z); } } } //----------------------------------------------------- csa_destroy(pCSA); SG_Free(pSrc); SG_Free(pDst); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_spline/Gridding_Spline_CSA.h000066400000000000000000000103641224124640700247350ustar00rootroot00000000000000/********************************************************** * Version $Id: Gridding_Spline_CSA.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // Gridding_Spline_CSA.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Gridding_Spline_CSA_H #define HEADER_INCLUDED__Gridding_Spline_CSA_H //--------------------------------------------------------- #include "Gridding_Spline_Base.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGridding_Spline_CSA : public CGridding_Spline_Base { public: CGridding_Spline_CSA(void); protected: virtual bool On_Execute (void); virtual bool On_Initialise (void); private: CSG_Points_Z m_Points; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Gridding_Spline_CSA_H saga-2.1.0+dfsg/src/modules/grid/grid_spline/Gridding_Spline_MBA.cpp000066400000000000000000000337331224124640700252660ustar00rootroot00000000000000/********************************************************** * Version $Id: Gridding_Spline_MBA.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // Gridding_Spline_MBA.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Gridding_Spline_MBA.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGridding_Spline_MBA::CGridding_Spline_MBA(void) : CGridding_Spline_Base() { Set_Name (_TL("Multilevel B-Spline Interpolation")); Set_Author (SG_T("(c) 2006 by O.Conrad")); Set_Description (_TW( "Multilevel B-spline algorithm for spatial interpolation of scattered data " "as proposed by Lee, Wolberg and Shin (1997). " "The algorithm makes use of a coarse-to-fine hierarchy of control lattices to " "generate a sequence of bicubic B-spline functions, whose sum approaches the " "desired interpolation function. Large performance gains are realized by using " "B-spline refinement to reduce the sum of these functions into one equivalent " "B-spline function. " "\n\n" "The 'Maximum Level' determines the maximum size of the final B-spline matrix " "and increases exponential with each level. Where level=10 requires about 1mb " "level=12 needs about 16mb and level=14 about 256mb(!) of additional memory. " "\n\n" "Reference:\n" " - Lee, S., Wolberg, G., Shin, S.Y. (1997):" " 'Scattered Data Interpolation with Multilevel B-Splines'," " IEEE Transactions On Visualisation And Computer Graphics, Vol.3, No.3\n" )); //----------------------------------------------------- Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("without B-spline refinement"), _TL("with B-spline refinement") ), 1 ); Parameters.Add_Value( NULL , "EPSILON" , _TL("Threshold Error"), _TL(""), PARAMETER_TYPE_Double , 0.0001, 0.0, true ); Parameters.Add_Value( NULL , "LEVEL_MAX" , _TL("Maximum Level"), _TL(""), PARAMETER_TYPE_Int , 11, 1, true, 14, true ); Parameters.Add_Value( NULL , "UPDATE" , _TL("Update View"), _TL(""), PARAMETER_TYPE_Bool , false ); } //--------------------------------------------------------- CGridding_Spline_MBA::~CGridding_Spline_MBA(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_MBA::On_Execute(void) { bool bResult = false; if( Initialise(m_Points, true) ) { m_Epsilon = Parameters("EPSILON") ->asDouble(); m_Level_Max = Parameters("LEVEL_MAX") ->asInt(); m_bUpdate = Parameters("UPDATE") ->asBool(); double dCell = m_pGrid->Get_XRange() > m_pGrid->Get_YRange() ? m_pGrid->Get_XRange() : m_pGrid->Get_YRange(); switch( Parameters("METHOD") ? Parameters("METHOD")->asInt() : 0 ) { case 0: // without B-spline refinement bResult = _Set_MBA (dCell); break; case 1: // with B-spline refinement bResult = _Set_MBA_Refinement (dCell); break; } } m_Points.Clear(); return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_MBA::_Set_MBA(double dCell) { bool bContinue; int nCells; CSG_Grid Phi; for(bContinue=true, nCells=1; bContinue; nCells*=2, dCell/=2.0) { bContinue = _Get_Phi(Phi, dCell, nCells); BA_Set_Grid (Phi, nCells > 1); if( m_bUpdate ) { DataObject_Update(m_pGrid, true); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_MBA::_Set_MBA_Refinement(double dCell) { bool bContinue; int nCells; CSG_Grid A, B, *Phi, *Psi, *pTmp; for(bContinue=true, Psi=&A, Phi=&B, nCells=1; bContinue; nCells*=2, dCell/=2.0) { bContinue = _Get_Phi(*Phi, dCell, nCells); if( nCells > 1 ) { _Set_MBA_Refinement(Psi, Phi); } pTmp = Phi; Phi = Psi; Psi = pTmp; if( m_bUpdate ) { BA_Set_Grid(*Psi); DataObject_Update(m_pGrid, true); } } BA_Set_Grid(*Psi); return( true ); } //--------------------------------------------------------- #define SET_PSI(x, y, z) if( (x) >= 0 && (x) < Psi_B->Get_NX() && (y) >= 0 && (y) < Psi_B->Get_NY() ) Psi_B->Add_Value(x, y, z); //--------------------------------------------------------- bool CGridding_Spline_MBA::_Set_MBA_Refinement(CSG_Grid *Psi_A, CSG_Grid *Psi_B) { if( Psi_A && Psi_B && 2 * (Psi_A->Get_NX() - 4) == (Psi_B->Get_NX() - 4) && 2 * (Psi_A->Get_NY() - 4) == (Psi_B->Get_NY() - 4) ) { int ax, ay, bx, by; double a[3][3]; for(ay=0, by=-1; ayGet_NY() && Set_Progress(ay, Psi_A->Get_NY()); ay++, by+=2) { for(ax=0, bx=-1; axGet_NX(); ax++, bx+=2) { for(int iy=0, jy=ay-1; iy<3; iy++, jy++) { for(int ix=0, jx=ax-1; ix<3; ix++, jx++) { a[ix][iy] = jx < 0 || jx >= Psi_A->Get_NX() || jy < 0 || jy >= Psi_A->Get_NY() ? 0.0 : Psi_A->asDouble(jx, jy); } } SET_PSI(bx + 0, by + 0, ( a[0][0] + a[0][2] + a[2][0] + a[2][2] + (a[0][1] + a[1][0] + a[1][2] + a[2][1]) * 6.0 + a[1][1] * 36.0 ) / 64.0 ); SET_PSI(bx + 0, by + 1, ( a[0][1] + a[0][2] + a[2][1] + a[2][2] + (a[1][1] + a[1][2]) * 6.0 ) / 16.0 ); SET_PSI(bx + 1, by + 0, ( a[1][0] + a[1][2] + a[2][0] + a[2][2] + (a[1][1] + a[2][1]) * 6.0 ) / 16.0 ); SET_PSI(bx + 1, by + 1, ( a[1][1] + a[1][2] + a[2][1] + a[2][2] ) / 4.0 ); } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_MBA::_Get_Phi(CSG_Grid &Phi, double dCell, int nCells) { Phi.Create (SG_DATATYPE_Float, nCells + 4, nCells + 4, dCell, m_pGrid->Get_XMin(), m_pGrid->Get_YMin()); BA_Get_Phi (Phi); return( _Get_Difference(Phi) ); } //--------------------------------------------------------- bool CGridding_Spline_MBA::_Get_Difference(CSG_Grid &Phi) { int i, nErrors; double x, y, z, zMax, zMean; CSG_String s; //----------------------------------------------------- for(i=0, zMax=0.0, nErrors=0, zMean=0.0; i m_Epsilon ) { nErrors ++; zMean += fabs(z); if( fabs(z) > zMax ) { zMax = fabs(z); } } else { m_Points[i].z = 0.0; } } if( nErrors > 0 ) { zMean /= nErrors; } //----------------------------------------------------- i = 1 + (int)(0.5 + log(Phi.Get_NX() - 4.0) / log(2.0)); s.Printf(SG_T("%s:%d, %s:%d, %s:%f, %s:%f"), _TL("level"), i, _TL("error"), nErrors, _TL("max") , zMax, _TL("mean") , zMean ); Process_Set_Text(s); Message_Add (s); return( zMax >= m_Epsilon && i < m_Level_Max && Process_Get_Okay(false) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGridding_Spline_MBA::BA_Set_Grid(CSG_Grid &Phi, bool bAdd) { int ix, iy; double x, y, d = m_pGrid->Get_Cellsize() / Phi.Get_Cellsize(); for(iy=0, y=0.0; iyGet_NY() && Set_Progress(iy, m_pGrid->Get_NY()); iy++, y+=d) { for(ix=0, x=0.0; ixGet_NX(); ix++, x+=d) { if( bAdd ) { m_pGrid->Add_Value(ix, iy, BA_Get_Value(x, y, Phi)); } else { m_pGrid->Set_Value(ix, iy, BA_Get_Value(x, y, Phi)); } } } } //--------------------------------------------------------- double CGridding_Spline_MBA::BA_Get_Value(double x, double y, CSG_Grid &Phi) { int _x, _y, ix, iy; double z = 0.0, bx[4], by; if( (_x = (int)x) >= 0 && _x < Phi.Get_NX() - 3 && (_y = (int)y) >= 0 && _y < Phi.Get_NY() - 3 ) { x -= _x; y -= _y; for(ix=0; ix<4; ix++) { bx[ix] = BA_Get_B(ix, x); } for(iy=0; iy<4; iy++) { by = BA_Get_B(iy, y); for(ix=0; ix<4; ix++) { z += by * bx[ix] * Phi.asDouble(_x + ix, _y + iy); } } } return( z ); } //--------------------------------------------------------- bool CGridding_Spline_MBA::BA_Get_Phi(CSG_Grid &Phi) { int iPoint, _x, _y, ix, iy; double x, y, z, dx, dy, wxy, wy, SW2, W[4][4]; CSG_Grid Delta; //----------------------------------------------------- Phi .Assign(0.0); Delta .Create(Phi.Get_System()); //----------------------------------------------------- for(iPoint=0; iPoint= 0 && _x < Phi.Get_NX() - 3 && (_y = (int)y) >= 0 && _y < Phi.Get_NY() - 3 ) { dx = x - _x; dy = y - _y; for(iy=0, SW2=0.0; iy<4; iy++) // compute W[k,l] and Sum[a=0-3, b=0-3](W[a,b]) { wy = BA_Get_B(iy, dy); for(ix=0; ix<4; ix++) { wxy = W[iy][ix] = wy * BA_Get_B(ix, dx); SW2 += wxy*wxy; } } for(iy=0; iy<4; iy++) { for(ix=0; ix<4; ix++) { wxy = W[iy][ix]; Delta.Add_Value(_x + ix, _y + iy, wxy*wxy * ((wxy * z) / SW2)); // Numerator Phi .Add_Value(_x + ix, _y + iy, wxy*wxy); // Denominator } } } } //----------------------------------------------------- for(iy=0; iyasInt() == 0 ) { m_Points.Create(*Parameters("GRIDPOINTS")->asGrid()); } else { m_Points.Create(Parameters("GRIDPOINTS")->asGrid()); m_Points.Assign(Parameters("GRIDPOINTS")->asGrid()); } m_Epsilon = Parameters("EPSILON") ->asDouble(); m_Level_Max = Parameters("LEVEL_MAX") ->asInt(); m_bUpdate = Parameters("UPDATE") ->asBool(); double dCell = m_pGrid->Get_XRange() > m_pGrid->Get_YRange() ? m_pGrid->Get_XRange() : m_pGrid->Get_YRange(); switch( Parameters("METHOD") ? Parameters("METHOD")->asInt() : 0 ) { case 0: // without B-spline refinement bResult = _Set_MBA (dCell); break; case 1: // with B-spline refinement bResult = _Set_MBA_Refinement (dCell); break; } m_Points.Destroy(); } return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_MBA_Grid::_Set_MBA(double dCell) { bool bContinue; int nCells; CSG_Grid Phi; for(bContinue=true, nCells=1; bContinue; nCells*=2, dCell/=2.0) { bContinue = _Get_Phi(Phi, dCell, nCells); BA_Set_Grid (Phi, nCells > 1); if( m_bUpdate ) { DataObject_Update(m_pGrid, true); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_MBA_Grid::_Set_MBA_Refinement(double dCell) { bool bContinue; int nCells; CSG_Grid A, B, *Phi, *Psi, *pTmp; for(bContinue=true, Psi=&A, Phi=&B, nCells=1; bContinue; nCells*=2, dCell/=2.0) { bContinue = _Get_Phi(*Phi, dCell, nCells); if( nCells > 1 ) { _Set_MBA_Refinement(Psi, Phi); } pTmp = Phi; Phi = Psi; Psi = pTmp; if( m_bUpdate ) { BA_Set_Grid(*Psi); DataObject_Update(m_pGrid, true); } } BA_Set_Grid(*Psi); return( true ); } //--------------------------------------------------------- #define SET_PSI(x, y, z) if( (x) >= 0 && (x) < Psi_B->Get_NX() && (y) >= 0 && (y) < Psi_B->Get_NY() ) Psi_B->Add_Value(x, y, z); //--------------------------------------------------------- bool CGridding_Spline_MBA_Grid::_Set_MBA_Refinement(CSG_Grid *Psi_A, CSG_Grid *Psi_B) { if( Psi_A && Psi_B && 2 * (Psi_A->Get_NX() - 4) == (Psi_B->Get_NX() - 4) && 2 * (Psi_A->Get_NY() - 4) == (Psi_B->Get_NY() - 4) ) { int ax, ay, bx, by; double a[3][3]; for(ay=0, by=-1; ayGet_NY() && Set_Progress(ay, Psi_A->Get_NY()); ay++, by+=2) { for(ax=0, bx=-1; axGet_NX(); ax++, bx+=2) { for(int iy=0, jy=ay-1; iy<3; iy++, jy++) { for(int ix=0, jx=ax-1; ix<3; ix++, jx++) { a[ix][iy] = jx < 0 || jx >= Psi_A->Get_NX() || jy < 0 || jy >= Psi_A->Get_NY() ? 0.0 : Psi_A->asDouble(jx, jy); } } SET_PSI(bx + 0, by + 0, ( a[0][0] + a[0][2] + a[2][0] + a[2][2] + (a[0][1] + a[1][0] + a[1][2] + a[2][1]) * 6.0 + a[1][1] * 36.0 ) / 64.0 ); SET_PSI(bx + 0, by + 1, ( a[0][1] + a[0][2] + a[2][1] + a[2][2] + (a[1][1] + a[1][2]) * 6.0 ) / 16.0 ); SET_PSI(bx + 1, by + 0, ( a[1][0] + a[1][2] + a[2][0] + a[2][2] + (a[1][1] + a[2][1]) * 6.0 ) / 16.0 ); SET_PSI(bx + 1, by + 1, ( a[1][1] + a[1][2] + a[2][1] + a[2][2] ) / 4.0 ); } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_MBA_Grid::_Get_Phi(CSG_Grid &Phi, double dCell, int nCells) { Phi.Create (SG_DATATYPE_Float, nCells + 4, nCells + 4, dCell, m_pGrid->Get_XMin(), m_pGrid->Get_YMin()); BA_Get_Phi (Phi); return( _Get_Difference(Phi) ); } //--------------------------------------------------------- bool CGridding_Spline_MBA_Grid::_Get_Difference(CSG_Grid &Phi) { int xPoint, yPoint, nErrors; double x, y, z, zMax, zMean; TSG_Point_Z p; CSG_String s; //----------------------------------------------------- for(yPoint=0, p.y=m_Points.Get_YMin(), zMax=0.0, nErrors=0, zMean=0.0; yPoint m_Epsilon ) { nErrors ++; zMean += fabs(z); if( fabs(z) > zMax ) { zMax = fabs(z); } } else { // m_Points.Set_Value(xPoint, yPoint, 0.0); m_Points.Set_NoData(xPoint, yPoint); } } } } if( nErrors > 0 ) { zMean /= nErrors; } //----------------------------------------------------- int i = 1 + (int)(0.5 + log(Phi.Get_NX() - 4.0) / log(2.0)); s.Printf(SG_T("%s:%d, %s:%d, %s:%f, %s:%f"), _TL("level"), i, _TL("error"), nErrors, _TL("max") , zMax, _TL("mean") , zMean ); Process_Set_Text(s); Message_Add (s); return( zMax >= m_Epsilon && i < m_Level_Max && Process_Get_Okay(false) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGridding_Spline_MBA_Grid::BA_Set_Grid(CSG_Grid &Phi, bool bAdd) { int ix, iy; double x, y, d = m_pGrid->Get_Cellsize() / Phi.Get_Cellsize(); for(iy=0, y=0.0; iyGet_NY() && Set_Progress(iy, m_pGrid->Get_NY()); iy++, y+=d) { for(ix=0, x=0.0; ixGet_NX(); ix++, x+=d) { if( bAdd ) { m_pGrid->Add_Value(ix, iy, BA_Get_Value(x, y, Phi)); } else { m_pGrid->Set_Value(ix, iy, BA_Get_Value(x, y, Phi)); } } } } //--------------------------------------------------------- double CGridding_Spline_MBA_Grid::BA_Get_Value(double x, double y, CSG_Grid &Phi) { int _x, _y, ix, iy; double z = 0.0, bx[4], by; if( (_x = (int)x) >= 0 && _x < Phi.Get_NX() - 3 && (_y = (int)y) >= 0 && _y < Phi.Get_NY() - 3 ) { x -= _x; y -= _y; for(ix=0; ix<4; ix++) { bx[ix] = BA_Get_B(ix, x); } for(iy=0; iy<4; iy++) { by = BA_Get_B(iy, y); for(ix=0; ix<4; ix++) { z += by * bx[ix] * Phi.asDouble(_x + ix, _y + iy); } } } return( z ); } //--------------------------------------------------------- bool CGridding_Spline_MBA_Grid::BA_Get_Phi(CSG_Grid &Phi) { int xPoint, yPoint, _x, _y, ix, iy; double x, y, z, dx, dy, wxy, wy, SW2, W[4][4]; TSG_Point p; CSG_Grid Delta; //----------------------------------------------------- Phi .Assign(0.0); Delta .Create(Phi.Get_System()); //----------------------------------------------------- for(yPoint=0, p.y=m_Points.Get_YMin(); yPoint= 0 && _x < Phi.Get_NX() - 3 && (_y = (int)y) >= 0 && _y < Phi.Get_NY() - 3 ) { dx = x - _x; dy = y - _y; for(iy=0, SW2=0.0; iy<4; iy++) // compute W[k,l] and Sum[a=0-3, b=0-3](W[a,b]) { wy = BA_Get_B(iy, dy); for(ix=0; ix<4; ix++) { wxy = W[iy][ix] = wy * BA_Get_B(ix, dx); SW2 += wxy*wxy; } } for(iy=0; iy<4; iy++) { for(ix=0; ix<4; ix++) { wxy = W[iy][ix]; Delta.Add_Value(_x + ix, _y + iy, wxy*wxy * ((wxy * z) / SW2)); // Numerator Phi .Add_Value(_x + ix, _y + iy, wxy*wxy); // Denominator } } } } } } //----------------------------------------------------- for(iy=0; iyhttp://elonen.iki.fi/code/tpsdemo/index.html." "\n" )); //----------------------------------------------------- Parameters.Add_Value( NULL , "REGULARISATION" , _TL("Regularisation"), _TL(""), PARAMETER_TYPE_Double, 0.0001, 0.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_TPS_Global::On_Initialise(void) { m_pShapes = Parameters("SHAPES" )->asShapes(); m_zField = Parameters("FIELD" )->asInt (); m_Regularisation = Parameters("REGULARISATION")->asDouble(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_TPS_Global::On_Execute(void) { if( !Initialise(m_Spline.Get_Points()) ) { return( false ); } if( !m_Spline.Create(m_Regularisation, false) ) { return( false ); } //----------------------------------------------------- int x, y; TSG_Point p; for(y=0, p.y=m_pGrid->Get_YMin(); yGet_NY() && Set_Progress(y, m_pGrid->Get_NY()); y++, p.y+=m_pGrid->Get_Cellsize()) { for(x=0, p.x=m_pGrid->Get_XMin(); xGet_NX(); x++, p.x+=m_pGrid->Get_Cellsize()) { m_pGrid->Set_Value(x, y, m_Spline.Get_Value(p.x, p.y)); } } m_Spline.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_spline/Gridding_Spline_TPS_Global.h000066400000000000000000000111461224124640700262540ustar00rootroot00000000000000/********************************************************** * Version $Id: Gridding_Spline_TPS_Global.h 1482 2012-10-08 16:15:45Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // Gridding_Spline_TPS_Global.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Gridding_Spline_TPS_Global_H #define HEADER_INCLUDED__Gridding_Spline_TPS_Global_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Gridding_Spline_Base.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_spline_EXPORT CGridding_Spline_TPS_Global : public CGridding_Spline_Base { public: CGridding_Spline_TPS_Global(void); protected: virtual bool On_Execute (void); virtual bool On_Initialise (void); int m_zField; double m_Regularisation; CSG_Shapes *m_pShapes; CSG_Thin_Plate_Spline m_Spline; private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Gridding_Spline_TPS_Global_H saga-2.1.0+dfsg/src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.cpp000066400000000000000000000227161224124640700264460ustar00rootroot00000000000000/********************************************************** * Version $Id: Gridding_Spline_TPS_Local.cpp 1482 2012-10-08 16:15:45Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // Gridding_Spline_TPS_Local.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Gridding_Spline_TPS_Local.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGridding_Spline_TPS_Local::CGridding_Spline_TPS_Local(void) : CGridding_Spline_TPS_Global() { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Thin Plate Spline (Local)")); Set_Author (SG_T("O.Conrad (c) 2006")); Set_Description (_TW( "Creates a 'Thin Plate Spline' function for each grid point " "based on all of the scattered data points that are within a " "given distance. The number of points can be limited to a " "maximum number of closest points. " "\n\n" "References:\n" "- Donato G., Belongie S. (2002):" " 'Approximation Methods for Thin Plate Spline Mappings and Principal Warps'," " In Heyden, A., Sparr, G., Nielsen, M., Johansen, P. (Eds.):" " 'Computer Vision - ECCV 2002: 7th European Conference on Computer Vision, Copenhagen, Denmark, May 28-31, 2002'," " Proceedings, Part III, Lecture Notes in Computer Science." " Springer-Verlag Heidelberg; pp.21-31." "\n" "\n" "- Elonen, J. (2005):" " 'Thin Plate Spline editor - an example program in C++'," " http://elonen.iki.fi/code/tpsdemo/index.html." "\n" )); //----------------------------------------------------- CSG_Parameter *pSearch = Parameters.Add_Node( NULL , "NODE_SEARCH" , _TL("Search Options"), _TL("") ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_RANGE" , _TL("Search Range"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("local"), _TL("global") ) ); Parameters.Add_Value( pNode , "SEARCH_RADIUS" , _TL("Maximum Search Distance"), _TL("local maximum search distance given in map units"), PARAMETER_TYPE_Double , 1000.0, 0, true ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_POINTS_ALL" , _TL("Number of Points"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("maximum number of nearest points"), _TL("all points within search distance") ) ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MAX" , _TL("Maximum Number of Points"), _TL("maximum number of nearest points"), PARAMETER_TYPE_Int, 20, 1, true ); Parameters.Add_Choice( pNode , "SEARCH_DIRECTION" , _TL("Search Direction"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("all directions"), _TL("quadrants") ) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGridding_Spline_TPS_Local::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) ) { pParameters->Get_Parameter("SEARCH_RADIUS" )->Set_Enabled(pParameter->asInt() == 0); // local } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) ) { pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0); // maximum number of points pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0); // maximum number of points per quadrant } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_TPS_Local::On_Execute(void) { m_nPoints_Max = Parameters("SEARCH_POINTS_ALL")->asInt() == 0 ? Parameters("SEARCH_POINTS_MAX")->asInt () : 0; m_Radius = Parameters("SEARCH_RANGE" )->asInt() == 0 ? Parameters("SEARCH_RADIUS" )->asDouble() : 0.0; m_Direction = Parameters("SEARCH_DIRECTION" )->asInt(); //----------------------------------------------------- if( m_nPoints_Max <= 0 && m_Radius <= 0.0 ) // global { return( CGridding_Spline_TPS_Global::On_Execute() ); } if( !Initialise() ) { return( false ); } if( !m_Search.Create(m_pShapes, m_zField) ) { return( false ); } //----------------------------------------------------- int x, y; TSG_Point p; for(y=0, p.y=m_pGrid->Get_YMin(); yGet_NY() && Set_Progress(y, m_pGrid->Get_NY()); y++, p.y+=m_pGrid->Get_Cellsize()) { for(x=0, p.x=m_pGrid->Get_XMin(); xGet_NX(); x++, p.x+=m_pGrid->Get_Cellsize()) { Set_Value(x, y, p); } } m_Search.Destroy(); m_Spline.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGridding_Spline_TPS_Local::Get_Points(const TSG_Point &p, int iQuadrant) { double x, y, z; if( m_Search.Select_Nearest_Points(p.x, p.y, m_nPoints_Max, m_Radius, iQuadrant) > 0 ) { for(int i=0; i= 3 && m_Spline.Create(m_Regularisation, true) ) { m_pGrid->Set_Value(x, y, m_Spline.Get_Value(p.x, p.y)); return( true ); } m_pGrid->Set_NoData(x, y); return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_spline/Gridding_Spline_TPS_Local.h000066400000000000000000000114171224124640700261070ustar00rootroot00000000000000/********************************************************** * Version $Id: Gridding_Spline_TPS_Local.h 1482 2012-10-08 16:15:45Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // Gridding_Spline_TPS_Local.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Gridding_Spline_TPS_Local_H #define HEADER_INCLUDED__Gridding_Spline_TPS_Local_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Gridding_Spline_TPS_Global.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_spline_EXPORT CGridding_Spline_TPS_Local : public CGridding_Spline_TPS_Global { public: CGridding_Spline_TPS_Local(void); protected: virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: int m_nPoints_Max, m_Direction; double m_Radius; CSG_PRQuadTree m_Search; int Get_Points (const TSG_Point &p, int iQuadrant = -1); bool Set_Value (int x, int y, const TSG_Point &p); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Gridding_Spline_TPS_Local_H saga-2.1.0+dfsg/src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.cpp000066400000000000000000000275011224124640700260430ustar00rootroot00000000000000/********************************************************** * Version $Id: Gridding_Spline_TPS_TIN.cpp 1143 2011-07-29 19:33:09Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // Gridding_Spline_TPS_TIN.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Gridding_Spline_TPS_TIN.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGridding_Spline_TPS_TIN::CGridding_Spline_TPS_TIN(void) : CGridding_Spline_TPS_Global() { Set_Name (_TL("Thin Plate Spline (TIN)")); Set_Author (SG_T("(c) 2006 by O.Conrad")); Set_Description (_TW( "Creates a 'Thin Plate Spline' function for each triangle of a TIN " "and uses it for subsequent gridding. The TIN is internally created " "from the scattered data points input. The 'Neighbourhood' option " "determines the number of points used for the spline generation. " "'Immediate neighbourhood' includes the points of the triangle as well as the " "immediate neighbour points. 'Level 1' adds the neighbours of the " "immediate neighbourhood and 'level 2' adds the neighbours of 'level 1' " "neighbours too. A higher neighbourhood degree reduces sharp breaks " "but also increases the computation time. " "\n\n" "References:\n" "- Donato G., Belongie S. (2002):" " 'Approximation Methods for Thin Plate Spline Mappings and Principal Warps'," " In Heyden, A., Sparr, G., Nielsen, M., Johansen, P. (Eds.):" " 'Computer Vision - ECCV 2002: 7th European Conference on Computer Vision, Copenhagen, Denmark, May 28-31, 2002'," " Proceedings, Part III, Lecture Notes in Computer Science." " Springer-Verlag Heidelberg; pp.21-31." "\n" "\n" "- Elonen, J. (2005):" " 'Thin Plate Spline editor - an example program in C++'," " http://elonen.iki.fi/code/tpsdemo/index.html." "\n" )); //----------------------------------------------------- Parameters.Add_Choice( NULL , "LEVEL" , _TL("Neighbourhood"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("immediate"), _TL("level 1"), _TL("level 2") ), 1 ); Parameters.Add_Value( NULL , "FRAME" , _TL("Add Frame"), _TL(""), PARAMETER_TYPE_Bool , true ); } //--------------------------------------------------------- CGridding_Spline_TPS_TIN::~CGridding_Spline_TPS_TIN(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_TPS_TIN::_Initialise(void) { m_Level = Parameters("LEVEL") ->asInt(); m_Points = NULL; m_nPoints_Buf = 0; return( CGridding_Spline_TPS_Global::On_Initialise() ); } //--------------------------------------------------------- bool CGridding_Spline_TPS_TIN::_Finalise(void) { if( m_Points ) { SG_Free(m_Points); } m_Points = NULL; m_nPoints_Buf = 0; m_Spline.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridding_Spline_TPS_TIN::On_Execute(void) { bool bResult = false; CSG_TIN TIN; if( Initialise() && _Initialise() && _Get_TIN(TIN) ) { for(int i=0; iGet_Extent().Intersects(pTriangle->Get_Extent()) != INTERSECTION_None ) { for(j=0, m_nPoints=0; j<3; j++) { for(i=0, pPoint=pTriangle->Get_Node(j); iGet_Neighbor_Count(); i++) { _Add_Points(pPoint->Get_Neighbor(i), 0); } } m_Spline.Destroy(); for(i=0; iGet_Point().x, pPoint->Get_Point().y, pPoint->asDouble(m_zField)); } if( m_Spline.Create(m_Regularisation, true) ) { _Set_Grid(pTriangle); } } } //--------------------------------------------------------- void CGridding_Spline_TPS_TIN::_Set_Grid(CSG_TIN_Triangle *pTriangle) { int ix, iy, ax, ay, bx, by; double x, y, xMin, yMin; ax = m_pGrid->Get_System().Get_xWorld_to_Grid(pTriangle->Get_Extent().Get_XMin()); if( ax < 0 ) ax = 0; ay = m_pGrid->Get_System().Get_yWorld_to_Grid(pTriangle->Get_Extent().Get_YMin()); if( ay < 0 ) ay = 0; bx = m_pGrid->Get_System().Get_xWorld_to_Grid(pTriangle->Get_Extent().Get_XMax()); if( bx >= m_pGrid->Get_NX() - 1 ) bx = m_pGrid->Get_NX() - 2; by = m_pGrid->Get_System().Get_yWorld_to_Grid(pTriangle->Get_Extent().Get_YMax()); if( by >= m_pGrid->Get_NY() - 1 ) by = m_pGrid->Get_NY() - 2; xMin = m_pGrid->Get_System().Get_xGrid_to_World(ax); yMin = m_pGrid->Get_System().Get_yGrid_to_World(ay); for(iy=ay, y=yMin; iy<=by; iy++, y+=m_pGrid->Get_Cellsize()) { for(ix=ax, x=xMin; ix<=bx; ix++, x+=m_pGrid->Get_Cellsize()) { if( pTriangle->is_Containing(x, y) ) { m_pGrid->Set_Value(ix, iy, m_Spline.Get_Value(x, y)); } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGridding_Spline_TPS_TIN::_Add_Points(CSG_TIN_Node *pPoint, int Level) { int i, j; CSG_TIN_Node *p; _Add_Point(pPoint); if( Level < m_Level ) { for(j=0; jGet_Neighbor_Count(); j++) { for(i=0, p=pPoint->Get_Neighbor(j); iGet_Neighbor_Count(); i++) { _Add_Points(p->Get_Neighbor(i), Level + 1); } } } } //--------------------------------------------------------- bool CGridding_Spline_TPS_TIN::_Add_Point(CSG_TIN_Node *pPoint) { for(int i=0; iasBool() ) { int iShape, iPart, iPoint, iCorner, iField, z[4]; double x[4], y[4], dMin[4], d; TSG_Point p; CSG_Shape *pShape; for(iField=0; iFieldGet_Field_Count(); iField++) { TIN.Add_Field(m_pShapes->Get_Field_Name(iField), m_pShapes->Get_Field_Type(iField)); } x[0] = m_pGrid->Get_Extent().Get_XMin(); y[0] = m_pGrid->Get_Extent().Get_YMin(); dMin[0] = -1.0; x[1] = m_pGrid->Get_Extent().Get_XMin(); y[1] = m_pGrid->Get_Extent().Get_YMax(); dMin[1] = -1.0; x[2] = m_pGrid->Get_Extent().Get_XMax(); y[2] = m_pGrid->Get_Extent().Get_YMax(); dMin[2] = -1.0; x[3] = m_pGrid->Get_Extent().Get_XMax(); y[3] = m_pGrid->Get_Extent().Get_YMin(); dMin[3] = -1.0; for(iShape=0; iShapeGet_Count() && Set_Progress(iShape, m_pShapes->Get_Count()); iShape++) { pShape = m_pShapes->Get_Shape(iShape); for(iPart=0; iPartGet_Part_Count(); iPart++) { for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { p = pShape->Get_Point(iPoint, iPart); TIN.Add_Node(p, pShape, false); for(iCorner=0; iCorner<4; iCorner++) { d = SG_Get_Distance(p.x, p.y, x[iCorner], y[iCorner]); if( dMin[iCorner] < 0.0 || d < dMin[iCorner] ) { dMin[iCorner] = d; z [iCorner] = iShape; } } } } } for(iCorner=0; iCorner<4; iCorner++) { if( dMin[iCorner] >= 0.0 ) { p.x = x[iCorner]; p.y = y[iCorner]; TIN.Add_Node(p, m_pShapes->Get_Shape(z[iCorner]), false); } } TIN.Update(); } else { TIN.Create(m_pShapes); } return( TIN.Get_Triangle_Count() > 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_spline/Gridding_Spline_TPS_TIN.h000066400000000000000000000115611224124640700255070ustar00rootroot00000000000000/********************************************************** * Version $Id: Gridding_Spline_TPS_TIN.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // Gridding_Spline_TPS_TIN.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Gridding_Spline_TPS_TIN_H #define HEADER_INCLUDED__Gridding_Spline_TPS_TIN_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Gridding_Spline_TPS_Global.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_spline_EXPORT CGridding_Spline_TPS_TIN : public CGridding_Spline_TPS_Global { public: CGridding_Spline_TPS_TIN(void); virtual ~CGridding_Spline_TPS_TIN(void); protected: virtual bool On_Execute (void); private: int m_nPoints, m_nPoints_Buf, m_Level; CSG_TIN_Node **m_Points; bool _Initialise (void); bool _Finalise (void); void _Set_Triangle (CSG_TIN_Triangle *pTriangle); void _Set_Grid (CSG_TIN_Triangle *pTriangle); void _Add_Points (CSG_TIN_Node *Point, int Level); bool _Add_Point (CSG_TIN_Node *Point); bool _Get_TIN (CSG_TIN &TIN); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Gridding_Spline_TPS_TIN_H saga-2.1.0+dfsg/src/modules/grid/grid_spline/MLB_Interface.cpp000066400000000000000000000123021224124640700241250ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // MLP_Interface.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Grid - Spline Interpolation") ); case MLB_INFO_Author: return( SG_T("O. Conrad (c) 2006-10") ); case MLB_INFO_Description: return( _TW( "Several spline interpolation/approximation methods for the gridding of scattered data. " "In most cases the 'Multilevel B-spline Interpolation' might be the optimal choice. " )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Grid|Gridding") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Gridding_Spline_TPS_Global.h" #include "Gridding_Spline_TPS_Local.h" #include "Gridding_Spline_TPS_TIN.h" #include "Gridding_Spline_BA.h" #include "Gridding_Spline_MBA.h" #include "Gridding_Spline_MBA_Grid.h" #include "Gridding_Spline_CSA.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CGridding_Spline_TPS_Global ); case 1: return( new CGridding_Spline_TPS_Local ); case 2: return( new CGridding_Spline_TPS_TIN ); case 3: return( new CGridding_Spline_BA ); case 4: return( new CGridding_Spline_MBA ); case 5: return( new CGridding_Spline_MBA_Grid ); case 6: return( new CGridding_Spline_CSA ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/grid/grid_spline/MLB_Interface.h000066400000000000000000000075751224124640700236120ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // grid_spline // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_spline_H #define HEADER_INCLUDED__grid_spline_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef grid_spline_EXPORTS #define grid_spline_EXPORT _SAGA_DLL_EXPORT #else #define grid_spline_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_spline_H saga-2.1.0+dfsg/src/modules/grid/grid_spline/Makefile.am000066400000000000000000000020161224124640700230640ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_spline.la libgrid_spline_la_SOURCES =\ csa.c\ Gridding_Spline_BA.cpp\ Gridding_Spline_Base.cpp\ Gridding_Spline_CSA.cpp\ Gridding_Spline_MBA.cpp\ Gridding_Spline_MBA_Grid.cpp\ Gridding_Spline_TPS_Global.cpp\ Gridding_Spline_TPS_Local.cpp\ Gridding_Spline_TPS_TIN.cpp\ MLB_Interface.cpp\ csa.h\ Gridding_Spline_BA.h\ Gridding_Spline_Base.h\ Gridding_Spline_MBA.h\ Gridding_Spline_CSA.h\ Gridding_Spline_MBA_Grid.h\ Gridding_Spline_TPS_Global.h\ Gridding_Spline_TPS_Local.h\ Gridding_Spline_TPS_TIN.h\ MLB_Interface.h libgrid_spline_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS) saga-2.1.0+dfsg/src/modules/grid/grid_spline/Makefile.in000066400000000000000000000510261224124640700231020ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/grid/grid_spline DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgrid_spline_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgrid_spline_la_OBJECTS = csa.lo Gridding_Spline_BA.lo \ Gridding_Spline_Base.lo Gridding_Spline_CSA.lo \ Gridding_Spline_MBA.lo Gridding_Spline_MBA_Grid.lo \ Gridding_Spline_TPS_Global.lo Gridding_Spline_TPS_Local.lo \ Gridding_Spline_TPS_TIN.lo MLB_Interface.lo libgrid_spline_la_OBJECTS = $(am_libgrid_spline_la_OBJECTS) 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) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgrid_spline_la_SOURCES) DIST_SOURCES = $(libgrid_spline_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_spline.la libgrid_spline_la_SOURCES = \ csa.c\ Gridding_Spline_BA.cpp\ Gridding_Spline_Base.cpp\ Gridding_Spline_CSA.cpp\ Gridding_Spline_MBA.cpp\ Gridding_Spline_MBA_Grid.cpp\ Gridding_Spline_TPS_Global.cpp\ Gridding_Spline_TPS_Local.cpp\ Gridding_Spline_TPS_TIN.cpp\ MLB_Interface.cpp\ csa.h\ Gridding_Spline_BA.h\ Gridding_Spline_Base.h\ Gridding_Spline_MBA.h\ Gridding_Spline_CSA.h\ Gridding_Spline_MBA_Grid.h\ Gridding_Spline_TPS_Global.h\ Gridding_Spline_TPS_Local.h\ Gridding_Spline_TPS_TIN.h\ MLB_Interface.h libgrid_spline_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS) all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .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) --gnu src/modules/grid/grid_spline/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/grid/grid_spline/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgrid_spline.la: $(libgrid_spline_la_OBJECTS) $(libgrid_spline_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgrid_spline_la_OBJECTS) $(libgrid_spline_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gridding_Spline_BA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gridding_Spline_Base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gridding_Spline_CSA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gridding_Spline_MBA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gridding_Spline_MBA_Grid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gridding_Spline_TPS_Global.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gridding_Spline_TPS_Local.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gridding_Spline_TPS_TIN.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csa.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/grid/grid_spline/csa.c000066400000000000000000001566761224124640700217700ustar00rootroot00000000000000/********************************************************** * Version $Id: csa.c 1082 2011-06-08 08:07:00Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: csa.c * * Created: 16/10/2002 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: 2D data approximation with bivariate C1 cubic spline. * A set of library functions + standalone utility. * * Description: See J. Haber, F. Zeilfelder, O.Davydov and H.-P. Seidel, * Smooth approximation and rendering of large scattered data * sets, in ``Proceedings of IEEE Visualization 2001'' * (Th.Ertl, K.Joy and A.Varshney, Eds.), pp.341-347, 571, * IEEE Computer Society, 2001. * http://www.uni-giessen.de/www-Numerische-Mathematik/ * davydov/VIS2001.ps.gz * http://www.math.uni-mannheim.de/~lsmath4/paper/ * VIS2001.pdf.gz * * Revisions: 09/04/2003 PS: Modified points_read() to read from a * file specified by name, not by handle. * *****************************************************************************/ #include #include #include #include #include #include #include #include #include #include "csa.h" int csa_verbose = 0; #define NPASTART 5 /* Number of Points Allocated at Start */ #define SVD_NMAX 30 /* Maximal number of iterations in svd() */ /* default algorithm parameters */ #define NPMIN_DEF 3 #define NPMAX_DEF 40 #define K_DEF 140 #define NPPC_DEF 5 struct square; typedef struct square square; typedef struct { square* parent; int index; /* index within parent square; 0 <= index <= * 3 */ point vertices[3]; point middle; /* barycenter */ double h; /* parent square edge length */ double r; /* data visibility radius */ /* * points used -- in primary triangles only */ int nallocated; int npoints; point** points; int primary; /* flag -- whether calculate spline * coefficients directly (by least squares * method) (primary = 1) or indirectly (from * C1 smoothness conditions) (primary = 0) */ int hascoeffs; /* flag -- whether there are no NaNs among * the spline coefficients */ int order; /* spline order -- for primary triangles only */ } triangle; struct square { csa* parent; int i, j; /* indices */ int nallocated; int npoints; point** points; int primary; /* flag -- whether this square contains a * primary triangle */ triangle* triangles[4]; double coeffs[25]; }; struct csa { double xmin; double xmax; double ymin; double ymax; int nallocated; int npoints; point** points; /* * squarization */ int ni; int nj; double h; square*** squares; /* square* [j][i] */ int npt; /* Number of Primary Triangles */ triangle** pt; /* Primary Triangles -- triangle* [npt] */ /* * algorithm parameters */ int npmin; /* minimal number of points locally involved * in * spline calculation (normally = 3) */ int npmax; /* maximal number of points locally involved * in * spline calculation (required > 10, * * recommended 20 < npmax < 60) */ double k; /* relative tolerance multiple in fitting * spline coefficients: the higher this * value, the higher degree of the locally * fitted spline (recommended 80 < k < 200) */ int nppc; /* average number of points per square */ }; static void csa_quit(char* format, ...) { va_list args; fflush(stdout); /* just in case -- to have the exit message * last */ fprintf(stderr, "error: csa: "); va_start(args, format); vfprintf(stderr, format, args); va_end(args); // exit(1); } /* Allocates n1xn2 matrix of something. Note that it will be accessed as * [n2][n1]. * @param n1 Number of columns * @param n2 Number of rows * @return Matrix */ static void* alloc2d(int n1, int n2, size_t unitsize) { unsigned int size; char* p; char** pp; int i; assert(n1 > 0); assert(n2 > 0); assert((double) n1 * (double) n2 <= (double) UINT_MAX); size = n1 * n2; if ((p = (char *)calloc(size, unitsize)) == NULL) csa_quit("alloc2d(): %s\n", strerror(errno)); assert((double) n2 * (double) sizeof(void*) <= (double) UINT_MAX); size = n2 * sizeof(void*); if ((pp = (char **)malloc(size)) == NULL) csa_quit("alloc2d(): %s\n", strerror(errno)); for (i = 0; i < n2; i++) pp[i] = &p[i * n1 * unitsize]; return pp; } /* Destroys n1xn2 matrix. * @param pp Matrix */ static void free2d(void* pp) { void* p; assert(pp != NULL); p = ((void**) pp)[0]; free(pp); assert(p != NULL); free(p); } static triangle* triangle_create(square* s, point vertices[], int index) { triangle* t = (triangle *)malloc(sizeof(triangle)); t->parent = s; memcpy(t->vertices, vertices, sizeof(point) * 3); t->middle.x = (vertices[0].x + vertices[1].x + vertices[2].x) / 3.0; t->middle.y = (vertices[0].y + vertices[1].y + vertices[2].y) / 3.0; t->h = s->parent->h; t->index = index; t->r = 0.0; t->points = 0; t->nallocated = 0; t->npoints = 0; t->hascoeffs = 0; t->primary = 0; t->order = -1; return t; } static void triangle_addpoint(triangle* t, point* p) { if (t->nallocated == t->npoints) { if (t->nallocated == 0) { t->points = (point **)malloc(NPASTART * sizeof(point*)); t->nallocated = NPASTART; } else { t->points = (point **)realloc(t->points, t->nallocated * 2 * sizeof(point*)); t->nallocated *= 2; } } t->points[t->npoints] = p; t->npoints++; } static void triangle_destroy(triangle* t) { if (t->points != NULL) free(t->points); free(t); } /* Calculates barycentric coordinates of a point. * Takes into account that possible triangles are rectangular, with the right * angle at t->vertices[0], the vertices[1] vertex being in * (-3*PI/4) + (PI/2) * t->index direction from vertices[0], and * vertices[2] being at (-5*PI/4) + (PI/2) * t->index. */ static void triangle_calculatebc(triangle* t, point* p, double bc[]) { double dx = p->x - t->vertices[0].x; double dy = p->y - t->vertices[0].y; if (t->index == 0) { bc[1] = (dy - dx) / t->h; bc[2] = -(dx + dy) / t->h; } else if (t->index == 1) { bc[1] = (dx + dy) / t->h; bc[2] = (dy - dx) / t->h; } else if (t->index == 2) { bc[1] = (dx - dy) / t->h; bc[2] = (dx + dy) / t->h; } else { bc[1] = -(dx + dy) / t->h; bc[2] = (dx - dy) / t->h; } bc[0] = 1.0 - bc[1] - bc[2]; } static square* square_create(csa* parent, double xmin, double ymin, int i, int j) { int ii; square* s = (square *)malloc(sizeof(square)); double h = parent->h; s->parent = parent; s->i = i; s->j = j; s->points = NULL; s->nallocated = 0; s->npoints = 0; s->primary = 0; /* * create 4 triangles formed by diagonals */ for (ii = 0; ii < 4; ++ii) { point vertices[3]; vertices[0].x = xmin + h / 2.0; vertices[0].y = ymin + h / 2.0; vertices[1].x = xmin + h * (((ii + 1) % 4) / 2); /* 0 1 1 0 */ vertices[1].y = ymin + h * (((ii + 2) % 4) / 2); /* 1 1 0 0 */ vertices[2].x = xmin + h * (ii / 2); /* 0 0 1 1 */ vertices[2].y = ymin + h * (((ii + 1) % 4) / 2); /* 0 1 1 0 */ s->triangles[ii] = triangle_create(s, vertices, ii); } for (ii = 0; ii < 25; ++ii) s->coeffs[ii] = NaN; return s; } static void square_destroy(square* s) { int i; for (i = 0; i < 4; ++i) triangle_destroy(s->triangles[i]); if (s->points != NULL) free(s->points); free(s); } static void square_addpoint(square* s, point* p) { if (s->nallocated == s->npoints) { if (s->nallocated == 0) { s->points = (point **)malloc(NPASTART * sizeof(point*)); s->nallocated = NPASTART; } else { s->points = (point **)realloc(s->points, s->nallocated * 2 * sizeof(point*)); s->nallocated *= 2; } } s->points[s->npoints] = p; s->npoints++; } csa* csa_create() { csa* a = (csa *)malloc(sizeof(csa)); a->xmin = DBL_MAX; a->xmax = -DBL_MAX; a->ymin = DBL_MAX; a->ymax = -DBL_MAX; a->points = (point **)malloc(NPASTART * sizeof(point*)); a->nallocated = NPASTART; a->npoints = 0; a->ni = 0; a->nj = 0; a->h = NaN; a->squares = NULL; a->npt = 0; a->pt = NULL; a->npmin = NPMIN_DEF; a->npmax = NPMAX_DEF; a->k = K_DEF; a->nppc = NPPC_DEF; return a; } void csa_destroy(csa* a) { int i, j; if (a->squares != NULL) { for (j = 0; j < a->nj; ++j) for (i = 0; i < a->ni; ++i) square_destroy(a->squares[j][i]); free2d(a->squares); } if (a->pt != NULL) free(a->pt); if (a->points != NULL) free(a->points); free(a); } void csa_addpoints(csa* a, int n, point points[]) { int na = a->nallocated; int i; assert(a->squares == NULL); /* * (can be called prior to squarization only) */ while (na < a->npoints + n) na *= 2; if (na != a->nallocated) { a->points = (point **)realloc(a->points, na * sizeof(point*)); a->nallocated = na; } for (i = 0; i < n; ++i) { point* p = &points[i]; a->points[a->npoints] = p; a->npoints++; if (p->x < a->xmin) a->xmin = p->x; if (p->x > a->xmax) a->xmax = p->x; if (p->y < a->ymin) a->ymin = p->y; if (p->y > a->ymax) a->ymax = p->y; } } /* Marks the squares containing "primary" triangles by setting "primary" flag * to 1. */ static void csa_setprimaryflag(csa* a) { square*** squares = a->squares; int nj1 = a->nj - 1; int ni1 = a->ni - 1; int i, j; for (j = 1; j < nj1; ++j) { for (i = 1; i < ni1; ++i) { if (squares[j][i]->npoints > 0) { if ((i + j) % 2 == 0) { squares[j][i]->primary = 1; squares[j - 1][i - 1]->primary = 1; squares[j + 1][i - 1]->primary = 1; squares[j - 1][i + 1]->primary = 1; squares[j + 1][i + 1]->primary = 1; } else { squares[j - 1][i]->primary = 1; squares[j + 1][i]->primary = 1; squares[j][i - 1]->primary = 1; squares[j][i + 1]->primary = 1; } } } } } /* Splits the data domain in a number of squares. */ static void csa_squarize(csa* a) { int nps[7] = { 0, 0, 0, 0, 0, 0 }; /* stats on number of points per * square */ double dx = a->xmax - a->xmin; double dy = a->ymax - a->ymin; int npoints = a->npoints; double h; int i, j, ii, nadj; if (csa_verbose) { fprintf(stderr, "squarizing csa:\n"); fflush(stderr); } assert(a->squares == NULL); /* * (can be done only once) */ h = sqrt(dx * dy * a->nppc / npoints); /* square edge size */ if (dx < h) h = dy * a->nppc / npoints; if (dy < h) h = dx * a->nppc / npoints; a->h = h; a->ni = (int)ceil(dx / h) + 2; a->nj = (int)ceil(dy / h) + 2; if (csa_verbose) { fprintf(stderr, " %d x %d squares\n", a->ni, a->nj); fflush(stderr); } /* * create squares */ a->squares = (square ***)alloc2d(a->ni, a->nj, sizeof(void*)); for (j = 0; j < a->nj; ++j) for (i = 0; i < a->ni; ++i) a->squares[j][i] = square_create(a, a->xmin + h * (i - 1), a->ymin + h * (j - 1), i, j); /* * map points to squares */ for (ii = 0; ii < npoints; ++ii) { point* p = a->points[ii]; i = (int)floor((p->x - a->xmin) / h) + 1; j = (int)floor((p->y - a->ymin) / h) + 1; square_addpoint(a->squares[j][i], p); } /* * mark relevant squares with no points */ csa_setprimaryflag(a); /* * Create a list of "primary" triangles, for which spline coefficients * will be calculated directy (by least squares method), without using * C1 smoothness conditions. */ a->pt = (triangle **)malloc((a->ni / 2 + 1) * a->nj * sizeof(triangle*)); for (j = 0, ii = 0, nadj = 0; j < a->nj; ++j) { for (i = 0; i < a->ni; ++i) { square* s = a->squares[j][i]; if (s->npoints > 0) { int nn = s->npoints / 5; if (nn > 6) nn = 6; nps[nn]++; ii++; } if (s->primary && s->npoints == 0) nadj++; if (s->primary) { a->pt[a->npt] = s->triangles[0]; s->triangles[0]->primary = 1; a->npt++; } } } if (csa_verbose) { fprintf(stderr, " %d non-empty squares\n", ii); fprintf(stderr, " %d primary squares\n", a->npt); fprintf(stderr, " %d primary squares with no data\n", nadj); fprintf(stderr, " %.2f points per square \n", (double) a->npoints / ii); } if (csa_verbose == 2) { for (i = 0; i < 6; ++i) fprintf(stderr, " %d-%d points -- %d squares\n", i * 5, i * 5 + 4, nps[i]); fprintf(stderr, " %d or more points -- %d squares\n", i * 5, nps[i]); } if (csa_verbose == 2) { fprintf(stderr, " j\\i"); for (i = 0; i < a->ni; ++i) fprintf(stderr, "%3d ", i); fprintf(stderr, "\n"); for (j = a->nj - 1; j >= 0; --j) { fprintf(stderr, "%3d ", j); for (i = 0; i < a->ni; ++i) { square* s = a->squares[j][i]; if (s->npoints > 0) fprintf(stderr, "%3d ", s->npoints); else fprintf(stderr, " . "); } fprintf(stderr, "\n"); } } if (csa_verbose) fflush(stderr); } /* Returns all squares intersecting with a square with center in t->middle * and edges of length 2*t->r parallel to X and Y axes. */ static void getsquares(csa* a, triangle* t, int* n, square*** squares) { int imin = (int)floor((t->middle.x - t->r - a->xmin) / t->h); int imax = (int)ceil((t->middle.x + t->r - a->xmin) / t->h); int jmin = (int)floor((t->middle.y - t->r - a->ymin) / t->h); int jmax = (int)ceil((t->middle.y + t->r - a->ymin) / t->h); int i, j; if (imin < 0) imin = 0; if (imax >= a->ni) imax = a->ni - 1; if (jmin < 0) jmin = 0; if (jmax >= a->nj) jmax = a->nj - 1; *n = 0; (*squares) = (square **)malloc((imax - imin + 1) * (jmax - jmin + 1) * sizeof(square*)); for (j = jmin; j <= jmax; ++j) { for (i = imin; i <= imax; ++i) { square* s = a->squares[j][i]; if (s->npoints > 0) { (*squares)[*n] = a->squares[j][i]; (*n)++; } } } } static double distance(point* p1, point* p2) { return hypot(p1->x - p2->x, p1->y - p2->y); } /* Thins data by creating an auxiliary regular grid and for leaving only * the most central point within each grid cell. * (I follow the paper here. It is possible that taking average -- in terms of * both value and position -- of all points within a cell would be a bit more * robust. However, because of keeping only shallow copies of input points, * this would require quite a bit of structural changes. So, leaving it as is * for now.) */ static void thindata(triangle* t, int npmax) { csa* a = t->parent->parent; int imax = (int)ceil(sqrt((double) (npmax * 3 / 2))); square*** squares = (square ***)alloc2d(imax, imax, sizeof(void*)); double h = t->r * 2.0 / imax; double h2 = h / 2.0; double xmin = t->middle.x - t->r; double ymin = t->middle.y - t->r; int i, j, ii; for (j = 0; j < imax; ++j) for (i = 0; i < imax; ++i) squares[j][i] = square_create(a, xmin + h * i, ymin + h * j, i, j); for (ii = 0; ii < t->npoints; ++ii) { point* p = t->points[ii]; int i = (int)floor((p->x - xmin) / h); int j = (int)floor((p->y - ymin) / h); square* s = squares[j][i]; if (s->npoints == 0) square_addpoint(s, p); else { /* npoints == 1 */ point pmiddle; pmiddle.x = xmin + h * i + h2; pmiddle.y = ymin + h * j + h2; if (distance(s->points[0], &pmiddle) > distance(p, &pmiddle)) s->points[0] = p; } } t->npoints = 0; for (j = 0; j < imax; ++j) { for (i = 0; i < imax; ++i) { square* s = squares[j][i]; if (squares[j][i]->npoints != 0) triangle_addpoint(t, s->points[0]); square_destroy(s); } } free2d(squares); imax++; } /* Finds data points to be used in calculating spline coefficients for each * primary triangle. */ static void csa_attachpoints(csa* a) { int npmin = a->npmin; int npmax = a->npmax; int nincreased = 0; int nthinned = 0; int i; assert(a->npt > 0); if (csa_verbose) { fprintf(stderr, "pre-processing data points:\n "); fflush(stderr); } for (i = 0; i < a->npt; ++i) { triangle* t = a->pt[i]; int increased = 0; if (csa_verbose) { fprintf(stderr, "."); fflush(stderr); } t->r = t->h * 1.25; while (1) { int nsquares = 0; square** squares = NULL; int ii; getsquares(a, t, &nsquares, &squares); for (ii = 0; ii < nsquares; ++ii) { square* s = squares[ii]; int iii; for (iii = 0; iii < s->npoints; ++iii) { point* p = s->points[iii]; if (distance(p, &t->middle) <= t->r) triangle_addpoint(t, p); } } free(squares); if (t->npoints < npmin) { if (!increased) { increased = 1; nincreased++; } t->r *= 1.25; t->npoints = 0; } else if (t->npoints > npmax) { nthinned++; thindata(t, npmax); if (t->npoints > npmin) break; else { /* * Sometimes you have too much data, you thin it and -- * oops -- you have too little. This is not a frequent * event, so let us not bother to put a new subdivision. */ t->r *= 1.25; t->npoints = 0; } } else break; } } if (csa_verbose) { fprintf(stderr, "\n %d sets enhanced, %d sets thinned\n", nincreased, nthinned); fflush(stderr); } } static int n2q(int n) { assert(n >= 3); if (n >= 10) return 3; else if (n >= 6) return 2; else /* n == 3 */ return 1; } /** Singular value decomposition. * Borrowed from EISPACK (1972-1973). * Presents input matrix A as A = U.W.V'. * * @param a Input matrix A = U.W[0..m-1][0..n-1]; output matrix U * @param n Number of columns * @param m Number of rows * @param w Ouput vector that presents diagonal matrix W * @param V output matrix V */ static void svd(double** a, int n, int m, double* w, double** v) { double* rv1; int i, j, k, l = -1; double tst1, c, f, g, h, s, scale; assert(m > 0 && n > 0); rv1 = (double *)malloc(n * sizeof(double)); /* * householder reduction to bidiagonal form */ g = 0.0; scale = 0.0; tst1 = 0.0; for (i = 0; i < n; i++) { l = i + 1; rv1[i] = scale * g; g = 0.0; s = 0.0; scale = 0.0; if (i < m) { for (k = i; k < m; k++) scale += fabs(a[k][i]); if (scale != 0.0) { for (k = i; k < m; k++) { a[k][i] /= scale; s += a[k][i] * a[k][i]; } f = a[i][i]; g = -copysign(sqrt(s), f); h = f * g - s; a[i][i] = f - g; if (i < n - 1) { for (j = l; j < n; j++) { s = 0.0; for (k = i; k < m; k++) s += a[k][i] * a[k][j]; f = s / h; for (k = i; k < m; k++) a[k][j] += f * a[k][i]; } } for (k = i; k < m; k++) a[k][i] *= scale; } } w[i] = scale * g; g = 0.0; s = 0.0; scale = 0.0; if (i < m && i < n - 1) { for (k = l; k < n; k++) scale += fabs(a[i][k]); if (scale != 0.0) { for (k = l; k < n; k++) { a[i][k] /= scale; s += a[i][k] * a[i][k]; } f = a[i][l]; g = -copysign(sqrt(s), f); h = f * g - s; a[i][l] = f - g; for (k = l; k < n; k++) rv1[k] = a[i][k] / h; for (j = l; j < m; j++) { s = 0.0; for (k = l; k < n; k++) s += a[j][k] * a[i][k]; for (k = l; k < n; k++) a[j][k] += s * rv1[k]; } for (k = l; k < n; k++) a[i][k] *= scale; } } { double tmp = fabs(w[i]) + fabs(rv1[i]); tst1 = (tst1 > tmp) ? tst1 : tmp; } } /* * accumulation of right-hand transformations */ for (i = n - 1; i >= 0; i--) { if (i < n - 1) { if (g != 0.0) { for (j = l; j < n; j++) /* * double division avoids possible underflow */ v[j][i] = (a[i][j] / a[i][l]) / g; for (j = l; j < n; j++) { s = 0.0; for (k = l; k < n; k++) s += a[i][k] * v[k][j]; for (k = l; k < n; k++) v[k][j] += s * v[k][i]; } } for (j = l; j < n; j++) { v[i][j] = 0.0; v[j][i] = 0.0; } } v[i][i] = 1.0; g = rv1[i]; l = i; } /* * accumulation of left-hand transformations */ for (i = (m < n) ? m - 1 : n - 1; i >= 0; i--) { l = i + 1; g = w[i]; if (i != n - 1) for (j = l; j < n; j++) a[i][j] = 0.0; if (g != 0.0) { for (j = l; j < n; j++) { s = 0.0; for (k = l; k < m; k++) s += a[k][i] * a[k][j]; /* * double division avoids possible underflow */ f = (s / a[i][i]) / g; for (k = i; k < m; k++) a[k][j] += f * a[k][i]; } for (j = i; j < m; j++) a[j][i] /= g; } else for (j = i; j < m; j++) a[j][i] = 0.0; a[i][i] += 1.0; } /* * diagonalization of the bidiagonal form */ for (k = n - 1; k >= 0; k--) { int k1 = k - 1; int its = 0; while (1) { int docancellation = 1; double x, y, z; int l1 = -1; its++; if (its > SVD_NMAX) csa_quit("svd(): no convergence in %d iterations", SVD_NMAX); for (l = k; l >= 0; l--) { /* test for splitting */ double tst2 = fabs(rv1[l]) + tst1; if (tst2 == tst1) { docancellation = 0; break; } l1 = l - 1; /* * rv1(1) is always zero, so there is no exit through the * bottom of the loop */ tst2 = fabs(w[l - 1]) + tst1; if (tst2 == tst1) break; } /* * cancellation of rv1[l] if l > 1 */ if (docancellation) { c = 0.0; s = 1.0; for (i = l; i <= k; i++) { f = s * rv1[i]; rv1[i] = c * rv1[i]; if ((fabs(f) + tst1) == tst1) break; g = w[i]; h = hypot(f, g); w[i] = h; h = 1.0 / h; c = g * h; s = -f * h; for (j = 0; j < m; j++) { double y = a[j][l1]; double z = a[j][i]; a[j][l1] = y * c + z * s; a[j][i] = z * c - y * s; } } } /* * test for convergence */ z = w[k]; if (l != k) { int i1; /* * shift from bottom 2 by 2 minor */ x = w[l]; y = w[k1]; g = rv1[k1]; h = rv1[k]; f = 0.5 * (((g + z) / h) * ((g - z) / y) + y / h - h / y); g = hypot(f, 1.0); f = x - (z / x) * z + (h / x) * (y / (f + copysign(g, f)) - h); /* * next qr transformation */ c = 1.0; s = 1.0; for (i1 = l; i1 < k; i1++) { i = i1 + 1; g = rv1[i]; y = w[i]; h = s * g; g = c * g; z = hypot(f, h); rv1[i1] = z; c = f / z; s = h / z; f = x * c + g * s; g = g * c - x * s; h = y * s; y *= c; for (j = 0; j < n; j++) { x = v[j][i1]; z = v[j][i]; v[j][i1] = x * c + z * s; v[j][i] = z * c - x * s; } z = hypot(f, h); w[i1] = z; /* * rotation can be arbitrary if z = 0 */ if (z != 0.0) { c = f / z; s = h / z; } f = c * g + s * y; x = c * y - s * g; for (j = 0; j < m; j++) { y = a[j][i1]; z = a[j][i]; a[j][i1] = y * c + z * s; a[j][i] = z * c - y * s; } } rv1[l] = 0.0; rv1[k] = f; w[k] = x; } else { /* * w[k] is made non-negative */ if (z < 0.0) { w[k] = -z; for (j = 0; j < n; j++) v[j][k] = -v[j][k]; } break; } } } free(rv1); } /* Least squares fitting via singular value decomposition. */ static void lsq(double** A, int ni, int nj, double* z, double* w, double* sol) { double** V = (double **)alloc2d(ni, ni, sizeof(double)); double** B = (double **)alloc2d(nj, ni, sizeof(double)); int i, j, ii; svd(A, ni, nj, w, V); for (j = 0; j < ni; ++j) for (i = 0; i < ni; ++i) V[j][i] /= w[i]; for (i = 0; i < ni; ++i) { double* v = V[i]; for (j = 0; j < nj; ++j) { double* a = A[j]; double* b = &B[i][j]; for (ii = 0; ii < ni; ++ii) *b += v[ii] * a[ii]; } } for (i = 0; i < ni; ++i) sol[i] = 0.0; for (i = 0; i < ni; ++i) for (j = 0; j < nj; ++j) sol[i] += B[i][j] * z[j]; free2d(B); free2d(V); } /* * square->coeffs[]: * * --------------------- * | 3 10 17 24 | * | 6 13 20 | * | 2 9 16 23 | * | 5 12 19 | * | 1 8 15 22 | * | 4 11 18 | * | 0 7 14 21 | * --------------------- */ /* Calculates spline coefficients in each primary triangle by least squares * fitting to data attached by csa_attachpoints(). */ static void csa_findprimarycoeffs(csa* a) { int n[4] = { 0, 0, 0, 0 }; int i; if (csa_verbose) fprintf(stderr, "calculating spline coefficients for primary triangles:\n "); for (i = 0; i < a->npt; ++i) { triangle* t = a->pt[i]; int npoints = t->npoints; point** points = t->points; double* z = (double *)malloc(npoints * sizeof(double)); int q = n2q(t->npoints); int ok = 1; double b[10]; double b1[6]; int ii; if (csa_verbose) { fprintf(stderr, "."); fflush(stderr); } for (ii = 0; ii < npoints; ++ii) z[ii] = points[ii]->z; do { double bc[3]; double wmin, wmax; if (!ok) q--; assert(q >= 0); if (q == 3) { double** A = (double **)alloc2d(10, npoints, sizeof(double)); double w[10]; for (ii = 0; ii < npoints; ++ii) { double* aii = A[ii]; double tmp; triangle_calculatebc(t, points[ii], bc); /* * 0 1 2 3 4 5 6 7 8 9 * 300 210 201 120 111 102 030 021 012 003 */ tmp = bc[0] * bc[0]; aii[0] = tmp * bc[0]; tmp *= 3.0; aii[1] = tmp * bc[1]; aii[2] = tmp * bc[2]; tmp = bc[1] * bc[1]; aii[6] = tmp * bc[1]; tmp *= 3.0; aii[3] = tmp * bc[0]; aii[7] = tmp * bc[2]; tmp = bc[2] * bc[2]; aii[9] = tmp * bc[2]; tmp *= 3.0; aii[5] = tmp * bc[0]; aii[8] = tmp * bc[1]; aii[4] = bc[0] * bc[1] * bc[2] * 6.0; } lsq(A, 10, npoints, z, w, b); wmin = w[0]; wmax = w[0]; for (ii = 1; ii < 10; ++ii) { if (w[ii] < wmin) wmin = w[ii]; else if (w[ii] > wmax) wmax = w[ii]; } if (wmin < wmax / a->k) ok = 0; free2d(A); } else if (q == 2) { double** A = (double **)alloc2d(6, npoints, sizeof(double)); double w[6]; for (ii = 0; ii < npoints; ++ii) { double* aii = A[ii]; triangle_calculatebc(t, points[ii], bc); /* * 0 1 2 3 4 5 * 200 110 101 020 011 002 */ aii[0] = bc[0] * bc[0]; aii[1] = bc[0] * bc[1] * 2.0; aii[2] = bc[0] * bc[2] * 2.0; aii[3] = bc[1] * bc[1]; aii[4] = bc[1] * bc[2] * 2.0; aii[5] = bc[2] * bc[2]; } lsq(A, 6, npoints, z, w, b1); wmin = w[0]; wmax = w[0]; for (ii = 1; ii < 6; ++ii) { if (w[ii] < wmin) wmin = w[ii]; else if (w[ii] > wmax) wmax = w[ii]; } if (wmin < wmax / a->k) ok = 0; else { /* degree raising */ ok = 1; b[0] = b1[0]; b[1] = (b1[0] + 2.0 * b1[1]) / 3.0; b[2] = (b1[0] + 2.0 * b1[2]) / 3.0; b[3] = (b1[3] + 2.0 * b1[1]) / 3.0; b[4] = (b1[1] + b1[2] + b1[4]) / 3.0; b[5] = (b1[5] + 2.0 * b1[2]) / 3.0; b[6] = b1[3]; b[7] = (b1[3] + 2.0 * b1[4]) / 3.0; b[8] = (b1[5] + 2.0 * b1[4]) / 3.0; b[9] = b1[5]; } free2d(A); } else if (q == 1) { double** A = (double **)alloc2d(3, npoints, sizeof(double)); double w[3]; for (ii = 0; ii < npoints; ++ii) { double* aii = A[ii]; triangle_calculatebc(t, points[ii], bc); aii[0] = bc[0]; aii[1] = bc[1]; aii[2] = bc[2]; } lsq(A, 3, npoints, z, w, b1); wmin = w[0]; wmax = w[0]; for (ii = 1; ii < 3; ++ii) { if (w[ii] < wmin) wmin = w[ii]; else if (w[ii] > wmax) wmax = w[ii]; } if (wmin < wmax / a->k) ok = 0; else { /* degree raising */ ok = 1; b[0] = b1[0]; b[1] = (2.0 * b1[0] + b1[1]) / 3.0; b[2] = (2.0 * b1[0] + b1[2]) / 3.0; b[3] = (2.0 * b1[1] + b1[0]) / 3.0; b[4] = (b1[0] + b1[1] + b1[2]) / 3.0; b[5] = (2.0 * b1[2] + b1[0]) / 3.0; b[6] = b1[1]; b[7] = (2.0 * b1[1] + b1[2]) / 3.0; b[8] = (2.0 * b1[2] + b1[1]) / 3.0; b[9] = b1[2]; } free2d(A); } else if (q == 0) { double** A = (double **)alloc2d(1, npoints, sizeof(double)); double w[1]; for (ii = 0; ii < npoints; ++ii) A[ii][0] = 1.0; lsq(A, 1, npoints, z, w, b1); ok = 1; b[0] = b1[0]; b[1] = b1[0]; b[2] = b1[0]; b[3] = b1[0]; b[4] = b1[0]; b[5] = b1[0]; b[6] = b1[0]; b[7] = b1[0]; b[8] = b1[0]; b[9] = b1[0]; free2d(A); } } while (!ok); n[q]++; t->order = q; { square* s = t->parent; double* coeffs = s->coeffs; coeffs[12] = b[0]; coeffs[9] = b[1]; coeffs[6] = b[3]; coeffs[3] = b[6]; coeffs[2] = b[7]; coeffs[1] = b[8]; coeffs[0] = b[9]; coeffs[4] = b[5]; coeffs[8] = b[2]; coeffs[5] = b[4]; } free(z); } if (csa_verbose) { fprintf(stderr, "\n 3rd order -- %d sets\n", n[3]); fprintf(stderr, " 2nd order -- %d sets\n", n[2]); fprintf(stderr, " 1st order -- %d sets\n", n[1]); fprintf(stderr, " 0th order -- %d sets\n", n[0]); fflush(stderr); } if (csa_verbose == 2) { int j; fprintf(stderr, " j\\i"); for (i = 0; i < a->ni; ++i) fprintf(stderr, "%2d ", i); fprintf(stderr, "\n"); for (j = a->nj - 1; j >= 0; --j) { fprintf(stderr, "%2d ", j); for (i = 0; i < a->ni; ++i) { square* s = a->squares[j][i]; if (s->triangles[0]->primary) fprintf(stderr, "%2d ", s->triangles[0]->order); else fprintf(stderr, " . "); } fprintf(stderr, "\n"); } } } /* Finds spline coefficients in (adjacent to primary triangles) secondary * triangles from C1 smoothness conditions. */ static void csa_findsecondarycoeffs(csa* a) { square*** squares = a->squares; int ni = a->ni; int nj = a->nj; int ii; if (csa_verbose) { fprintf(stderr, "propagating spline coefficients to the remaining triangles:\n"); fflush(stderr); } /* * red */ for (ii = 0; ii < a->npt; ++ii) { triangle* t = a->pt[ii]; square* s = t->parent; int i = s->i; int j = s->j; double* c = s->coeffs; double* cl = (i > 0) ? squares[j][i - 1]->coeffs : NULL; double* cb = (j > 0) ? squares[j - 1][i]->coeffs : NULL; double* cbl = (i > 0 && j > 0) ? squares[j - 1][i - 1]->coeffs : NULL; double* ca = (j < nj - 1) ? squares[j + 1][i]->coeffs : NULL; double* cal = (j < nj - 1 && i > 0) ? squares[j + 1][i - 1]->coeffs : NULL; c[7] = 2.0 * c[4] - c[1]; c[11] = 2.0 * c[8] - c[5]; c[15] = 2.0 * c[12] - c[9]; c[10] = 2.0 * c[6] - c[2]; c[13] = 2.0 * c[9] - c[5]; c[16] = 2.0 * c[12] - c[8]; c[19] = 2.0 * c[15] - c[11]; if (cl != NULL) { cl[21] = c[0]; cl[22] = c[1]; cl[23] = c[2]; cl[24] = c[3]; cl[18] = c[0] + c[1] - c[4]; cl[19] = c[1] + c[2] - c[5]; cl[20] = c[2] + c[3] - c[6]; cl[17] = 2.0 * cl[20] - cl[23]; cl[14] = 2.0 * cl[18] - cl[22]; } if (cb != NULL) { cb[3] = c[0]; cb[10] = c[7]; cb[6] = c[0] + c[7] - c[4]; cb[2] = 2.0 * cb[6] - cb[10]; } if (cbl != NULL) { cbl[23] = cb[2]; cbl[24] = cb[3]; cbl[20] = cb[2] + cb[3] - cb[6]; cbl[17] = cl[14]; } if (ca != NULL) { ca[0] = c[3]; ca[7] = c[10]; ca[4] = c[3] + c[10] - c[6]; ca[1] = 2.0 * ca[4] - ca[7]; } if (cal != NULL) { cal[21] = c[3]; cal[22] = ca[1]; cal[18] = ca[0] + ca[1] - ca[4]; cal[14] = cl[17]; } } /* * blue */ for (ii = 0; ii < a->npt; ++ii) { triangle* t = a->pt[ii]; square* s = t->parent; int i = s->i; int j = s->j; double* c = s->coeffs; double* cr = (i < ni - 1) ? squares[j][i + 1]->coeffs : NULL; double* car = (i < ni - 1 && j < nj - 1) ? squares[j + 1][i + 1]->coeffs : NULL; double* cbr = (i < ni - 1 && j > 0) ? squares[j - 1][i + 1]->coeffs : NULL; if (car != NULL) cr[13] = car[7] + car[14] - car[11]; if (cbr != NULL) cr[11] = cbr[10] + cbr[17] - cbr[13]; if (cr != NULL) cr[5] = c[22] + c[23] - c[19]; } /* * green & yellow */ for (ii = 0; ii < a->npt; ++ii) { triangle* t = a->pt[ii]; square* s = t->parent; int i = s->i; int j = s->j; double* cr = (i < ni - 1) ? squares[j][i + 1]->coeffs : NULL; if (cr != NULL) { cr[9] = (cr[5] + cr[13]) / 2.0; cr[8] = (cr[5] + cr[11]) / 2.0; cr[15] = (cr[11] + cr[19]) / 2.0; cr[16] = (cr[13] + cr[19]) / 2.0; cr[12] = (cr[8] + cr[16]) / 2.0; } } if (csa_verbose) { fprintf(stderr, "checking that all coefficients have been set:\n"); fflush(stderr); } for (ii = 0; ii < ni * nj; ++ii) { square* s = squares[0][ii]; double* c = s->coeffs; int i; if (s->npoints == 0) continue; for (i = 0; i < 25; ++i) if (isnan(c[i])) fprintf(stderr, " squares[%d][%d]->coeffs[%d] = NaN\n", s->j, s->i, i); } } static int i300[] = { 12, 12, 12, 12 }; static int i030[] = { 3, 24, 21, 0 }; static int i003[] = { 0, 3, 24, 21 }; static int i210[] = { 9, 16, 15, 8 }; static int i021[] = { 2, 17, 22, 7 }; static int i102[] = { 4, 6, 20, 18 }; static int i120[] = { 6, 20, 18, 4 }; static int i012[] = { 1, 10, 23, 14 }; static int i201[] = { 8, 9, 16, 15 }; static int i111[] = { 5, 13, 19, 11 }; static int* iall[] = { i300, i030, i003, i210, i021, i102, i120, i012, i201, i111 }; static void csa_sethascoeffsflag(csa* a) { int i, j; for (j = 0; j < a->nj; ++j) { for (i = 0; i < a->ni; ++i) { square* s = a->squares[j][i]; double* coeffs = s->coeffs; int ii; for (ii = 0; ii < 4; ++ii) { triangle* t = s->triangles[ii]; int cc; for (cc = 0; cc < 10; ++cc) if (isnan(coeffs[iall[cc][ii]])) break; if (cc == 10) t->hascoeffs = 1; } } } } void csa_calculatespline(csa* a) { csa_squarize(a); csa_attachpoints(a); csa_findprimarycoeffs(a); csa_findsecondarycoeffs(a); csa_sethascoeffsflag(a); } void csa_approximate_point(csa* a, point* p) { double h = a->h; double ii = (p->x - a->xmin) / h + 1.0; double jj = (p->y - a->ymin) / h + 1.0; int i, j; square* s; double fi, fj; int ti; triangle* t; double bc[3]; if (ii < 0.0 || jj < 0.0 || ii > (double) a->ni - 1.0 || jj > (double) a->nj - 1.0) { p->z = NaN; return; } i = (int)floor(ii); j = (int)floor(jj); s = a->squares[j][i]; fi = ii - i; fj = jj - j; if (fj < fi) { if (fi + fj < 1.0) ti = 3; else ti = 2; } else { if (fi + fj < 1.0) ti = 0; else ti = 1; } t = s->triangles[ti]; if (!t->hascoeffs) { p->z = NaN; return; } triangle_calculatebc(t, p, bc); { double* c = s->coeffs; double bc1 = bc[0]; double bc2 = bc[1]; double bc3 = bc[2]; double tmp1 = bc1 * bc1; double tmp2 = bc2 * bc2; double tmp3 = bc3 * bc3; switch (ti) { case 0: p->z = c[12] * bc1 * tmp1 + c[3] * bc2 * tmp2 + c[0] * bc3 * tmp3 + 3.0 * (c[9] * tmp1 * bc2 + c[2] * tmp2 * bc3 + c[4] * tmp3 * bc1 + c[6] * bc1 * tmp2 + c[1] * bc2 * tmp3 + c[8] * tmp1 * bc3) + 6.0 * c[5] * bc1 * bc2 * bc3; break; case 1: p->z = c[12] * bc1 * tmp1 + c[24] * bc2 * tmp2 + c[3] * bc3 * tmp3 + 3.0 * (c[16] * tmp1 * bc2 + c[17] * tmp2 * bc3 + c[6] * tmp3 * bc1 + c[20] * bc1 * tmp2 + c[10] * bc2 * tmp3 + c[9] * tmp1 * bc3) + 6.0 * c[13] * bc1 * bc2 * bc3; break; case 2: p->z = c[12] * bc1 * tmp1 + c[21] * bc2 * tmp2 + c[24] * bc3 * tmp3 + 3.0 * (c[15] * tmp1 * bc2 + c[22] * tmp2 * bc3 + c[20] * tmp3 * bc1 + c[18] * bc1 * tmp2 + c[23] * bc2 * tmp3 + c[16] * tmp1 * bc3) + 6.0 * c[19] * bc1 * bc2 * bc3; break; default: /* 3 */ p->z = c[12] * bc1 * tmp1 + c[0] * bc2 * tmp2 + c[21] * bc3 * tmp3 + 3.0 * (c[8] * tmp1 * bc2 + c[7] * tmp2 * bc3 + c[18] * tmp3 * bc1 + c[4] * bc1 * tmp2 + c[14] * bc2 * tmp3 + c[15] * tmp1 * bc3) + 6.0 * c[11] * bc1 * bc2 * bc3; } } } void csa_approximate_points(csa* a, long n, point* points) { long ii; for (ii = 0; ii < n; ++ii) csa_approximate_point(a, &points[ii]); } void csa_setnpmin(csa* a, int npmin) { a->npmin = npmin; } void csa_setnpmax(csa* a, int npmax) { a->npmax = npmax; } void csa_setk(csa* a, int k) { a->k = k; } void csa_setnppc(csa* a, double nppc) { a->nppc = (int)(0.5 + nppc); } #if defined(STANDALONE) #include "minell.h" #define NIMAX 2048 #define BUFSIZE 10240 #define STRBUFSIZE 64 static void points_generate(double xmin, double xmax, double ymin, double ymax, int nx, int ny, int* nout, point** pout) { double stepx, stepy; double x0, xx, yy; int i, j, ii; if (nx < 1 || ny < 1) { *pout = NULL; *nout = 0; return; } *nout = nx * ny; *pout = (point *)malloc(*nout * sizeof(point)); stepx = (nx > 1) ? (xmax - xmin) / (nx - 1) : 0.0; stepy = (ny > 1) ? (ymax - ymin) / (ny - 1) : 0.0; x0 = (nx > 1) ? xmin : (xmin + xmax) / 2.0; yy = (ny > 1) ? ymin : (ymin + ymax) / 2.0; ii = 0; for (j = 0; j < ny; ++j) { xx = x0; for (i = 0; i < nx; ++i) { point* p = &(*pout)[ii]; p->x = xx; p->y = yy; xx += stepx; ii++; } yy += stepy; } } static int str2double(char* token, double* value) { char* end = NULL; if (token == NULL) { *value = NaN; return 0; } *value = strtod(token, &end); if (end == token) { *value = NaN; return 0; } return 1; } #define NALLOCATED_START 1024 /* Reads array of points from a columnar file. * * @param fname File name (can be "stdin" or "-" for standard input) * @param dim Number of dimensions (must be 2 or 3) * @param n Pointer to number of points (output) * @param points Pointer to array of points [*n] (output) (to be freed) */ void points_read(char* fname, int dim, int* n, point** points) { FILE* f = NULL; int nallocated = NALLOCATED_START; char buf[BUFSIZE]; char seps[] = " ,;\t"; char* token; if (dim < 2 || dim > 3) { *n = 0; *points = NULL; return; } if (fname == NULL) f = stdin; else { if (strcmp(fname, "stdin") == 0 || strcmp(fname, "-") == 0) f = stdin; else { f = fopen(fname, "r"); if (f == NULL) csa_quit("%s: %s\n", fname, strerror(errno)); } } *points = (point *)malloc(nallocated * sizeof(point)); *n = 0; while (fgets(buf, BUFSIZE, f) != NULL) { point* p; if (*n == nallocated) { nallocated *= 2; *points = (point *)realloc(*points, nallocated * sizeof(point)); } p = &(*points)[*n]; if (buf[0] == '#') continue; if ((token = strtok(buf, seps)) == NULL) continue; if (!str2double(token, &p->x)) continue; if ((token = strtok(NULL, seps)) == NULL) continue; if (!str2double(token, &p->y)) continue; if (dim == 2) p->z = NaN; else { if ((token = strtok(NULL, seps)) == NULL) continue; if (!str2double(token, &p->z)) continue; } (*n)++; } if (*n == 0) { free(*points); *points = NULL; } else *points = (point *)realloc(*points, *n * sizeof(point)); if (f != stdin) if (fclose(f) != 0) csa_quit("%s: %s\n", fname, strerror(errno)); } static void points_write(int n, point* points) { int i; if (csa_verbose) printf("Output:\n"); for (i = 0; i < n; ++i) { point* p = &points[i]; printf("%.15g %.15g %.15g\n", p->x, p->y, p->z); } } static double points_scaletosquare(int n, point* points) { double xmin, ymin, xmax, ymax; double k; int i; if (n <= 0) return NaN; xmin = xmax = points[0].x; ymin = ymax = points[0].y; for (i = 1; i < n; ++i) { point* p = &points[i]; if (p->x < xmin) xmin = p->x; else if (p->x > xmax) xmax = p->x; if (p->y < ymin) ymin = p->y; else if (p->y > ymax) ymax = p->y; } if (xmin == xmax || ymin == ymax) return NaN; else k = (ymax - ymin) / (xmax - xmin); for (i = 0; i < n; ++i) points[i].y /= k; return k; } static void points_scale(int n, point* points, double k) { int i; for (i = 0; i < n; ++i) points[i].y /= k; } static void usage() { printf("Usage: csabathy -i {-o |-n x [-c|-s] [-z ]}\n"); printf(" [-v|-V] [-P nppc=] [-P k=]\n"); printf("Options:\n"); printf(" -c -- scale internally so that the minimal ellipse turns into a\n"); printf(" circle (this produces results invariant to affine\n"); printf(" transformations)\n"); printf(" -i -- three-column file with points to approximate from (use\n"); printf(" \"-i stdin\" or \"-i -\" for standard input)\n"); printf(" -n x -- generate x output rectangular grid\n"); printf(" -o -- two-column file with points to approximate in (use\n"); printf(" \"-o stdin\" or \"-o -\" for standard input)\n"); printf(" -s -- scale internally so that Xmax - Xmin = Ymax - Ymin\n"); printf(" -v -- verbose / version\n"); printf(" -z -- zoom in (if < 1) or out ( > 1)\n"); printf(" -P nppc= -- set the average number of points per cell (default = 5\n"); printf(" increase if the point distribution is strongly non-uniform\n"); printf(" to get larger cells)\n"); printf(" -P k= -- set the spline sensitivity (default = 140, reduce to get\n"); printf(" smoother results)\n"); printf(" -V -- very verbose / version\n"); printf("Description:\n"); printf(" `csabathy' approximates irregular scalar 2D data in specified points using\n"); printf(" C1-continuous bivariate cubic spline. The calculated values are written to\n"); printf(" standard output.\n"); // exit(0); } static void version() { // exit(0); } static void parse_commandline(int argc, char* argv[], char** fdata, char** fpoints, int* invariant, int* square, int* generate_points, int* nx, int* ny, int* nppc, int* k, double* zoom) { int i; if (argc < 2) usage(); i = 1; while (i < argc) { if (argv[i][0] != '-') usage(); switch (argv[i][1]) { case 'c': i++; *invariant = 1; *square = 0; break; case 'i': i++; if (i >= argc) csa_quit("no file name found after -i\n"); *fdata = argv[i]; i++; break; case 'n': i++; *fpoints = NULL; *generate_points = 1; if (i >= argc) csa_quit("no grid dimensions found after -n\n"); if (sscanf(argv[i], "%dx%d", nx, ny) != 2) csa_quit("could not read grid dimensions after \"-n\"\n"); if (*nx <= 0 || *nx > NIMAX || *ny <= 0 || *ny > NIMAX) csa_quit("invalid size for output grid\n"); i++; break; case 'o': i++; if (i >= argc) csa_quit("no file name found after -o\n"); *fpoints = argv[i]; i++; break; case 's': i++; *square = 1; *invariant = 0; break; case 'v': i++; csa_verbose = 1; break; case 'z': i++; if (i >= argc) csa_quit("no zoom value found after -z\n"); *zoom = atof(argv[i]); i++; break; case 'P':{ char delim[] = "="; char prmstr[STRBUFSIZE] = ""; char* token; i++; if (i >= argc) csa_quit("no input found after -P\n"); if (strlen(argv[i]) >= STRBUFSIZE) csa_quit("could not interpret \"%s\" after -P option\n", argv[i]); strcpy(prmstr, argv[i]); token = strtok(prmstr, delim); if (token == NULL) csa_quit("could not interpret \"%s\" after -P option\n", argv[i]); if (strcmp(token, "nppc") == 0) { long int n; token = strtok(NULL, delim); if (token == NULL) csa_quit("could not interpret \"%s\" after -P option\n", argv[i]); n = strtol(token, NULL, 10); if (n == LONG_MIN || n == LONG_MAX) csa_quit("could not interpret \"%s\" after -P option\n", argv[i]); else if (n <= 0) csa_quit("non-sensible value for \"nppc\" parameter\n"); *nppc = (int) n; } else if (strcmp(token, "k") == 0) { long int n; token = strtok(NULL, delim); if (token == NULL) csa_quit("could not interpret \"%s\" after -P option\n", argv[i]); n = strtol(token, NULL, 10); if (n == LONG_MIN || n == LONG_MAX) csa_quit("could not interpret \"%s\" after -P option\n", argv[i]); else if (n <= 0) csa_quit("non-sensible value for \"k\" parameter\n"); *k = (int) n; } else usage(); i++; break; } case 'V': i++; csa_verbose = 2; break; default: usage(); break; } } if (csa_verbose && argc == 2) version(); } int main(int argc, char* argv[]) { char* fdata = NULL; char* fpoints = NULL; int nin = 0; point* pin = NULL; int invariant = 0; minell* me = NULL; int square = 0; int nout = 0; int generate_points = 0; point* pout = NULL; int nx = -1; int ny = -1; csa* a = NULL; int nppc = -1; int k = -1; double ks = NaN; double zoom = NaN; parse_commandline(argc, argv, &fdata, &fpoints, &invariant, &square, &generate_points, &nx, &ny, &nppc, &k, &zoom); if (fdata == NULL) csa_quit("no input data\n"); if (!generate_points && fpoints == NULL) csa_quit("no output grid specified\n"); points_read(fdata, 3, &nin, &pin); if (nin < 3) return 0; if (invariant) { me = minell_build(nin, pin); minell_scalepoints(me, nin, pin); } else if (square) ks = points_scaletosquare(nin, pin); a = csa_create(); csa_addpoints(a, nin, pin); if (nppc > 0) csa_setnppc(a, nppc); if (k > 0) csa_setk(a, k); csa_calculatespline(a); if (generate_points) { if (isnan(zoom)) points_generate(a->xmin - a->h, a->xmax + a->h, a->ymin - a->h, a->ymax + a->h, nx, ny, &nout, &pout); else { double xdiff2 = (a->xmax - a->xmin) / 2.0; double ydiff2 = (a->ymax - a->ymin) / 2.0; double xav = (a->xmax + a->xmin) / 2.0; double yav = (a->ymax + a->ymin) / 2.0; points_generate(xav - xdiff2 * zoom, xav + xdiff2 * zoom, yav - ydiff2 * zoom, yav + ydiff2 * zoom, nx, ny, &nout, &pout); } } else { points_read(fpoints, 2, &nout, &pout); if (invariant) minell_scalepoints(me, nout, pout); else if (square) points_scale(nout, pout, ks); } csa_approximate_points(a, nout, pout); if (invariant) minell_rescalepoints(me, nout, pout); else if (square) points_scale(nout, pout, 1.0 / ks); points_write(nout, pout); csa_destroy(a); free(pin); free(pout); return 0; } #endif /* STANDALONE */ saga-2.1.0+dfsg/src/modules/grid/grid_spline/csa.h000066400000000000000000000037421224124640700217560ustar00rootroot00000000000000/********************************************************** * Version $Id: csa.h 1082 2011-06-08 08:07:00Z reklov_w $ *********************************************************/ /****************************************************************************** * * File: csa.h * * Created: 16/10/2002 * * Author: Pavel Sakov * CSIRO Marine Research * * Purpose: A header for csa library (2D data approximation with * bivariate C1 cubic spline) * * Revisions: None * *****************************************************************************/ #if !defined(_CSA_H) #define _CSA_H //--------------------------------------------------------- extern int csa_verbose; #include #ifdef __cplusplus extern "C" { #endif //--------------------------------------------------------- #if !defined(_POINT_STRUCT) #define _POINT_STRUCT typedef struct { double x; double y; double z; } point; #endif struct csa; typedef struct csa csa; csa* csa_create(); void csa_destroy(csa* a); void csa_addpoints(csa* a, int n, point points[]); void csa_calculatespline(csa* a); void csa_approximate_point(csa* a, point* p); void csa_approximate_points(csa* a, long n, point* points); void csa_setnpmin(csa* a, int npmin); void csa_setnpmax(csa* a, int npmax); void csa_setk(csa* a, int k); void csa_setnppc(csa* a, double nppc); //--------------------------------------------------------- #if defined(__GNUC__) static const double NaN = 0.0 / 0.0; #elif defined(BIG_ENDIAN) || defined(_BIG_ENDIAN) static const long long lNaN = 0x7fffffffffffffff; #define NaN (*(double*)&lNaN) #elif defined(_SAGA_VC) static const __int64 lNaN = 0xfff8000000000000; #define NaN (*(double*)&lNaN) #define copysign _copysign #define isnan _isnan #else static const long long lNaN = 0xfff8000000000000; #define NaN (*(double*)&lNaN) #endif #ifdef __cplusplus } #endif //--------------------------------------------------------- #endif saga-2.1.0+dfsg/src/modules/grid/grid_tools/000077500000000000000000000000001224124640700206775ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/grid/grid_tools/CreateGridSystem.cpp000066400000000000000000000344521224124640700246310ustar00rootroot00000000000000/********************************************************** * Version $Id: CreateGridSystem.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // CreateGridSystem // // // //-------------------------------------------------------// // // // CreateGridSystem.cpp // // // // Copyright (C) 2007 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: reklovw@web.de // // // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "CreateGridSystem.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// CCreateGridSystem::CCreateGridSystem(void) { CSG_Parameter *pNode_0, *pNode_1; Parameters.Set_Name(_TL("Create Grid System")); Set_Author(_TL("Copyrights (c) 2007 by Volker Wichmann")); Parameters.Set_Description(_TW( "This module creates a new user specified Grid System for use with other modules.\n\n" "First of all, please consider the following issues before using the module:\n" "(a) all calculations of the module refer to the lower left corner of the grid system, i.e. " "the xMin and yMin values. This coordinate is fixed unless you specify an offset.\n" "(b) the module follows the philosophy of SAGA in that the values describing the extent refer to the " "cell centers. If you like to match the extent with the border of a grid, use an offset.\n\n" "The module provides four possibilities to set/determine the extent of the grid system:\n" "(1) by specifying the coordinate of the lower left cell (xMin, yMin) and the number of cells in W-E (NX) and S-N (NY) direction\n" "(2) by specifying the coordinates the of lower left (xMin, yMin) and the upper right (xMax, yMax) cell\n" "(3) by the extent of the shape(s) provided in the Data Objects section\n" "(4) by the extent of the grid(s) provided in the Data Objects section\n\n" "After selecting the appropriate method to determine the extent, the next step is to specify the " "cellsize of the new grid system.\n" "For all methods supplied to determine the extent but number (1), three possibilities are provided to " "adjust cellsize and grid system extent (please remember, the lower left corner is fixed!):\n" "(I) adjust the extent to match the cellsize\n" "(II) adjust the cellsize to match the extent in E-W direction\n" "(III) adjust the cellsize to match the extent in S-N direction\n\n" "Finally it is possible to apply an offset to the lower left corner of the grid system. " "In this case check the Use Offset option and specify the offset in W-E and S-N direction. Positive values " "result in a shift in E/N, negative in W/S direction.\n" "In order to create the grid system the module needs to create a dummy grid.") ); Parameters.Add_Grid_Output( NULL , "GRID" , _TL("Dummy Grid"), _TL("") ); pNode_0 = Parameters.Add_Choice( NULL, "M_EXTENT", _TL("Set extent by"), _TL("Please choose a method of module operation."), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("xMin, yMin, NX, NY"), _TL("xMin, yMin, xMax, yMax"), _TL("Shape(s)"), _TL("Grid(s)") ), 0 ); pNode_1 = Parameters.Add_Value( pNode_0, "XMIN", _TL("xMin"), _TL("minimum x value"), PARAMETER_TYPE_Double, 0.0 ); pNode_1 = Parameters.Add_Value( pNode_0, "YMIN", _TL("yMin"), _TL("minimum y value"), PARAMETER_TYPE_Double, 0.0 ); pNode_1 = Parameters.Add_Value( pNode_0, "XMAX", _TL("xMax"), _TL("maximum x value"), PARAMETER_TYPE_Double, 100.0 ); pNode_1 = Parameters.Add_Value( pNode_0, "YMAX", _TL("yMax"), _TL("maximum y value"), PARAMETER_TYPE_Double, 100.0 ); pNode_1 = Parameters.Add_Value( pNode_0, "NX", _TL("NX"), _TL("number of cells in W-E direction"), PARAMETER_TYPE_Int, 10, 1, true ); pNode_1 = Parameters.Add_Value( pNode_0, "NY", _TL("NY"), _TL("number of cells in S-N direction"), PARAMETER_TYPE_Int, 10, 1, true ); pNode_0 = Parameters.Add_Value( NULL, "CELLSIZE", _TL("Cellsize"), _TL("Cellsize"), PARAMETER_TYPE_Double, 10.0, 0.0, true ); pNode_0 = Parameters.Add_Choice( NULL, "ADJUST", _TL("Adjust"), _TL("Choose method how to adjust input values."), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Extent to CellSize"), _TL("CellSize to W-E Extent"), _TL("CellSize to S-N Extent") ), 0 ); pNode_0 = Parameters.Add_Value( NULL, "USEOFF", _TL("Use Offset"), _TL("Apply offset?"), PARAMETER_TYPE_Bool, false ); pNode_1 = Parameters.Add_Value( pNode_0, "XOFFSET", _TL("X offset"), _TL("Positive values result in a shift in E direction."), PARAMETER_TYPE_Double, 0.0 ); pNode_1 = Parameters.Add_Value( pNode_0, "YOFFSET", _TL("Y offset"), _TL("Positive values result in a shift in N direction."), PARAMETER_TYPE_Double, 0.0 ); pNode_0 = Parameters.Add_Value( NULL, "INIT", _TL("Initialization Value"), _TL("Value which is assigned to the dummy grid."), PARAMETER_TYPE_Double, 1.0 ); Parameters.Add_Shapes_List( NULL, "SHAPESLIST", _TL("Shape(s)"), _TL("Shape(s) to fit extent to"), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid_List( NULL, "GRIDLIST", _TL("Grid(s)"), _TL("Grid(s) to fit extent to"), PARAMETER_INPUT_OPTIONAL ); } //--------------------------------------------------------- CCreateGridSystem::~CCreateGridSystem(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// bool CCreateGridSystem::On_Execute(void) { CSG_Grid *pDummy; CSG_Shapes *pShapes; CSG_Rect extent; CSG_Parameter_Shapes_List *pShapesList; CSG_Parameter_Grid_List *pGridList; CSG_Grid_System System; double xMin, xMax, yMin, yMax, cellsize, offset_x, offset_y, xRange, yRange, n, initVal; int NX, NY, m_extent, m_adjust, i; bool useoff; xMin = Parameters("XMIN")->asDouble(); yMin = Parameters("YMIN")->asDouble(); xMax = Parameters("XMAX")->asDouble(); yMax = Parameters("YMAX")->asDouble(); NX = Parameters("NX")->asInt(); NY = Parameters("NY")->asInt(); cellsize = Parameters("CELLSIZE")->asDouble(); offset_x = Parameters("XOFFSET")->asDouble(); offset_y = Parameters("YOFFSET")->asDouble(); useoff = Parameters("USEOFF")->asBool(); m_extent = Parameters("M_EXTENT")->asInt(); m_adjust = Parameters("ADJUST")->asInt(); initVal = Parameters("INIT")->asDouble(); pShapesList = Parameters("SHAPESLIST")->asShapesList(); pGridList = Parameters("GRIDLIST")->asGridList(); if( useoff ) { xMin += offset_x; yMin += offset_y; xMax += offset_x; yMax += offset_y; } switch( m_extent ) { case 0: // xMin, yMin, NX, NY System.Assign(cellsize, xMin, yMin, NX, NY); break; case 1: // xMin, yMin, xMax, yMax if( xMin > xMax || yMin > yMax ) { Message_Add(CSG_String::Format(_TL("\nError: Please verify your xMin, yMin, xMax, yMax settings!\n"))); return false; } xRange = xMax - xMin; yRange = yMax - yMin; if( m_adjust == 0 ) // extent to cellsize { if( modf((xRange/cellsize), &n) != 0.0 ) { NX = (int) floor(xRange / cellsize + 0.5); xMax = xMin + NX * cellsize; } if( modf((yRange/cellsize), &n) != 0.0 ) { NY = (int) floor(yRange / cellsize + 0.5); yMax = yMin + NY * cellsize; } } else if( m_adjust == 1) // cellsize to W-E extent { if( modf((xRange/cellsize), &n) != 0.0 ) { NX = (int) (xRange/cellsize); cellsize = xRange/NX; } if( modf((yRange/cellsize), &n) != 0.0 ) { NY = (int) floor(yRange / cellsize + 0.5); yMax = yMin + NY * cellsize; } } else // cellsize to S-N extent { if( modf((yRange/cellsize), &n) != 0.0 ) { NY = (int) (yRange/cellsize); cellsize = yRange/NY; } if( modf((xRange/cellsize), &n) != 0.0 ) { NX = (int) floor(xRange / cellsize + 0.5); xMax = xMin + NX * cellsize; } } System.Assign(cellsize, xMin, yMin, xMax, yMax); break; case 2: // Shape(s) if( pShapesList == NULL || pShapesList->Get_Count() == 0) { Message_Add(CSG_String::Format(_TL("\nError: the method Extent by Shape(s) requires shape(s) as input!\n"))); return false; } for (i=0; iGet_Count(); i++) { pShapes = pShapesList->asShapes(i); extent = pShapes->Get_Extent(); if (i==0) { xMin = extent.Get_XMin(); yMin = extent.Get_YMin(); xMax = extent.Get_XMax(); yMax = extent.Get_YMax(); } else { xMin = (extent.Get_XMin() < xMin) ? extent.Get_XMin() : xMin; yMin = (extent.Get_YMin() < yMin) ? extent.Get_YMin() : yMin; xMax = (extent.Get_XMax() > xMax) ? extent.Get_XMax() : xMax; yMax = (extent.Get_YMax() > yMax) ? extent.Get_YMax() : yMax; } } if( useoff ) { xMin += offset_x; xMax += offset_x; yMin += offset_y; yMax += offset_y; } xRange = xMax - xMin; yRange = yMax - yMin; if( m_adjust == 0 ) // extent to cellsize { if( modf((xRange/cellsize), &n) != 0.0 ) { NX = (int) floor(xRange / cellsize + 0.5); xMax = xMin + NX * cellsize; } if( modf((yRange/cellsize), &n) != 0.0 ) { NY = (int) floor(yRange / cellsize + 0.5); yMax = yMin + NY * cellsize; } } else if( m_adjust == 1) // cellsize to W-E extent { if( modf((xRange/cellsize), &n) != 0.0 ) { NX = (int) (xRange/cellsize); cellsize = xRange/NX; } if( modf((yRange/cellsize), &n) != 0.0 ) { NY = (int) floor(yRange / cellsize + 0.5); yMax = yMin + NY * cellsize; } } else // cellsize to S-N extent { if( modf((yRange/cellsize), &n) != 0.0 ) { NY = (int) (yRange/cellsize); cellsize = yRange/NY; } if( modf((xRange/cellsize), &n) != 0.0 ) { NX = (int) floor(xRange / cellsize + 0.5); xMax = xMin + NX * cellsize; } } System.Assign(cellsize, xMin, yMin, xMax, yMax); break; case 3: // Grid(s) if( pGridList == NULL || pGridList->Get_Count() == 0) { Message_Add(CSG_String::Format(_TL("\nError: the method Extent by Grid(s) requires grid(s) as input!\n"))); return false; } for (i=0; iGet_Count(); i++) { pDummy = pGridList->asGrid(i); extent = pDummy->Get_Extent(); if (i==0) { xMin = extent.Get_XMin(); yMin = extent.Get_YMin(); xMax = extent.Get_XMax(); yMax = extent.Get_YMax(); } else { xMin = (extent.Get_XMin() < xMin) ? extent.Get_XMin() : xMin; yMin = (extent.Get_YMin() < yMin) ? extent.Get_YMin() : yMin; xMax = (extent.Get_XMax() > xMax) ? extent.Get_XMax() : xMax; yMax = (extent.Get_YMax() > yMax) ? extent.Get_YMax() : yMax; } } if( useoff ) { xMin += offset_x; xMax += offset_x; yMin += offset_y; yMax += offset_y; } xRange = xMax - xMin; yRange = yMax - yMin; if( m_adjust == 0 ) // extent to cellsize { if( modf((xRange/cellsize), &n) != 0.0 ) { NX = (int) floor(xRange / cellsize + 0.5); xMax = xMin + NX * cellsize; } if( modf((yRange/cellsize), &n) != 0.0 ) { NY = (int) floor(yRange / cellsize + 0.5); yMax = yMin + NY * cellsize; } } else if( m_adjust == 1) // cellsize to W-E extent { if( modf((xRange/cellsize), &n) != 0.0 ) { NX = (int) (xRange/cellsize); cellsize = xRange/NX; } if( modf((yRange/cellsize), &n) != 0.0 ) { NY = (int) floor(yRange / cellsize + 0.5); yMax = yMin + NY * cellsize; } } else // cellsize to S-N extent { if( modf((yRange/cellsize), &n) != 0.0 ) { NY = (int) (yRange/cellsize); cellsize = yRange/NY; } if( modf((xRange/cellsize), &n) != 0.0 ) { NX = (int) floor(xRange / cellsize + 0.5); xMax = xMin + NX * cellsize; } } System.Assign(cellsize, xMin, yMin, xMax, yMax); break; } pDummy = SG_Create_Grid(System, SG_DATATYPE_Double); pDummy->Assign(initVal); pDummy->Set_Name(_TL("Dummy Grid")); Parameters("GRID")->Set_Value(pDummy); return (true); } saga-2.1.0+dfsg/src/modules/grid/grid_tools/CreateGridSystem.h000066400000000000000000000100521224124640700242640ustar00rootroot00000000000000/********************************************************** * Version $Id: CreateGridSystem.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // CreateGridSystem // // // //-------------------------------------------------------// // // // CreateGridSystem.h // // // // Copyright (C) 2007 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata.at // // // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__CreateGridSystem_H #define HEADER_INCLUDED__CreateGridSystem_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_tools_EXPORT CCreateGridSystem : public CSG_Module { public: CCreateGridSystem(void); virtual ~CCreateGridSystem(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__CreateGridSystem_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Aggregate.cpp000066400000000000000000000136431224124640700242450ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Aggregate.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Aggregate.cpp // // // // Copyright (C) 2005 by // // Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "Grid_Aggregate.h" #define SUM 0 #define MIN 1 #define MAX 2 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Aggregate::CGrid_Aggregate(void) { //----------------------------------------------------- Set_Name(_TL("Aggregate")); Set_Author(_TL("Copyrights (c) 2005 by Victor Olaya")); Set_Description (_TW("Resamples a raster layer to a lower resolution, aggregating" "the values of a group of cells. This should be used in any case in which and a normal" "resampling will result in wrong values in the resulting layer, such as, for instance," "the number of elements of a given class in each cell.") ); //----------------------------------------------------- Parameters.Add_Grid( NULL , "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Value( NULL , "SIZE" , _TL("Aggregation Size"), _TL(""), PARAMETER_TYPE_Int , 2, 2, true ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), _TL("Sum|Min|Max|"), 0 ); } //--------------------------------------------------------- CGrid_Aggregate::~CGrid_Aggregate(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// bool CGrid_Aggregate::On_Execute(void) { int x,y; int x2,y2; int i,j; int iNX, iNY; int iSize = Parameters("SIZE")->asInt(); int iMethod = Parameters("METHOD")->asInt(); double dMin,dMax; double dSum; double dValue; iNX = (int) (Get_NX() / iSize); iNY = (int) (Get_NY() / iSize); CSG_Grid *pGrid = Parameters("INPUT")->asGrid(); CSG_Grid *pOutput = SG_Create_Grid(pGrid->Get_Type(), iNX, iNY, pGrid->Get_Cellsize() * iSize, pGrid->Get_XMin(), pGrid->Get_YMin()); pOutput->Set_Name(pGrid->Get_Name()); for (y = 0, y2 = 0; y2 < iNY; y+=iSize, y2++){ for (x = 0, x2 = 0; x2 < iNX; x+=iSize, x2++){ dMax = dMin = pGrid->asDouble(x,y); dSum = 0; for (i = 0; i < iSize; i++){ for (j = 0; j < iSize; j++){ dValue = pGrid->asDouble(x+i,y+j); if (dValue > dMax){ dMax = dValue; }//if if (dValue < dMin){ dMin = dValue; }//if dSum += dValue; }//for }//for switch (iMethod){ case SUM: pOutput->Set_Value(x2,y2,dSum); break; case MIN: pOutput->Set_Value(x2,y2,dMin); break; case MAX: pOutput->Set_Value(x2,y2,dMax); break; default: break; } }//for }//for DataObject_Add(pOutput); return true; } saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Aggregate.h000066400000000000000000000075021224124640700237070ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Aggregate.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Aggregate.h // // // // Copyright (C) 2003 by // // Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Aggregate_H #define HEADER_INCLUDED__Grid_Aggregate_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CGrid_Aggregate : public CSG_Module_Grid { public: CGrid_Aggregate(void); virtual ~CGrid_Aggregate(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual bool On_Execute (void); private: }; #endif // #ifndef HEADER_INCLUDED__Grid_Aggregate_Hsaga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Buffer.cpp000066400000000000000000000073321224124640700235660ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Buffer.cpp 1586 2013-01-16 09:28:07Z reklov_w $ *********************************************************/ /******************************************************************************* Grid_Buffer.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Grid_Buffer.h" #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif int BUFFER = 1; int FEATURE = 2; CGrid_Buffer::CGrid_Buffer(void){ Set_Name(_TL("Grid Buffer")); Set_Author(_TL("Copyrights (c) 2004 by Victor Olaya")); Set_Description (_TW( "The module allows to buffer features. The features must be encoded by values greater zero. " "With the buffer distance method 'cell value', the buffer distance must be encoded in the " "features grid. The output buffer grid is encoded as follows: one inside the buffer, two " "at feature locations.\n\n")); Parameters.Add_Grid(NULL, "FEATURES", _TL("Features Grid"), _TL("Grid with features to be buffered."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "BUFFER", _TL("Buffer Grid"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Byte); Parameters.Add_Value(NULL, "DIST", _TL("Distance"), _TL("Buffer distance [map units]."), PARAMETER_TYPE_Double, 1000); Parameters.Add_Choice(NULL, "BUFFERTYPE", _TL("Buffer Distance"), _TL(""), _TL("Fixed|Cell value|"), 0); }//constructor CGrid_Buffer::~CGrid_Buffer(void) {} bool CGrid_Buffer::On_Execute(void){ CSG_Grid* pFeatures = Parameters("FEATURES")->asGrid(); CSG_Grid* pGrid_Buffer = Parameters("BUFFER")->asGrid(); int iBufferType = Parameters("BUFFERTYPE")->asInt(); double dBufDist = Parameters("DIST")->asDouble() / pFeatures->Get_Cellsize(); int iBufFixedDist = (int) (dBufDist + 2.0); double dDist = 0; int iBufDist; double dValue = 0; int x2=0, y2=0; pGrid_Buffer->Assign(0.0); for(int y=0; yasDouble(x,y); if (dValue != 0 && !pFeatures->is_NoData(x,y)){ if (iBufferType==1){ dBufDist = dValue / pFeatures->Get_Cellsize(); iBufDist = (int) (dBufDist + 2.0); }//if else{ iBufDist = iBufFixedDist; }//else for (int i=-iBufDist ; iasDouble(x2,y2); if (dValue != 0 && dValue!= pFeatures->Get_NoData_Value()){ pGrid_Buffer->Set_Value(x2,y2,FEATURE); }//if else{ pGrid_Buffer->Set_Value(x2,y2,BUFFER); }//else }//if }//for }//for }//if }//for }//for return( true ); }//method saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Buffer.h000066400000000000000000000032441224124640700232310ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Buffer.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Grid_Buffer.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Buffer_H #define HEADER_INCLUDED__Grid_Buffer_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CGrid_Buffer : public CSG_Module_Grid { private: public: CGrid_Buffer(void); virtual ~CGrid_Buffer(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Buffers") ); } protected: virtual bool On_Execute(void); }; #endif // #ifndef HEADER_INCLUDED__Grid_Buffer_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Buffer_Proximity.cpp000066400000000000000000000205611224124640700256510ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Buffer_Proximity.cpp 1150 2011-08-29 12:32:40Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Buffer_Proximity.cpp // // // // Copyright (C) 2006 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: volker.wichmann@ku-eichstaett.de // // // // contact: Volker Wichmann // // Research Associate // // Chair of Physical Geography // // KU Eichsttt-Ingolstadt // // Ostenstr. 18 // // 85072 Eichsttt // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// #include "Grid_Buffer_Proximity.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// CGrid_Proximity_Buffer::CGrid_Proximity_Buffer(void){ Set_Name(_TL("Grid Proximity Buffer")); Set_Author(_TL("Copyrights (c) 2006 by Volker Wichmann")); Set_Description(_TW( "This module calculates the euclidian distance within a buffer distance from all NoData cells to the nearest " "valid neighbour in a source grid. Additionally, the source cells define the zones that will be used in the " "euclidean allocation calculations. Cell values in the source grid are treated as IDs (integer) and " "used in the allocation grid to identify the grid value of the closest source cell. If a cell is at an equal " "distance to two or more sources, the cell is assigned to the source that is first encountered in the modules scanning " "process. The buffer grid is a " "reclassification of the distance grid using a user specified equidistance to create a set of discrete distance " "buffers from source features. The buffer zones are coded with the maximum distance value of the corresponding buffer interval. " "The output value type for the distance grid is floating-point. The output values for the allocation and buffer " "grid are of type integer. The duration of module execution is dependent on the number of source cells and the buffer distance.")); Parameters.Add_Grid(NULL, "SOURCE", _TL("Source Grid"), _TL("Grid with features to be buffered [Category/NoData]"), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "DISTANCE", _TL("Distance Grid"), _TL("Grid with euclidian distance to nearest source cell [grid units]"), PARAMETER_OUTPUT, true, SG_DATATYPE_Double); Parameters.Add_Grid(NULL, "ALLOC", _TL("Allocation Grid"), _TL("Grid with category of nearest source cell [Category]"), PARAMETER_OUTPUT, true, SG_DATATYPE_Int); Parameters.Add_Grid(NULL, "BUFFER", _TL("Buffer Grid"), _TL("Reclassification of distance grid to buffer zones with a width equal to the equidistance value."), PARAMETER_OUTPUT, true, SG_DATATYPE_Int); Parameters.Add_Value(NULL, "DIST", _TL("Buffer distance"), _TL("Buffer distance (grid units)."), PARAMETER_TYPE_Double, 500.0); Parameters.Add_Value(NULL, "IVAL", _TL("Equidistance"), _TL("Reclassify buffer distance to intervals of euqidistance ..."), PARAMETER_TYPE_Int, 100); } CGrid_Proximity_Buffer::~CGrid_Proximity_Buffer(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Proximity_Buffer::On_Execute(void){ CSG_Grid *pSource, *pDistance, *pAlloc, *pBuffer; double dBufDist, dDist, cellSize; int x, y, i, j, imin, imax, jmin, jmax, iBufDist, alloc, ival; pSource = Parameters("SOURCE")->asGrid(); pDistance = Parameters("DISTANCE")->asGrid(); pAlloc = Parameters("ALLOC")->asGrid(); pBuffer = Parameters("BUFFER")->asGrid(); ival = Parameters("IVAL")->asInt(); cellSize = pSource->Get_Cellsize(); dBufDist = Parameters("DIST")->asDouble(); if (dBufDist < cellSize) { SG_UI_Msg_Add_Error(_TL("The buffer distance must be greater than or equal to the cell size!")); return (false); } dBufDist = dBufDist / cellSize; iBufDist = (int) (dBufDist + 2.0); dBufDist = pow(dBufDist, 2); pDistance->Assign_NoData(); pAlloc->Assign_NoData(); pBuffer->Assign_NoData(); for(y=0; yis_NoData(x, y) ) { alloc = pSource->asInt(x, y); pAlloc->Set_Value(x, y, alloc); pDistance->Set_Value(x, y, 0.0); imin = M_GET_MAX(0, x-iBufDist); imax = M_GET_MIN(x+iBufDist, Get_NX()); jmin = M_GET_MAX(0, y-iBufDist); jmax = M_GET_MIN(y+iBufDist, Get_NY()); for(i=imin; iis_NoData(i, j) ) { dDist= (x-i)*(x-i)+(y-j)*(y-j); if( dDist <= dBufDist && (pDistance->is_NoData(i, j) || pDistance->asDouble(i, j) > dDist) ) { pDistance->Set_Value(i, j, dDist); pAlloc->Set_Value(i, j, alloc); } } }//for }//for }//if }//for }//for for(y=0; yis_NoData(x, y) ) { dDist = sqrt(pDistance->asDouble(x, y)) * cellSize; pDistance->Set_Value(x, y, dDist); i = 0; while( i< dDist ) i += ival; pBuffer->Set_Value(x, y, i); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Buffer_Proximity.h000066400000000000000000000072571224124640700253250ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Buffer_Proximity.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Buffer_Proximity.h // // // // Copyright (C) 2006 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: volker.wichmann@ku-eichstaett.de // // // // contact: Volker Wichmann // // Research Associate // // Chair of Physical Geography // // KU Eichsttt-Ingolstadt // // Ostenstr. 18 // // 85072 Eichsttt // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Buffer_Proximity_H #define HEADER_INCLUDED__Grid_Buffer_Proximity_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class grid_tools_EXPORT CGrid_Proximity_Buffer : public CSG_Module_Grid { public: CGrid_Proximity_Buffer(void); virtual ~CGrid_Proximity_Buffer(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Buffers") ); } protected: virtual bool On_Execute (void); }; #endif // #ifndef HEADER_INCLUDED__Grid_Buffer_Proximity_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_CombineGrids.cpp000066400000000000000000000063041224124640700247200ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_CombineGrids.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CombineGrids.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Grid_CombineGrids.h" CCombineGrids::CCombineGrids(void){ CSG_Table *pLookup; CSG_Table_Record *pRecord; Parameters.Set_Name(_TL("Combine Grids")); Parameters.Set_Description(_TW( "(c) 2005 by Victor Olaya.")); Parameters.Add_Grid(NULL, "GRID1", _TL("Grid 1"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "GRID2", _TL("Grid 2"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RESULT", _TL("Result"), _TL(""), PARAMETER_OUTPUT); pLookup = Parameters.Add_FixedTable(NULL, "LOOKUP", _TL("LookUp Table"), _TL(""))->asTable(); pLookup->Add_Field(_TL("Value in Grid 1"), SG_DATATYPE_Double); pLookup->Add_Field(_TL("Value in Grid 2"), SG_DATATYPE_Double); pLookup->Add_Field(_TL("Resulting Value"), SG_DATATYPE_Double); pRecord = pLookup->Add_Record(); pRecord->Set_Value(0, 0.0); pRecord->Set_Value(1, 0.0); pRecord->Set_Value(2, 0.0); }//constructor CCombineGrids::~CCombineGrids(void) {} bool CCombineGrids::On_Execute(void){ int x,y; int i; int iCellValue1, iCellValue2; int iTableValue1, iTableValue2; int iResultValue; CSG_Grid *pGrid1 = Parameters("GRID1")->asGrid(); CSG_Grid *pGrid2 = Parameters("GRID2")->asGrid(); CSG_Grid *pResult = Parameters("RESULT")->asGrid(); ; CSG_Table *pLookup; CSG_Table_Record *pRecord; pLookup = Parameters("LOOKUP")->asTable(); for(y=0; yasInt(x,y); iCellValue2 = pGrid2->asInt(x,y); for (i = 0; i < pLookup->Get_Record_Count(); i++){ pRecord = pLookup->Get_Record(i); iTableValue1 = pRecord->asInt(0); iTableValue2 = pRecord->asInt(1); if (iTableValue1 == iCellValue1){ if (iTableValue2 == iCellValue2){ iResultValue = pRecord->asInt(2); pResult->Set_Value(x,y,iResultValue); break; }//if }//if }//for if (i >= pLookup->Get_Record_Count()){ pResult->Set_NoData(x,y); }//if }//for }//for return true; }//method saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_CombineGrids.h000066400000000000000000000025531224124640700243670ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_CombineGrids.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CombineGrids.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CCombineGrids : public CSG_Module_Grid { private: public: CCombineGrids(void); virtual ~CCombineGrids(void); protected: virtual bool On_Execute(void); };saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Completion.cpp000066400000000000000000000141521224124640700244640ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Completion.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Tutorial // // // //-------------------------------------------------------// // // // Grid_Completion.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Completion.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Completion::CGrid_Completion(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Patching")); Set_Author (SG_T("(c) 2003 by O.Conrad")); Set_Description (_TW( "Fill gaps of a grid with data from another grid. " )); //----------------------------------------------------- // 2. Standard in- and output... Parameters.Add_Grid( NULL , "ORIGINAL" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "ADDITIONAL" , _TL("Patch Grid"), _TL(""), PARAMETER_INPUT, false ); Parameters.Add_Grid( NULL , "COMPLETED" , _TL("Completed Grid"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "INTERPOLATION" , _TL("Interpolation Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 4 ); } //--------------------------------------------------------- CGrid_Completion::~CGrid_Completion(void) {} /////////////////////////////////////////////////////////// // // // Run // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Completion::On_Execute(void) { int x, y; double xPos, yPos, Value; TSG_Grid_Interpolation Interpolation; CSG_Grid *pGrid, *pAdditional; pAdditional = Parameters("ADDITIONAL") ->asGrid(); pGrid = Parameters("COMPLETED") ->asGrid(); if( pGrid->is_Intersecting(pAdditional->Get_Extent()) ) { if( pGrid != Parameters("ORIGINAL")->asGrid() ) { Process_Set_Text(_TL("Copying original data...")); pGrid->Assign(Parameters("ORIGINAL")->asGrid()); } Interpolation = (TSG_Grid_Interpolation)Parameters("INTERPOLATION")->asInt(); Process_Set_Text(_TL("Data completion...")); for(y=0, yPos=Get_YMin(); y= pAdditional->Get_YMin() ) { for(x=0, xPos=Get_XMin(); xGet_XMax(); x++, xPos+=Get_Cellsize()) { if( pGrid->is_NoData(x, y) && xPos >= pAdditional->Get_XMin() ) { if( !pAdditional->is_NoData_Value(Value = pAdditional->Get_Value(xPos, yPos, Interpolation)) ) { pGrid->Set_Value(x, y, Value); } } } } } return( true ); } Error_Set(_TL("Nothing to do: there is no intersection with additonal grid.")); return( false ); } saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Completion.h000066400000000000000000000104021224124640700241230ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Completion.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Tutorial // // // //-------------------------------------------------------// // // // Grid_Completion.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Completion_H #define HEADER_INCLUDED__Grid_Completion_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Completion : public CSG_Module_Grid { public: CGrid_Completion(void); virtual ~CGrid_Completion(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Completion_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_ConstantGrid.cpp000066400000000000000000000130271224124640700247520ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_ConstantGrid.cpp 1688 2013-05-14 11:40:29Z oconrad $ *********************************************************/ /******************************************************************************* ConstantGrid.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_ConstantGrid.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CConstantGrid::CConstantGrid(void) { Set_Name (_TL("Constant Grid")); Set_Author (SG_T("Victor Olaya (c) 2004")); Set_Description (_TW( "Constant grid creation." )); //----------------------------------------------------- Parameters.Add_String( NULL , "NAME" , _TL("Name"), _TL(""), _TL("Constant Grid") ); Parameters.Add_Value( NULL , "CONST" , _TL("Constant Value"), _TL(""), PARAMETER_TYPE_Double, 1 ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TYPE" , _TL("Data Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|"), SG_Data_Type_Get_Name(SG_DATATYPE_Bit ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Byte ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Char ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Word ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Short ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_ULong ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Long ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Float ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Double).c_str() ), 7 ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TARGET" , _TL("Target Grid"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("user defined"), _TL("grid") ), 0 ); m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid") , _TL(""))); m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid") , _TL(""))); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CConstantGrid::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CConstantGrid::On_Execute(void) { //----------------------------------------------------- TSG_Data_Type Type = SG_DATATYPE_Float; switch( Parameters("TYPE")->asInt() ) { case 0: Type = SG_DATATYPE_Bit ; break; case 1: Type = SG_DATATYPE_Byte ; break; case 2: Type = SG_DATATYPE_Char ; break; case 3: Type = SG_DATATYPE_Word ; break; case 4: Type = SG_DATATYPE_Short ; break; case 5: Type = SG_DATATYPE_ULong ; break; case 6: Type = SG_DATATYPE_Long ; break; case 7: Type = SG_DATATYPE_Float ; break; case 8: Type = SG_DATATYPE_Double; break; } //----------------------------------------------------- CSG_Grid *pGrid = NULL; switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... if( m_Grid_Target.Init_User(0.0, 0.0, 1.0, 101, 101) && Dlg_Parameters("USER") ) { pGrid = m_Grid_Target.Get_User(Type); } break; case 1: // grid... if( Dlg_Parameters("GRID") ) { pGrid = m_Grid_Target.Get_Grid(Type); } break; } if( pGrid == NULL ) { return( false ); } //----------------------------------------------------- pGrid->Set_Name(Parameters("NAME" )->asString()); pGrid->Assign (Parameters("CONST")->asDouble()); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_ConstantGrid.h000066400000000000000000000043251224124640700244200ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_ConstantGrid.h 1688 2013-05-14 11:40:29Z oconrad $ *********************************************************/ /******************************************************************************* Grid_ConstantGrid.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CConstantGrid : public CSG_Module { public: CConstantGrid(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: CSG_Parameters_Grid_Target m_Grid_Target; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_CropToData.cpp000066400000000000000000000117071224124640700243560ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_CropToData.cpp 1149 2011-08-29 12:26:13Z oconrad $ *********************************************************/ /******************************************************************************* CropToData.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_CropToData.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CCropToData::CCropToData(void) { Set_Name (_TL("Crop to Data")); Set_Author (SG_T("V.Olaya (c) 2004")); Set_Description (_TW( "Crop grids to valid data cells" )); Parameters.Add_Grid_List( NULL , "INPUT" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "OUTPUT" , _TL("Cropped Grids"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CCropToData::On_Execute(void) { CSG_Parameter_Grid_List *pGrids = Parameters("INPUT")->asGridList(); //----------------------------------------------------- if( pGrids->Get_Count() <= 0 ) { Error_Set(_TL("no grids in selection")); return( false ); } //----------------------------------------------------- bool bCrop = false; int xMin, yMin, xMax, yMax; //----------------------------------------------------- for(int y=0; yGet_Count() && !bData; i++) { if( !pGrids->asGrid(i)->is_NoData(x, y) ) { bData = true; } } if( bData ) { if( bCrop == false ) { bCrop = true; xMin = xMax = x; yMin = yMax = y; } else { if( xMin > x ) { xMin = x; } else if( xMax < x ) { xMax = x; } if( yMin > y ) { yMin = y; } else if( yMax < y ) { yMax = y; } } } } } //----------------------------------------------------- if( bCrop == false ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("nothing to crop"), _TL("no valid data found in grid(s)"))); } else if( (1 + xMax - xMin) == Get_NX() && (1 + yMax - yMin) == Get_NY() ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("nothing to crop"), _TL("valid data cells match original grid extent"))); } else { CSG_Parameter_Grid_List *pCropped = Parameters("OUTPUT")->asGridList(); pCropped->Del_Items(); for(int i=0; iGet_Count(); i++) { CSG_Grid *pGrid = SG_Create_Grid( pGrids->asGrid(i)->Get_Type(), 1 + xMax - xMin, 1 + yMax - yMin, Get_Cellsize(), Get_XMin() + xMin * Get_Cellsize(), Get_YMin() + yMin * Get_Cellsize() ); pGrid->Assign(pGrids->asGrid(i), GRID_INTERPOLATION_NearestNeighbour); pGrid->Set_Name(pGrids->asGrid(i)->Get_Name()); pCropped->Add_Item(pGrid); } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_CropToData.h000066400000000000000000000046171224124640700240250ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_CropToData.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* CropToData.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CCropToData : public CSG_Module_Grid { public: CCropToData(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Cut.cpp000066400000000000000000000253751224124640700231170ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Cut.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Cut.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "Grid_Cut.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Cut::CGrid_Cut(void) { //----------------------------------------------------- Set_Name (_TL("Cutting")); Set_Author (SG_T("(c) 2003 by O.Conrad")); Set_Description (_TW( "Create a new grid from interactively selected cut of an input grid.\n" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_Output( NULL , "CUT" , _TL("Cut"), _TL("") ); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Additional Grids"), _TL(""), PARAMETER_INPUT_OPTIONAL, false ); Parameters.Add_Grid_List( NULL , "CUTS" , _TL("Additional Cuts"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, false ); //----------------------------------------------------- CSG_Parameters *pParameters = Add_Parameters("CUT", _TL("Cut"), _TL("")); pParameters->Add_Value( NULL, "XMIN" , _TL("Left") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "XMAX" , _TL("Right") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "YMIN" , _TL("Bottom") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "YMAX" , _TL("Top") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "NX" , _TL("Columns") , _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); pParameters->Add_Value( NULL, "NY" , _TL("Rows") , _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); } //--------------------------------------------------------- CGrid_Cut::~CGrid_Cut(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGrid_Cut::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { int nx, ny; double xMin, xMax, yMin, yMax, d; if( m_pGrid && !SG_STR_CMP(pParameters->Get_Identifier(), SG_T("CUT")) ) { xMin = pParameters->Get_Parameter("XMIN")->asDouble(); xMax = pParameters->Get_Parameter("XMAX")->asDouble(); yMin = pParameters->Get_Parameter("YMIN")->asDouble(); yMax = pParameters->Get_Parameter("YMAX")->asDouble(); nx = pParameters->Get_Parameter("NX") ->asInt(); ny = pParameters->Get_Parameter("NY") ->asInt(); if( xMin > xMax ) { d = xMin; xMin = xMax; xMax = d; } if( yMin > yMax ) { d = yMin; yMin = yMax; yMax = d; } d = m_pGrid->Get_Cellsize(); if ( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("NX")) ) { xMax = xMin + nx * d; } else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("XMIN")) ) { nx = 1 + (int)((xMax - xMin) / d); xMin = xMax - nx * d; } else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("XMAX")) ) { nx = 1 + (int)((xMax - xMin) / d); xMax = xMin + nx * d; } else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("NY")) ) { yMax = yMin + ny * d; } else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("YMIN")) ) { ny = 1 + (int)((yMax - yMin) / d); yMin = yMax - ny * d; } else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("YMAX")) ) { ny = 1 + (int)((yMax - yMin) / d); yMax = yMin + ny * d; } pParameters->Get_Parameter("XMIN") ->Set_Value(xMin); pParameters->Get_Parameter("XMAX") ->Set_Value(xMax); pParameters->Get_Parameter("YMIN") ->Set_Value(yMin); pParameters->Get_Parameter("YMAX") ->Set_Value(yMax); pParameters->Get_Parameter("NX") ->Set_Value(nx); pParameters->Get_Parameter("NY") ->Set_Value(ny); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Cut::On_Execute(void) { m_bDown = false; m_pGrid = Parameters("GRID") ->asGrid(); m_pGrids = Parameters("GRIDS") ->asGridList(); Parameters("CUTS")->asGridList()->Del_Items(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Cut::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode) { CSG_Rect r; CSG_Grid_System System; CSG_Grid *pCut; CSG_Parameters *pParameters; switch( Mode ) { //----------------------------------------------------- case MODULE_INTERACTIVE_LDOWN: if( m_bDown == false ) { m_bDown = true; m_ptDown = Fit_to_Grid(ptWorld); } return( true ); //----------------------------------------------------- case MODULE_INTERACTIVE_LUP: if( m_bDown == true ) { m_bDown = false; ptWorld = Fit_to_Grid(ptWorld); r.Assign(m_ptDown.Get_X(), m_ptDown.Get_Y(), ptWorld.Get_X(), ptWorld.Get_Y()); pParameters = Get_Parameters("CUT"); pParameters->Get_Parameter("XMIN") ->Set_Value(r.Get_XMin()); pParameters->Get_Parameter("XMAX") ->Set_Value(r.Get_XMax()); pParameters->Get_Parameter("YMIN") ->Set_Value(r.Get_YMin()); pParameters->Get_Parameter("YMAX") ->Set_Value(r.Get_YMax()); pParameters->Get_Parameter("NX") ->Set_Value(1 + (int)(r.Get_XRange() / m_pGrid->Get_Cellsize())); pParameters->Get_Parameter("NY") ->Set_Value(1 + (int)(r.Get_YRange() / m_pGrid->Get_Cellsize())); if( Dlg_Parameters("CUT") ) { r.Assign( pParameters->Get_Parameter("XMIN")->asDouble(), pParameters->Get_Parameter("YMIN")->asDouble(), pParameters->Get_Parameter("XMAX")->asDouble(), pParameters->Get_Parameter("YMAX")->asDouble() ); if( r.Intersect(m_pGrid->Get_Extent()) && System.Assign(m_pGrid->Get_Cellsize(), r) ) { pCut = SG_Create_Grid(System, m_pGrid->Get_Type()); pCut->Assign(m_pGrid, GRID_INTERPOLATION_NearestNeighbour); pCut->Set_Name(m_pGrid->Get_Name()); Parameters("CUT")->Set_Value(pCut); for(int i=0; iGet_Count(); i++) { if( r.Intersect(m_pGrids->asGrid(i)->Get_Extent()) ) { pCut = SG_Create_Grid(System, m_pGrids->asGrid(i)->Get_Type()); pCut->Assign(m_pGrids->asGrid(i), GRID_INTERPOLATION_NearestNeighbour); pCut->Set_Name(m_pGrids->asGrid(i)->Get_Name()); Parameters("CUTS")->asGridList()->Add_Item(pCut); DataObject_Add(pCut); } } } } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- TSG_Point CGrid_Cut::Fit_to_Grid(TSG_Point pt) { pt.x = m_pGrid->Get_XMin() + m_pGrid->Get_Cellsize() * (int)(0.5 + (pt.x - m_pGrid->Get_XMin()) / m_pGrid->Get_Cellsize()); pt.y = m_pGrid->Get_YMin() + m_pGrid->Get_Cellsize() * (int)(0.5 + (pt.y - m_pGrid->Get_YMin()) / m_pGrid->Get_Cellsize()); return( pt ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Cut.h000066400000000000000000000113471224124640700225560ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Cut.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Cut.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Cut_H #define HEADER_INCLUDED__Grid_Cut_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Cut : public CSG_Module_Interactive { public: CGrid_Cut(void); virtual ~CGrid_Cut(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); virtual bool On_Execute_Position (CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode); private: bool m_bDown; CSG_Point m_ptDown; CSG_Grid *m_pGrid; CSG_Parameter_Grid_List *m_pGrids; TSG_Point Fit_to_Grid (TSG_Point pt); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Cut_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Fill.cpp000066400000000000000000000222241224124640700232400ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Fill.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Fill.cpp // // // // Copyright (C) 2005 by // // Andre Ringeler // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Fill.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Fill::CGrid_Fill(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Change Grid Values - Flood Fill")); Set_Author (SG_T("(c) 2005 by A.Ringeler, (c) 2006 by O.Conrad")); Set_Description (_TW( "Interactively use the flood fill method to replace a grid's cell values. " "If the target is not set, the changes will be stored to the original grid. ") ); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL , "GRID_IN" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "GRID_OUT" , _TL("Changed Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Value( NULL , "FILL" , _TL("Fill Value"), _TL(""), PARAMETER_TYPE_Double, 1 ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Value to be replaced"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("value at mouse position"), _TL("fixed value"), _TL("tolerance as absolute values") ), 0 ); Parameters.Add_Value( NULL , "ZFIXED" , _TL("Fixed value to be replaced"), _TL(""), PARAMETER_TYPE_Double, 0.0 ); Parameters.Add_Value( NULL , "DZMAX" , _TL("Upper Tolerance"), _TL(""), PARAMETER_TYPE_Double, 1.0 ); Parameters.Add_Value( NULL , "DZMIN" , _TL("Lower Tolerance"), _TL(""), PARAMETER_TYPE_Double, -1.0 ); Parameters.Add_Value( NULL , "NODATA" , _TL("Fill NoData"), _TL(""), PARAMETER_TYPE_Bool, false ); } //--------------------------------------------------------- CGrid_Fill::~CGrid_Fill(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Fill::On_Execute(void) { if( Parameters("GRID_OUT")->asGrid() == NULL || Parameters("GRID_IN")->asGrid() == Parameters("GRID_OUT")->asGrid() ) { m_pGrid = Parameters("GRID_IN") ->asGrid(); } else { m_pGrid = Parameters("GRID_OUT")->asGrid(); m_pGrid->Assign(Parameters("GRID_IN")->asGrid()); } m_Method = Parameters("METHOD") ->asInt(); m_zFill = Parameters("FILL") ->asDouble(); m_zFixed = Parameters("ZFIXED") ->asDouble(); m_zTolerance_Min = Parameters("DZMIN") ->asDouble(); m_zTolerance_Max = Parameters("DZMAX") ->asDouble(); m_bNoData = Parameters("NODATA") ->asBool(); if( m_zTolerance_Min > m_zTolerance_Max ) { double z = m_zTolerance_Min; m_zTolerance_Min = m_zTolerance_Min; m_zTolerance_Max = z; } if (m_bNoData == true) m_bNoData = false; else m_bNoData = true; return( true ); } //--------------------------------------------------------- bool CGrid_Fill::On_Execute_Finish(void) { m_Stack.Clear(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void CGrid_Fill::Push(int x, int y) { if( m_iStack >= m_Stack.Get_Count() ) { m_Stack.Set_Count(m_Stack.Get_Count() + 1000); } m_Stack[m_iStack].x = x; m_Stack[m_iStack].y = y; m_iStack++; } //--------------------------------------------------------- inline void CGrid_Fill::Pop(int &x, int &y) { m_iStack--; x = m_Stack[m_iStack].x; y = m_Stack[m_iStack].y; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Fill::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode) { //----------------------------------------------------- if( Mode == MODULE_INTERACTIVE_LDOWN ) { int x, y, i, ix, iy, nReplaced; double z, zMin, zMax; x = Get_System()->Get_xWorld_to_Grid(ptWorld.Get_X()); y = Get_System()->Get_yWorld_to_Grid(ptWorld.Get_Y()); if( m_pGrid && m_pGrid->is_InGrid(x, y, m_bNoData) ) { Message_Add(_TL("Starting flood fill...")); switch( m_Method ) { case 0: z = m_pGrid->asDouble(x, y); break; // value at mouse position case 1: z = m_zFixed; break; // fixed value case 2: z = 0.0; break; // tolerance as absolute values } zMin = z + m_zTolerance_Min; zMax = z + m_zTolerance_Max; m_iStack = 0; nReplaced = 1; Push(x, y); //--------------------------------------------- while( m_iStack > 0 && Set_Progress(nReplaced, m_pGrid->Get_NCells()) ) { Pop(x, y); for(i=0; i<8; i+=2) { ix = Get_xTo(i, x); iy = Get_yTo(i, y); if( m_pGrid->is_InGrid(ix, iy, m_bNoData) ) { z = m_pGrid->asDouble(ix, iy); if( z != m_zFill && z >= zMin && z <= zMax ) { Push(ix, iy); m_pGrid->Set_Value(ix, iy, m_zFill); nReplaced++; } } } } //--------------------------------------------- Message_Add(_TL("ready"), false); Message_Add(CSG_String::Format(SG_T("%d %s"), nReplaced, _TL("replacements"))); DataObject_Update(m_pGrid, m_pGrid->Get_ZMin(), m_pGrid->Get_ZMax()); return( true ); } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Fill.h000066400000000000000000000116601224124640700227070ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Fill.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Fill.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Fill_H #define HEADER_INCLUDED__Grid_Fill_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Fill : public CSG_Module_Grid_Interactive { public: CGrid_Fill(void); virtual ~CGrid_Fill(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Values") ); } protected: virtual bool On_Execute (void); virtual bool On_Execute_Finish (void); virtual bool On_Execute_Position (CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode); private: int m_iStack, m_Method; double m_zFill, m_zFixed, m_zTolerance_Min, m_zTolerance_Max; bool m_bNoData; CSG_Grid *m_pGrid; CSG_Points_Int m_Stack; void Push (int x, int y); void Pop (int &x, int &y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Fill_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Gaps.cpp000066400000000000000000000240761224124640700232530ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Gaps.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Gaps.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Gaps.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define IS_MASKED(x, y) (pMask ? pMask->is_NoData(x, y) : false) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Gaps::CGrid_Gaps(void) { //----------------------------------------------------- Set_Name(_TL("Close Gaps")); Set_Author (SG_T("(c) 2002 by O.Conrad")); Set_Description (_TW( "Close gaps of a grid data set (i.e. eliminate no data values). " "If the target is not set, the changes will be stored to the original grid. ") ); //----------------------------------------------------- Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "MASK" , _TL("Mask"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Changed Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); //----------------------------------------------------- Parameters.Add_Value( NULL, "THRESHOLD" , _TL("Tension Threshold"), _TL(""), PARAMETER_TYPE_Double, 0.1 ); } //--------------------------------------------------------- CGrid_Gaps::~CGrid_Gaps(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Gaps::On_Execute(void) { bool bKillInput; //----------------------------------------------------- pInput = Parameters("INPUT") ->asGrid(); pMask = Parameters("MASK") ->asGrid(); if( Parameters("RESULT")->asGrid() == NULL || Parameters("RESULT")->asGrid() == pInput ) { pResult = pInput; Parameters("RESULT")->Set_Value(pResult); pInput = SG_Create_Grid(pInput); pInput->Assign(pResult); bKillInput = true; } else { pResult = Parameters("RESULT")->asGrid(); pResult->Get_History().Assign(pInput->Get_History()); bKillInput = false; } //----------------------------------------------------- Tension_Main(); //----------------------------------------------------- if( bKillInput ) { delete(pInput); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_Gaps::Tension_Main(void) { int iStep, iStart, n; double max, Threshold; Threshold = Parameters("THRESHOLD")->asDouble(); n = Get_NX() > Get_NY() ? Get_NX() : Get_NY(); iStep = 0; do { iStep++; } while( pow(2.0, iStep + 1) < n ); iStart = (int)pow(2.0, iStep); pTension_Keep = new CSG_Grid(pResult, SG_DATATYPE_Byte); pTension_Temp = new CSG_Grid(pResult); pResult->Assign_NoData(); for(iStep=iStart; iStep>=1; iStep/=2) { Tension_Init(iStep); do { max = Tension_Step(iStep); Process_Set_Text(CSG_String::Format(SG_T("[%d] %s: %f"), iStep, _TL("max. change"), max)); } while( max > Threshold && Process_Get_Okay(true) ); DataObject_Update(pResult, pInput->Get_ZMin(), pInput->Get_ZMax(), true); } delete(pTension_Keep); delete(pTension_Temp); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_Gaps::Tension_Init(int iStep) { int x, y, i, ix, iy, nx, ny, nz; double z; //----------------------------------------------------- // 1. Channels... pTension_Temp->Assign_NoData(); pTension_Keep->Assign(); for(y=0; yis_NoData(x, y) || IS_MASKED(x, y) ) { pTension_Temp->Set_Value(x, y, pInput->asDouble(x, y) ); pTension_Keep->Set_Value(x, y, 1.0); } else { nx = x + iStep < Get_NX() ? x + iStep : Get_NX(); nz = 0; z = 0.0; for(iy=y; iyis_InGrid(ix, iy) ) { z += pInput->asDouble(ix, iy); nz++; } } } if( nz > 0 ) { pTension_Temp->Set_Value(x, y, z / (double)nz ); pTension_Keep->Set_Value(x, y, 1.0); } } } } //----------------------------------------------------- // 2. Previous Iteration... for(y=0; yasByte(x, y) == false ) { if( !pResult->is_NoData(x, y) ) { pTension_Temp->Set_Value(x, y, pResult->asDouble(x, y)); } else { nz = 0; z = 0.0; for(i=0; i<8; i++) { ix = x + iStep * Get_System()->Get_xTo(i); iy = y + iStep * Get_System()->Get_yTo(i); if( pResult->is_InGrid(ix, iy) ) { z += pResult->asDouble(ix, iy); nz++; } } if( nz > 0.0 ) { pTension_Temp->Set_Value(x, y, z / (double)nz); } else { pTension_Temp->Set_Value(x, y, pInput->asDouble(x, y)); } } } } } //----------------------------------------------------- // 3. ... pResult->Assign(pTension_Temp); } //--------------------------------------------------------- double CGrid_Gaps::Tension_Step(int iStep) { int x, y; double d, dMax; dMax = 0.0; for(y=0; yasByte(x, y) == false ) { d = Tension_Change(x, y, iStep); pTension_Temp->Set_Value(x, y, d); d = fabs(d - pResult->asDouble(x, y)); if( d > dMax ) { dMax = d; } } } } for(y=0; yasByte(x, y) == false ) { pResult->Set_Value(x, y, pTension_Temp->asDouble(x, y)); } } } return( dMax ); } //--------------------------------------------------------- double CGrid_Gaps::Tension_Change(int x, int y, int iStep) { int i, ix, iy; double n, d, dz; for(i=0, d=0.0, n=0.0; i<8; i++) { ix = x + iStep * Get_System()->Get_xTo(i); iy = y + iStep * Get_System()->Get_yTo(i); if( pResult->is_InGrid(ix, iy) ) { dz = 1.0 / Get_System()->Get_UnitLength(i); d += dz * pResult->asDouble(ix, iy); n += dz; } } if( n > 0.0 ) { d /= n; return( d ); } return( pResult->asDouble(x, y) ); } saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Gaps.h000066400000000000000000000104121224124640700227050ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Gaps.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Gaps.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Gaps_H #define HEADER_INCLUDED__Grid_Gaps_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class grid_tools_EXPORT CGrid_Gaps : public CSG_Module_Grid { public: CGrid_Gaps(void); virtual ~CGrid_Gaps(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual bool On_Execute (void); private: CSG_Grid *pInput, *pMask, *pResult, *pTension_Keep, *pTension_Temp; void Tension_Main (void); double Tension_Step (int iStep); double Tension_Change (int x, int y, int iStep); void Tension_Init (int iStep); }; #endif // #ifndef HEADER_INCLUDED__Grid_Gaps_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Gaps_OneCell.cpp000066400000000000000000000123411224124640700246440ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Gaps_OneCell.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Gaps_OneCell.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Gaps_OneCell.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Gaps_OneCell::CGrid_Gaps_OneCell(void) { Set_Name(_TL("Close One Cell Gaps")); Set_Author (SG_T("(c) 2001 by O.Conrad")); Set_Description (_TW( "Closes one cell gaps using the mean value of the surrounding cell values. " "If the target is not set, the changes will be stored to the original grid. ") ); Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Changed Grid"), _TL(""), PARAMETER_OUTPUT ); } //--------------------------------------------------------- CGrid_Gaps_OneCell::~CGrid_Gaps_OneCell(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Gaps_OneCell::On_Execute(void) { bool bCloseGap; int x, y, i, ix, iy; double Sum; CSG_Grid *pInput, *pResult; pInput = Parameters("INPUT")->asGrid(); pResult = Parameters("RESULT")->asGrid(); for(y=0; yis_NoData(x, y) ) { for(i=0, bCloseGap=true, Sum=0.0; i<8 && bCloseGap; i++) { Get_System()->Get_Neighbor_Pos(i, x, y, ix, iy); if( !pInput->is_InGrid(ix, iy) ) { bCloseGap = false; } else { Sum += pInput->asDouble(ix, iy); } } if( bCloseGap ) { pResult->Set_Value(x, y, Sum / 8.0); } else { pResult->Set_NoData(x, y); } } else { pResult->Set_Value(x, y, pInput->asDouble(x, y)); } } } return( true ); } saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Gaps_OneCell.h000066400000000000000000000077051224124640700243210ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Gaps_OneCell.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Gaps_OneCell.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Gaps_OneCell_H #define HEADER_INCLUDED__Grid_Gaps_OneCell_H //--------------------------------------------------------- //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CGrid_Gaps_OneCell : public CSG_Module_Grid { public: CGrid_Gaps_OneCell(void); virtual ~CGrid_Gaps_OneCell(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual bool On_Execute (void); }; #endif // #ifndef HEADER_INCLUDED__Grid_Gaps_OneCell_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Gaps_Resampling.cpp000066400000000000000000000241371224124640700254320ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Gaps_Resampling.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Gaps_Resampling.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Gaps_Resampling.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Gaps_Resampling::CGrid_Gaps_Resampling(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Close Gaps with Stepwise Resampling")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "Close gaps of a grid data set (i.e. eliminate no data values). " "If the target is not set, the changes will be stored to the original grid. " )); //----------------------------------------------------- Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "MASK" , _TL("Mask"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "INTERPOLATION" , _TL("Interpolation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 4 ); Parameters.Add_Value( NULL , "GROW" , _TL("Grow Factor"), _TL(""), PARAMETER_TYPE_Double, 2.0, 1.0, true ); Parameters.Add_Value( NULL , "PYRAMIDS" , _TL("Use Pyramids"), _TL(""), PARAMETER_TYPE_Bool, false ); pNode = Parameters.Add_Choice( NULL , "START" , _TL("Start Size"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("grid cell size"), _TL("user defined size") ), 0 ); Parameters.Add_Value( pNode , "START_SIZE" , _TL("User Defined Size"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGrid_Gaps_Resampling::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PYRAMIDS")) ) { pParameters->Get_Parameter("START")->Set_Enabled(!pParameter->asBool()); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("START")) ) { pParameters->Get_Parameter("START_SIZE")->Set_Enabled(pParameter->asInt() == 1); } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Gaps_Resampling::On_Execute(void) { //----------------------------------------------------- CSG_Grid *pGrid = Parameters("RESULT")->asGrid(); CSG_Grid *pMask = Parameters("MASK" )->asGrid(); if( pGrid == NULL ) { pGrid = Parameters("INPUT")->asGrid(); } else { pGrid->Assign(Parameters("INPUT")->asGrid()); pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("INPUT")->asGrid()->Get_Name(), _TL("no gaps"))); } TSG_Grid_Interpolation Interpolation = (TSG_Grid_Interpolation)Parameters("INTERPOLATION")->asInt(); double Grow = Parameters("GROW")->asDouble(); //----------------------------------------------------- if( !Parameters("PYRAMIDS")->asBool() ) { int nCells, nCells_0; double Size, maxSize; nCells_0 = pGrid->Get_NoData_Count(); Size = Parameters("START")->asInt() == 1 ? Parameters("START_SIZE")->asDouble() : Grow * Get_Cellsize(); maxSize = Get_System()->Get_XRange() > Get_System()->Get_YRange() ? Get_System()->Get_XRange() : Get_System()->Get_YRange(); //------------------------------------------------- for(nCells=nCells_0; nCells>0 && Size<=maxSize && Set_Progress(nCells_0-nCells, nCells_0); Size*=Grow) { Process_Set_Text(CSG_String::Format(SG_T("%s: %d; %s: %f"), _TL("no-data cells"), nCells, _TL("patch size"), Size)); CSG_Grid Patch(CSG_Grid_System(Size, Get_System()->Get_Extent())); SG_UI_Progress_Lock(true); Patch.Assign(pGrid, GRID_INTERPOLATION_BSpline); SG_UI_Progress_Lock(false); nCells = 0; #pragma omp parallel for for(int y=0; yis_NoData(x, y) && (!pMask || !pMask->is_NoData(x, y)) ) { double px = Get_XMin() + x * Get_Cellsize(); if( Patch.is_InGrid_byPos(px, py) ) { pGrid->Set_Value(x, y, Patch.Get_Value(px, py, Interpolation)); } else { nCells++; } } } } } } //----------------------------------------------------- else // if( Parameters("PYRAMIDS")->asBool() == true ) { CSG_Grid_Pyramid Pyramid; if( !Pyramid.Create(pGrid, Grow) ) { return( false ); } //------------------------------------------------- for(int y=0; yis_NoData(x, y) && (!pMask || !pMask->is_NoData(x, y)) ) { double px = Get_XMin() + x * Get_Cellsize(); for(int i=0; iis_InGrid_byPos(px, py) ) { pGrid->Set_Value(x, y, pPatch->Get_Value(px, py, Interpolation)); break; } } } } } } //----------------------------------------------------- if( pGrid == Parameters("INPUT")->asGrid() ) { DataObject_Update(pGrid); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// /*/--------------------------------------------------------- bool CGrid_Gaps_Resampling::On_Execute(void) { //----------------------------------------------------- CSG_Grid *pGrid = Parameters("RESULT")->asGrid(); CSG_Grid *pMask = Parameters("MASK" )->asGrid(); if( pGrid == NULL ) { pGrid = Parameters("INPUT")->asGrid(); } else { pGrid->Assign(Parameters("INPUT")->asGrid()); pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("INPUT")->asGrid()->Get_Name(), _TL("no gaps"))); } //----------------------------------------------------- TSG_Grid_Interpolation Interpolation = (TSG_Grid_Interpolation)Parameters("INTERPOLATION")->asInt(); //----------------------------------------------------- if( pGrid == Parameters("INPUT")->asGrid() ) { DataObject_Update(pGrid); } return( true ); }/**/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Gaps_Resampling.h000066400000000000000000000104211224124640700250660ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Gaps_Resampling.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Gaps_Resampling.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Gaps_Resampling_H #define HEADER_INCLUDED__Grid_Gaps_Resampling_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Gaps_Resampling : public CSG_Module_Grid { public: CGrid_Gaps_Resampling(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Gaps_Resampling_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.cpp000066400000000000000000000272201224124640700255250ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Gaps_Spline_Fill.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Gaps_Spline_Fill.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Gaps_Spline_Fill.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Gaps_Spline_Fill::CGrid_Gaps_Spline_Fill(void) { Set_Name (_TL("Close Gaps with Spline")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "" )); Parameters.Add_Grid( NULL, "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "MASK" , _TL("Mask"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Value( NULL, "MAXGAPCELLS" , _TL("Only Process Gaps with Less Cells"), _TL("is ignored if set to zero"), PARAMETER_TYPE_Int , 0, 0, true ); Parameters.Add_Grid( NULL, "CLOSED" , _TL("Closed Gaps Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Value( NULL, "MAXPOINTS" , _TL("Maximum Points"), _TL(""), PARAMETER_TYPE_Int , 1000, 2, true ); Parameters.Add_Value( NULL, "LOCALPOINTS" , _TL("Number of Points for Local Interpolation"), _TL(""), PARAMETER_TYPE_Int , 20, 2, true ); Parameters.Add_Value( NULL, "EXTENDED" , _TL("Extended Neighourhood"), _TL(""), PARAMETER_TYPE_Bool , false ); Parameters.Add_Choice( NULL, "NEIGHBOURS" , _TL("Neighbourhood"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Neumann"), _TL("Moore") ), 0 ); Parameters.Add_Value( NULL, "RADIUS" , _TL("Radius (Cells)"), _TL(""), PARAMETER_TYPE_Int , 0.0, 0.0, true ); Parameters.Add_Value( NULL, "RELAXATION" , _TL("Relaxation"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Gaps_Spline_Fill::On_Execute(void) { //----------------------------------------------------- m_pGrid = Parameters("CLOSED") ->asGrid(); m_pMask = Parameters("MASK") ->asGrid(); m_nGapCells_Max = Parameters("MAXGAPCELLS") ->asInt(); m_nPoints_Max = Parameters("MAXPOINTS") ->asInt(); m_nPoints_Local = Parameters("LOCALPOINTS") ->asInt(); m_bExtended = Parameters("EXTENDED") ->asBool(); m_Neighbours = Parameters("NEIGHBOURS") ->asInt() == 0 ? 2 : 1; m_Radius = Parameters("RADIUS") ->asDouble(); m_Relaxation = Parameters("RELAXATION") ->asDouble(); if( m_pGrid == NULL ) { m_pGrid = Parameters("GRID")->asGrid(); Parameters("CLOSED")->Set_Value(m_pGrid); } else if( m_pGrid != Parameters("GRID")->asGrid() ) { m_pGrid->Assign(Parameters("GRID")->asGrid()); m_pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("GRID")->asGrid()->Get_Name(), _TL("no gaps"))); } if( m_nGapCells_Max == 0 ) { m_nGapCells_Max = Get_NCells(); } if( m_nPoints_Local > m_nPoints_Max ) { m_nPoints_Local = m_nPoints_Max; } //----------------------------------------------------- m_Gaps.Create(*Get_System(), SG_DATATYPE_Int); m_Gaps.Assign(0.0); m_nGaps = 0; for(int y=0; yis_NoData(x, y)) && m_pGrid->is_NoData(x, y) ); } //--------------------------------------------------------- inline void CGrid_Gaps_Spline_Fill::Push(int x, int y) { if( m_iStack >= m_Stack.Get_Count() ) { m_Stack.Set_Count(m_Stack.Get_Count() + 1024); } m_Stack[m_iStack].x = x; m_Stack[m_iStack].y = y; m_iStack++; } //--------------------------------------------------------- inline void CGrid_Gaps_Spline_Fill::Pop(int &x, int &y) { if( m_iStack > 0 ) { m_iStack--; x = m_Stack[m_iStack].x; y = m_Stack[m_iStack].y; } } //--------------------------------------------------------- void CGrid_Gaps_Spline_Fill::Set_Gap_Cell(int x, int y) { if( is_InGrid(x, y) && (!m_pMask || !m_pMask->is_NoData(x, y)) && m_Gaps.asInt(x, y) != m_nGaps ) { m_Gaps.Set_Value(x, y, m_nGaps); if( !is_Gap(x, y) ) { m_Spline.Add_Point(x, y, m_pGrid->asDouble(x, y)); for(int i=0; m_bExtended && i<8; i+=m_Neighbours) { int ix = Get_xTo(i, x), iy = Get_yTo(i, y); if( m_pGrid->is_InGrid(ix, iy) && m_Gaps.asInt(ix, iy) != m_nGaps ) { m_Gaps.Set_Value(ix, iy, m_nGaps); m_Spline.Add_Point(ix, iy, m_pGrid->asDouble(ix, iy)); } } } else { if( m_nGapCells >= m_GapCells.Get_Count() ) { m_GapCells.Set_Count(m_GapCells.Get_Count() + 1024); } m_GapCells[m_nGapCells].x = x; m_GapCells[m_nGapCells].y = y; m_nGapCells++; Push(x, y); } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_Gaps_Spline_Fill::Close_Gap(int x, int y) { //----------------------------------------------------- m_nGaps ++; m_nGapCells = 0; m_iStack = 0; m_Spline.Destroy(); Set_Gap_Cell(x, y); while( m_iStack > 0 && m_nGapCells <= m_nGapCells_Max && Process_Get_Okay() ) { Pop(x, y); for(int i=0; i<8; i+=m_Neighbours) { Set_Gap_Cell(Get_xTo(i, x), Get_yTo(i, y)); } } //----------------------------------------------------- if( m_nGapCells <= m_nGapCells_Max ) { if( m_nPoints_Max == 0 || m_Spline.Get_Point_Count() <= m_nPoints_Max ) { if( m_Spline.Create(m_Relaxation, true) ) { for(int i=0; iSet_Value(p.x, p.y, m_Spline.Get_Value(p.x, p.y)); } } } else { Close_Gap(); } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_Gaps_Spline_Fill::Close_Gap(void) { int i, j; CSG_PRQuadTree Search(CSG_Rect(0, 0, Get_NX(), Get_NY())); for(i=0; iSet_Value(p.x, p.y, m_Spline.Get_Value(p.x, p.y)); } } /* for(i=0; i 0 ? -1 : 4) > 2 ) { m_Spline.Set_Point_Count(Search.Get_Selected_Count()); for(j=0; jSet_Value(p.x, p.y, m_Spline.Get_Value(p.x, p.y)); } } }/**/ /* m_Spline.Set_Point_Count(m_nPoints_Local); for(i=0; iSet_Value(p.x, p.y, m_Spline.Get_Value(p.x, p.y)); } } }/**/ } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Gaps_Spline_Fill.h000066400000000000000000000117341224124640700251750ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Gaps_Spline_Fill.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Gaps_Spline_Fill.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Gaps_Spline_Fill_H #define HEADER_INCLUDED__Grid_Gaps_Spline_Fill_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Gaps_Spline_Fill : public CSG_Module_Grid { public: CGrid_Gaps_Spline_Fill(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual bool On_Execute (void); private: bool m_bExtended; int m_nGaps, m_nGapCells, m_iStack, m_nPoints_Max, m_nPoints_Local, m_nGapCells_Max, m_Neighbours; double m_Relaxation, m_Radius; CSG_Points_Int m_GapCells, m_Stack; CSG_Thin_Plate_Spline m_Spline; CSG_Grid *m_pGrid, *m_pMask, m_Gaps; bool is_Gap (int x, int y); void Push (int x, int y); void Pop (int &x, int &y); void Set_Gap_Cell (int x, int y); void Close_Gap (int x, int y); void Close_Gap (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Gaps_Spline_Fill_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_InvertNoData.cpp000066400000000000000000000040101224124640700247010ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_InvertNoData.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* InvertNoData.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Grid_InvertNoData.h" CInvertNoData::CInvertNoData(void){ Parameters.Set_Name(_TL("Invert Data/No-Data")); Parameters.Set_Description(_TW("(c) 2005 Victor Olaya.")); Parameters.Add_Grid(NULL, "INPUT", _TL("Grid"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "OUTPUT", _TL("Result"), _TL(""), PARAMETER_OUTPUT); }//constructor CInvertNoData::~CInvertNoData(void) {} bool CInvertNoData::On_Execute(void){ int x,y; CSG_Grid* pInput = Parameters("INPUT")->asGrid(); CSG_Grid* pOutput = Parameters("OUTPUT")->asGrid(); pOutput->Set_NoData_Value_Range(-9999,0); for(y=0; yis_NoData(x,y)){ pOutput->Set_Value(x, y, 1.0); }//if else{ pOutput->Set_Value(x, y, -9999.0); }//else }//if }//for return true; }//methodsaga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_InvertNoData.h000066400000000000000000000024321224124640700243540ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_InvertNoData.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* InvertNoData.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "MLB_Interface.h" class CInvertNoData : public CSG_Module_Grid { public: CInvertNoData(void); virtual ~CInvertNoData(void); protected: bool On_Execute(void); };saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Mask.cpp000066400000000000000000000125651224124640700232540ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Mask.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Mask.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Mask.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Mask::CGrid_Mask(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Grid Masking")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "" )); //----------------------------------------------------- // 2. Standard in- and output... Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "MASK" , _TL("Mask"), _TL(""), PARAMETER_INPUT, false ); Parameters.Add_Grid( NULL , "MASKED" , _TL("Masked Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Mask::On_Execute(void) { int x, y; double z; TSG_Point p; CSG_Grid *pGrid, *pMask, *pMasked; pGrid = Parameters("GRID") ->asGrid(); pMask = Parameters("MASK") ->asGrid(); pMasked = Parameters("MASKED") ->asGrid(); if( !pGrid->is_Intersecting(pMask->Get_Extent()) ) { Message_Add(_TL("no intersection with mask grid.")); return( false ); } if( pMasked == NULL ) { pMasked = pGrid; Parameters("MASKED")->Set_Value(pMasked); } else if( pMasked != pGrid ) { pMasked->Assign(pGrid); } Process_Set_Text(_TL("masking...")); for(y=0, p.y=Get_YMin(); yis_NoData(x, y) && !pMask->Get_Value(p, z, GRID_INTERPOLATION_NearestNeighbour) ) { pMasked->Set_NoData(x, y); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Mask.h000066400000000000000000000100561224124640700227120ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Mask.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Mask.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Mask_H #define HEADER_INCLUDED__Grid_Mask_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Mask : public CSG_Module_Grid { public: CGrid_Mask(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Values") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Mask_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Merge.cpp000066400000000000000000000435151224124640700234170ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Merge.cpp 1490 2012-10-17 13:54:24Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Tutorial // // // //-------------------------------------------------------// // // // Grid_Merge.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Merge.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Merge::CGrid_Merge(void) { //----------------------------------------------------- Set_Name (_TL("Mosaicking")); Set_Author (SG_T("O.Conrad (c) 2003-12")); Set_Description (_TW( "Mosaicking several grids to a single new one. Formerly known as 'Merge Grids'." )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Input Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Preferred data storage type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|"), _TL("1 bit"), _TL("1 byte unsigned integer"), _TL("1 byte signed integer"), _TL("2 byte unsigned integer"), _TL("2 byte signed integer"), _TL("4 byte unsigned integer"), _TL("4 byte signed integer"), _TL("4 byte floating point"), _TL("8 byte floating point") ), 7 ); Parameters.Add_Choice( NULL , "INTERPOL" , _TL("Interpolation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 0 ); Parameters.Add_Choice( NULL , "OVERLAP" , _TL("Overlapping Areas"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|"), _TL("first"), _TL("last"), _TL("minimum"), _TL("maximum"), _TL("mean"), _TL("blend boundary"), _TL("feathering") ), 1 ); Parameters.Add_Value( NULL , "BLEND_DIST" , _TL("Blending Distance"), _TL("blending distance given in map units"), PARAMETER_TYPE_Double, 10.0, 0.0, true ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TARGET" , _TL("Target Grid"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("user defined"), _TL("existing grid or grid system") ), 0 ); m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid") , _TL(""))); m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid") , _TL(""))); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGrid_Merge::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 ); } //--------------------------------------------------------- int CGrid_Merge::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("OVERLAP")) ) { pParameters->Get_Parameter("BLEND_DIST")->Set_Enabled(pParameter->asInt() == 5 || pParameter->asInt() == 6); } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Merge::On_Execute(void) { //----------------------------------------------------- if( !Initialize() ) { return( false ); } //----------------------------------------------------- for(int i=0; iGet_Count(); i++) { CSG_Grid *pGrid = m_pGrids->asGrid(i); Set_Weight(pGrid); if( i > 0 && m_Overlap == 6 ) { } int ax = (int)((pGrid->Get_XMin() - m_pMosaic->Get_XMin()) / m_pMosaic->Get_Cellsize()); int ay = (int)((pGrid->Get_YMin() - m_pMosaic->Get_YMin()) / m_pMosaic->Get_Cellsize()); //------------------------------------------------- if( is_Aligned(pGrid) ) { Process_Set_Text(CSG_String::Format(SG_T("[%d/%d] %s: %s"), i + 1, m_pGrids->Get_Count(), _TL("copying"), pGrid->Get_Name())); int nx = pGrid->Get_NX(); if( nx > m_pMosaic->Get_NX() - ax ) nx = m_pMosaic->Get_NX() - ax; int ny = pGrid->Get_NY(); if( ny > m_pMosaic->Get_NY() - ay ) ny = m_pMosaic->Get_NY() - ay; for(int y=0; y= 0 ) { #pragma omp parallel for for(int x=0; x= 0 && !pGrid->is_NoData(x, y) ) { Set_Value(ax + x, ay + y, pGrid->asDouble(x, y), Get_Weight(x, y)); } } } } } //------------------------------------------------- else { Process_Set_Text(CSG_String::Format(SG_T("[%d/%d] %s: %s"), i + 1, m_pGrids->Get_Count(), _TL("resampling"), pGrid->Get_Name())); if( ax < 0 ) ax = 0; if( ay < 0 ) ay = 0; int nx = 1 + m_pMosaic->Get_System().Get_xWorld_to_Grid(pGrid->Get_XMax()); if( nx > m_pMosaic->Get_NX() ) nx = m_pMosaic->Get_NX(); int ny = 1 + m_pMosaic->Get_System().Get_yWorld_to_Grid(pGrid->Get_YMax()); if( ny > m_pMosaic->Get_NY() ) ny = m_pMosaic->Get_NY(); for(int y=ay; yGet_YMin() + y * m_pMosaic->Get_Cellsize(); #pragma omp parallel for for(int x=ax; xGet_XMin() + x * m_pMosaic->Get_Cellsize(); Set_Value(x, y, pGrid, px, py); } } } } //----------------------------------------------------- if( m_Overlap == 4 ) // mean { for(int y=0; yGet_NY() && Set_Progress(y, m_pMosaic->Get_NY()); y++) { #pragma omp parallel for for(int x=0; xGet_NX(); x++) { double w = m_Weights.asDouble(x, y); if( w > 0.0 ) { m_pMosaic->Mul_Value(x, y, 1.0 / w); } } } } //----------------------------------------------------- m_Weight .Destroy(); m_Weights.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Merge::Initialize(void) { //----------------------------------------------------- m_pMosaic = NULL; m_Overlap = Parameters("OVERLAP" )->asInt(); m_pGrids = Parameters("GRIDS" )->asGridList(); m_dBlend = Parameters("BLEND_DIST")->asDouble(); if( m_pGrids->Get_Count() < 2 ) { Error_Set(_TL("nothing to do, there are less than two grids in input list.")); return( false ); } //----------------------------------------------------- switch( Parameters("INTERPOL")->asInt() ) { default: case 0: m_Interpolation = GRID_INTERPOLATION_NearestNeighbour; break; // Nearest Neighbor case 1: m_Interpolation = GRID_INTERPOLATION_Bilinear; break; // Bilinear Interpolation case 2: m_Interpolation = GRID_INTERPOLATION_InverseDistance; break; // Inverse Distance Interpolation case 3: m_Interpolation = GRID_INTERPOLATION_BicubicSpline; break; // Bicubic Spline Interpolation case 4: m_Interpolation = GRID_INTERPOLATION_BSpline; break; // B-Spline Interpolation } //----------------------------------------------------- TSG_Data_Type Type; switch( Parameters("TYPE")->asInt() ) { default: Type = SG_DATATYPE_Float; break; case 0: Type = SG_DATATYPE_Bit; break; case 1: Type = SG_DATATYPE_Byte; break; case 2: Type = SG_DATATYPE_Char; break; case 3: Type = SG_DATATYPE_Word; break; case 4: Type = SG_DATATYPE_Short; break; case 5: Type = SG_DATATYPE_DWord; break; case 6: Type = SG_DATATYPE_Int; break; case 7: Type = SG_DATATYPE_Float; break; case 8: Type = SG_DATATYPE_Double; break; } //----------------------------------------------------- switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... { double d = m_pGrids->asGrid(0)->Get_Cellsize(); CSG_Rect r = m_pGrids->asGrid(0)->Get_Extent(); for(int i=1; iGet_Count(); i++) { if( d > m_pGrids->asGrid(i)->Get_Cellsize() ) { d = m_pGrids->asGrid(i)->Get_Cellsize(); } r.Union(m_pGrids->asGrid(i)->Get_Extent()); } int nx = 1 + (int)(r.Get_XRange() / d); int ny = 1 + (int)(r.Get_YRange() / d); if( m_Grid_Target.Init_User(r.Get_XMin(), r.Get_YMin(), d, nx, ny) && Dlg_Parameters("USER") ) { m_pMosaic = m_Grid_Target.Get_User(Type); } } break; case 1: // grid... { if( Dlg_Parameters("GRID") ) { m_pMosaic = m_Grid_Target.Get_Grid(Type); } } break; } //----------------------------------------------------- if( m_pMosaic ) { m_pMosaic->Set_Name(_TL("Mosaic")); m_pMosaic->Assign_NoData(); switch( m_Overlap ) { case 4: // mean case 6: // feathering { if( !m_Weights.Create(m_pMosaic->Get_System(), m_Overlap == 4 && m_pGrids->Get_Count() < 256 ? SG_DATATYPE_Byte : SG_DATATYPE_Word) ) { Error_Set(_TL("could not create weights grid")); return( false ); } } break; } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Merge::is_Aligned(CSG_Grid *pGrid) { return( pGrid->Get_Cellsize() == m_pMosaic->Get_Cellsize() && fabs(fmod(pGrid->Get_XMin() - m_pMosaic->Get_XMin(), m_pMosaic->Get_Cellsize())) <= 0.001 * m_pMosaic->Get_Cellsize() && fabs(fmod(pGrid->Get_YMin() - m_pMosaic->Get_YMin(), m_pMosaic->Get_Cellsize())) <= 0.001 * m_pMosaic->Get_Cellsize() ); } //--------------------------------------------------------- inline void CGrid_Merge::Set_Value(int x, int y, double Value, double Weight) { switch( m_Overlap ) { case 0: // first if( m_pMosaic->is_NoData(x, y) ) { m_pMosaic->Set_Value(x, y, Value); } break; case 1: // last { m_pMosaic->Set_Value(x, y, Value); } break; case 2: // minimum if( m_pMosaic->is_NoData(x, y) || m_pMosaic->asDouble(x, y) > Value ) { m_pMosaic->Set_Value(x, y, Value); } break; case 3: // maximum if( m_pMosaic->is_NoData(x, y) || m_pMosaic->asDouble(x, y) < Value ) { m_pMosaic->Set_Value(x, y, Value); } break; case 4: // mean if( m_pMosaic->is_NoData(x, y) ) { m_pMosaic->Set_Value(x, y, Value); m_Weights .Set_Value(x, y, 1); } else { m_pMosaic->Add_Value(x, y, Value); m_Weights .Add_Value(x, y, 1); } break; case 5: // blend if( m_pMosaic->is_NoData(x, y) ) { m_pMosaic->Set_Value(x, y, Value); } else { m_pMosaic->Set_Value(x, y, (1.0 - Weight) * m_pMosaic->asDouble(x, y) + Weight * Value); } break; case 6: // feathering if( m_pMosaic->is_NoData(x, y) ) { m_pMosaic->Set_Value(x, y, Value); m_Weights .Set_Value(x, y, Weight / m_Weights.Get_ZFactor()); } else { double d = (Weight - m_Weights.asDouble(x, y, true)) / m_dBlend; if( d >= 1.0 ) { m_pMosaic->Set_Value(x, y, Value); m_Weights .Set_Value(x, y, Weight / m_Weights.Get_ZFactor()); } else if( d > -1.0 ) { d = 0.5 * (1.0 + d); m_pMosaic->Set_Value(x, y, (1.0 - d) * m_pMosaic->asDouble(x, y) + d * Value); if( d > 0.5 ) { m_Weights .Set_Value(x, y, Weight / m_Weights.Get_ZFactor()); } } } break; case 7: // feathering if( m_pMosaic->is_NoData(x, y) ) { m_pMosaic->Set_Value(x, y, Weight * Value); m_Weights .Set_Value(x, y, Weight); } else { m_pMosaic->Add_Value(x, y, Weight * Value); m_Weights .Add_Value(x, y, Weight); } break; } } //--------------------------------------------------------- inline void CGrid_Merge::Set_Value(int x, int y, CSG_Grid *pGrid, double px, double py) { double z; if( pGrid->Get_Value(px, py, z, m_Interpolation) ) { if( m_Weight.is_Valid() ) { double w; if( m_Weight.Get_Value(px, py, w, GRID_INTERPOLATION_BSpline, true) ) { Set_Value(x, y, z, w); } } else { Set_Value(x, y, z, 1.0); } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline double CGrid_Merge::Get_Weight(int x, int y) { return( m_Weight.is_Valid() ? m_Weight.asDouble(x, y, true) : 1.0 ); } //--------------------------------------------------------- bool CGrid_Merge::Set_Weight(CSG_Grid *pGrid) { int dBlend; switch( m_Overlap ) { default: // only feathering/blending return( true ); case 5: // blending dBlend = 1 + (int)(m_dBlend / pGrid->Get_Cellsize()); break; case 6: // feathering dBlend = 0; break; } //----------------------------------------------------- if( !m_Weight.Get_System().is_Equal(pGrid->Get_System()) ) { if( !m_Weight.Create(pGrid->Get_System(), dBlend > 0 && dBlend < 255 ? SG_DATATYPE_Byte : SG_DATATYPE_Word) ) { Error_Set(_TL("could not create distance grid")); return( false ); } } //----------------------------------------------------- int x, y, d; for(y=0; yGet_NY() && Process_Get_Okay(); y++) { for(x=0, d=1; xGet_NX(); x++) { if( pGrid->is_NoData(x, y) ) m_Weight.Set_Value(x, y, d = 0); else //if( m_Weight.asDouble(x, y) > d ) m_Weight.Set_Value(x, y, d); if( dBlend <= 0 || d < dBlend ) d++; } for(x=pGrid->Get_NX()-1, d=1; x>=0; x--) { if( pGrid->is_NoData(x, y) ) m_Weight.Set_Value(x, y, d = 0); else if( m_Weight.asDouble(x, y) > d ) m_Weight.Set_Value(x, y, d); if( dBlend <= 0 || d < dBlend ) d++; } } for(x=0; xGet_NX() && Process_Get_Okay(); x++) { for(y=0, d=1; yGet_NY(); y++) { if( pGrid->is_NoData(x, y) ) m_Weight.Set_Value(x, y, d = 0); else if( m_Weight.asDouble(x, y) > d ) m_Weight.Set_Value(x, y, d); if( dBlend <= 0 || d < dBlend ) d++; } for(y=pGrid->Get_NY()-1, d=1; y>=0; y--) { if( pGrid->is_NoData(x, y) ) m_Weight.Set_Value(x, y, d = 0); else if( m_Weight.asDouble(x, y) > d ) m_Weight.Set_Value(x, y, d); if( dBlend <= 0 || d < dBlend ) d++; } } //----------------------------------------------------- switch( m_Overlap ) { case 5: // blending m_Weight.Set_ZFactor(1.0 / dBlend); // normalize (0 <= z <= 1) break; case 6: // feathering m_Weight.Set_ZFactor(m_Weight.Get_Cellsize()); break; } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Merge.h000066400000000000000000000116531224124640700230620ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Merge.h 1490 2012-10-17 13:54:24Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Tutorial // // // //-------------------------------------------------------// // // // Grid_Merge.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Merge_H #define HEADER_INCLUDED__Grid_Merge_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Merge : public CSG_Module { public: CGrid_Merge(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_Overlap, m_Interpolation; double m_dBlend; CSG_Grid *m_pMosaic, m_Weights, m_Weight; CSG_Parameter_Grid_List *m_pGrids; CSG_Parameters_Grid_Target m_Grid_Target; bool Initialize (void); bool is_Aligned (CSG_Grid *pGrid); void Set_Value (int x, int y, double Value, double Weight); void Set_Value (int x, int y, CSG_Grid *pGrid, double px, double py); bool Set_Weight (CSG_Grid *pGrid); double Get_Weight (int x, int y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Merge_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Orientation.cpp000066400000000000000000000124631224124640700246510ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Orientation.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Orientation.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Orientation.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Orientation::CGrid_Orientation(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Grid Orientation")); Set_Author (SG_T("(c) 2001 by O.Conrad")); Set_Description (_TW( "Copy, mirror (horizontally or vertically) and invert grid values. " "If the target is not set, the changes will be stored to the original grid. ") ); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Changed Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL, "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("Copy"), _TL("Flip"), _TL("Mirror"), _TL("Invert") ) ); } //--------------------------------------------------------- CGrid_Orientation::~CGrid_Orientation(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Orientation::On_Execute(void) { CSG_Grid *pInput, *pResult; pInput = Parameters("INPUT")->asGrid(); pResult = Parameters("RESULT")->asGrid(); if( !pResult ) { pResult = pInput; Parameters("RESULT")->Set_Value(pInput); } else if( pResult != pInput ) { pResult->Assign(pInput); } switch( Parameters("METHOD")->asInt() ) { case 0: default: // Copy... break; case 1: // Flip... pResult->Flip(); break; case 2: // Mirror... pResult->Mirror(); break; case 3: // Invert... pResult->Invert(); break; } return( true ); } saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Orientation.h000066400000000000000000000075621224124640700243220ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Orientation.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Orientation.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Orientation_H #define HEADER_INCLUDED__Grid_Orientation_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CGrid_Orientation : public CSG_Module_Grid { public: CGrid_Orientation(void); virtual ~CGrid_Orientation(void); protected: virtual bool On_Execute(void); private: }; //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Orientation_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Proximity.cpp000066400000000000000000000156641224124640700243700ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Proximity.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Proximity.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Proximity.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Proximity::CGrid_Proximity(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Proximity Grid")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Calculates a grid with euclidean distance to feature cells (not no-data cells)." )); //----------------------------------------------------- // 2. Standard in- and output... Parameters.Add_Grid( NULL , "FEATURES" , _TL("Features"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "DISTANCE" , _TL("Distance"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "DIRECTION" , _TL("Direction"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL , "ALLOCATION" , _TL("Allocation"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Proximity::On_Execute(void) { int x, y; double z, d; TSG_Point p; CSG_Grid *pFeatures, *pDistance, *pDirection, *pAllocation; CSG_PRQuadTree Search; //----------------------------------------------------- pFeatures = Parameters("FEATURES") ->asGrid(); pDistance = Parameters("DISTANCE") ->asGrid(); pDirection = Parameters("DIRECTION") ->asGrid(); pAllocation = Parameters("ALLOCATION") ->asGrid(); //----------------------------------------------------- Process_Set_Text(_TL("preparing distance calculation...")); Search.Create(CSG_Rect(-1, -1, Get_NX(), Get_NY())); for(y=0; yis_NoData(x, y) ) { pDistance->Set_Value(x, y, -1.0); } else { pDistance->Set_Value(x, y, 0.0); if( pDirection ) { pDirection->Set_NoData(x, y); } if( pAllocation ) { pAllocation->Set_Value(x, y, pFeatures->asDouble(x, y)); } //----------------------------------------- bool bBorder = false; for(int i=0; i<8 && !bBorder; i++) { int ix = Get_xTo(i, x); int iy = Get_yTo(i, y); if( is_InGrid(ix, iy) && pFeatures->is_NoData(ix, iy) ) { bBorder = true; } } if( bBorder ) { Search.Add_Point(x, y, pFeatures->asDouble(x, y)); } } } } if( !Search.is_Okay() || Search.Get_Point_Count() <= 0 || Search.Get_Point_Count() >= Get_NCells() ) { Message_Add(_TL("no features to buffer.")); return( false ); } //----------------------------------------------------- Process_Set_Text(_TL("performing distance calculation...")); for(y=0; yasDouble(x, y) < 0.0 && Search.Get_Nearest_Point(x, y, p, z, d) ) { pDistance->Set_Value(x, y, d * Get_Cellsize()); if( pDirection ) { if( d > 0.0 ) { pDirection->Set_Value(x, y, SG_Get_Angle_Of_Direction(x, y, p.x, p.y) * M_RAD_TO_DEG); } else { pDirection->Set_NoData(x, y); } } if( pAllocation ) { pAllocation->Set_Value(x, y, z); } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Proximity.h000066400000000000000000000101161224124640700240200ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Proximity.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Proximity.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Proximity_H #define HEADER_INCLUDED__Grid_Proximity_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Proximity : public CSG_Module_Grid { public: CGrid_Proximity(void); // virtual CSG_String Get_MenuPath (void) { return( _TL("R:Values") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Proximity_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Resample.cpp000066400000000000000000000237731224124640700241340ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Resample.cpp 1117 2011-06-24 14:36:07Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Resample.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Resample.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Resample::CGrid_Resample(void) { CSG_Parameter *pNode; CSG_Parameters *pParameters; //----------------------------------------------------- Set_Name (_TL("Resampling")); Set_Author (SG_T("O.Conrad (c) 2003")); Set_Description (_TW( "Resampling of grids." )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "INPUT_ADD" , _TL("Additional Grids"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid_List( NULL , "OUTPUT_ADD" , _TL("Additional Grids"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Value( NULL , "KEEP_TYPE" , _TL("Preserve Data Type"), _TL(""), PARAMETER_TYPE_Bool , false ); //----------------------------------------------------- pParameters = Add_Parameters("SCALE_UP" , _TL("Up-Scaling") , _TL("")); pNode = pParameters->Add_Choice( NULL , "METHOD" , _TL("Interpolation Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation"), _TL("Mean Value"), _TL("Mean Value (cell area weighted)"), _TL("Minimum Value"), _TL("Maximum Value"), _TL("Majority") ), 6 ); //----------------------------------------------------- pParameters = Add_Parameters("SCALE_DOWN" , _TL("Down-Scaling") , _TL("")); pNode = pParameters->Add_Choice( NULL , "METHOD" , _TL("Interpolation Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 4 ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TARGET" , _TL("Target Grid"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("user defined"), _TL("grid") ), 0 ); m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid") , _TL(""))); m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid") , _TL(""))); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGrid_Resample::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Resample::On_Execute(void) { bool bResult, bKeepType; TSG_Grid_Interpolation Interpolation; CSG_Grid *pInput, *pOutput; CSG_Parameters *pParameters; //----------------------------------------------------- bResult = false; bKeepType = Parameters("KEEP_TYPE") ->asBool(); pInput = Parameters("INPUT") ->asGrid(); pOutput = NULL; //----------------------------------------------------- switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... if( m_Grid_Target.Init_User(pInput->Get_Extent(false)) && Dlg_Parameters("USER") ) { pOutput = m_Grid_Target.Get_User(bKeepType ? pInput->Get_Type() : SG_DATATYPE_Undefined); } break; case 1: // grid... if( Dlg_Parameters("GRID") ) { pOutput = m_Grid_Target.Get_Grid(bKeepType ? pInput->Get_Type() : SG_DATATYPE_Undefined); } break; } //----------------------------------------------------- if( !pOutput || !pInput->is_Intersecting(pOutput->Get_Extent()) ) { return( false ); } pParameters = NULL; //------------------------------------------------- // Up-Scaling... if( pInput->Get_Cellsize() < pOutput->Get_Cellsize() ) { if( Dlg_Parameters("SCALE_UP") ) { switch( Get_Parameters("SCALE_UP")->Get_Parameter("METHOD")->asInt() ) { case 0: Interpolation = GRID_INTERPOLATION_NearestNeighbour; break; case 1: Interpolation = GRID_INTERPOLATION_Bilinear; break; case 2: Interpolation = GRID_INTERPOLATION_InverseDistance; break; case 3: Interpolation = GRID_INTERPOLATION_BicubicSpline; break; case 4: Interpolation = GRID_INTERPOLATION_BSpline; break; case 5: Interpolation = GRID_INTERPOLATION_Mean_Nodes; break; case 6: Interpolation = GRID_INTERPOLATION_Mean_Cells; break; case 7: Interpolation = GRID_INTERPOLATION_Minimum; break; case 8: Interpolation = GRID_INTERPOLATION_Maximum; break; case 9: Interpolation = GRID_INTERPOLATION_Majority; break; } pParameters = Get_Parameters("SCALE_UP"); } } //------------------------------------------------- // Down-Scaling... else { if( Dlg_Parameters("SCALE_DOWN") ) { switch( Get_Parameters("SCALE_DOWN")->Get_Parameter("METHOD")->asInt() ) { case 0: Interpolation = GRID_INTERPOLATION_NearestNeighbour; break; case 1: Interpolation = GRID_INTERPOLATION_Bilinear; break; case 2: Interpolation = GRID_INTERPOLATION_InverseDistance; break; case 3: Interpolation = GRID_INTERPOLATION_BicubicSpline; break; case 4: Interpolation = GRID_INTERPOLATION_BSpline; break; } pParameters = Get_Parameters("SCALE_DOWN"); } } //------------------------------------------------- if( !pParameters ) { return( false ); } pOutput->Assign(pInput, Interpolation); pOutput->Set_Name(pInput->Get_Name()); //------------------------------------------------- CSG_Grid_System System(pOutput->Get_System()); CSG_Parameter_Grid_List *pInputs = Parameters("INPUT_ADD") ->asGridList(); CSG_Parameter_Grid_List *pOutputs = Parameters("OUTPUT_ADD") ->asGridList(); pOutputs->Del_Items(); for(int i=0; iGet_Count() && Process_Get_Okay(); i++) { pInput = pInputs->asGrid(i); pOutput = SG_Create_Grid(pOutput->Get_System(), bKeepType ? pInput->Get_Type() : SG_DATATYPE_Undefined); pOutput->Assign(pInput, Interpolation); pOutput->Set_Name(pInput->Get_Name()); pOutputs->Add_Item(pOutput); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Resample.h000066400000000000000000000112771224124640700235750ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Resample.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Resample.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Resample_H #define HEADER_INCLUDED__Grid_Resample_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Resample : public CSG_Module_Grid { public: CGrid_Resample(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: CSG_Parameters_Grid_Target m_Grid_Target; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Resample_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Shrink_Expand.cpp000066400000000000000000000250331224124640700251100ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Shrink_Expand.cpp 1104 2011-06-20 20:50:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Shrink_Expand.cpp // // // // Copyright (C) 2011 by // // Volker Wichmann and Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Shrink_Expand.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Shrink_Expand::CGrid_Shrink_Expand(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Grid Shrink/Expand")); Set_Author (SG_T("V.Wichmann & O.Conrad (c) 2011")); Set_Description (_TW( "Regions with valid data in the input grid can be shrinked or expanded by a certain amount (radius). " "Shrinking just sets the border of regions with valid data to NoData, expanding sets NoData " "cells along the border of regions with valid data to a new valid value, computed by the method " "selected (min, max, mean, majority).\n\n" )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Result Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL, "OPERATION" , _TL("Operation"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Shrink"), _TL("Expand") ), 1 ); Parameters.Add_Choice( NULL, "MODE" , _TL("Search Mode"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Square"), _TL("Circle") ), 1 ); Parameters.Add_Value( NULL, "RADIUS" , _TL("Radius"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); CSG_String choices; for (int i=0; iasGrid(); pResult = Parameters("RESULT") ->asGrid(); m_Radius = Parameters("RADIUS") ->asInt(); operation = Parameters("OPERATION") ->asInt(); methodExpand = Parameters("METHOD_EXPAND")->asInt(); //----------------------------------------------------- m_Kernel.Create(SG_DATATYPE_Byte, 1 + 2 * m_Radius, 1 + 2 * m_Radius); m_Kernel.Set_NoData_Value(0.0); m_Kernel.Assign(1.0); m_Kernel.Set_Value(m_Radius, m_Radius, 0.0); if( Parameters("MODE")->asInt() == 1 ) { for(y=-m_Radius, iy=0; y<=m_Radius; y++, iy++) { for(x=-m_Radius, ix=0; x<=m_Radius; x++, ix++) { if( x*x + y*y > m_Radius*m_Radius ) { m_Kernel.Set_Value(ix, iy, 0.0); } } } } //----------------------------------------------------- if( !pResult || pResult == m_pInput ) { pResult = SG_Create_Grid(m_pInput); } else { if( operation == 0 ) pResult->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pInput->Get_Name(), _TL("Shrink"))); else pResult->Set_Name(CSG_String::Format(SG_T("%s [%s %s]"), m_pInput->Get_Name(), _TL("Expand"), gSG_Method_Key_Names[Parameters("METHOD_EXPAND")->asInt()])); pResult->Set_NoData_Value(m_pInput->Get_NoData_Value()); } pResult->Assign_NoData(); //----------------------------------------------------- if( operation == 0 ) // shrink { for(y=0; yis_NoData(x, y) ) continue; else { bool bShrink = false; for(int iy=0, jy=y-m_Radius; iyis_InGrid(jx, jy, false) ) { if( m_pInput->is_NoData(jx, jy) ) { bShrink = true; break; } } } if( bShrink ) break; } if( bShrink ) pResult->Set_NoData(x, y); else pResult->Set_Value(x, y, m_pInput->asDouble(x, y)); } } } } else // expand { for(y=0; yis_NoData(x, y) ) { pResult->Set_Value(x, y, m_pInput->asDouble(x, y)); continue; } else { if( methodExpand == METHOD_KEY_MIN || methodExpand == METHOD_KEY_MAX || methodExpand == METHOD_KEY_MEAN ) { Statistics.Invalidate(); for(int iy=0, jy=y-m_Radius; iyis_InGrid(jx, jy, false) ) { if( !m_pInput->is_NoData(jx, jy) ) Statistics.Add_Value(m_pInput->asDouble(jx, jy)); } } } if( Statistics.Get_Count() == 0 ) { pResult->Set_NoData(x, y); continue; } } switch( methodExpand ) { default: return( false ); case METHOD_KEY_MIN: pResult->Set_Value(x, y, Statistics.Get_Minimum()); break; case METHOD_KEY_MAX: pResult->Set_Value(x, y, Statistics.Get_Maximum()); break; case METHOD_KEY_MEAN: pResult->Set_Value(x, y, Statistics.Get_Mean()); break; case METHOD_KEY_MAJORITY: m_Majority.Create(); pResult->Set_Value(x, y, Get_Majority(x, y)); m_Majority.Destroy(); break; } } // noData } // for x } // for y } // method expand //----------------------------------------------------- if( !Parameters("RESULT")->asGrid() || Parameters("RESULT")->asGrid() == m_pInput ) { m_pInput->Assign(pResult); delete(pResult); DataObject_Update(m_pInput); } m_Kernel.Destroy(); return( true ); } //--------------------------------------------------------- int CGrid_Shrink_Expand::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("OPERATION")) ) { pParameters->Get_Parameter("METHOD_EXPAND")->Set_Enabled(pParameter->asInt() > 0); } //----------------------------------------------------- return (1); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- double CGrid_Shrink_Expand::Get_Majority(int x, int y) { m_Majority.Reset(); for(int iy=0, jy=y-m_Radius; iyis_InGrid(jx, jy) ) { m_Majority.Add_Value(m_pInput->asDouble(jx, jy)); } } } int Count; double Value; if( m_Majority.Get_Majority(Value, Count) && Count > 0 ) return( Value ); else return( m_pInput->Get_NoData_Value() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Shrink_Expand.h000066400000000000000000000120631224124640700245540ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Shrink_Expand.h 1104 2011-06-20 20:50:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Shrink_Expand.h // // // // Copyright (C) 2011 by // // Volker Wichmann and Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Shrink_Expand_H #define HEADER_INCLUDED__Grid_Shrink_Expand_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- typedef enum ESG_Method_Key { METHOD_KEY_MIN = 0, METHOD_KEY_MAX, METHOD_KEY_MEAN, METHOD_KEY_MAJORITY, METHOD_KEY_Count } TSG_Method_Key; //--------------------------------------------------------- const SG_Char gSG_Method_Key_Names[METHOD_KEY_Count][32] = { SG_T("min"), SG_T("max"), SG_T("mean"), SG_T("majority") }; //--------------------------------------------------------- class CGrid_Shrink_Expand : public CSG_Module_Grid { public: CGrid_Shrink_Expand(void); protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_Radius, m_Threshold; CSG_Grid m_Kernel, *m_pInput; CSG_Class_Statistics m_Majority; double Get_Majority (int x, int y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Shrink_Expand_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_SortRaster.cpp000066400000000000000000000046601224124640700244660ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_SortRaster.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* SortRaster.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Grid_SortRaster.h" CSortRaster::CSortRaster(void){ Parameters.Set_Name(_TL("Sort Grid")); Parameters.Set_Description(_TW( "(c) 2004 by Victor Olaya. Sort Grid")); Parameters.Add_Grid(NULL, "GRID", _TL("Input Grid"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "OUTPUT", _TL("Sorted Grid"), _TL(""), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "DOWN", _TL("Down sort"), _TL(""), PARAMETER_TYPE_Bool, false); }//constructor CSortRaster::~CSortRaster(void) {} bool CSortRaster::On_Execute(void){ CSG_Grid* pGrid = Parameters("GRID")->asGrid(); CSG_Grid* pSortedGrid = Parameters("OUTPUT")->asGrid(); bool bDown = Parameters("DOWN")->asBool(); bool bCopy = false; long i; int iX, iY; int iCell=0; if (pGrid == pSortedGrid){ pSortedGrid = SG_Create_Grid(pGrid); bCopy = true; }//if pSortedGrid->Set_NoData_Value(0.0); for(i=0; iGet_Sorted(i, iX, iY, bDown, false); if (pGrid->is_NoData(iX,iY)){ pSortedGrid->Set_NoData(iX,iY); }//if else{ // pSortedGrid->Set_Value(iX, iY, i); pSortedGrid->Set_Value(iX, iY, ++iCell); }//else }//for if (bCopy){ pGrid->Assign(pSortedGrid); }//if return true; }//method saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_SortRaster.h000066400000000000000000000024321224124640700241260ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_SortRaster.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* SortRaster.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "MLB_Interface.h" class CSortRaster : public CSG_Module_Grid { public: CSortRaster(void); virtual ~CSortRaster(void); protected: bool On_Execute(void); private: };saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_ThresholdBuffer.cpp000066400000000000000000000111741224124640700254420ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_ThresholdBuffer.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* ThresholdBuffer.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Grid_ThresholdBuffer.h" #define BUFFER 1 #define FEATURE 2 #define THRESHOLD_ABSOLUTE 0 #define THRESHOLD_RELATIVE 1 CThresholdBuffer::CThresholdBuffer(void){ CSG_Parameter * pNode; Parameters.Set_Name(_TL("Threshold Buffer")); Parameters.Set_Description(_TW( "(c) 2004 by Victor Olaya. Threshold Buffer Creation")); Parameters.Add_Grid(NULL, "FEATURES", _TL("Features Grid"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "VALUE", _TL("Value Grid"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "THRESHOLDGRID", _TL("Threshold Grid"), _TL(""), PARAMETER_INPUT_OPTIONAL); Parameters.Add_Grid(NULL, "BUFFER", _TL("Buffer Grid"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Int); pNode = Parameters.Add_Value(NULL, "THRESHOLD", _TL("Threshold"), _TL("Threshold (Grid Units)"), PARAMETER_TYPE_Double, 0); Parameters.Add_Choice(NULL, "THRESHOLDTYPE", _TL("Threshold Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Absolute"), _TL("Relative from cell value") )); }//constructor CThresholdBuffer::~CThresholdBuffer(void) {} bool CThresholdBuffer::On_Execute(void){ double dValue; int iPoint = 0; m_pFeatures = Parameters("FEATURES")->asGrid(); m_pBuffer = Parameters("BUFFER")->asGrid(); m_pValueGrid = Parameters("VALUE")->asGrid(); m_pThresholdGrid = Parameters("THRESHOLDGRID")->asGrid(); m_dThreshold = Parameters("THRESHOLD")->asDouble() ; m_iThresholdType = Parameters("THRESHOLDTYPE")->asInt(); m_pCentralPoints .Clear(); m_pAdjPoints .Clear(); m_pBuffer->Assign((double)0); for(int y=0; yasDouble(x,y); if (dValue != 0 && !m_pFeatures->is_NoData(x,y)){ BufferPoint(x,y); }//if }//for }//for return true; }//method void CThresholdBuffer::BufferPoint(int x, int y){ int x2,y2; static int nX[8] = {0, 1, 1, 1, 0, -1, -1, -1}; static int nY[8] = {1, 1, 0, -1, -1, -1, 0, 1}; double dValue; int iValue; int iPt; int n; float fBaseValue; double dThreshold; fBaseValue = m_pValueGrid->asFloat(x,y,true); if (m_pThresholdGrid){ dThreshold = m_pThresholdGrid->asFloat(x,y,true); }//if else{ dThreshold = m_dThreshold; }//else m_pCentralPoints.Add(x,y); m_pBuffer->Set_Value(x,y,FEATURE); while (m_pCentralPoints.Get_Count()!=0){ for (iPt=0; iPtis_NoData(x,y)){ for (n=0; n<8; n++){ x2 = x + nX[n]; y2 = y + nY[n]; if (m_pValueGrid->is_InGrid(x2,y2)){ iValue = m_pBuffer->asInt(x2,y2); if (!m_pValueGrid->is_NoData(x2, y2) && iValue == 0){ if (m_iThresholdType == THRESHOLD_ABSOLUTE){ dValue = m_pValueGrid->asFloat(x2,y2,true); }//if else{ dValue = fabs(m_pValueGrid->asFloat(x2,y2,true) - fBaseValue); }//else if(dValue < dThreshold){ m_pBuffer->Set_Value(x2, y2, BUFFER); m_pAdjPoints.Add(x2,y2); }//if }//if }//if }//for }//if }//for m_pCentralPoints.Clear(); for (iPt=0; iPt 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CThresholdBuffer : public CSG_Module_Grid { private: CSG_Grid* m_pFeatures; CSG_Grid* m_pBuffer; CSG_Grid* m_pValueGrid; CSG_Grid* m_pThresholdGrid; double m_dThreshold; int m_iThresholdType; // CAPI_3D_iPoints m_pCentralPoints; // CAPI_3D_iPoints m_pAdjPoints; CSG_Points_Int m_pCentralPoints; CSG_Points_Int m_pAdjPoints; void BufferPoint(int,int); public: CThresholdBuffer(void); virtual ~CThresholdBuffer(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Buffers") ); } protected: virtual bool On_Execute(void); }; saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Tiling.cpp000066400000000000000000000267141224124640700236100ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Tiling.cpp 1380 2012-04-26 12:02:19Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Tiling.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Tiling.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Tiling::CGrid_Tiling(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Tiling")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "TILES" , _TL("Tiles"), _TL(""), PARAMETER_OUTPUT, false ); pNode = Parameters.Add_Value( NULL , "OVERLAP" , _TL("Overlapping Cells"), _TL(""), PARAMETER_TYPE_Int, 0, 0, true ); Parameters.Add_Choice( pNode , "OVERLAP_SYM" , _TL("Add Cells"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("symmetric"), _TL("bottom / left"), _TL("top / right") ), 0 ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Tile Size Definition"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("number of grid cells per tile"), _TL("coordinates (offset, range, cell size, tile size)") ), 0 ); Parameters.Add_Value( NULL , "SAVE_TILES" , _TL("Save Tiles to Disk"), _TL("Save tiles to disk individually"), PARAMETER_TYPE_Bool, false ); Parameters.Add_String( Parameters("SAVE_TILES"), "TILE_BASENAME" , _TL("Base Name"), _TL("The base name of the tiles"), SG_T("") ); Parameters.Add_FilePath( Parameters("SAVE_TILES"), "TILE_PATH" , _TL("Output Directory"), _TL(""), NULL, NULL, true, true ); pNode = Parameters.Add_Node( NULL , "NODE_A" , _TL("Number of Grid Cells"), _TL("") ); Parameters.Add_Value( pNode , "NX" , _TL("Number of Column Cells"), _TL(""), PARAMETER_TYPE_Int, 100, 1, true ); Parameters.Add_Value( pNode , "NY" , _TL("Number of Row Cells"), _TL(""), PARAMETER_TYPE_Int, 100, 1, true ); pNode = Parameters.Add_Node( NULL , "NODE_B" , _TL("Coordinates"), _TL("") ); Parameters.Add_Range( pNode , "XRANGE" , _TL("Offset and Range (X)"), _TL(""), 0.0, 1000.0 ); Parameters.Add_Range( pNode , "YRANGE" , _TL("Offset and Range (Y)"), _TL(""), 0.0, 1000.0 ); Parameters.Add_Value( pNode , "DCELL" , _TL("Cell Size"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); Parameters.Add_Value( pNode , "DX" , _TL("Tile Size (X)"), _TL(""), PARAMETER_TYPE_Double, 100.0, 0.0, true ); Parameters.Add_Value( pNode , "DY" , _TL("Tile Size (Y)"), _TL(""), PARAMETER_TYPE_Double, 100.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGrid_Tiling::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PARAMETERS_GRID_SYSTEM")) ) { CSG_Grid_System System(1.0, 0.0, 0.0, 101, 101); if( pParameter->asGrid_System() && pParameter->asGrid_System()->is_Valid() ) { System = *pParameter->asGrid_System(); } pParameters->Get_Parameter("NX") ->Set_Value(System.Get_NX() / 2); pParameters->Get_Parameter("NY") ->Set_Value(System.Get_NX() / 2); pParameters->Get_Parameter("XRANGE")->asRange()->Set_Range(System.Get_XMin(), System.Get_XMax()); pParameters->Get_Parameter("YRANGE")->asRange()->Set_Range(System.Get_YMin(), System.Get_YMax()); pParameters->Get_Parameter("DCELL") ->Set_Value(System.Get_Cellsize()); pParameters->Get_Parameter("DX") ->Set_Value(System.Get_XRange() / 2.0); pParameters->Get_Parameter("DY") ->Set_Value(System.Get_YRange() / 2.0); } return( 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Tiling::On_Execute(void) { bool bSaveTiles; int ix, iy, nx, ny, Overlap; double y, x, dx, dy, dCell; CSG_String FilePath, BaseName; TSG_Data_Type Type; TSG_Rect Extent; TSG_Grid_Interpolation Interpolation; CSG_Grid *pGrid, *pTile; CSG_Parameter_Grid_List *pTiles; //----------------------------------------------------- pGrid = Parameters("GRID") ->asGrid(); pTiles = Parameters("TILES") ->asGridList(); Overlap = Parameters("OVERLAP") ->asInt(); bSaveTiles = Parameters("SAVE_TILES") ->asBool(); BaseName = Parameters("TILE_BASENAME") ->asString(); FilePath = Parameters("TILE_PATH") ->asString(); switch( Parameters("METHOD")->asInt() ) { case 0: default: Extent.xMin = pGrid->Get_XMin(); Extent.xMax = pGrid->Get_XMax(); Extent.yMin = pGrid->Get_YMin(); Extent.yMax = pGrid->Get_YMax(); dCell = pGrid->Get_Cellsize(); nx = Parameters("NX") ->asInt(); ny = Parameters("NY") ->asInt(); dx = dCell * nx; dy = dCell * ny; Type = pGrid->Get_Type(); Interpolation = GRID_INTERPOLATION_NearestNeighbour; break; case 1: Extent.xMin = Parameters("XRANGE") ->asRange()->Get_LoVal(); Extent.xMax = Parameters("XRANGE") ->asRange()->Get_HiVal(); Extent.yMin = Parameters("YRANGE") ->asRange()->Get_LoVal(); Extent.yMax = Parameters("YRANGE") ->asRange()->Get_HiVal(); dCell = Parameters("DCELL") ->asDouble(); dx = Parameters("DX") ->asDouble(); dy = Parameters("DY") ->asDouble(); nx = (int)(dx / dCell); ny = (int)(dy / dCell); Type = pGrid->Get_Type(); Interpolation = GRID_INTERPOLATION_Undefined; break; } switch( Parameters("OVERLAP_SYM")->asInt() ) { case 0: default: // symetric nx += Overlap * 2; ny += Overlap * 2; break; case 1: // bottom / left nx += Overlap; ny += Overlap; break; case 2: // top / right nx += Overlap; ny += Overlap; Overlap = 0; break; } pTiles->Del_Items(); //----------------------------------------------------- if( dx <= 0.0 || dy <= 0.0 || dCell <= 0.0 ) { Message_Add(_TL("no intersection with mask grid.")); return( false ); } if( bSaveTiles ) { if( !SG_STR_CMP(BaseName, SG_T("")) ) { SG_UI_Msg_Add_Error(_TL("Please provide a valid base name for the output files!")); return( false ); } if( !SG_STR_CMP(FilePath, SG_T("")) ) { SG_UI_Msg_Add_Error(_TL("Please provide a valid output directory for the output files!")); return( false ); } } //----------------------------------------------------- int iTiles = 0; for(y=Extent.yMin, iy=1; yAssign(pGrid, Interpolation); pTile ->Set_Name(CSG_String::Format(SG_T("%s [%d, %d]"), pGrid->Get_Name(), iy, ix)); if( pTile->Get_NoData_Count() == pTile->Get_NCells() ) { delete(pTile); } else { if( bSaveTiles ) { CSG_String FileName = CSG_String::Format(SG_T("%s/%s_%d_%d"), FilePath.c_str(), BaseName.c_str(), iy, ix); pTile->Save(FileName); delete(pTile); } else { pTiles->Add_Item(pTile); } iTiles++; } } } SG_UI_Msg_Add(CSG_String::Format(_TL("%d tiles created."), iTiles), true); return( iTiles > 0 ); } //--------------------------------------------------------- int CGrid_Tiling::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) ) { pParameters->Get_Parameter("NODE_A" )->Set_Enabled( pParameter->asInt() == 0 ); pParameters->Get_Parameter("NODE_B" )->Set_Enabled( pParameter->asInt() == 1 ); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SAVE_TILES")) ) { pParameters->Get_Parameter("TILE_BASENAME" )->Set_Enabled( pParameter->asBool() ); pParameters->Get_Parameter("TILE_PATH" )->Set_Enabled( pParameter->asBool() ); } //----------------------------------------------------- return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Tiling.h000066400000000000000000000104161224124640700232450ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Tiling.h 1380 2012-04-26 12:02:19Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Tiling.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Tiling_H #define HEADER_INCLUDED__Grid_Tiling_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Tiling : public CSG_Module_Grid { public: CGrid_Tiling(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Tiling_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Value_Reclassify.cpp000066400000000000000000000472011224124640700256140ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Value_Reclassify.cpp 1733 2013-06-19 08:47:38Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Value_Reclassify.cpp // // // // Copyright (C) 2005 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Value_Reclassify.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Value_Reclassify::CGrid_Value_Reclassify(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name(_TL("Reclassify Grid Values")); Set_Author(_TL("Copyrights (c) 2005 by Volker Wichmann")); Set_Description (_TW( "The module can be used to reclassify the values of a grid. It provides three different options: (a) " "reclassification of single values, (b) reclassification of a range of values and (c) reclassification " "of value ranges specified in a lookup table. In addition to theses methods, two special cases " "(No-Data values and values not included in the reclassification setup) are supported. In mode (a) " "and (b) the 'No-Data option' is evaluated before the method settings, in mode (c) the option is " "evaluated only if the No-Data value ins't included in the lookup table. The 'other values' option " "is always evaluated after checking the method settings. ") ); //----------------------------------------------------- Parameters.Add_Grid( NULL , "INPUT" ,_TL("Grid"), _TL("Grid to reclassify"), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "RESULT" , _TL("Reclassified Grid"), _TL("Reclassified grid."), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL("Select the desired method: 1. a single value or a range defined by a single value is reclassified, 2. a range of values is reclassified, 3. the lookup table is used to reclassify the grid."), _TL("single|range|simple table|user supplied table|"), 0 ); //----------------------------------------------------- Parameters.Add_Value( NULL , "OLD" , _TL("old value"), _TL("Value to reclassify."), PARAMETER_TYPE_Double, 0 ); Parameters.Add_Value( NULL , "NEW" , _TL("new value"), _TL("New value."), PARAMETER_TYPE_Double, 1 ); Parameters.Add_Choice( NULL , "SOPERATOR" , _TL("operator"), _TL("Select the desired operator (<;.;=; >;.); it is possible to define a range above or below the old value."), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("="), _TL("<"), _TL("<="), _TL(">="), _TL(">") ), 0 ); //----------------------------------------------------- Parameters.Add_Value( NULL , "MIN" , _TL("minimum value"), _TL("Minimum value of the range to be reclassified."), PARAMETER_TYPE_Double, 0 ); Parameters.Add_Value( NULL , "MAX" , _TL("maximum value"), _TL("Maximum value of the range to be reclassified."), PARAMETER_TYPE_Double, 10 ); Parameters.Add_Value( NULL , "RNEW" , _TL("new value"), _TL("new value"), PARAMETER_TYPE_Double, 5 ); Parameters.Add_Choice( NULL , "ROPERATOR" , _TL("operator"), _TL("Select operator: eg. min < value < max."), CSG_String::Format(SG_T("%s|%s|"), _TL("<="), _TL("<") ), 0 ); //----------------------------------------------------- Parameters.Add_FixedTable( NULL , "RETAB" , _TL("Lookup Table"), _TL("Lookup table used in method \"table\"") ); Parameters.Add_Choice( NULL , "TOPERATOR" , _TL("operator"), _TL("Select the desired operator (min < value < max; min . value < max; min .value . max; min < value . max)."), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("min <= value < max"), _TL("min <= value <= max"), _TL("min < value <= max"), _TL("min < value < max") ), 0 ); //----------------------------------------------------- pNode = Parameters.Add_Table( NULL , "RETAB_2" , _TL("Lookup Table"), _TL("Lookup table used in method \"user supplied table\""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Table_Field( pNode , "F_MIN" , _TL("minimum value"), _TL("") ); Parameters.Add_Table_Field( pNode , "F_MAX" , _TL("maximum value"), _TL("") ); Parameters.Add_Table_Field( pNode , "F_CODE" , _TL("new value"), _TL("") ); //----------------------------------------------------- pNode = Parameters.Add_Node( NULL, "OPTIONS" , _TL("Special cases"), _TL("Parameter settings for No-Data and all other values.") ); Parameters.Add_Value( pNode , "NODATAOPT" , _TL("no data values"), _TL("Use this option to reclassify No-Data values independently of the method settings."), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( Parameters("NODATAOPT") , "NODATA" , _TL("new value"), _TL("new value"), PARAMETER_TYPE_Double, 0 ); Parameters.Add_Value( pNode , "OTHEROPT" , _TL("other values"), _TL("Use this option to reclassify all other values that are not specified in the options above."), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( Parameters("OTHEROPT") , "OTHERS" , _TL("new value"), _TL("new value"), PARAMETER_TYPE_Double, 0 ); //----------------------------------------------------- CSG_Table *pLookup; CSG_Table_Record *pRecord; pLookup = Parameters("RETAB")->asTable(); pLookup->Add_Field(_TL("minimum") , SG_DATATYPE_Double); pLookup->Add_Field(_TL("maximum") , SG_DATATYPE_Double); pLookup->Add_Field(_TL("new") , SG_DATATYPE_Double); pRecord = pLookup->Add_Record(); pRecord->Set_Value(0, 0.0); pRecord->Set_Value(1, 10.0); pRecord->Set_Value(2, 1.0); pRecord = pLookup->Add_Record(); pRecord->Set_Value(0, 10.0); pRecord->Set_Value(1, 20.0); pRecord->Set_Value(2, 2.0); } //--------------------------------------------------------- CGrid_Value_Reclassify::~CGrid_Value_Reclassify(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Value_Reclassify::On_Execute(void) { int method; bool bSuccess = false; pInput = Parameters("INPUT")->asGrid(); pResult = Parameters("RESULT")->asGrid(); method = Parameters("METHOD")->asInt(); //----------------------------------------------------- switch( method ) { default: case 0: bSuccess = ReclassSingle(); break; case 1: bSuccess = ReclassRange(); break; case 2: bSuccess = ReclassTable(false); break; case 3: bSuccess = ReclassTable(true); break; } //----------------------------------------------------- if( bSuccess ) { pResult->Set_NoData_Value(pInput->Get_NoData_Value()); pResult->Set_Name(CSG_String::Format(SG_T("%s_reclassified"), pInput->Get_Name())); return( true ); } else { return( false ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Value_Reclassify::ReclassRange(void) { bool otherOpt, noDataOpt, floating; int opera; double minValue, maxValue, others, noData, noDataValue, newValue; minValue = Parameters("MIN")->asDouble(); maxValue = Parameters("MAX")->asDouble(); newValue = Parameters("RNEW")->asDouble(); others = Parameters("OTHERS")->asDouble(); noData = Parameters("NODATA")->asDouble(); otherOpt = Parameters("OTHEROPT")->asBool(); noDataOpt = Parameters("NODATAOPT")->asBool(); opera = Parameters("ROPERATOR")->asInt(); noDataValue = pInput->Get_NoData_Value(); if( (pInput->Get_Type() == SG_DATATYPE_Double) || (pInput->Get_Type() == SG_DATATYPE_Float) ) floating = true; else floating = false; for(int y=0; yasDouble(x, y); else value = pInput->asInt(x, y); if( opera == 0 ) // operator <= { if( noDataOpt == true && value == noDataValue ) // noData option pResult->Set_Value(x, y, noData); else if( minValue <= value && value <= maxValue ) // reclass old range pResult->Set_Value(x, y, newValue); else if( otherOpt == true && value != noDataValue ) // other values option pResult->Set_Value(x, y, others); else pResult->Set_Value(x, y, value); // or original value } if( opera == 1 ) // operator < { if( noDataOpt == true && value == noDataValue ) // noData option pResult->Set_Value(x, y, noData); else if( minValue < value && value < maxValue ) // reclass old range pResult->Set_Value(x, y, newValue); else if( otherOpt == true && value != noDataValue ) // other values option pResult->Set_Value(x, y, others); else pResult->Set_Value(x, y, value); // or original value } } } return( true ); } //--------------------------------------------------------- bool CGrid_Value_Reclassify::ReclassSingle(void) { bool otherOpt, noDataOpt, floating; int opera; double oldValue, newValue, others, noData, noDataValue; oldValue = Parameters("OLD")->asDouble(); newValue = Parameters("NEW")->asDouble(); others = Parameters("OTHERS")->asDouble(); noData = Parameters("NODATA")->asDouble(); otherOpt = Parameters("OTHEROPT")->asBool(); noDataOpt = Parameters("NODATAOPT")->asBool(); opera = Parameters("SOPERATOR")->asInt(); noDataValue = pInput->Get_NoData_Value(); if( (pInput->Get_Type() == SG_DATATYPE_Double) || (pInput->Get_Type() == SG_DATATYPE_Float) ) floating = true; else floating = false; for(int y=0; yasDouble(x, y); else value = pInput->asInt(x, y); if( opera == 0 ) // operator = { if( noDataOpt == true && value == noDataValue ) // noData option pResult->Set_Value(x, y, noData); else if( value == oldValue ) // reclass old value pResult->Set_Value(x, y, newValue); else if( otherOpt == true && value != noDataValue ) // other values option pResult->Set_Value(x, y, others); else pResult->Set_Value(x, y, value); // or original value } if( opera == 1 ) // operator < { if( noDataOpt == true && value == noDataValue ) // noData option pResult->Set_Value(x, y, noData); else if( value < oldValue ) // reclass old value pResult->Set_Value(x, y, newValue); else if( otherOpt == true && value != noDataValue ) // other values option pResult->Set_Value(x, y, others); else pResult->Set_Value(x, y, value); // or original value } if( opera == 2 ) // operator <= { if( noDataOpt == true && value == noDataValue ) // noData option pResult->Set_Value(x, y, noData); else if( value <= oldValue ) // reclass old value pResult->Set_Value(x, y, newValue); else if( otherOpt == true && value != noDataValue ) // other values option pResult->Set_Value(x, y, others); else pResult->Set_Value(x, y, value); // or original value } if( opera == 3 ) // operator >= { if( noDataOpt == true && value == noDataValue ) // noData option pResult->Set_Value(x, y, noData); else if( value >= oldValue ) // reclass old value pResult->Set_Value(x, y, newValue); else if( otherOpt == true && value != noDataValue ) // other values option pResult->Set_Value(x, y, others); else pResult->Set_Value(x, y, value); // or original value } if( opera == 4 ) // operator > { if( noDataOpt == true && value == noDataValue ) // noData option pResult->Set_Value(x, y, noData); else if( value > oldValue ) // reclass old value pResult->Set_Value(x, y, newValue); else if( otherOpt == true && value != noDataValue ) // other values option pResult->Set_Value(x, y, others); else pResult->Set_Value(x, y, value); // or original value } } } return( true ); } //--------------------------------------------------------- bool CGrid_Value_Reclassify::ReclassTable(bool bUser) { bool otherOpt, noDataOpt; int opera, field_Min, field_Max, field_Code; double others, noData, noDataValue; CSG_Table *pReTab; if( bUser ) { pReTab = Parameters("RETAB_2") ->asTable(); field_Min = Parameters("F_MIN") ->asInt(); field_Max = Parameters("F_MAX") ->asInt(); field_Code = Parameters("F_CODE") ->asInt(); } else { pReTab = Parameters("RETAB") ->asTable(); field_Min = 0; field_Max = 1; field_Code = 2; } others = Parameters("OTHERS")->asDouble(); noData = Parameters("NODATA")->asDouble(); otherOpt = Parameters("OTHEROPT")->asBool(); noDataOpt = Parameters("NODATAOPT")->asBool(); opera = Parameters("TOPERATOR")->asInt(); noDataValue = pInput->Get_NoData_Value(); if( pReTab == NULL ) { Error_Set(_TL("You must specify a reclass table with a minimium (field 1), a maximum (field 2) and a code value (field 3)!\n")); return( false ); } if( pReTab->Get_Record_Count() == 0 ) { Error_Set(_TL("You must specify a reclass table with a minimium of one record!\n")); return( false ); } for(int y=0; yasDouble(x, y); bool set = false; for(int iRecord=0; iRecordGet_Record_Count(); iRecord++) // reclass { CSG_Table_Record *pRecord = pReTab->Get_Record(iRecord); if( opera == 0 ) // min <= value < max { if( value >= pRecord->asDouble(field_Min) && value < pRecord->asDouble(field_Max) ) { pResult->Set_Value(x, y, pRecord->asDouble(field_Code)); set = true; break; } } else if( opera == 1 ) // min <= value <= max { if( value >= pRecord->asDouble(field_Min) && value <= pRecord->asDouble(field_Max) ) { pResult->Set_Value(x, y, pRecord->asDouble(field_Code)); set = true; break; } } else if( opera == 2 ) // min < value <= max { if( value > pRecord->asDouble(field_Min) && value <= pRecord->asDouble(field_Max) ) { pResult->Set_Value(x, y, pRecord->asDouble(field_Code)); set = true; break; } } else if( opera == 3 ) // min < value < max { if( value > pRecord->asDouble(field_Min) && value < pRecord->asDouble(field_Max) ) { pResult->Set_Value(x, y, pRecord->asDouble(field_Code)); set = true; break; } } } if( set == false ) { if( noDataOpt == true && value == noDataValue ) // noData option pResult->Set_Value(x, y, noData); else if( otherOpt == true && value != noDataValue) // other values option pResult->Set_Value(x, y, others); else pResult->Set_Value(x, y, value); // or original value } } } return (true); } //--------------------------------------------------------- int CGrid_Value_Reclassify::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) ) { int Value = pParameter->asInt(); // single pParameters->Get_Parameter("OLD" )->Set_Enabled(Value == 0); pParameters->Get_Parameter("NEW" )->Set_Enabled(Value == 0); pParameters->Get_Parameter("SOPERATOR" )->Set_Enabled(Value == 0); // range pParameters->Get_Parameter("MIN" )->Set_Enabled(Value == 1); pParameters->Get_Parameter("MAX" )->Set_Enabled(Value == 1); pParameters->Get_Parameter("RNEW" )->Set_Enabled(Value == 1); pParameters->Get_Parameter("ROPERATOR" )->Set_Enabled(Value == 1); // simple table pParameters->Get_Parameter("RETAB" )->Set_Enabled(Value == 2); // user supplied table pParameters->Get_Parameter("RETAB_2" )->Set_Enabled(Value == 3); pParameters->Get_Parameter("TOPERATOR" )->Set_Enabled(Value == 2 || Value == 3); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("NODATAOPT")) ) { pParameters->Get_Parameter("NODATA" )->Set_Enabled(pParameter->asInt() > 0); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("OTHEROPT")) ) { pParameters->Get_Parameter("OTHERS" )->Set_Enabled(pParameter->asInt() > 0); } //----------------------------------------------------- return (1); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Value_Reclassify.h000066400000000000000000000112231224124640700252540ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Value_Reclassify.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Value_Reclassify.h // // // // Copyright (C) 2005 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Value_Reclassify_H #define HEADER_INCLUDED__Grid_Value_Reclassify_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Value_Reclassify : public CSG_Module_Grid { public: CGrid_Value_Reclassify(void); virtual ~CGrid_Value_Reclassify(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Values") ); } protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int single; CSG_Grid *pInput, *pResult; bool ReclassSingle (void); bool ReclassRange (void); bool ReclassTable (bool bUser); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Value_Reclassify_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Value_Replace.cpp000066400000000000000000000163151224124640700250650ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Value_Replace.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Value_Replace.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Value_Replace.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Value_Replace::CGrid_Value_Replace(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Change Grid Values")); Set_Author (SG_T("(c) 2001 by O.Conrad")); Set_Description (_TW( "Changes values of a grid according to the rules of a user defined lookup table. " "Values or value ranges that are not listed in the lookup table remain unchanged. " "If the target is not set, the changes will be stored to the original grid. ") ); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL , "GRID_IN" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "GRID_OUT" , _TL("Changed Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Replace Condition"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Grid value equals low value"), _TL("Low value < grid value < high value"), _TL("Low value <= grid value < high value") ) ); //----------------------------------------------------- CSG_Table *pLookup; CSG_Table_Record *pRecord; pLookup = Parameters.Add_FixedTable( NULL , "LOOKUP" , _TL("Lookup Table"), _TL("") )->asTable(); pLookup->Add_Field(_TL("Low Value") , SG_DATATYPE_Double); pLookup->Add_Field(_TL("High Value") , SG_DATATYPE_Double); pLookup->Add_Field(_TL("Replace with") , SG_DATATYPE_Double); pRecord = pLookup->Add_Record(); pRecord->Set_Value(0, 0.0); pRecord->Set_Value(1, 0.0); pRecord->Set_Value(2, 10.0); pRecord = pLookup->Add_Record(); pRecord->Set_Value(0, 1.0); pRecord->Set_Value(1, 4.0); pRecord->Set_Value(2, 11.0); } //--------------------------------------------------------- CGrid_Value_Replace::~CGrid_Value_Replace(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Value_Replace::On_Execute(void) { bool bReplace; int x, y, iRecord, Method; double Value; CSG_Grid *pGrid; CSG_Table *pLookup; CSG_Table_Record *pRecord; //----------------------------------------------------- pLookup = Parameters("LOOKUP")->asTable(); if( pLookup->Get_Record_Count() > 0 ) { if( Parameters("GRID_OUT")->asGrid() == NULL || Parameters("GRID_IN")->asGrid() == Parameters("GRID_OUT")->asGrid() ) { pGrid = Parameters("GRID_IN") ->asGrid(); } else { pGrid = Parameters("GRID_OUT")->asGrid(); pGrid->Assign(Parameters("GRID_IN")->asGrid()); } Method = Parameters("METHOD")->asInt(); //------------------------------------------------- for(y=0; yasDouble(x, y); for(iRecord=0, bReplace=false; iRecordGet_Record_Count() && !bReplace; iRecord++) { pRecord = pLookup->Get_Record(iRecord); switch( Method ) { case 0: // grid value equals low value... bReplace = Value == pRecord->asDouble(0); break; case 1: // low value < grid value < high value... bReplace = pRecord->asDouble(0) < Value && Value < pRecord->asDouble(1); break; case 2: // low value <= grid value <= high value... bReplace = pRecord->asDouble(0) <= Value && Value <= pRecord->asDouble(1); break; } if( bReplace ) { pGrid->Set_Value(x, y, pRecord->asDouble(2)); } } } } //------------------------------------------------- DataObject_Update(pGrid, pGrid->Get_ZMin(), pGrid->Get_ZMax()); return( true ); } return( false ); } saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Value_Replace.h000066400000000000000000000111441224124640700245250ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Value_Replace.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Value_Replace.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Value_Replace_H #define HEADER_INCLUDED__Grid_Value_Replace_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Value_Replace : public CSG_Module_Grid { public: CGrid_Value_Replace(void); virtual ~CGrid_Value_Replace(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Values") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Value_Replace_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.cpp000066400000000000000000000047121224124640700274200ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Value_Replace_Interactive.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* Grid_Value_Replace_Interactive.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Grid_Value_Replace_Interactive.h" CGrid_Value_Replace_Interactive::CGrid_Value_Replace_Interactive(void){ Set_Name(_TL("Change Cell Values")); Set_Author(_TL("Copyrights (c) 2004 by Victor Olaya")); Set_Description (_TW("(c) 2004 by Victor Olaya.")); Parameters.Add_Grid(NULL, "GRID", _TL("Grid"), _TL(""), PARAMETER_INPUT); Parameters.Add_Value(NULL, "NEWVALUE", _TL("New Value"), _TL("New Value"), PARAMETER_TYPE_Double, 0); }//constructor CGrid_Value_Replace_Interactive::~CGrid_Value_Replace_Interactive(void){ On_Execute_Finish(); } bool CGrid_Value_Replace_Interactive::On_Execute(void){ m_pGrid = Parameters("GRID")->asGrid(); m_dNewValue = Parameters("NEWVALUE")->asDouble(); return true; }//method bool CGrid_Value_Replace_Interactive::On_Execute_Finish(void) { return( true ); } bool CGrid_Value_Replace_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode) { int iX, iY; //----------------------------------------------------- if( Mode != MODULE_INTERACTIVE_LDOWN || !Get_Grid_Pos(iX, iY) ) { return( false ); } double dValue = m_pGrid->asDouble(iX,iY); m_pGrid->Set_Value(iX,iY,m_dNewValue); DataObject_Update(m_pGrid, SG_UI_DATAOBJECT_UPDATE_ONLY); return (true); }//method saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Value_Replace_Interactive.h000066400000000000000000000037571224124640700270750ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Value_Replace_Interactive.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Grid_Value_Replace_Interactive.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Value_Replace_Interactive_H #define HEADER_INCLUDED__Grid_Value_Replace_Interactive_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CGrid_Value_Replace_Interactive : public CSG_Module_Grid_Interactive { private: CSG_Grid *m_pGrid; double m_dNewValue; public: CGrid_Value_Replace_Interactive(void); virtual ~CGrid_Value_Replace_Interactive(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Values") ); } protected: virtual bool On_Execute(void); virtual bool On_Execute_Finish(void); virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode); }; #endif // #ifndef HEADER_INCLUDED__Grid_Value_Replace_Interactive_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Value_Request.cpp000066400000000000000000000202521224124640700251350ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Value_Request.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Tutorial // // // //-------------------------------------------------------// // // // Grid_Value_Request.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Value_Request.h" //--------------------------------------------------------- #define FIELD_NAME 0 #define FIELD_VALUE 1 #define FIELD_X 0 #define FIELD_Y 1 #define FIELD_GRIDS 2 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Value_Request::CGrid_Value_Request(void) { //----------------------------------------------------- // 1. Info... Set_Name(_TL("Grid Value Request")); Set_Author (SG_T("(c) 2003 by O.Conrad")); Set_Description (_TW( "Grid Value Request.\n") ); //----------------------------------------------------- // 2. Standard in- and output... m_pGrids = Parameters.Add_Grid_List( NULL , "GRID_LIST" , _TL("Grids to request"), _TL(""), PARAMETER_INPUT )->asGridList(); Parameters.Add_Table( NULL , "VALUES" , _TL("Values"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Single value"), _TL("Collect values") ), 0 ); Parameters.Add_Choice( NULL , "INTERPOLATION" , _TL("Interpolation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 0 ); Set_Drag_Mode(MODULE_INTERACTIVE_DRAG_NONE); } //--------------------------------------------------------- CGrid_Value_Request::~CGrid_Value_Request(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Value_Request::On_Execute(void) { int iGrid; if( m_pGrids->Get_Count() > 0 ) { m_Method = Parameters("METHOD") ->asInt(); m_Interpolation = Parameters("INTERPOLATION") ->asInt(); m_pTable = Parameters("VALUES") ->asTable(); m_pTable->Destroy(); m_pTable->Set_Name(_TL("Grid Values")); switch( m_Method ) { case 0: default: m_pTable->Add_Field(_TL("NAME") , SG_DATATYPE_String); m_pTable->Add_Field(_TL("VALUE") , SG_DATATYPE_Double); m_pTable->Add_Record()->Set_Value(FIELD_NAME, _TL("X")); m_pTable->Add_Record()->Set_Value(FIELD_NAME, _TL("Y")); for(iGrid=0; iGridGet_Count(); iGrid++) { m_pTable->Add_Record()->Set_Value(FIELD_NAME, m_pGrids->asGrid(iGrid)->Get_Name()); } break; case 1: m_pTable->Add_Field(_TL("X") , SG_DATATYPE_Double); m_pTable->Add_Field(_TL("Y") , SG_DATATYPE_Double); for(iGrid=0; iGridGet_Count(); iGrid++) { m_pTable->Add_Field(m_pGrids->asGrid(iGrid)->Get_Name(), SG_DATATYPE_Double); } break; } DataObject_Update(m_pTable, true); return( true ); } Message_Dlg(_TL("There is no grid to request."), Get_Name()); return( false ); } //--------------------------------------------------------- bool CGrid_Value_Request::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode) { int iGrid; double Value; CSG_Table_Record *pRecord; if( m_pGrids->Get_Count() > 0 ) { switch( m_Method ) { //------------------------------------------------- case 0: if( Mode == MODULE_INTERACTIVE_LDOWN || Mode == MODULE_INTERACTIVE_MOVE_LDOWN ) { m_pTable->Get_Record(0)->Set_Value(FIELD_VALUE, ptWorld.Get_X()); m_pTable->Get_Record(1)->Set_Value(FIELD_VALUE, ptWorld.Get_Y()); for(iGrid=0; iGridGet_Count(); iGrid++) { if( m_pGrids->asGrid(iGrid)->Get_Value(ptWorld, Value, m_Interpolation, true) ) { m_pTable->Get_Record(iGrid + 2)->Set_Value(FIELD_VALUE, Value); } else { m_pTable->Get_Record(iGrid + 2)->Set_Value(FIELD_VALUE, 0.0); } } DataObject_Update(m_pTable); return( true ); } break; //------------------------------------------------- case 1: if( Mode == MODULE_INTERACTIVE_LDOWN ) { pRecord = m_pTable->Add_Record(); pRecord->Set_Value(FIELD_X, ptWorld.Get_X()); pRecord->Set_Value(FIELD_Y, ptWorld.Get_Y()); for(iGrid=0; iGridGet_Count(); iGrid++) { if( m_pGrids->asGrid(iGrid)->Get_Value(ptWorld, Value, m_Interpolation, true) ) { pRecord->Set_Value(FIELD_GRIDS + iGrid, Value); } else { pRecord->Set_Value(FIELD_GRIDS + iGrid, 0.0); } } DataObject_Update(m_pTable); return( true ); } break; } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Value_Request.h000066400000000000000000000103631224124640700246040ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Value_Request.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Tutorial // // // //-------------------------------------------------------// // // // Grid_Value_Request.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Grid_Value_Request.h // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Value_Request_H #define HEADER_INCLUDED__Grid_Value_Request_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Value_Request : public CSG_Module_Interactive { public: CGrid_Value_Request(void); virtual ~CGrid_Value_Request(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Values") ); } protected: virtual bool On_Execute (void); virtual bool On_Execute_Position (CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode); private: int m_Method, m_Interpolation; CSG_Table *m_pTable; CSG_Parameter_Grid_List *m_pGrids; }; #endif // #ifndef HEADER_INCLUDED__Grid_Value_Request_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Value_Type.cpp000066400000000000000000000154521224124640700244340ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Value_Type.cpp 1497 2012-10-22 15:25:48Z manfred-e $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Value_Type.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Value_Type.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Value_Type::CGrid_Value_Type(void) { //----------------------------------------------------- Set_Name(_TL("Convert Data Storage Type")); Set_Author (SG_T("O.Conrad (c) 2003")); Set_Description (_TW( "Changes the storage data type of a grid " "(e.g. from 4 byte floating point to 2 byte signed integer). " "If the target is not set, the original grid's storage type will be changed. ") ); //----------------------------------------------------- Parameters.Add_Grid( NULL , "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Converted Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Data storage type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|"), SG_Data_Type_Get_Name(SG_DATATYPE_Bit ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Byte ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Char ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Word ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Short ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_DWord ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Int ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Float ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Double).c_str() ) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Value_Type::On_Execute(void) { //----------------------------------------------------- CSG_Grid *pOutput = Parameters("OUTPUT") ->asGrid(); CSG_Grid *pInput = Parameters("INPUT") ->asGrid(); if( pOutput == NULL || pOutput == pInput ) { pOutput = pInput; pInput = new CSG_Grid(*pOutput); } //----------------------------------------------------- switch( Parameters("TYPE")->asInt() ) { default: case 0: pOutput->Create(*Get_System(), SG_DATATYPE_Bit ); break; case 1: pOutput->Create(*Get_System(), SG_DATATYPE_Byte ); break; case 2: pOutput->Create(*Get_System(), SG_DATATYPE_Char ); break; case 3: pOutput->Create(*Get_System(), SG_DATATYPE_Word ); break; case 4: pOutput->Create(*Get_System(), SG_DATATYPE_Short ); break; case 5: pOutput->Create(*Get_System(), SG_DATATYPE_DWord ); break; case 6: pOutput->Create(*Get_System(), SG_DATATYPE_Int ); break; case 7: pOutput->Create(*Get_System(), SG_DATATYPE_Float ); break; case 8: pOutput->Create(*Get_System(), SG_DATATYPE_Double); break; } //----------------------------------------------------- for(int y=0; yis_NoData(x, y) ) { pOutput->Set_NoData(x, y); } else { pOutput->Set_Value(x, y, pInput->asDouble(x, y)); } } } //----------------------------------------------------- if( pInput != Parameters("INPUT")->asGrid() ) { delete(pInput); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/Grid_Value_Type.h000066400000000000000000000110421224124640700240700ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Value_Type.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // Grid_Value_Type.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Value_Type_H #define HEADER_INCLUDED__Grid_Value_Type_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Value_Type : public CSG_Module_Grid { public: CGrid_Value_Type(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Values") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Value_Type_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/GridsFromTableAndGrid.cpp000066400000000000000000000135371224124640700255110ustar00rootroot00000000000000/********************************************************** * Version $Id: GridsFromTableAndGrid.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* GridsFromTableAndGrid.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GridsFromTableAndGrid.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGridsFromTableAndGrid::CGridsFromTableAndGrid(void) { CSG_Parameter *pNode; Set_Name (_TL("Grids from classified grid and table")); Set_Description (_TW( "Creates several grids using a classified grid and a table with data values for each class." )); pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "ID_FIELD" , _TL("Attribute"), _TL("") ); Parameters.Add_Grid( NULL , "CLASSES" , _TL("Classes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGridsFromTableAndGrid::On_Execute(void) { int iField, iRecord, iAttribute, nAttributes, *Attribute; long iCell, jCell; CSG_Parameter_Grid_List *pGrids; CSG_Grid *pClasses; CSG_Table *pTable; //----------------------------------------------------- pClasses = Parameters("CLASSES") ->asGrid(); pGrids = Parameters("GRIDS") ->asGridList(); pTable = Parameters("TABLE") ->asTable(); iField = Parameters("ID_FIELD") ->asInt(); pGrids->Del_Items(); //----------------------------------------------------- if( pTable->Get_Field_Count() == 0 || pTable->Get_Count() == 0 ) { Message_Add(_TL("selected table contains no valid records")); return( false ); } //----------------------------------------------------- if( !pTable->Set_Index(iField, TABLE_INDEX_Ascending) ) { Message_Add(_TL("failed to create index for table")); return( false ); } //----------------------------------------------------- if( !pClasses->Get_Sorted(0, iCell, false, true) ) { Message_Add(_TL("failed to create index for grid")); return( false ); } //----------------------------------------------------- Attribute = new int[pTable->Get_Field_Count()]; for(iAttribute=0, nAttributes=0; iAttributeGet_Field_Count(); iAttribute++) { if( iAttribute != iField && pTable->Get_Field_Type(iAttribute) != SG_DATATYPE_String ) { Attribute[nAttributes++] = iAttribute; CSG_Grid *pGrid = SG_Create_Grid(*Get_System()); pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pClasses->Get_Name(), pTable->Get_Field_Name(iAttribute))); pGrids->Add_Item(pGrid); } } if( nAttributes == 0 ) { delete[](Attribute); Message_Add(_TL("selected table does not have numeric attributes")); return( false ); } //----------------------------------------------------- CSG_Table_Record *pRecord = pTable->Get_Record_byIndex(0); for(iCell=0, iRecord=0; iCellGet_Sorted(iCell, jCell, false, true) ) { double valClass = pClasses->asDouble(jCell); while( pRecord && pRecord->asDouble(iField) < valClass ) { pRecord = pTable->Get_Record_byIndex(++iRecord); } if( !pRecord || pRecord->asDouble(iField) > valClass ) { for(iAttribute=0; iAttributeasGrid(iAttribute)->Set_NoData(jCell); } } else { for(iAttribute=0; iAttributeasGrid(iAttribute)->Set_Value(jCell, pRecord->asDouble(Attribute[iAttribute])); } } } } //----------------------------------------------------- delete[](Attribute); return true; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/GridsFromTableAndGrid.h000066400000000000000000000047001224124640700251460ustar00rootroot00000000000000/********************************************************** * Version $Id: GridsFromTableAndGrid.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* GridsFromTableAndGrid.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGridsFromTableAndGrid : public CSG_Module_Grid { public: CGridsFromTableAndGrid(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Grid|Construction") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_tools/MLB_Interface.cpp000066400000000000000000000151461224124640700240040ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1383 2012-04-26 15:44:11Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Grid - Tools") ); case MLB_INFO_Author: return( SG_T("O. Conrad, V. Olaya, V. Wichmann (c) 2002-11") ); case MLB_INFO_Description: return( _TL("Tools for the manipulation of gridded data.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Grid|Tools") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Grid_Orientation.h" #include "Grid_Resample.h" #include "Grid_Aggregate.h" #include "Grid_Cut.h" #include "Grid_Merge.h" #include "Grid_Completion.h" #include "Grid_Gaps.h" #include "Grid_Gaps_OneCell.h" #include "Grid_Gaps_Resampling.h" #include "Grid_Gaps_Spline_Fill.h" #include "Grid_CombineGrids.h" #include "Grid_ConstantGrid.h" #include "Grid_CropToData.h" #include "Grid_InvertNoData.h" #include "GridsFromTableAndGrid.h" #include "Grid_Value_Type.h" #include "Grid_Value_Replace.h" #include "Grid_Value_Replace_Interactive.h" #include "Grid_Value_Request.h" #include "Grid_Value_Reclassify.h" #include "Grid_Buffer.h" #include "Grid_ThresholdBuffer.h" #include "Grid_Buffer_Proximity.h" #include "Grid_SortRaster.h" #include "Grid_Fill.h" #include "CreateGridSystem.h" #include "Grid_Mask.h" #include "Grid_Proximity.h" #include "Grid_Tiling.h" #include "Grid_Shrink_Expand.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CGrid_Resample ); case 1: return( new CGrid_Aggregate ); case 2: return( new CGrid_Cut ); case 3: return( new CGrid_Merge ); case 4: return( new CConstantGrid ); case 5: return( new CGrid_Completion ); case 6: return( new CGrid_Gaps_OneCell ); case 7: return( new CGrid_Gaps ); case 8: return( new CGrid_Buffer ); case 9: return( new CThresholdBuffer ); case 10: return( new CGrid_Proximity_Buffer ); case 11: return( new CGrid_Value_Type ); case 12: return( new CGrid_Value_Replace ); case 13: return( new CGrid_Value_Replace_Interactive ); case 14: return( new CGrid_Value_Request ); case 15: return( new CGrid_Value_Reclassify ); case 16: return( new CGrid_Fill ); case 17: return( new CCropToData ); case 18: return( new CInvertNoData ); case 19: return( new CGrid_Orientation ); case 20: return( new CCombineGrids ); case 21: return( new CSortRaster ); case 22: return( new CGridsFromTableAndGrid ); case 23: return( new CCreateGridSystem ); case 24: return( new CGrid_Mask ); case 25: return( new CGrid_Gaps_Spline_Fill ); case 26: return( new CGrid_Proximity ); case 27: return( new CGrid_Tiling ); case 28: return( new CGrid_Shrink_Expand ); case 29: return( new CGrid_Gaps_Resampling ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/grid/grid_tools/MLB_Interface.h000066400000000000000000000077071224124640700234550ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Tools // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_tools_H #define HEADER_INCLUDED__grid_tools_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef grid_tools_EXPORTS #define grid_tools_EXPORT _SAGA_DLL_EXPORT #else #define grid_tools_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_tools_H saga-2.1.0+dfsg/src/modules/grid/grid_tools/Makefile.am000066400000000000000000000034501224124640700227350ustar00rootroot00000000000000# # $Id: Makefile.am 1383 2012-04-26 15:44:11Z oconrad $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_tools.la libgrid_tools_la_SOURCES =\ CreateGridSystem.cpp\ Grid_Aggregate.cpp\ Grid_Buffer.cpp\ Grid_Buffer_Proximity.cpp\ Grid_CombineGrids.cpp\ Grid_Completion.cpp\ Grid_ConstantGrid.cpp\ Grid_CropToData.cpp\ Grid_Cut.cpp\ Grid_Fill.cpp\ Grid_Gaps.cpp\ Grid_Gaps_OneCell.cpp\ Grid_Gaps_Resampling.cpp\ Grid_Gaps_Spline_Fill.cpp\ Grid_InvertNoData.cpp\ Grid_Mask.cpp\ Grid_Merge.cpp\ Grid_Orientation.cpp\ Grid_Proximity.cpp\ Grid_Resample.cpp\ Grid_Shrink_Expand.cpp\ Grid_SortRaster.cpp\ Grid_ThresholdBuffer.cpp\ Grid_Tiling.cpp\ Grid_Value_Reclassify.cpp\ Grid_Value_Replace.cpp\ Grid_Value_Replace_Interactive.cpp\ Grid_Value_Request.cpp\ Grid_Value_Type.cpp\ GridsFromTableAndGrid.cpp\ MLB_Interface.cpp\ CreateGridSystem.h\ Grid_Aggregate.h\ Grid_Buffer.h\ Grid_Buffer_Proximity.h\ Grid_CombineGrids.h\ Grid_Completion.h\ Grid_ConstantGrid.h\ Grid_CropToData.h\ Grid_Cut.h\ Grid_Fill.h\ Grid_Gaps.h\ Grid_Gaps_OneCell.h\ Grid_Gaps_Resampling.h\ Grid_Gaps_Spline_Fill.h\ Grid_InvertNoData.h\ Grid_Mask.h\ Grid_Merge.h\ Grid_Orientation.h\ Grid_Proximity.h\ Grid_Resample.h\ Grid_Shrink_Expand.h\ Grid_SortRaster.h\ Grid_ThresholdBuffer.h\ Grid_Tiling.h\ Grid_Value_Reclassify.h\ Grid_Value_Replace.h\ Grid_Value_Replace_Interactive.h\ Grid_Value_Request.h\ Grid_Value_Type.h\ GridsFromTableAndGrid.h\ MLB_Interface.h libgrid_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/grid/grid_tools/Makefile.in000066400000000000000000000542621224124640700227550ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/grid/grid_tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgrid_tools_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgrid_tools_la_OBJECTS = CreateGridSystem.lo Grid_Aggregate.lo \ Grid_Buffer.lo Grid_Buffer_Proximity.lo Grid_CombineGrids.lo \ Grid_Completion.lo Grid_ConstantGrid.lo Grid_CropToData.lo \ Grid_Cut.lo Grid_Fill.lo Grid_Gaps.lo Grid_Gaps_OneCell.lo \ Grid_Gaps_Resampling.lo Grid_Gaps_Spline_Fill.lo \ Grid_InvertNoData.lo Grid_Mask.lo Grid_Merge.lo \ Grid_Orientation.lo Grid_Proximity.lo Grid_Resample.lo \ Grid_Shrink_Expand.lo Grid_SortRaster.lo \ Grid_ThresholdBuffer.lo Grid_Tiling.lo \ Grid_Value_Reclassify.lo Grid_Value_Replace.lo \ Grid_Value_Replace_Interactive.lo Grid_Value_Request.lo \ Grid_Value_Type.lo GridsFromTableAndGrid.lo MLB_Interface.lo libgrid_tools_la_OBJECTS = $(am_libgrid_tools_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgrid_tools_la_SOURCES) DIST_SOURCES = $(libgrid_tools_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1383 2012-04-26 15:44:11Z oconrad $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_tools.la libgrid_tools_la_SOURCES = \ CreateGridSystem.cpp\ Grid_Aggregate.cpp\ Grid_Buffer.cpp\ Grid_Buffer_Proximity.cpp\ Grid_CombineGrids.cpp\ Grid_Completion.cpp\ Grid_ConstantGrid.cpp\ Grid_CropToData.cpp\ Grid_Cut.cpp\ Grid_Fill.cpp\ Grid_Gaps.cpp\ Grid_Gaps_OneCell.cpp\ Grid_Gaps_Resampling.cpp\ Grid_Gaps_Spline_Fill.cpp\ Grid_InvertNoData.cpp\ Grid_Mask.cpp\ Grid_Merge.cpp\ Grid_Orientation.cpp\ Grid_Proximity.cpp\ Grid_Resample.cpp\ Grid_Shrink_Expand.cpp\ Grid_SortRaster.cpp\ Grid_ThresholdBuffer.cpp\ Grid_Tiling.cpp\ Grid_Value_Reclassify.cpp\ Grid_Value_Replace.cpp\ Grid_Value_Replace_Interactive.cpp\ Grid_Value_Request.cpp\ Grid_Value_Type.cpp\ GridsFromTableAndGrid.cpp\ MLB_Interface.cpp\ CreateGridSystem.h\ Grid_Aggregate.h\ Grid_Buffer.h\ Grid_Buffer_Proximity.h\ Grid_CombineGrids.h\ Grid_Completion.h\ Grid_ConstantGrid.h\ Grid_CropToData.h\ Grid_Cut.h\ Grid_Fill.h\ Grid_Gaps.h\ Grid_Gaps_OneCell.h\ Grid_Gaps_Resampling.h\ Grid_Gaps_Spline_Fill.h\ Grid_InvertNoData.h\ Grid_Mask.h\ Grid_Merge.h\ Grid_Orientation.h\ Grid_Proximity.h\ Grid_Resample.h\ Grid_Shrink_Expand.h\ Grid_SortRaster.h\ Grid_ThresholdBuffer.h\ Grid_Tiling.h\ Grid_Value_Reclassify.h\ Grid_Value_Replace.h\ Grid_Value_Replace_Interactive.h\ Grid_Value_Request.h\ Grid_Value_Type.h\ GridsFromTableAndGrid.h\ MLB_Interface.h libgrid_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/grid/grid_tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/grid/grid_tools/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgrid_tools.la: $(libgrid_tools_la_OBJECTS) $(libgrid_tools_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgrid_tools_la_OBJECTS) $(libgrid_tools_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CreateGridSystem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Aggregate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Buffer_Proximity.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_CombineGrids.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Completion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_ConstantGrid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_CropToData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Cut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Fill.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Gaps.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Gaps_OneCell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Gaps_Resampling.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Gaps_Spline_Fill.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_InvertNoData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Mask.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Merge.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Orientation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Proximity.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Resample.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Shrink_Expand.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_SortRaster.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_ThresholdBuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Tiling.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Value_Reclassify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Value_Replace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Value_Replace_Interactive.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Value_Request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Value_Type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GridsFromTableAndGrid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/000077500000000000000000000000001224124640700224315ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_3D_Image.cpp000066400000000000000000000470661224124640700254670ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_3D_Image.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_3D_Image.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_3D_Image.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_3D_Image::CGrid_3D_Image(void) { Set_Name(_TL("Create 3D Image")); Set_Author (SG_T("(c) 2005 by O.Conrad")); Set_Description( _TL("") ); //----------------------------------------------------- Parameters.Add_Grid( NULL , "DEM" , _TL("Elevation"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "IMAGE" , _TL("Overlay Image"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes_List( NULL , "SHAPES" , _TL("Shapes to project"), _TL(""), PARAMETER_INPUT_OPTIONAL ); //----------------------------------------------------- Parameters.Add_Value( NULL , "ZEXAGG" , _TL("Exaggeration"), _TL(""), PARAMETER_TYPE_Double, 1.0 ); Parameters.Add_Value( NULL , "ZEXAGG_MIN" , _TL("Minimum Exaggeration [%]"), _TL(""), PARAMETER_TYPE_Double, 10.0, 0.0, true, 100.0, true ); Parameters.Add_Value( NULL , "Z_ROTATE" , _TL("Image Rotation [Degree]"), _TL(""), PARAMETER_TYPE_Double, 0.0 ); Parameters.Add_Value( NULL , "X_ROTATE" , _TL("Local Rotation [Degree]"), _TL(""), PARAMETER_TYPE_Double, 1.0 ); Parameters.Add_Choice( NULL , "X_ROTATE_LEVEL" , _TL("Local Rotation Base Level"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Zero"), _TL("Mean Elevation") ), 1 ); Parameters.Add_Value( NULL , "PANBREAK" , _TL("Panorama Break [%]"), _TL(""), PARAMETER_TYPE_Double, 70.0, 0.0, true, 100.0, true ); Parameters.Add_Value( NULL , "BKCOLOR" , _TL("Background Color"), _TL(""), PARAMETER_TYPE_Color, SG_COLOR_BLACK ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "PROJECTION" , _TL("Projection"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Panorama"), _TL("Circular") ), 0 ); //----------------------------------------------------- Parameters.Add_Value( NULL , "NX" , _TL("3D Image Width"), _TL(""), PARAMETER_TYPE_Int, 100, 1, true ); Parameters.Add_Value( NULL , "NY" , _TL("3D Image Height"), _TL(""), PARAMETER_TYPE_Int, 100, 1, true ); Parameters.Add_Grid( NULL , "RGB" , _TL("3D Image"), _TL(""), // PARAMETER_OUTPUT_OPTIONAL, false, SG_DATATYPE_Int PARAMETER_OUTPUT_OPTIONAL, true, SG_DATATYPE_Int ); Parameters.Add_Grid( NULL , "RGB_Z" , _TL("Projected Height"), _TL(""), // PARAMETER_OUTPUT_OPTIONAL, false, SG_DATATYPE_Float PARAMETER_OUTPUT_OPTIONAL, true, SG_DATATYPE_Float ); } //--------------------------------------------------------- CGrid_3D_Image::~CGrid_3D_Image(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_3D_Image::On_Execute(void) { //----------------------------------------------------- m_pDEM = Parameters("DEM") ->asGrid(); m_pImage = Parameters("IMAGE") ->asGrid(); m_Projection = Parameters("PROJECTION") ->asInt(); m_ZExagg = Parameters("ZEXAGG") ->asDouble(); m_ZExagg_Min = Parameters("ZEXAGG_MIN") ->asDouble() / 100.0; m_ZMean = Parameters("X_ROTATE_LEVEL") ->asInt() == 0 ? 0.0 : m_pDEM->Get_ZMin() + m_pDEM->Get_ZRange() / 2.0; m_XRotate = Parameters("X_ROTATE") ->asDouble() * M_DEG_TO_RAD; m_ZRotate = Parameters("Z_ROTATE") ->asDouble() * M_DEG_TO_RAD; m_PanoramaBreak = Parameters("PANBREAK") ->asDouble() / 100.0; //----------------------------------------------------- m_pRGB = Parameters("RGB") ->asGrid(); m_pRGB_Z = Parameters("RGB_Z") ->asGrid(); if( !m_pRGB ) { int nx, ny; nx = Parameters("NX")->asInt(); ny = Parameters("NY")->asInt(); m_pRGB = SG_Create_Grid(SG_DATATYPE_Int , nx, ny, 1.0); } if( !m_pRGB_Z || !m_pRGB_Z->is_Compatible(m_pRGB->Get_System()) ) { m_pRGB_Z = SG_Create_Grid(m_pRGB, SG_DATATYPE_Float); } m_pRGB ->Set_Name(_TL("3D Image")); m_pRGB ->Assign(Parameters("BKCOLOR")->asDouble()); m_pRGB_Z ->Set_Name(_TL("3D Image Height")); m_pRGB_Z ->Set_NoData_Value_Range(-999999, -999999); m_pRGB_Z ->Assign_NoData(); //----------------------------------------------------- m_XScale = (double)m_pRGB->Get_NX() / (double)Get_NX(); m_YScale = (double)m_pRGB->Get_NY() / (double)Get_NY(); //----------------------------------------------------- _Set_Grid(); CSG_Parameter_Shapes_List *pShapes = Parameters("SHAPES")->asShapesList(); for(int i=0; iGet_Count(); i++) { _Set_Shapes(pShapes->asShapes(i)); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define DRAW_TRIANGLE(pa, pb, pc) p[0] = pa; p[1] = pb; p[2] = pc; _Draw_Triangle(p); //--------------------------------------------------------- void CGrid_3D_Image::_Set_Grid(void) { T3DPoint *a, *b, *c, *d, p[3]; //----------------------------------------------------- a = (T3DPoint *)SG_Malloc(sizeof(T3DPoint) * Get_NX()); b = (T3DPoint *)SG_Malloc(sizeof(T3DPoint) * Get_NX()); c = (T3DPoint *)SG_Malloc(sizeof(T3DPoint) * (Get_NX() - 1)); //----------------------------------------------------- _Get_Line(0, b); for(int y=1; yis_Valid() ) { Process_Set_Text(CSG_String::Format(_TL("Project \'%s\'"), pInput->Get_Name())); pOutput = SG_Create_Shapes(*pInput); dx = (double)Get_NX() / Get_System()->Get_XRange(); dy = (double)Get_NY() / Get_System()->Get_YRange(); for(iShape=0; iShapeGet_Count() && Set_Progress(iShape, pOutput->Get_Count()); iShape++) { pShape = pOutput->Get_Shape(iShape); for(iPart=0; iPartGet_Part_Count(); iPart++) { for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { Point = pShape->Get_Point(iPoint, iPart); x = dx * (Point.x - Get_XMin()); y = dy * (Point.y - Get_YMin()); z = m_pDEM->is_InGrid((int)x, (int)y, true) ? m_pDEM->asDouble((int)x, (int)y) : 0.0; _Get_Position(x, y, z, p); pShape->Set_Point(p.x, p.y, iPoint, iPart); } } } DataObject_Add(pOutput); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_3D_Image::_Get_Line(int y, T3DPoint *p) { for(int x=0; xis_NoData(x, y) || m_pImage->is_NoData(x, y) ) { p[x].bOk = false; } else { p[x].r = SG_GET_R(m_pImage->asInt(x, y)); p[x].g = SG_GET_G(m_pImage->asInt(x, y)); p[x].b = SG_GET_B(m_pImage->asInt(x, y)); _Get_Position(x, y, m_pDEM->asDouble(x, y), p[x]); } } } //--------------------------------------------------------- void CGrid_3D_Image::_Get_Line(T3DPoint *a, T3DPoint *b, T3DPoint *c) { for(int ax=0, bx=1; bxGet_NY())) ) { _Get_Rotated(y, y, 0.0, z, m_XRotate); } else { _Get_Rotated(y, y, 0.0, z, m_XRotate); yRange = m_pRGB->Get_NY() - yOffset; angle = M_PI_090 * ((y - yOffset) / (double)yRange); z = z * (m_ZExagg_Min + (1.0 - m_ZExagg_Min) * (angle > M_PI_090 ? 0.0 : 0.5 + 0.5 * cos(2.0 * angle))); // if( angle < m_XRotate ) // { // _Get_Rotated(y, y, 0.0, z, m_XRotate - angle); // } y = yOffset; _Get_Rotated(y, y, -(1.0 / M_PI_090) * yRange, z, angle); } return( true ); } //--------------------------------------------------------- inline bool CGrid_3D_Image::_Get_Circle(double &y, double &z) { double angle; angle = M_PI_090 * (y / (double)m_pRGB->Get_NY()); z = z * (m_ZExagg_Min + (1.0 - m_ZExagg_Min) * (angle > M_PI_090 ? 0.0 : 0.5 + 0.5 * cos(2.0 * angle))); y = 0.0; _Get_Rotated(y, y, -(1.0 / M_PI_090) * m_pRGB->Get_NY(), z, angle); return( true ); } //--------------------------------------------------------- inline bool CGrid_3D_Image::_Get_Sinus(double &y, double &z) { if( y >= 0 && y < m_pRGB->Get_NY() ) { return( true ); } return( false ); } //--------------------------------------------------------- inline bool CGrid_3D_Image::_Get_Hyperbel(double &y, double &z) { if( y >= 0 && y < m_pRGB->Get_NY() ) { return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define SORT_POINTS_Y(a, b) if( p[a].y < p[b].y ) { pp = p[a]; p[a] = p[b]; p[b] = pp; } #define SORT_POINTS_X(a, b) if( p[a].x < p[b].x ) { pp = p[a]; p[a] = p[b]; p[b] = pp; } //--------------------------------------------------------- void CGrid_3D_Image::_Draw_Triangle(T3DPoint p[3]) { int i, j, k, y, y_j; double x[2], dx[2], dy, z[2], dz[2], r[2], dr[2], g[2], dg[2], b[2], db[2]; T3DPoint pp; //----------------------------------------------------- if( !p[0].bOk || !p[1].bOk || !p[2].bOk ) { return; } //----------------------------------------------------- SORT_POINTS_Y(1, 0); SORT_POINTS_Y(2, 0); SORT_POINTS_Y(2, 1); //----------------------------------------------------- if( p[2].y == p[0].y ) { if( p[0].y >= 0 && p[0].y < m_pRGB->Get_NY() ) { SORT_POINTS_X(1, 0); SORT_POINTS_X(2, 0); SORT_POINTS_X(2, 1); //--------------------------------------------- if( p[2].x == p[0].x ) { if( p[0].x >= 0 && p[0].x < m_pRGB->Get_NX() ) { i = p[0].z > p[1].z ? (p[0].z > p[2].z ? 0 : 2) : (p[1].z > p[2].z ? 1 : 2); _Draw_Pixel(p[0].x, p[0].y, p[i].z, p[i].r, p[i].g, p[i].b); } } //--------------------------------------------- else { _Draw_Line(p[0].x, p[1].x, p[0].y, p[0].z, p[1].z, p[0].r, p[1].r, p[0].g, p[1].g, p[0].b, p[1].b); _Draw_Line(p[1].x, p[2].x, p[0].y, p[1].z, p[2].z, p[1].r, p[2].r, p[1].g, p[2].g, p[1].b, p[2].b); } } } //----------------------------------------------------- else if( !((p[0].y < 0 && p[2].y < 0) || (p[0].y >= m_pRGB->Get_NY() && p[2].y >= m_pRGB->Get_NY())) ) { dy = p[2].y - p[0].y; dx[0] = (p[2].x - p[0].x) / dy; dz[0] = (p[2].z - p[0].z) / dy; dr[0] = (p[2].r - p[0].r) / dy; dg[0] = (p[2].g - p[0].g) / dy; db[0] = (p[2].b - p[0].b) / dy; x [0] = p[0].x; z [0] = p[0].z; r [0] = p[0].r; g [0] = p[0].g; b [0] = p[0].b; for(i=0, j=1; i<2; i++, j++) { if( (dy = p[j].y - p[i].y) > 0.0 ) { dx[1] = (p[j].x - p[i].x) / dy; dz[1] = (p[j].z - p[i].z) / dy; dr[1] = (p[j].r - p[i].r) / dy; dg[1] = (p[j].g - p[i].g) / dy; db[1] = (p[j].b - p[i].b) / dy; x [1] = p[i].x; z [1] = p[i].z; r [1] = p[i].r; g [1] = p[i].g; b [1] = p[i].b; if( (y = p[i].y) < 0 ) { x[1] -= y * dx[1]; z[1] -= y * dz[1]; r[1] -= y * dr[1]; g[1] -= y * dg[1]; b[1] -= y * db[1]; y = 0; x[0] = p[0].x - p[0].y * dx[0]; z[0] = p[0].z - p[0].y * dz[0]; r[0] = p[0].r - p[0].y * dr[0]; g[0] = p[0].g - p[0].y * dg[0]; b[0] = p[0].b - p[0].y * db[0]; } if( (y_j = p[j].y) > m_pRGB->Get_NY() ) { y_j = m_pRGB->Get_NY(); } for( ; y 0.0 ) { dz = (zb - za) / d; dr = (rb - ra) / d; dg = (gb - ga) / d; db = (bb - ba) / d; if( xa < 0 ) { za -= dz * xa; ra -= dr * xa; ga -= dg * xa; ba -= db * xa; xa = 0; } if( xb >= m_pRGB->Get_NX() ) { xb = m_pRGB->Get_NX() - 1; } for(int x=xa; x<=xb; x++, za+=dz, ra+=dr, ga+=dg, ba+=db) { _Draw_Pixel(x, y, za, (int)ra, (int)ga, (int)ba); } } else if( xa >= 0 && xa < m_pRGB->Get_NX() ) { _Draw_Pixel(xa, y, za, (int)ra, (int)ga, (int)ba); } } //--------------------------------------------------------- inline void CGrid_3D_Image::_Draw_Pixel(int x, int y, double z, BYTE r, BYTE g, BYTE b) { if( m_pRGB->is_InGrid(x, y, false) && (m_pRGB_Z->is_NoData(x, y) || z > m_pRGB_Z->asDouble(x, y)) ) { m_pRGB_Z ->Set_Value(x, y, z); m_pRGB ->Set_Value(x, y, SG_GET_RGB(r, g, b)); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_3D_Image.h000066400000000000000000000127461224124640700251310ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_3D_Image.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_3D_Image.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_3D_Image_H #define HEADER_INCLUDED__Grid_3D_Image_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_3D_Image : public CSG_Module_Grid { public: CGrid_3D_Image(void); virtual ~CGrid_3D_Image(void); protected: virtual bool On_Execute (void); private: typedef struct { bool bOk; BYTE r, g, b; int x, y; double z; } T3DPoint; int m_Projection; double m_ZMean, m_ZExagg, m_ZExagg_Min, m_ZRotate, m_XRotate, m_XScale, m_YScale, m_PanoramaBreak; CSG_Grid *m_pDEM, *m_pImage, *m_pRGB, *m_pRGB_Z; void _Set_Grid (void); void _Set_Shapes (CSG_Shapes *pInput); void _Get_Line (int y, T3DPoint *p); void _Get_Line (T3DPoint *a, T3DPoint *b, T3DPoint *c); void _Get_Position (double x, double y, double z, T3DPoint &p); void _Get_Rotated (double xAxis, double &x, double yAxis, double &y, double angle); bool _Get_Panorama (double &y, double &z); bool _Get_Sinus (double &y, double &z); bool _Get_Circle (double &y, double &z); bool _Get_Hyperbel (double &y, double &z); void _Draw_Triangle (T3DPoint p[3]); void _Draw_Line (int xa, int xb, int y, double za, double zb, double ra, double rb, double ga, double gb, double ba, double bb); void _Draw_Pixel (int x, int y, double z, BYTE r, BYTE g, BYTE b); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_3D_Image_H saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.cpp000066400000000000000000000243031224124640700272620ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Aspect_Slope_Map.cpp 1459 2012-08-16 08:22:16Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Aspect_Slope_Map.cpp // // // // Copyright (C) 2012 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Aspect_Slope_Map.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Aspect_Slope_Map::CGrid_Aspect_Slope_Map(void) { //----------------------------------------------------- Set_Name(_TL("Aspect-Slope Grid")); Set_Author(_TL("Copyrights (c) 2012 by Volker Wichmann")); Set_Description (_TW( "This module creates an aspect-slope map which shows both the aspect " "and the slope of the terrain. Aspect is symbolized by different hues, " "while slope is mapped with saturation.\n\n" "References:\n" "Brewer, C.A. & Marlow, K.A. (1993): Color Representation of Aspect and " "Slope simultaneously. Proceedings, Eleventh International Symposium on " "Computer-Assisted Cartography (Auto-Carto-11), Minneapolis, " "October/November 1993, pp. 328-337.\n" "http://www.personal.psu.edu/cab38/Terrain/AutoCarto.html\n" "\n\n" "http://blogs.esri.com/esri/arcgis/2008/05/23/aspect-slope-map/\n") ); //----------------------------------------------------- Parameters.Add_Grid( NULL , "ASPECT" ,_TL("Aspect"), _TL("Aspect grid, in radians and 360 degree from north."), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "SLOPE" ,_TL("Slope"), _TL("Slope grid, in radians."), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "ASPECT_SLOPE", _TL("Aspect-Slope"), _TL("Final aspect-slope grid."), PARAMETER_OUTPUT ); Parameters.Add_Table( NULL , "LUT" , _TL("Lookup Table"), _TL("Lookup table."), PARAMETER_OUTPUT_OPTIONAL ); } //--------------------------------------------------------- CGrid_Aspect_Slope_Map::~CGrid_Aspect_Slope_Map(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- long LUT_COLOR[25] = { SG_GET_RGB(153, 153, 153), SG_GET_RGB(147, 166, 89), SG_GET_RGB(102, 153, 102), SG_GET_RGB(102, 153, 136), SG_GET_RGB( 89, 89, 166), SG_GET_RGB(128, 108, 147), SG_GET_RGB(166, 89, 89), SG_GET_RGB(166, 134, 89), SG_GET_RGB(166, 166, 89), SG_GET_RGB(172, 217, 38), SG_GET_RGB( 77, 179, 77), SG_GET_RGB( 73, 182, 146), SG_GET_RGB( 51, 51, 204), SG_GET_RGB(128, 89, 166), SG_GET_RGB(217, 38, 38), SG_GET_RGB(217, 142, 38), SG_GET_RGB(217, 217, 38), SG_GET_RGB(191, 255, 0), SG_GET_RGB( 51, 204, 51), SG_GET_RGB( 51, 204, 153), SG_GET_RGB( 26, 26, 230), SG_GET_RGB(128, 51, 204), SG_GET_RGB(255, 0, 0), SG_GET_RGB(255, 149, 0), SG_GET_RGB(255, 255, 0) }; //--------------------------------------------------------- CSG_String LUT_NAME[25] = { SG_T("near-flat slopes"), SG_T("N, low slopes"), SG_T("NE, low slopes"), SG_T("E, low slopes"), SG_T("SE, low slopes"), SG_T("S, low slopes"), SG_T("SW, low slopes"), SG_T("W, low slopes"), SG_T("NW, low slopes"), SG_T("N, moderate slopes"), SG_T("NE, moderate slopes"), SG_T("E, moderate slopes"), SG_T("SE, moderate slopes"), SG_T("S, moderate slopes"), SG_T("SW, moderate slopes"), SG_T("W, moderate slopes"), SG_T("NW, moderate slopes"), SG_T("N, steep slopes"), SG_T("NE, steep slopes"), SG_T("E, steep slopes"), SG_T("SE, steep slopes"), SG_T("S, steep slopes"), SG_T("SW, steep slopes"), SG_T("W, steep slopes"), SG_T("NW, steep slopes") }; //--------------------------------------------------------- int LUT_BREAK[26] = {11, 20, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 44, 45, 46, 47, 48, 49 }; //--------------------------------------------------------- bool CGrid_Aspect_Slope_Map::On_Execute(void) { CSG_Grid *pAspect, *pSlope, *pAspectSlope; CSG_Table *pLUT; int iAspectCount = 9; static const double AspectBreaks[] = {0.000, 0.393, 1.178, 1.963, 2.749, 3.534, 4.320, 5.105, 5.890, 6.283}; static const int AspectClass[] = {1, 2, 3, 4, 5, 6, 7, 8, 1}; int iSlopeCount = 4; static const double SlopeBreaks[] = {0.000, 0.087, 0.349, 0.698, 1.571}; static const int SlopeClass[] = {10, 20, 30, 40}; pAspect = Parameters("ASPECT")->asGrid(); pSlope = Parameters("SLOPE")->asGrid(); pAspectSlope = Parameters("ASPECT_SLOPE")->asGrid(); pLUT = Parameters("LUT")->asTable(); //----------------------------------------------------- if( pLUT == NULL ) pLUT = new CSG_Table(); else pLUT->Destroy(); pLUT->Set_Name(SG_T("LUT_Aspect-Slope")); pLUT->Add_Field(SG_T("COLOR"), SG_DATATYPE_Int); pLUT->Add_Field(SG_T("NAME"), SG_DATATYPE_String); pLUT->Add_Field(SG_T("DESCRIPTION"), SG_DATATYPE_String); pLUT->Add_Field(SG_T("MINIMUM"), SG_DATATYPE_Int); pLUT->Add_Field(SG_T("MAXIMUM"), SG_DATATYPE_Int); for(int i=0; i<25; i++) { CSG_Table_Record *pRecord = pLUT->Add_Record(); pRecord->Set_Value(0, LUT_COLOR[i]); pRecord->Set_Value(1, LUT_NAME[i]); pRecord->Set_Value(2, SG_T("")); pRecord->Set_Value(3, LUT_BREAK[i]); pRecord->Set_Value(4, LUT_BREAK[i+1]); } //----------------------------------------------------- #pragma omp parallel for for(long n=0; nis_NoData(n) || pSlope->is_NoData(n) ) { pAspectSlope->Set_NoData(n); } else { iAspectClass = Get_Class(pAspect->asDouble(n), iAspectCount, AspectBreaks, AspectClass); iSlopeClass = Get_Class(pSlope->asDouble(n), iSlopeCount, SlopeBreaks, SlopeClass); pAspectSlope->Set_Value(n, iAspectClass + iSlopeClass); } } //----------------------------------------------------- CSG_Parameters Parms; if( DataObject_Get_Parameters(pAspectSlope, Parms) && Parms("COLORS_TYPE") && Parms("LUT") ) { Parms("LUT")->asTable()->Assign(pLUT); Parms("COLORS_TYPE")->Set_Value(1); DataObject_Set_Parameters(pAspectSlope, Parms); } if( Parameters("LUT")->asTable() == NULL ) { delete pLUT; } //----------------------------------------------------- return( true ); } //--------------------------------------------------------- int CGrid_Aspect_Slope_Map::Get_Class(double dValue, int iCount, const double *pBreaks, const int *pClass) { for(int i=0; i= pBreaks[i] && dValue < pBreaks[i+1] ) return( pClass[i] ); } return( -1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Aspect_Slope_Map.h000066400000000000000000000107031224124640700267260ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Aspect_Slope_Map.h 1456 2012-08-15 10:31:10Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Aspect_Slope_Map.h // // // // Copyright (C) 2012 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Aspect_Slope_Map_H #define HEADER_INCLUDED__Grid_Aspect_Slope_Map_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" #include ; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Aspect_Slope_Map : public CSG_Module_Grid { public: CGrid_Aspect_Slope_Map(void); virtual ~CGrid_Aspect_Slope_Map(void); protected: virtual bool On_Execute (void); private: int Get_Class(double dValue, int iCount, const double *pBreaks, const int *pClass); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Aspect_Slope_Map_H saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Color_Blend.cpp000066400000000000000000000175331224124640700262750ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Color_Blend.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Color_Blend.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Color_Blend.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Color_Blend::CGrid_Color_Blend(void) { Set_Name(_TL("Color Blending")); Set_Author (SG_T("(c) 2001 by O.Conrad")); Set_Description( _TL("Creates a color animation based on the values of selected grids.\n") ); Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Value( NULL , "NSTEPS" , _TL("Interpolation Steps"), _TL(""), PARAMETER_TYPE_Int , 0.0, 0.0, true ); Parameters.Add_Choice( NULL , "RANGE" , _TL("Color Stretch"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("fit to each grid"), _TL("fit to overall range"), _TL("fit to overall 1.5 standard deviation"), _TL("fit to overall 2.0 standard deviation") ), 3 ); } //--------------------------------------------------------- CGrid_Color_Blend::~CGrid_Color_Blend(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Color_Blend::On_Execute(void) { int iGrid, x, y, iStep, nSteps, Range; double d, dStep, Value_A, Value_B, Range_Min, Range_Max; CSG_Grid *pGrid, *pGrid_A, *pGrid_B; CSG_Parameter_Grid_List *pGrids; pGrid = Parameters("GRID") ->asGrid(); pGrids = Parameters("GRIDS") ->asGridList(); Range = Parameters("RANGE") ->asInt(); if( pGrids->Get_Count() > 1 ) { nSteps = Parameters("NSTEPS")->asInt(); dStep = 1.0 / (1.0 + nSteps); nSteps = (1 + nSteps) * (pGrids->Get_Count() - 1); pGrid_B = pGrids->asGrid(0); pGrid->Assign(pGrid_B); switch( Range ) { case 0: Range_Min = pGrid->Get_ZMin(); Range_Max = pGrid->Get_ZMax(); break; case 1: Range_Min = pGrid->Get_ZMin(); Range_Max = pGrid->Get_ZMax(); for(iGrid=1; iGridGet_Count(); iGrid++) { if( Range_Min > pGrids->asGrid(iGrid)->Get_ZMin() ) Range_Min = pGrids->asGrid(iGrid)->Get_ZMin(); if( Range_Max < pGrids->asGrid(iGrid)->Get_ZMax() ) Range_Max = pGrids->asGrid(iGrid)->Get_ZMax(); } break; case 2: Range_Min = pGrid->Get_ArithMean() - 1.5 * pGrid->Get_StdDev(); Range_Max = pGrid->Get_ArithMean() + 1.5 * pGrid->Get_StdDev(); for(iGrid=1; iGridGet_Count(); iGrid++) { double Min = pGrids->asGrid(iGrid)->Get_ArithMean() - 1.5 * pGrids->asGrid(iGrid)->Get_StdDev(); double Max = pGrids->asGrid(iGrid)->Get_ArithMean() + 1.5 * pGrids->asGrid(iGrid)->Get_StdDev(); if( Range_Min > Min ) Range_Min = Min; if( Range_Max < Max ) Range_Max = Max; } break; case 3: Range_Min = pGrid->Get_ArithMean() - 2.0 * pGrid->Get_StdDev(); Range_Max = pGrid->Get_ArithMean() + 2.0 * pGrid->Get_StdDev(); for(iGrid=1; iGridGet_Count(); iGrid++) { double Min = pGrids->asGrid(iGrid)->Get_ArithMean() - 2.0 * pGrids->asGrid(iGrid)->Get_StdDev(); double Max = pGrids->asGrid(iGrid)->Get_ArithMean() + 2.0 * pGrids->asGrid(iGrid)->Get_StdDev(); if( Range_Min > Min ) Range_Min = Min; if( Range_Max < Max ) Range_Max = Max; } break; } DataObject_Update(pGrid, Range_Min, Range_Max, SG_UI_DATAOBJECT_SHOW); for(iGrid=1, iStep=1; iGridGet_Count() && Set_Progress(iStep, nSteps); iGrid++, iStep++) { pGrid_A = pGrid_B; pGrid_B = pGrids->asGrid(iGrid); for(d=dStep; d<1.0 && Set_Progress(iStep, nSteps); d+=dStep, iStep++) { for(y=0; yasDouble(x, y); Value_B = pGrid_B->asDouble(x, y); pGrid->Set_Value(x, y, Value_A + d * (Value_B - Value_A) ); } } if( Range == 0 ) { DataObject_Update(pGrid); } else { DataObject_Update(pGrid, Range_Min, Range_Max); } } pGrid->Assign(pGrid_B); if( Range == 0 ) { DataObject_Update(pGrid); } else { DataObject_Update(pGrid, Range_Min, Range_Max); } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Color_Blend.h000066400000000000000000000074511224124640700257400ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Color_Blend.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Color_Blend.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Color_Blend_H #define HEADER_INCLUDED__Grid_Color_Blend_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CGrid_Color_Blend : public CSG_Module_Grid { public: CGrid_Color_Blend(void); virtual ~CGrid_Color_Blend(void); protected: virtual bool On_Execute(void); }; #endif // #ifndef HEADER_INCLUDED__Grid_Color_Blend_H saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Color_Rotate.cpp000066400000000000000000000123371224124640700265040ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Color_Rotate.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Color_Rotate.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Color_Rotate.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Color_Rotate::CGrid_Color_Rotate(void) { Set_Name (_TL("Color Palette Rotation")); Set_Author (SG_T("(c) 2001 by O.Conrad")); Set_Description (_TW( "The 'Color Palette Rotator' rotates the grids color palette. " )); Parameters.Add_Grid( NULL, "GRID" , _TL("Grid") , _TL(""), PARAMETER_INPUT); Parameters.Add_Colors( NULL, "COLORS" , _TL("Colors") , _TL("")); Parameters.Add_Value( NULL, "DIR" , _TL("Down") , _TL(""), PARAMETER_TYPE_Bool, true); } //--------------------------------------------------------- CGrid_Color_Rotate::~CGrid_Color_Rotate(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Color_Rotate::On_Execute(void) { bool bDown; int i; long c; CSG_Grid *pGrid; CSG_Colors *pColors; pGrid = Parameters("GRID")->asGrid(); pColors = Parameters("COLORS")->asColors(); bDown = Parameters("DIR")->asBool(); if( pColors->Get_Count() > 1 ) { do { if( bDown ) { for(i=0, c=pColors->Get_Color(0); iGet_Count() - 1; i++) { pColors->Set_Color(i, pColors->Get_Color(i + 1)); } pColors->Set_Color(pColors->Get_Count() - 1, c); } else { for(i=pColors->Get_Count()-1, c=pColors->Get_Color(pColors->Get_Count()-1); i>0; i--) { pColors->Set_Color(i, pColors->Get_Color(i - 1)); } pColors->Set_Color(0, c); } DataObject_Set_Colors(pGrid, *pColors); DataObject_Update(pGrid, true); } while( Process_Get_Okay(true) ); return( true ); } return( false ); } saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Color_Rotate.h000066400000000000000000000074641224124640700261560ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Color_Rotate.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Color_Rotate.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Color_Rotate_H #define HEADER_INCLUDED__Grid_Color_Rotate_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CGrid_Color_Rotate : public CSG_Module_Grid { public: CGrid_Color_Rotate(void); virtual ~CGrid_Color_Rotate(void); protected: virtual bool On_Execute (void); }; #endif // #ifndef HEADER_INCLUDED__Grid_Color_Rotate_H saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Color_Triangle.cpp000066400000000000000000000267741224124640700270250ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Color_Triangle.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Color_Triangle.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Color_Triangle.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Color_Triangle::CGrid_Color_Triangle(void) { CSG_Parameter *pNode; Set_Name (_TL("Color Triangle Composite")); Set_Author (SG_T("(c) 2008 by O.Conrad")); Set_Description (_TW( "Similar to 'RGB Composite', but the three colors representing intensity of each data set can be chosen by user. " )); //----------------------------------------------------- pNode = NULL; pNode = Parameters.Add_Grid( pNode , "A_GRID" , _TL("A"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Value( pNode , "A_COLOR" , _TL("Color"), _TL(""), PARAMETER_TYPE_Color , SG_COLOR_RED ); Parameters.Add_Choice( pNode , "A_METHOD" , _TL("Value Preparation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("0 - 1"), _TL("Rescale to 0 - 1"), _TL("User defined rescale"), _TL("Percentiles"), _TL("Percentage of standard deviation") ), 4 ); Parameters.Add_Range( pNode , "A_RANGE" , _TL("Rescale Range"), _TL(""), 0, 1 ); Parameters.Add_Range( pNode , "A_PERCTL" , _TL("Percentiles"), _TL(""), 1.0, 99.0, 0.0, true, 100.0, true ); Parameters.Add_Value( pNode , "A_PERCENT" , _TL("Percentage of standard deviation"), _TL(""), PARAMETER_TYPE_Double , 150.0, 0.0, true ); //----------------------------------------------------- pNode = NULL; pNode = Parameters.Add_Grid( pNode , "B_GRID" , _TL("B"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Value( pNode , "B_COLOR" , _TL("Color"), _TL(""), PARAMETER_TYPE_Color , SG_COLOR_GREEN ); Parameters.Add_Choice( pNode , "B_METHOD" , _TL("Value Preparation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("0 - 1"), _TL("Rescale to 0 - 1"), _TL("User defined rescale"), _TL("Percentiles"), _TL("Percentage of standard deviation") ), 4 ); Parameters.Add_Range( pNode , "B_RANGE" , _TL("Rescale Range"), _TL(""), 0, 1 ); Parameters.Add_Range( pNode , "B_PERCTL" , _TL("Percentiles"), _TL(""), 1.0, 99.0, 0.0, true, 100.0, true ); Parameters.Add_Value( pNode , "B_PERCENT" , _TL("Percentage of standard deviation"), _TL(""), PARAMETER_TYPE_Double , 150.0, 0.0, true ); //----------------------------------------------------- pNode = NULL; pNode = Parameters.Add_Grid( pNode , "C_GRID" , _TL("C"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Value( pNode , "C_COLOR" , _TL("Color"), _TL(""), PARAMETER_TYPE_Color , SG_COLOR_BLUE ); Parameters.Add_Choice( pNode , "C_METHOD" , _TL("Value Preparation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("0 - 1.0"), _TL("Rescale to 0 - 1.0"), _TL("User defined rescale"), _TL("Percentiles"), _TL("Percentage of standard deviation") ), 4 ); Parameters.Add_Range( pNode , "C_RANGE" , _TL("Rescale Range"), _TL(""), 0, 1 ); Parameters.Add_Range( pNode , "C_PERCTL" , _TL("Percentiles"), _TL(""), 1.0, 99.0, 0.0, true, 100.0, true ); Parameters.Add_Value( pNode , "C_PERCENT" , _TL("Percentage of standard deviation"), _TL(""), PARAMETER_TYPE_Double , 150.0, 0.0, true ); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Composite"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Int ); } //--------------------------------------------------------- CGrid_Color_Triangle::~CGrid_Color_Triangle(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define CHK_COLOR(C) if( C > 255 ) C = 255; else if( C < 0 ) C = 0; //--------------------------------------------------------- bool CGrid_Color_Triangle::On_Execute(void) { int x, y, Color[3], aC[3], bC[3], cC[3]; double aMin, bMin, cMin, aRange, bRange, cRange, a, b, c; CSG_Grid *pA, *pB, *pC, *pRGB; //----------------------------------------------------- pA = _Get_Grid(Parameters("A_GRID")->asGrid(), Parameters("A_METHOD")->asInt(), Parameters("A_RANGE")->asRange(), Parameters("A_PERCTL")->asRange(), Parameters("A_PERCENT")->asDouble(), aMin, aRange); pB = _Get_Grid(Parameters("B_GRID")->asGrid(), Parameters("B_METHOD")->asInt(), Parameters("B_RANGE")->asRange(), Parameters("B_PERCTL")->asRange(), Parameters("B_PERCENT")->asDouble(), bMin, bRange); pC = _Get_Grid(Parameters("C_GRID")->asGrid(), Parameters("C_METHOD")->asInt(), Parameters("C_RANGE")->asRange(), Parameters("C_PERCTL")->asRange(), Parameters("C_PERCENT")->asDouble(), cMin, cRange); x = Parameters("A_COLOR")->asColor(); aC[0] = SG_GET_R(x); aC[1] = SG_GET_G(x); aC[2] = SG_GET_B(x); x = Parameters("B_COLOR")->asColor(); bC[0] = SG_GET_R(x); bC[1] = SG_GET_G(x); bC[2] = SG_GET_B(x); x = Parameters("C_COLOR")->asColor(); cC[0] = SG_GET_R(x); cC[1] = SG_GET_G(x); cC[2] = SG_GET_B(x); //----------------------------------------------------- pRGB = Parameters("GRID")->asGrid(); pRGB->Create(pRGB->Get_System(), SG_DATATYPE_Int); DataObject_Set_Colors(pRGB, 100, SG_COLORS_BLACK_WHITE); CSG_Parameters Parms; if( DataObject_Get_Parameters(pRGB, Parms) && Parms("COLORS_TYPE") ) { Parms("COLORS_TYPE")->Set_Value(3); // Color Classification Type: RGB DataObject_Set_Parameters(pRGB, Parms); } //----------------------------------------------------- for(y=0; yis_NoData(x, y) || pB->is_NoData(x, y) || pC->is_NoData(x, y) ) { pRGB->Set_NoData(x, y); } else { a = aRange * (pA->asDouble(x, y) - aMin); if( a > 1.0 ) a = 1.0; else if( a < 0.0 ) a = 0.0; b = bRange * (pB->asDouble(x, y) - bMin); if( b > 1.0 ) b = 1.0; else if( b < 0.0 ) b = 0.0; c = cRange * (pC->asDouble(x, y) - cMin); if( c > 1.0 ) c = 1.0; else if( c < 0.0 ) c = 0.0; Color[0] = (int)((a * aC[0] + b * bC[0] + c * cC[0])); CHK_COLOR(Color[0]); Color[1] = (int)((a * aC[1] + b * bC[1] + c * cC[1])); CHK_COLOR(Color[1]); Color[2] = (int)((a * aC[2] + b * bC[2] + c * cC[2])); CHK_COLOR(Color[2]); pRGB->Set_Value(x, y, SG_GET_RGB(Color[0], Color[1], Color[2])); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Grid * CGrid_Color_Triangle::_Get_Grid(CSG_Grid *pGrid, int Method, CSG_Parameter_Range *pRange, CSG_Parameter_Range *pPerctl, double Percent, double &Min, double &Range) { if( pGrid ) { int x, y; long n; switch( Method ) { default: case 0: // 0 - 1 Min = 0.0; Range = 1.0; break; case 1: // Rescale to 0 - 1 Min = pGrid->Get_ZMin(); Range = pGrid->Get_ZRange(); Range = Range > 0.0 ? 1.0 / Range : 0.0; break; case 2: // User defined rescale Min = pRange->Get_LoVal(); Range = pRange->Get_HiVal() - pRange->Get_LoVal(); Range = Range > 0.0 ? 1.0 / Range : 0.0; break; case 3: // Normalise n = (long)(pGrid->Get_NCells() * pPerctl->Get_LoVal() / 100.0); pGrid->Get_Sorted(n < 0 ? 0 : (n >= pGrid->Get_NCells() ? pGrid->Get_NCells() - 1 : n), x, y, false, false); Min = pGrid->asDouble(x, y); n = (long)(pGrid->Get_NCells() * pPerctl->Get_HiVal() / 100.0); pGrid->Get_Sorted(n < 0 ? 0 : (n >= pGrid->Get_NCells() ? pGrid->Get_NCells() - 1 : n), x, y, false, false); Range = pGrid->asDouble(x, y) - Min; Range = Range > 0.0 ? 1.0 / Range : 0.0; break; case 4: // Standard deviation Range = sqrt(pGrid->Get_Variance()) * Percent / 100.0; Min = pGrid->Get_ArithMean() - Range; Range = Range * 2.0; Range = Range > 0.0 ? 1.0 / Range : 0.0; break; } } return( pGrid ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Color_Triangle.h000066400000000000000000000077521224124640700264650ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Color_Triangle.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Color_Triangle.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Color_Triangle_H #define HEADER_INCLUDED__Grid_Color_Triangle_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CGrid_Color_Triangle : public CSG_Module_Grid { public: CGrid_Color_Triangle(void); virtual ~CGrid_Color_Triangle(void); protected: virtual bool On_Execute(void); private: CSG_Grid * _Get_Grid (CSG_Grid *pGrid, int Method, CSG_Parameter_Range *pRange, CSG_Parameter_Range *pPerctl, double Percent, double &Min, double &Range); }; #endif // #ifndef HEADER_INCLUDED__Grid_Color_Triangle_H saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Colors_Fit.cpp000066400000000000000000000152541224124640700261540ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Colors_Fit.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Colors_Fit.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Colors_Fit.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Colors_Fit::CGrid_Colors_Fit(void) { Set_Name (_TL("Fit Color Palette to Grid Values")); Set_Author (SG_T("(c) 2005 by O.Conrad")); Set_Description (_TW( "" )); Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Value( NULL , "COUNT" , _TL("Number of Colors"), _TL(""), PARAMETER_TYPE_Int , 100, 2, true ); Parameters.Add_Choice( NULL , "SCALE" , _TL("Scale"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Grid range"), _TL("User defined range") ), 0 ); Parameters.Add_Range( NULL , "RANGE" , _TL("User defined range"), _TL(""), 0.0, 1.0 ); } //--------------------------------------------------------- CGrid_Colors_Fit::~CGrid_Colors_Fit(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Colors_Fit::On_Execute(void) { int iColor; long aC, bC; double aZ, bZ, dColor, zMin, zRange; CSG_Colors Colors_Old, Colors_New; CSG_Grid *pGrid; pGrid = Parameters("GRID")->asGrid(); Colors_New.Set_Count(Parameters("COUNT")->asInt()); switch( Parameters("SCALE")->asInt() ) { case 0: default: zMin = pGrid->Get_ZMin(); zRange = pGrid->Get_ZMax() - zMin; break; case 1: zMin = Parameters("RANGE")->asRange()->Get_LoVal(); zRange = Parameters("RANGE")->asRange()->Get_HiVal() - zMin; break; } DataObject_Get_Colors(pGrid, Colors_Old); if( Colors_Old.Get_Count() > 1 && pGrid->Get_ZRange() > 0.0 && zRange != 0.0 ) { dColor = 100.0 / Colors_Old.Get_Count(); aZ = 0.0; aC = Colors_Old.Get_Color(0); for(iColor=1; iColorGet_Percentile(100.0 - iColor * dColor, false) - zMin) / zRange; aC = Colors_Old.Get_Color(iColor); _Set_Colors(Colors_New, bZ, bC, aZ, aC); } bZ = aZ; bC = aC; aZ = 1.0; aC = Colors_Old.Get_Color(Colors_Old.Get_Count() - 1); _Set_Colors(Colors_New, bZ, bC, aZ, aC); DataObject_Set_Colors (pGrid, Colors_New); DataObject_Update (pGrid, zMin, zMin + zRange); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_Colors_Fit::_Set_Colors(CSG_Colors &Colors, double pos_a, long color_a, double pos_b, long color_b) { int a, b; a = (int)(pos_a * Colors.Get_Count()); if( a < 0 ) a = 0; else if( a >= Colors.Get_Count() ) a = Colors.Get_Count() - 1; b = (int)(pos_b * Colors.Get_Count()); if( b < 0 ) b = 0; else if( b >= Colors.Get_Count() ) b = Colors.Get_Count() - 1; Colors.Set_Ramp(color_a, color_b, a, b); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Colors_Fit.h000066400000000000000000000111541224124640700256140ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Colors_Fit.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Colors_Fit.h // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Colors_Fit_H #define HEADER_INCLUDED__Grid_Colors_Fit_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Colors_Fit : public CSG_Module_Grid { public: CGrid_Colors_Fit(void); virtual ~CGrid_Colors_Fit(void); protected: virtual bool On_Execute (void); private: void _Set_Colors (CSG_Colors &Colors, double pos_a, long color_a, double pos_b, long color_b); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Colors_Fit_H saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Histogram_Surface.cpp000066400000000000000000000163721224124640700275200ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Histogram_Surface.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Histogram_Surface.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Histogram_Surface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Histogram_Surface::CGrid_Histogram_Surface(void) { Set_Name (_TL("Histogram Surface")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_Output( NULL , "HIST" , _TL("Histogram"), _TL("") ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("rows"), _TL("columns"), _TL("circle") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Histogram_Surface::On_Execute(void) { m_pGrid = Parameters("GRID")->asGrid(); switch( Parameters("METHOD")->asInt() ) { case 0: return( Get_Lines( true) ); case 1: return( Get_Lines(false) ); case 2: return( Get_Circle() ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Histogram_Surface::Get_Lines(bool bRows) { int i, j, n_i, n_j; CSG_Table Values; CSG_Grid *pHist; //----------------------------------------------------- Parameters("HIST")->Set_Value(pHist = SG_Create_Grid(m_pGrid)); pHist->Set_NoData_Value_Range( m_pGrid->Get_NoData_Value(), m_pGrid->Get_NoData_hiValue() ); n_i = bRows ? Get_NX() : Get_NY(); n_j = bRows ? Get_NY() : Get_NX(); Values.Add_Field(SG_T("Z"), SG_DATATYPE_Double); for(i=0; iSet_Value(0, bRows ? m_pGrid->asDouble(i, j) : m_pGrid->asDouble(j, i)); } Values.Set_Index(0, TABLE_INDEX_Ascending); for(i=0; iSet_Value(k, j, Values.Get_Record_byIndex(i)->asDouble(0)); } else { pHist->Set_Value(j, k, Values.Get_Record_byIndex(i)->asDouble(0)); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Histogram_Surface::Get_Circle(void) { long i; int n; double r; CSG_Grid *pHist; r = sqrt(m_pGrid->Get_NCells() / M_PI); n = 1 + (int)(2.0 * r); //----------------------------------------------------- Parameters("HIST")->Set_Value(pHist = SG_Create_Grid(m_pGrid->Get_Type(), n, n, m_pGrid->Get_Cellsize(), -r * m_pGrid->Get_Cellsize(), -r * m_pGrid->Get_Cellsize())); pHist->Set_NoData_Value_Range( m_pGrid->Get_NoData_Value(), m_pGrid->Get_NoData_hiValue() ); //----------------------------------------------------- for(int y=0; yGet_Sorted((long)(d*d*M_PI), i) ) { pHist->Set_Value(x, y, m_pGrid->asDouble(i)); } else { pHist->Set_NoData(x, y); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_Histogram_Surface.h000066400000000000000000000107551224124640700271640ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Histogram_Surface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_Histogram_Surface.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Histogram_Surface_H #define HEADER_INCLUDED__Grid_Histogram_Surface_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Histogram_Surface : public CSG_Module_Grid { public: CGrid_Histogram_Surface(void); protected: virtual bool On_Execute (void); private: CSG_Grid *m_pGrid; bool Get_Lines (bool bRows); bool Get_Circle (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Histogram_Surface_H saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_RGB_Composite.cpp000066400000000000000000000273171224124640700265500ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_RGB_Composite.cpp 1228 2011-11-18 11:14:21Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_RGB_Composite.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_RGB_Composite.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_RGB_Composite::CGrid_RGB_Composite(void) { CSG_Parameter *pNode; Set_Name (_TL("RGB Composite")); Set_Author (SG_T("(c) 2002 by O.Conrad")); Set_Description (_TW( "Create red-green-blue overlays of grids. " )); //----------------------------------------------------- pNode = NULL; pNode = Parameters.Add_Grid( pNode , "GRID_R" , _TL("Red"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Choice( pNode , "R_METHOD" , _TL("Value Preparation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("0 - 255"), _TL("Rescale to 0 - 255"), _TL("User defined rescale"), _TL("Percentiles"), _TL("Percentage of standard deviation") ), 4 ); Parameters.Add_Range( pNode , "R_RANGE" , _TL("Rescale Range"), _TL(""), 0, 255 ); Parameters.Add_Range( pNode , "R_PERCTL" , _TL("Percentiles"), _TL(""), 1.0, 99.0, 0.0, true, 100.0, true ); Parameters.Add_Value( pNode , "R_PERCENT" , _TL("Percentage of standard deviation"), _TL(""), PARAMETER_TYPE_Double , 150.0, 0.0, true ); //----------------------------------------------------- pNode = NULL; pNode = Parameters.Add_Grid( pNode , "GRID_G" , _TL("Green"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Choice( pNode , "G_METHOD" , _TL("Value Preparation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("0 - 255"), _TL("Rescale to 0 - 255"), _TL("User defined rescale"), _TL("Percentiles"), _TL("Percentage of standard deviation") ), 4 ); Parameters.Add_Range( pNode , "G_RANGE" , _TL("Rescale Range"), _TL(""), 0, 255 ); Parameters.Add_Range( pNode , "G_PERCTL" , _TL("Percentiles"), _TL(""), 1.0, 99.0, 0.0, true, 100.0, true ); Parameters.Add_Value( pNode , "G_PERCENT" , _TL("Percentage of standard deviation"), _TL(""), PARAMETER_TYPE_Double , 150.0, 0.0, true ); //----------------------------------------------------- pNode = NULL; pNode = Parameters.Add_Grid( pNode , "GRID_B" , _TL("Blue"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Choice( pNode , "B_METHOD" , _TL("Value Preparation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("0 - 255"), _TL("Rescale to 0 - 255"), _TL("User defined rescale"), _TL("Percentiles"), _TL("Percentage of standard deviation") ), 4 ); Parameters.Add_Range( pNode , "B_RANGE" , _TL("Rescale Range"), _TL(""), 0, 255 ); Parameters.Add_Range( pNode , "B_PERCTL" , _TL("Percentiles"), _TL(""), 1.0, 99.0, 0.0, true, 100.0, true ); Parameters.Add_Value( pNode , "B_PERCENT" , _TL("Percentage of standard deviation"), _TL(""), PARAMETER_TYPE_Double , 150.0, 0.0, true ); //----------------------------------------------------- pNode = NULL; pNode = Parameters.Add_Grid( pNode , "GRID_A" , _TL("Transparency"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Choice( pNode , "A_METHOD" , _TL("Value Preparation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("0 - 255"), _TL("Rescale to 0 - 255"), _TL("User defined rescale"), _TL("Percentiles"), _TL("Percentage of standard deviation") ), 4 ); Parameters.Add_Range( pNode , "A_RANGE" , _TL("Rescale Range"), _TL(""), 0, 255 ); Parameters.Add_Range( pNode , "A_PERCTL" , _TL("Percentiles"), _TL(""), 1.0, 99.0, 0.0, true, 100.0, true ); Parameters.Add_Value( pNode , "A_PERCENT" , _TL("Percentage of standard deviation"), _TL(""), PARAMETER_TYPE_Double , 150.0, 0.0, true ); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID_RGB" , _TL("Composite"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Int ); } //--------------------------------------------------------- CGrid_RGB_Composite::~CGrid_RGB_Composite(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_RGB_Composite::On_Execute(void) { int x, y, r, g, b, a; double rMin, gMin, bMin, aMin, rRange, gRange, bRange, aRange; CSG_Grid *pR, *pG, *pB, *pA, *pRGB; //----------------------------------------------------- pR = _Get_Grid(Parameters("GRID_R")->asGrid(), Parameters("R_METHOD")->asInt(), Parameters("R_RANGE")->asRange(), Parameters("R_PERCTL")->asRange(), Parameters("R_PERCENT")->asDouble(), rMin, rRange); pG = _Get_Grid(Parameters("GRID_G")->asGrid(), Parameters("G_METHOD")->asInt(), Parameters("G_RANGE")->asRange(), Parameters("G_PERCTL")->asRange(), Parameters("G_PERCENT")->asDouble(), gMin, gRange); pB = _Get_Grid(Parameters("GRID_B")->asGrid(), Parameters("B_METHOD")->asInt(), Parameters("B_RANGE")->asRange(), Parameters("B_PERCTL")->asRange(), Parameters("B_PERCENT")->asDouble(), bMin, bRange); pA = _Get_Grid(Parameters("GRID_A")->asGrid(), Parameters("A_METHOD")->asInt(), Parameters("A_RANGE")->asRange(), Parameters("A_PERCTL")->asRange(), Parameters("A_PERCENT")->asDouble(), aMin, aRange); //----------------------------------------------------- pRGB = Parameters("GRID_RGB")->asGrid(); CSG_String n = pRGB->Get_Name(); pRGB->Create(pRGB->Get_System(), SG_DATATYPE_Int); pRGB->Set_Name(n); DataObject_Set_Colors(pRGB, 100, SG_COLORS_BLACK_WHITE); CSG_Parameters Parms; if( DataObject_Get_Parameters(pRGB, Parms) && Parms("COLORS_TYPE") ) { Parms("COLORS_TYPE")->Set_Value(3); // Color Classification Type: RGB DataObject_Set_Parameters(pRGB, Parms); } //----------------------------------------------------- for(y=0; yis_NoData(x, y) || pG->is_NoData(x, y) || pB->is_NoData(x, y) ) { pRGB->Set_NoData(x, y); } else { r = (int)(rRange * (pR->asDouble(x, y) - rMin)); if( r > 255 ) r = 255; else if( r < 0 ) r = 0; g = (int)(gRange * (pG->asDouble(x, y) - gMin)); if( g > 255 ) g = 255; else if( g < 0 ) g = 0; b = (int)(bRange * (pB->asDouble(x, y) - bMin)); if( b > 255 ) b = 255; else if( b < 0 ) b = 0; if( pA ) { a = (int)(aRange * (pA->asDouble(x, y) - aMin)); if( a > 255 ) a = 255; else if( a < 0 ) a = 0; pRGB->Set_Value(x, y, SG_GET_RGBA(r, g, b, a)); } else { pRGB->Set_Value(x, y, SG_GET_RGB(r, g, b)); } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Grid * CGrid_RGB_Composite::_Get_Grid(CSG_Grid *pGrid, int Method, CSG_Parameter_Range *pRange, CSG_Parameter_Range *pPerctl, double Percent, double &Min, double &Range) { if( pGrid ) { int x, y; long n; switch( Method ) { default: case 0: // 0 - 255 Min = 0.0; Range = 1.0; break; case 1: // Rescale to 0 - 255 Min = pGrid->Get_ZMin(); Range = pGrid->Get_ZRange(); Range = Range > 0.0 ? 255.0 / Range : 0.0; break; case 2: // User defined rescale Min = pRange->Get_LoVal(); Range = pRange->Get_HiVal() - pRange->Get_LoVal(); Range = Range > 0.0 ? 255.0 / Range : 0.0; break; case 3: // Normalise n = (long)(pGrid->Get_NCells() * pPerctl->Get_LoVal() / 100.0); pGrid->Get_Sorted(n < 0 ? 0 : (n >= pGrid->Get_NCells() ? pGrid->Get_NCells() - 1 : n), x, y, false, false); Min = pGrid->asDouble(x, y); n = (long)(pGrid->Get_NCells() * pPerctl->Get_HiVal() / 100.0); pGrid->Get_Sorted(n < 0 ? 0 : (n >= pGrid->Get_NCells() ? pGrid->Get_NCells() - 1 : n), x, y, false, false); Range = pGrid->asDouble(x, y) - Min; Range = Range > 0.0 ? 255.0 / Range : 0.0; break; case 4: // Standard deviation Range = sqrt(pGrid->Get_Variance()) * Percent / 100.0; Min = pGrid->Get_ArithMean() - Range; Range = Range * 2.0; Range = Range > 0.0 ? 255.0 / Range : 0.0; break; } } return( pGrid ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Grid_RGB_Composite.h000066400000000000000000000077431224124640700262160ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_RGB_Composite.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // Grid_RGB_Composite.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_RGB_Composite_H #define HEADER_INCLUDED__Grid_RGB_Composite_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CGrid_RGB_Composite : public CSG_Module_Grid { public: CGrid_RGB_Composite(void); virtual ~CGrid_RGB_Composite(void); protected: virtual bool On_Execute(void); private: CSG_Grid * _Get_Grid (CSG_Grid *pGrid, int Method, CSG_Parameter_Range *pRange, CSG_Parameter_Range *pPerctl, double Percent, double &Min, double &Range); }; #endif // #ifndef HEADER_INCLUDED__Grid_RGB_Composite_H saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/MLB_Interface.cpp000066400000000000000000000121221224124640700255250ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1456 2012-08-15 10:31:10Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Grid - Visualisation") ); case MLB_INFO_Author: return( SG_T("O. Conrad, V. Wichmann (c) 2002-2012") ); case MLB_INFO_Description: return( _TL("Special visualisation functions for grids.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Grid|Visualisation") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Grid_Color_Rotate.h" #include "Grid_Color_Blend.h" #include "Grid_Colors_Fit.h" #include "Grid_RGB_Composite.h" #include "Grid_3D_Image.h" #include "Grid_Color_Triangle.h" #include "Grid_Histogram_Surface.h" #include "Grid_Aspect_Slope_Map.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CGrid_Color_Rotate ); case 1: return( new CGrid_Color_Blend ); case 2: return( new CGrid_Colors_Fit ); case 3: return( new CGrid_RGB_Composite ); case 4: return( new CGrid_3D_Image ); case 5: return( new CGrid_Color_Triangle ); case 6: return( new CGrid_Histogram_Surface ); case 7: return( new CGrid_Aspect_Slope_Map ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/MLB_Interface.h000066400000000000000000000077671224124640700252150ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Visualisation // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_visualisation_H #define HEADER_INCLUDED__grid_visualisation_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef grid_visualisation_EXPORTS #define grid_visualisation_EXPORT _SAGA_DLL_EXPORT #else #define grid_visualisation_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_visualisation_H saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Makefile.am000066400000000000000000000017071224124640700244720ustar00rootroot00000000000000# # $Id: Makefile.am 1456 2012-08-15 10:31:10Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_visualisation.la libgrid_visualisation_la_SOURCES =\ Grid_3D_Image.cpp\ Grid_Color_Blend.cpp\ Grid_Color_Triangle.cpp\ Grid_Color_Rotate.cpp\ Grid_Colors_Fit.cpp\ Grid_Histogram_Surface.cpp\ Grid_RGB_Composite.cpp\ Grid_Aspect_Slope_Map.cpp\ MLB_Interface.cpp\ Grid_3D_Image.h\ Grid_Color_Blend.h\ Grid_Color_Rotate.h\ Grid_Color_Triangle.h\ Grid_Colors_Fit.h\ Grid_Histogram_Surface.h\ Grid_RGB_Composite.h\ Grid_Aspect_Slope_Map.h\ MLB_Interface.h libgrid_visualisation_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/grid/grid_visualisation/Makefile.in000066400000000000000000000464441224124640700245120ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/grid/grid_visualisation DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgrid_visualisation_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgrid_visualisation_la_OBJECTS = Grid_3D_Image.lo \ Grid_Color_Blend.lo Grid_Color_Triangle.lo \ Grid_Color_Rotate.lo Grid_Colors_Fit.lo \ Grid_Histogram_Surface.lo Grid_RGB_Composite.lo \ Grid_Aspect_Slope_Map.lo MLB_Interface.lo libgrid_visualisation_la_OBJECTS = \ $(am_libgrid_visualisation_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgrid_visualisation_la_SOURCES) DIST_SOURCES = $(libgrid_visualisation_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1456 2012-08-15 10:31:10Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgrid_visualisation.la libgrid_visualisation_la_SOURCES = \ Grid_3D_Image.cpp\ Grid_Color_Blend.cpp\ Grid_Color_Triangle.cpp\ Grid_Color_Rotate.cpp\ Grid_Colors_Fit.cpp\ Grid_Histogram_Surface.cpp\ Grid_RGB_Composite.cpp\ Grid_Aspect_Slope_Map.cpp\ MLB_Interface.cpp\ Grid_3D_Image.h\ Grid_Color_Blend.h\ Grid_Color_Rotate.h\ Grid_Color_Triangle.h\ Grid_Colors_Fit.h\ Grid_Histogram_Surface.h\ Grid_RGB_Composite.h\ Grid_Aspect_Slope_Map.h\ MLB_Interface.h libgrid_visualisation_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/grid/grid_visualisation/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/grid/grid_visualisation/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgrid_visualisation.la: $(libgrid_visualisation_la_OBJECTS) $(libgrid_visualisation_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgrid_visualisation_la_OBJECTS) $(libgrid_visualisation_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_3D_Image.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Aspect_Slope_Map.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Color_Blend.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Color_Rotate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Color_Triangle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Colors_Fit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Histogram_Surface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_RGB_Composite.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/pointcloud/000077500000000000000000000000001224124640700177655ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/pointcloud/Makefile.am000066400000000000000000000001441224124640700220200ustar00rootroot00000000000000if WITH_GUI SUBDIRS = pointcloud_viewer pointcloud_tools else SUBDIRS = pointcloud_tools endif saga-2.1.0+dfsg/src/modules/pointcloud/Makefile.in000066400000000000000000000426211224124640700220370ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/pointcloud DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = pointcloud_tools pointcloud_viewer DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @WITH_GUI_FALSE@SUBDIRS = pointcloud_tools @WITH_GUI_TRUE@SUBDIRS = pointcloud_viewer pointcloud_tools all: all-recursive .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) --gnu src/modules/pointcloud/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/pointcloud/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/000077500000000000000000000000001224124640700233655ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/MLB_Interface.cpp000066400000000000000000000120131224124640700264600ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1546 2012-11-27 12:12:54Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Shapes - Point Clouds") ); case MLB_INFO_Author: return( SG_T("O.Conrad, V.Wichmann, M.Bremer (c) 2009-12") ); case MLB_INFO_Description: return( _TL("Tools for point clouds.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Shapes|Point Clouds") ); } } //--------------------------------------------------------- #include "pc_attribute_calculator.h" #include "pc_cluster_analysis.h" #include "pc_cut.h" #include "pc_drop_attribute.h" #include "pc_from_grid.h" #include "pc_from_shapes.h" #include "pc_merge.h" #include "pc_reclass_extract.h" #include "pc_thinning_simple.h" #include "pc_to_grid.h" #include "pc_to_shapes.h" #include "pc_transform.h" //--------------------------------------------------------- CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CPC_Cut ); case 1: return( new CPC_Cut_Interactive ); case 2: return( new CPC_From_Grid ); case 3: return( new CPC_From_Shapes ); case 4: return( new CPC_To_Grid ); case 5: return( new CPC_To_Shapes ); case 6: return( new CPC_Reclass_Extract ); case 7: return( new CPC_Drop_Attribute ); case 8: return( new CPC_Transform ); case 9: return( new CPC_Thinning_Simple ); case 10: return( new CPC_Attribute_Calculator ); case 11: return( new CPC_Cluster_Analysis ); case 12: return( new CPC_Merge ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/MLB_Interface.h000066400000000000000000000075631224124640700261430ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__pointcloud_tools_H #define HEADER_INCLUDED__pointcloud_tools_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef pointcloud_tools_EXPORTS #define pointcloud_tools_EXPORT _SAGA_DLL_EXPORT #else #define pointcloud_tools_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__pointcloud_tools_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/Makefile.am000066400000000000000000000024701224124640700254240ustar00rootroot00000000000000if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` UC_DEFS = -D_SAGA_UNICODE else DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LFLG) pkglib_LTLIBRARIES = libpointcloud_tools.la libpointcloud_tools_la_SOURCES =\ MLB_Interface.cpp\ pc_attribute_calculator.cpp\ pc_cluster_analysis.cpp\ pc_cut.cpp\ pc_drop_attribute.cpp\ pc_from_grid.cpp\ pc_from_shapes.cpp\ pc_merge.cpp\ pc_reclass_extract.cpp\ pc_thinning_simple.cpp\ pc_to_grid.cpp\ pc_to_shapes.cpp\ pc_transform.cpp\ MLB_Interface.h\ pc_attribute_calculator.h\ pc_cluster_analysis.h\ pc_cut.h\ pc_drop_attribute.h\ pc_from_grid.h\ pc_from_shapes.h\ pc_merge.h\ pc_reclass_extract.h\ pc_thinning_simple.h\ pc_to_grid.h\ pc_to_shapes.h\ pc_transform.h libpointcloud_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/Makefile.in000066400000000000000000000500331224124640700254330ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/pointcloud/pointcloud_tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libpointcloud_tools_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libpointcloud_tools_la_OBJECTS = MLB_Interface.lo \ pc_attribute_calculator.lo pc_cluster_analysis.lo pc_cut.lo \ pc_drop_attribute.lo pc_from_grid.lo pc_from_shapes.lo \ pc_merge.lo pc_reclass_extract.lo pc_thinning_simple.lo \ pc_to_grid.lo pc_to_shapes.lo pc_transform.lo libpointcloud_tools_la_OBJECTS = $(am_libpointcloud_tools_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libpointcloud_tools_la_SOURCES) DIST_SOURCES = $(libpointcloud_tools_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_FALSE@DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) @SAGA_UNICODE_TRUE@DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) @SAGA_UNICODE_FALSE@DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` @SAGA_UNICODE_TRUE@DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LFLG) pkglib_LTLIBRARIES = libpointcloud_tools.la libpointcloud_tools_la_SOURCES = \ MLB_Interface.cpp\ pc_attribute_calculator.cpp\ pc_cluster_analysis.cpp\ pc_cut.cpp\ pc_drop_attribute.cpp\ pc_from_grid.cpp\ pc_from_shapes.cpp\ pc_merge.cpp\ pc_reclass_extract.cpp\ pc_thinning_simple.cpp\ pc_to_grid.cpp\ pc_to_shapes.cpp\ pc_transform.cpp\ MLB_Interface.h\ pc_attribute_calculator.h\ pc_cluster_analysis.h\ pc_cut.h\ pc_drop_attribute.h\ pc_from_grid.h\ pc_from_shapes.h\ pc_merge.h\ pc_reclass_extract.h\ pc_thinning_simple.h\ pc_to_grid.h\ pc_to_shapes.h\ pc_transform.h libpointcloud_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/pointcloud/pointcloud_tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/pointcloud/pointcloud_tools/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libpointcloud_tools.la: $(libpointcloud_tools_la_OBJECTS) $(libpointcloud_tools_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libpointcloud_tools_la_OBJECTS) $(libpointcloud_tools_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_attribute_calculator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_cluster_analysis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_cut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_drop_attribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_from_grid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_from_shapes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_merge.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_reclass_extract.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_thinning_simple.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_to_grid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_to_shapes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc_transform.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.cpp000066400000000000000000000172761224124640700310040ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_attribute_calculator.cpp 1519 2012-11-06 14:13:35Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_attribute_calculator.cpp // // // // Copyright (C) 2010 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_attribute_calculator.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_Attribute_Calculator::CPC_Attribute_Calculator(void) { Set_Name(_TL("Point Cloud Attribute Calculator")); Set_Author(_TL("Volker Wichmann (c) 2010, LASERDATA GmbH")); CSG_String s(_TW( "The Point Cloud Attribute Calculator calculates a new attribute " "based on existing attributes and a mathematical formula. " "The attribute fields are referenced by characters 'a' to 'z' " "with 'a' referencing the first field, 'b' the second field and so " "on. Please note that the first three fields contain the x,y,z coordinates.\n" "This (meaningless) example calculates the sine of the x coordinate and " "multiplies it with the z coordinate: sin(a) * c\n\n" "The following operators are available for the formula definition:\n" )); s += CSG_Formula::Get_Help_Operators(); Set_Description(s); //----------------------------------------------------- Parameters.Add_PointCloud( NULL , "PC_IN" ,_TL("Point Cloud"), _TL("Input"), PARAMETER_INPUT ); Parameters.Add_PointCloud( NULL , "PC_OUT" ,_TL("Result"), _TL("Output"), PARAMETER_OUTPUT ); Parameters.Add_String( NULL , "FORMULA" , _TL("Formula"), _TL(""), SG_T("a+b") ); Parameters.Add_String( NULL , "NAME" , _TL("Output Field Name"), _TL(""), SG_T("a+b") ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Field data type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|"), _TL("1 bit"), _TL("1 byte unsigned integer"), _TL("1 byte signed integer"), _TL("2 byte unsigned integer"), _TL("2 byte signed integer"), _TL("4 byte unsigned integer"), _TL("4 byte signed integer"), _TL("4 byte floating point"), _TL("8 byte floating point") ), 7 ); } //--------------------------------------------------------- CPC_Attribute_Calculator::~CPC_Attribute_Calculator(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_Attribute_Calculator::On_Execute(void) { CSG_PointCloud *pInput, *pResult; int iFields; double dValue; double *pFieldValues; const SG_Char *pFormula; CSG_Formula Formula; CSG_String Msg; TSG_Data_Type Type; //--------------------------------------------------------- pInput = Parameters("PC_IN")->asPointCloud(); pResult = Parameters("PC_OUT")->asPointCloud(); switch( Parameters("TYPE")->asInt() ) { case 0: Type = SG_DATATYPE_Bit; break; case 1: Type = SG_DATATYPE_Byte; break; case 2: Type = SG_DATATYPE_Char; break; case 3: Type = SG_DATATYPE_Word; break; case 4: Type = SG_DATATYPE_Short; break; case 5: Type = SG_DATATYPE_DWord; break; case 6: Type = SG_DATATYPE_Int; break; case 7: default: Type = SG_DATATYPE_Float; break; case 8: Type = SG_DATATYPE_Double; break; } pResult->Create(pInput); pResult->Set_Name(CSG_String::Format(SG_T("%s_%s"), pInput->Get_Name(), Parameters("NAME")->asString())); pResult->Add_Field(Parameters("NAME")->asString(), Type); pFormula = Parameters("FORMULA")->asString(); iFields = pInput->Get_Field_Count(); Formula.Set_Formula(pFormula); if( Formula.Get_Error(Msg) ) { SG_UI_Msg_Add_Error(Msg); return( false ); } //--------------------------------------------------------- pFieldValues = new double[iFields]; for( int i=0; iGet_Point_Count() && Set_Progress(i, pInput->Get_Point_Count()); i++ ) { pResult->Add_Point(pInput->Get_X(i), pInput->Get_Y(i), pInput->Get_Z(i)); for( int j=0; jGet_Value(i, j); if( j > 2 ) pResult->Set_Value(j, pInput->Get_Value(i, j)); } dValue = Formula.Get_Value(pFieldValues, iFields); pResult->Set_Value(iFields, dValue); } delete[] pFieldValues; return (true); } //--------------------------------------------------------- int CPC_Attribute_Calculator::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FORMULA")) ) pParameters->Get_Parameter(SG_T("NAME"))->Set_Value(pParameter->asString()); return (true); }saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_attribute_calculator.h000066400000000000000000000110111224124640700304260ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_attribute_calculator.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_attribute_calculator.h // // // // Copyright (C) 2010 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_Attribute_Calculator_H #define HEADER_INCLUDED__PC_Attribute_Calculator_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_Attribute_Calculator : public CSG_Module { public: CPC_Attribute_Calculator(void); virtual ~CPC_Attribute_Calculator(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Tools") ); } protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PC_Attribute_Calculator_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.cpp000066400000000000000000000575751224124640700301620ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_cluster_analysis.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_cluster_analysis.h // // // // Copyright (C) 2010 by // // Volker Wichmann // // // // This module is a port of the Grid_Cluster_Analysis // // module from the Grid_Discretisation module library, // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_cluster_analysis.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_Cluster_Analysis::CPC_Cluster_Analysis(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Cluster Analysis for Point Clouds")); Set_Author (SG_T("Volker Wichmann (c) 2010, LASERDATA GmbH")); Set_Description (_TW( "Cluster Analysis for Point Clouds.\n\n" "Module usage is different between SAGA GUI and SAGA CMD: With " "SAGA GUI you will get prompted to choose the attributes to use " "once you execute the module. With SAGA CMD you have to provide " "a string with the -ATTR_FIELDS parameter containing the field " "numbers of the attributes to use (separated by semicolon). Field " "numbers start with 1, e.g. -ATTR_FIELDS=\"4;5;7\".\n\n" "References:\n\n" "This module is a port of the 'Cluster Analysis for Grids' " "module from the 'Imagery - Classification' module library, " "Copyright (C) 2003 by Olaf Conrad.\n\n" "Iterative Minimum Distance:\n" "- Forgy, E. (1965):\n" " 'Cluster Analysis of multivariate data: efficiency vs. interpretability of classifications',\n" " Biometrics 21:768\n\n" "Hill-Climbing:" "- Rubin, J. (1967):\n" " 'Optimal Classification into Groups: An Approach for Solving the Taxonomy Problem',\n" " J. Theoretical Biology, 15:103-144\n\n" )); //----------------------------------------------------- // 2. Datasets... Parameters.Add_PointCloud( NULL , "PC_IN" ,_TL("Point Cloud"), _TL("Input"), PARAMETER_INPUT ); Parameters.Add_PointCloud( NULL , "PC_OUT" ,_TL("Result"), _TL("Output"), PARAMETER_OUTPUT ); Parameters.Add_Table( NULL , "STATISTICS" , _TL("Statistics"), _TL(""), PARAMETER_OUTPUT ); //----------------------------------------------------- // 3. General Parameters... Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Iterative Minimum Distance (Forgy 1965)"), _TL("Hill-Climbing (Rubin 1967)"), _TL("Combined Minimum Distance / Hillclimbing") ),1 ); Parameters.Add_Value( NULL , "NCLUSTER" , _TL("Clusters"), _TL("Number of clusters"), PARAMETER_TYPE_Int, 10, 2, true ); Parameters.Add_Value( NULL , "NORMALISE" , _TL("Normalise"), _TL("Automatically normalise attributes by standard deviation before clustering."), PARAMETER_TYPE_Bool, true ); if (!SG_UI_Get_Window_Main()) { Parameters.Add_String( NULL , "ATTR_FIELDS" , _TL("Attribute Fields"), _TL("The numbers (starting from 1) of the fields to use for clustering, separated by semicolon, e.g. \"4;5;7\""), SG_T("") ); } else { Parameters.Add_Value( NULL , "UPDATEVIEW" , _TL("Update View"), _TL("Update cluster view while clustering."), PARAMETER_TYPE_Bool, true ); } } //--------------------------------------------------------- CPC_Cluster_Analysis::~CPC_Cluster_Analysis(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_Cluster_Analysis::On_Execute(void) { int i, j, nCluster, cnt; long nElements; double SP; CSG_Parameters Parms; //----------------------------------------------------- nCluster = Parameters("NCLUSTER")->asInt(); pInput = Parameters("PC_IN") ->asPointCloud(); pResult = Parameters("PC_OUT") ->asPointCloud(); pResult ->Create(pInput); pResult ->Set_Name(CSG_String::Format(SG_T("%s_cluster"), pInput->Get_Name())); pResult ->Add_Field(SG_T("CLUSTER"), SG_DATATYPE_Int); DataObject_Update(pResult); pResult ->Set_NoData_Value(- 1.0); clustField = pResult->Get_Field_Count()-1; vFields.resize(pInput->Get_Field_Count()); //----------------------------------------------------- if( SG_UI_Get_Window_Main() ) // GUI { CSG_Parameters Parms; CSG_String fName, fID; Parms.Set_Name(_TL("Choose the attributes to use for clustering:")); for( int iField=0; iFieldGet_Field_Count(); iField++ ) { fName.Printf(SG_T("%s"), pInput->Get_Field_Name(iField)); fID.Printf(SG_T("FIELD_%03d"), iField); Parms.Add_Value(NULL, fID, fName, _TL(""), PARAMETER_TYPE_Bool, false); } if( Dlg_Parameters(&Parms, _TL("")) ) { for( int iField=0; iFieldGet_Field_Count(); iField++ ) { fID.Printf(SG_T("FIELD_%03d"), iField); if( Parms.Get_Parameter(fID)->asBool() ) vFields.at(iField) = true; } } else return( false ); } else // CMD LINE { CSG_String attrFields; CSG_String token; int field; Parameters.Add_Value( NULL , "UPDATEVIEW" , _TL("Update View"), _TL("Update cluster view while clustering."), PARAMETER_TYPE_Bool, false ); attrFields = Parameters("ATTR_FIELDS")->asString(); wxStringTokenizer tkz_fields(attrFields.c_str(), wxT(";"), wxTOKEN_STRTOK); while( tkz_fields.HasMoreTokens() ) { token = tkz_fields.GetNextToken().wc_str(); if( token.Length() == 0 ) break; if( !token.asInt(field) ) { SG_UI_Msg_Add_Error(_TL("Error parsing attribute fields: can't convert to number")); return( false ); } field -= 1; if( field < 0 || field > vFields.size() - 1 ) { SG_UI_Msg_Add_Error(_TL("Error parsing attribute fields: field index out of range")); return( false ); } else vFields.at(field) = true; } } //----------------------------------------------------- Process_Set_Text(_TL("Initializing ...")); nFields = 0; for( i=0; i 0 ) { for( i=0; i() ); for( i=0; iGet_Record_Count() && SG_UI_Process_Set_Progress(i, pInput->Get_Record_Count()); i++ ) { pResult->Add_Point(pInput->Get_X(i), pInput->Get_Y(i), pInput->Get_Z(i)); cnt = 0; for( j=0; jGet_Field_Count(); j++ ) { if( vFields.at(j) ) { if( Parameters("NORMALISE")->asBool() ) vValues.at(cnt).push_back( (pInput->Get_Value(i, j) - pInput->Get_Mean(j)) / pInput->Get_StdDev(j) ); else vValues.at(cnt).push_back(pInput->Get_Value(i, j)); cnt++; } if( j > 2 ) pResult->Set_Value(j, pInput->Get_Value(i, j)); } } pResult->Set_NoData(clustField); if( Parameters("UPDATEVIEW")->asBool() ) { if( DataObject_Get_Parameters(pResult, Parms) && Parms("COLORS_TYPE") && Parms("METRIC_ATTRIB") && Parms("METRIC_COLORS") && Parms("METRIC_ZRANGE") ) { Parms("COLORS_TYPE") ->Set_Value(2); // graduated color Parms("METRIC_COLORS")->asColors() ->Set_Count(nCluster); Parms("METRIC_ATTRIB") ->Set_Value(clustField); Parms("METRIC_ZRANGE")->asRange() ->Set_Range(0, nCluster); } DataObject_Set_Parameters(pResult, Parms); DataObject_Update(pResult, SG_UI_DATAOBJECT_SHOW_LAST_MAP); } nMembers = (int *)SG_Malloc(nCluster * sizeof(int)); Variances = (double *)SG_Malloc(nCluster * sizeof(double)); Centroids = (double **)SG_Malloc(nCluster * sizeof(double *)); for( i=0; iGet_Point_Count(); switch( Parameters("METHOD")->asInt() ) { case 0: SP = MinimumDistance (nElements, nCluster); break; case 1: SP = HillClimbing (nElements, nCluster); break; case 2: SP = MinimumDistance (nElements, nCluster); nElements = pInput->Get_Point_Count(); // may have been diminished because of no data values... SP = HillClimbing (nElements, nCluster); break; } //------------------------------------------------- if( Parameters("NORMALISE")->asBool() ) { int iv = 0; for( i=0; iGet_Variance(i)) * Centroids[j][iv] + pInput->Get_Mean(i); } iv++; } } } Write_Result(Parameters("STATISTICS")->asTable(), nElements, nCluster, SP); //------------------------------------------------- if( DataObject_Get_Parameters(pResult, Parms) && Parms("COLORS_TYPE") && Parms("LUT") && Parms("LUT_ATTRIB") ) { CSG_Table_Record *pClass; CSG_Table *pLUT = Parms("LUT")->asTable(); for( i=0; iGet_Record(i)) == NULL ) { pClass = pLUT->Add_Record(); pClass->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX)); } pClass->Set_Value(1, CSG_String::Format(SG_T("%s %d"), _TL("Class"), i)); pClass->Set_Value(2, CSG_String::Format(SG_T("%s %d"), _TL("Class"), i)); pClass->Set_Value(3, i); pClass->Set_Value(4, i); } while( pLUT->Get_Record_Count() > nCluster ) { pLUT->Del_Record(pLUT->Get_Record_Count() - 1); } Parms("COLORS_TYPE") ->Set_Value(1); // Color Classification Type: Lookup Table Parms("LUT_ATTRIB") ->Set_Value(clustField); DataObject_Set_Parameters(pResult, Parms); } //------------------------------------------------- for( i=0; iDestroy(); s = CSG_String::Format(_TL("Cluster Analysis PC")); s += CSG_String::Format(SG_T("_%s"), pInput->Get_Name()); pTable->Set_Name(s); pTable->Add_Field(_TL("ClusterID") , SG_DATATYPE_Int); pTable->Add_Field(_TL("Elements") , SG_DATATYPE_Int); pTable->Add_Field(_TL("Variance") , SG_DATATYPE_Double); s.Printf(SG_T("\n%s:\t%ld \n%s:\t%d \n%s:\t%d \n%s:\t%f"), _TL("Number of Elements") , nElements, _TL("\nNumber of Variables") , nFields, _TL("\nNumber of Clusters") , nCluster, _TL("\nValue of Target Function") , SP ); s.Append(CSG_String::Format(SG_T("%s\t%s\t%s"), _TL("Cluster"), _TL("Elements"), _TL("Variance"))); cntField = 1; for( j=0; jGet_Field_Name(j))); pTable->Add_Field(pInput->Get_Field_Name(j), SG_DATATYPE_Double); cntField++; } } Message_Add(s); for( i=0; iAdd_Record(); pRecord->Set_Value(0, i); pRecord->Set_Value(1, nMembers[i]); pRecord->Set_Value(2, Variances[i]); for( j=0; jSet_Value(j + 3, Centroids[i][j]); } Message_Add(s); } } /////////////////////////////////////////////////////////// // // // Minimum Distance // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // (nElements)-Array -> Bei Eingabe Startgruppierung oder 0. // Bei Ausgabe Gruppierung: >Das ite Element ist im Cluster Cluster(i). double CPC_Cluster_Analysis::MinimumDistance(long &nElements, int nCluster) { //----------------------------------------------------- // Variablen... bool bContinue; int iElement, iField, iCluster, nClusterElements, nShifts, minCluster, nPasses; double d, Variance, minVariance, SP, SP_Last = -1; //----------------------------------------------------- // Anfangspartition (Standard falls nicht vorgegeben for( iElement=0, nClusterElements=0; iElementis_NoData(iElement) ) { bContinue = false; } }*/ bContinue = true; if( bContinue ) { if( pResult->Get_Value(iElement, clustField) < 0 || pResult->Get_Value(iElement, clustField) >= nCluster ) { pResult->Set_Value(iElement, clustField, iElement % nCluster); } nClusterElements++; } else { pResult->Set_Value(iElement, clustField, -1); } } if( Parameters("UPDATEVIEW")->asBool() ) { DataObject_Update(pResult); } //----------------------------------------------------- // Hauptschleife der Iteration for( nPasses=1, bContinue=true; bContinue && Process_Get_Okay(false); nPasses++ ) { //------------------------------------------------- for( iCluster=0; iClusterGet_Value(iElement, clustField) >= 0 ) { iCluster = (int)pResult->Get_Value(iElement, clustField); nMembers[iCluster]++; for( iField=0; iField 0 ? 1.0 / (double)nMembers[iCluster] : 0; for( iField=0; iFieldGet_Value(iElement, clustField) >= 0 ) { minVariance = -1; for( iCluster=0; iClusterGet_Value(iElement, clustField) != minCluster ) { pResult->Set_Value(iElement, clustField, minCluster); nShifts++; } SP += minVariance; Variances[minCluster] += minVariance; } } //------------------------------------------------- if( nShifts == 0 || (SP_Last >= 0 && SP >= SP_Last) ) { bContinue = false; } Process_Set_Text(CSG_String::Format(SG_T("%s: %d >> %s %f"), _TL("pass") , nPasses, _TL("change") , SP_Last < 0.0 ? SP : SP_Last - SP )); SP_Last = SP; if( Parameters("UPDATEVIEW")->asBool() ) { DataObject_Update(pResult); } } nElements = nClusterElements; return( SP ); } /////////////////////////////////////////////////////////// // // // Hill-Climbing // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- double CPC_Cluster_Analysis::HillClimbing(long &nElements, int nCluster) { //----------------------------------------------------- // Variablen... bool bContinue; int iElement, iField, iCluster, jCluster, kCluster, nClusterElements, noShift, nPasses; double d, e, n_iK, n_jK, V, VMin, V1, V2, SP, SP_Last = -1; //----------------------------------------------------- for( iCluster=0; iClusteris_NoData(iElement) ) { bContinue = false; } }*/ bContinue = true; if( bContinue ) { if( pResult->Get_Value(iElement, clustField) < 0 || pResult->Get_Value(iElement, clustField) >= nCluster ) { pResult->Set_Value(iElement, clustField, iElement % nCluster); } nClusterElements++; iCluster = (int)pResult->Get_Value(iElement, clustField); nMembers[iCluster]++; V = 0.0; for( iField=0; iFieldSet_Value(iElement, clustField, -1); } } //----------------------------------------------------- SP = 0.0; for( iCluster=0; iClusterasBool() ) { DataObject_Update(pResult); } //----------------------------------------------------- // Hauptschleife der Iteration noShift = 0; for( nPasses=1, bContinue=true; bContinue && Process_Get_Okay(false); nPasses++ ) { //------------------------------------------------- for( iElement=0; iElementGet_Value(iElement, clustField) >= 0 ) { if( noShift++ >= nElements ) { bContinue = false; } else { //--------------------------------------------- iCluster = (int)pResult->Get_Value(iElement, clustField); if( nMembers[iCluster] > 1 ) { V = 0.0; for( iField=0; iField= 0 && VMin < V1 ) { noShift = 0; Variances[iCluster] -= V1; Variances[kCluster] += VMin; SP = SP - V1 + VMin; V1 = 1.0 / (n_iK - 1.0); n_jK = nMembers[kCluster]; V2 = 1.0 / (n_jK + 1.0); for( iField=0; iFieldSet_Value(iElement, clustField, kCluster); nMembers[iCluster]--; nMembers[kCluster]++; } } } } } Process_Set_Text(CSG_String::Format(SG_T("%s: %d >> %s %f"), _TL("pass") , nPasses, _TL("change") , SP_Last < 0.0 ? SP : SP_Last - SP )); SP_Last = SP; if( Parameters("UPDATEVIEW")->asBool() ) { DataObject_Update(pResult); } } nElements = nClusterElements; return( SP ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_cluster_analysis.h000066400000000000000000000113731224124640700276110ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_cluster_analysis.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_cluster_analysis.h // // // // Copyright (C) 2010 by // // Volker Wichmann // // // // This module is a port of the Grid_Cluster_Analysis // // module from the Grid_Discretisation module library, // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_Cluster_Analysis_H #define HEADER_INCLUDED__PC_Cluster_Analysis_H //--------------------------------------------------------- #include #include #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_Cluster_Analysis : public CSG_Module { public: CPC_Cluster_Analysis(void); virtual ~CPC_Cluster_Analysis(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Classification") ); } protected: virtual bool On_Execute (void); private: int nFields, clustField, *nMembers; double **Centroids, *Variances; CSG_PointCloud *pInput, *pResult; std::vector vFields; std::vector< std::vector > vValues; void Write_Result (CSG_Table *pTable, long nElements, int nCluster, double SP); double MinimumDistance (long &nElements, int nCluster); double HillClimbing (long &nElements, int nCluster); }; #endif // #ifndef HEADER_INCLUDED__PC_Cluster_Analysis_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_cut.cpp000066400000000000000000000376361224124640700253650ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_cut.cpp 1217 2011-11-07 09:02:46Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_cut.cpp // // // // Copyright (C) 2009-10 by // // Olaf Conrad // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_cut.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_Cut::CPC_Cut(void) { CSG_Parameters *pParameters; //----------------------------------------------------- Set_Name (_TL("Point Cloud Cutter")); Set_Author (SG_T("O. Conrad, V. Wichmann (c) 2009-10")); Set_Description (_TW( "This modules allows to extract subsets from a Point Cloud. The area-of-interest " "is defined either by bounding box coordinates, the extent of a grid system or " "a shapes layer, or by polygons of a shapes layer. Note that the latter " "does not support the inverse selection.\n\n" )); //----------------------------------------------------- Parameters.Add_PointCloud( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT ); Parameters.Add_PointCloud( NULL , "CUT" , _TL("Cut"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "AREA" , _TL("Choose Cut from ..."), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("User Defined Extent"), _TL("Grid System Extent"), _TL("Shapes Extent"), _TL("Polygons") ), 0 ); Parameters.Add_Value( NULL , "INVERSE" , _TL("Inverse"), _TL("Invert selection."), PARAMETER_TYPE_Bool, false ); //----------------------------------------------------- // User Defined Extent pParameters = Add_Parameters ( "USER" , _TL("User Defined Extent"), _TL("")); pParameters ->Add_Value (NULL, "XMIN" , _TL("Left") , _TL(""), PARAMETER_TYPE_Double); pParameters ->Add_Value (NULL, "XMAX" , _TL("Right") , _TL(""), PARAMETER_TYPE_Double); pParameters ->Add_Value (NULL, "YMIN" , _TL("Bottom") , _TL(""), PARAMETER_TYPE_Double); pParameters ->Add_Value (NULL, "YMAX" , _TL("Top") , _TL(""), PARAMETER_TYPE_Double); //----------------------------------------------------- // Grid System Extent pParameters = Add_Parameters ( "GRID" , _TL("Grid System Extent") , _TL("")); pParameters ->Add_Grid_System (NULL, "GRID" , _TL("Grid System") , _TL("")); //----------------------------------------------------- // Shapes Extent pParameters = Add_Parameters ( "EXTENT" , _TL("Shapes Extent") , _TL("")); pParameters ->Add_Shapes (NULL, "EXTENT" , _TL("Shapes Extent") , _TL(""), PARAMETER_INPUT); //----------------------------------------------------- // Polygons pParameters = Add_Parameters ( "POLYGONS" , _TL("Polygons") , _TL("")); pParameters ->Add_Shapes (NULL, "POLYGONS" , _TL("Polygons") , _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_Cut::On_Execute(void) { CSG_PointCloud *pPoints = Parameters("POINTS") ->asPointCloud(); CSG_PointCloud *pCut = Parameters("CUT") ->asPointCloud(); switch( Parameters("AREA")->asInt() ) { //----------------------------------------------------- case 0: // User Defined Extent if( Dlg_Parameters("USER") ) { CSG_Rect r( Get_Parameters("USER")->Get_Parameter("XMIN")->asDouble(), Get_Parameters("USER")->Get_Parameter("YMIN")->asDouble(), Get_Parameters("USER")->Get_Parameter("XMAX")->asDouble(), Get_Parameters("USER")->Get_Parameter("YMAX")->asDouble() ); return( Get_Cut(pPoints, pCut, r, Parameters("INVERSE")->asBool()) ); } break; //----------------------------------------------------- case 1: // Grid System Extent if( Dlg_Parameters("GRID") ) { return( Get_Cut(pPoints, pCut, Get_Parameters("GRID")->Get_Parameter("GRID")->asGrid_System()->Get_Extent(), Parameters("INVERSE")->asBool()) ); } break; //----------------------------------------------------- case 2: // Shapes Extent if( Dlg_Parameters("EXTENT") ) { return( Get_Cut(pPoints, pCut, Get_Parameters("EXTENT")->Get_Parameter("EXTENT")->asShapes()->Get_Extent(), Parameters("INVERSE")->asBool()) ); } break; //----------------------------------------------------- case 3: // Polygons if( Dlg_Parameters("POLYGONS") ) { if( Parameters("INVERSE")->asBool() && Get_Parameters("POLYGONS")->Get_Parameter("POLYGONS")->asShapes()->Get_Count() > 1 ) { SG_UI_Msg_Add_Error(_TL("The inverse selection is not implemented for input shapefiles with more than one polygon!")); return (false); } return( Get_Cut(pPoints, pCut, Get_Parameters("POLYGONS")->Get_Parameter("POLYGONS")->asShapes(), Parameters("INVERSE")->asBool()) ); } break; } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_Cut::Get_Cut(CSG_PointCloud *pPoints, CSG_PointCloud *pCut, const CSG_Rect &Extent, bool bInverse) { if( pPoints && pPoints->is_Valid() && pCut ) { pCut->Create(pPoints); pCut->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Cut"))); if( Extent.Intersects(pPoints->Get_Extent()) ) { for(int i=0; iGet_Point_Count() && SG_UI_Process_Set_Progress(i, pPoints->Get_Point_Count()); i++) { pPoints->Set_Cursor(i); if( (Extent.Contains(pPoints->Get_X(), pPoints->Get_Y()) && !bInverse) || (!Extent.Contains(pPoints->Get_X(), pPoints->Get_Y()) && bInverse) ) { pCut->Add_Point(pPoints->Get_X(), pPoints->Get_Y(), pPoints->Get_Z()); for(int j=0; jGet_Field_Count() - 3; j++) { pCut->Set_Attribute(j, pPoints->Get_Attribute(j)); } } } } return( pCut->Get_Count() > 0 ); } return( false ); } //--------------------------------------------------------- bool CPC_Cut::Get_Cut(CSG_PointCloud *pPoints, CSG_PointCloud *pCut, CSG_Shapes *pPolygons, bool bInverse) { if( pPoints && pPoints->is_Valid() && pCut ) { pCut->Create(pPoints); pCut->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), pPolygons->Get_Name())); if( pPolygons && pPolygons->Get_Type() == SHAPE_TYPE_Polygon && pPolygons->Get_Extent().Intersects(pPoints->Get_Extent()) ) { for(int i=0; iGet_Point_Count() && SG_UI_Process_Set_Progress(i, pPoints->Get_Point_Count()); i++) { pPoints->Set_Cursor(i); if( (Contains(pPolygons, pPoints->Get_X(), pPoints->Get_Y()) && !bInverse) || (!Contains(pPolygons, pPoints->Get_X(), pPoints->Get_Y()) && bInverse) ) { pCut->Add_Point(pPoints->Get_X(), pPoints->Get_Y(), pPoints->Get_Z()); for(int j=0; jGet_Field_Count() - 3; j++) { pCut->Set_Attribute(j, pPoints->Get_Attribute(j)); } } } } return( pCut->Get_Count() > 0 ); } return( false ); } //--------------------------------------------------------- bool CPC_Cut::Contains(CSG_Shapes *pPolygons, double x, double y) { if( pPolygons->Get_Extent().Contains(x, y) ) { for(int iPolygon=0; iPolygonGet_Count(); iPolygon++) { CSG_Shape_Polygon *pPolygon = (CSG_Shape_Polygon *)pPolygons->Get_Shape(iPolygon); if( pPolygon->Contains(x, y) ) { return( true ); } } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_Cut_Interactive::CPC_Cut_Interactive(void) { //----------------------------------------------------- Set_Name (_TL("Point Cloud Cutter")); Set_Author (SG_T("O. Conrad, V. Wichmann (c) 2009-10")); Set_Description (_TW( "This modules allows to extract subsets from a Point Cloud. The area-of-interest " "is interactively defined either by dragging a box or by digitizing a polygon.\n" "Best practice is to display the Point Cloud in a new Map View first and then " "execute the module. Use the Action tool to define the AOI.\n\n" )); //----------------------------------------------------- Parameters.Add_PointCloud( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT ); Parameters.Add_PointCloud( NULL , "CUT" , _TL("Cut"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "AOI" , _TL("Define AOI by ..."), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("dragging a box"), _TL("digitzing a polygon") ), 0 ); Parameters.Add_Shapes( Parameters("AOI"), "AOISHAPE" , _TL("AOI Shape"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon ); Parameters.Add_Value( NULL , "INVERSE" , _TL("Inverse"), _TL("Invert selection."), PARAMETER_TYPE_Bool, false ); //----------------------------------------------------- CSG_Parameters *pParameters = Add_Parameters("CUT", _TL("Cut"), _TL("")); pParameters->Add_Value(NULL, "XMIN", _TL("Left") , _TL(""), PARAMETER_TYPE_Double); pParameters->Add_Value(NULL, "XMAX", _TL("Right") , _TL(""), PARAMETER_TYPE_Double); pParameters->Add_Value(NULL, "YMIN", _TL("Bottom") , _TL(""), PARAMETER_TYPE_Double); pParameters->Add_Value(NULL, "YMAX", _TL("Top") , _TL(""), PARAMETER_TYPE_Double); } //--------------------------------------------------------- bool CPC_Cut_Interactive::On_Execute(void) { m_pPoints = Parameters("POINTS") ->asPointCloud(); m_pCut = Parameters("CUT") ->asPointCloud(); m_bAOIBox = Parameters("AOI") ->asInt() == 0 ? true : false; m_pAOI = Parameters("AOISHAPE")->asShapes(); m_bInverse = Parameters("INVERSE") ->asBool(); if( !m_bAOIBox ) { m_bAdd = false; Set_Drag_Mode(MODULE_INTERACTIVE_DRAG_LINE); if( m_pAOI == NULL ) { m_pAOI = SG_Create_Shapes(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("AOI_%s"), m_pPoints->Get_Name())); m_pAOI->Add_Field("ID", SG_DATATYPE_Int); Parameters("AOISHAPE")->Set_Value(m_pAOI); DataObject_Add(m_pAOI, true); } else if( m_pAOI->Get_Field_Count() < 1) m_pAOI->Add_Field("ID", SG_DATATYPE_Int); CSG_Parameters sParms; if( DataObject_Get_Parameters(m_pAOI, sParms) && sParms("DISPLAY_BRUSH") && sParms("OUTLINE_COLOR")) { sParms("OUTLINE_COLOR") ->Set_Value((int)SG_GET_RGB(180, 0, 0)); // outline color sParms("DISPLAY_BRUSH") ->Set_Value(1); // fillstyle transparent DataObject_Set_Parameters(m_pAOI, sParms); DataObject_Update(m_pAOI, SG_UI_DATAOBJECT_SHOW_LAST_MAP); } } else Set_Drag_Mode(MODULE_INTERACTIVE_DRAG_BOX); //----------------------------------------------------- return( true ); } //--------------------------------------------------------- bool CPC_Cut_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode) { switch( Mode ) { //----------------------------------------------------- case MODULE_INTERACTIVE_LDOWN: if( m_bAOIBox ) m_ptDown = ptWorld; else { if( !m_bAdd ) { m_bAdd = true; m_pAOI ->Del_Records(); m_pAOI ->Add_Shape(); m_pAOI->Get_Shape(0)->Add_Point(ptWorld); // workaround to have first line immediately displayed, } // i.e. we add the first point clicked two times m_pAOI->Get_Shape(0)->Add_Point(ptWorld); DataObject_Update(m_pAOI, SG_UI_DATAOBJECT_SHOW_LAST_MAP); } return( true ); //----------------------------------------------------- case MODULE_INTERACTIVE_LUP: if( m_bAOIBox ) { CSG_Rect r(m_ptDown.Get_X(), m_ptDown.Get_Y(), ptWorld.Get_X(), ptWorld.Get_Y()); CSG_Parameters *pParameters = Get_Parameters("CUT"); pParameters->Get_Parameter("XMIN")->Set_Value(r.Get_XMin()); pParameters->Get_Parameter("XMAX")->Set_Value(r.Get_XMax()); pParameters->Get_Parameter("YMIN")->Set_Value(r.Get_YMin()); pParameters->Get_Parameter("YMAX")->Set_Value(r.Get_YMax()); if( Dlg_Parameters("CUT") ) { r.Assign( pParameters->Get_Parameter("XMIN")->asDouble(), pParameters->Get_Parameter("YMIN")->asDouble(), pParameters->Get_Parameter("XMAX")->asDouble(), pParameters->Get_Parameter("YMAX")->asDouble() ); if( CPC_Cut::Get_Cut(m_pPoints, m_pCut, r, m_bInverse) ) { DataObject_Update(m_pCut); } } return( true ); } return( false ); //----------------------------------------------------- case MODULE_INTERACTIVE_RDOWN: if( !m_bAOIBox ) { m_bAdd = false; if( CPC_Cut::Get_Cut(m_pPoints, m_pCut, m_pAOI, m_bInverse) ) { DataObject_Update(m_pCut); } return( true ); } return( false ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_cut.h000066400000000000000000000120431224124640700250130ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_cut.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_cut.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_Cut_H #define HEADER_INCLUDED__PC_Cut_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_Cut : public CSG_Module { public: CPC_Cut(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Tools") ); } static bool Get_Cut (CSG_PointCloud *pPoints, CSG_PointCloud *pCut, const CSG_Rect &Extent, bool bInverse); static bool Get_Cut (CSG_PointCloud *pPoints, CSG_PointCloud *pCut, CSG_Shapes *pPolygons, bool bInverse); protected: virtual bool On_Execute (void); private: static bool Contains (CSG_Shapes *pPolygons, double x, double y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_Cut_Interactive : public CSG_Module_Interactive { public: CPC_Cut_Interactive(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Tools") ); } protected: virtual bool On_Execute (void); virtual bool On_Execute_Position (CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode); private: CSG_Point m_ptDown; CSG_PointCloud *m_pPoints, *m_pCut; CSG_Shapes *m_pAOI; bool m_bAOIBox, m_bAdd, m_bInverse; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PC_Cut_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.cpp000066400000000000000000000230561224124640700276100ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_drop_attribute.cpp 1463 2012-08-18 15:52:03Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_drop_attribute.cpp // // // // Copyright (C) 2010 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_drop_attribute.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_Drop_Attribute::CPC_Drop_Attribute(void) { Set_Name(_TL("Drop Point Cloud Attributes")); Set_Author(_TL("Volker Wichmann (c) 2010, LASERDATA GmbH")); Set_Description (_TW( "The module can be used to drop attributes from a point cloud. " "In case the output dataset is not set, the attribute(s) will be dropped " "from the input dataset, i.e. the input dataset will be overwritten.\n\n" "Module usage is different between SAGA GUI and SAGA CMD: With " "SAGA GUI you will get prompted to choose the attributes to drop " "once you execute the module. With SAGA CMD you have to provide " "a string with the -FIELDS parameter containing the field numbers " "(separated by semicolon). Field numbers start with 1, e.g. " "-FIELDS=\"5;8;9\".\n\n" )); //----------------------------------------------------- Parameters.Add_PointCloud( NULL , "INPUT" ,_TL("Input"), _TL("Point Cloud to drop attribute from."), PARAMETER_INPUT ); Parameters.Add_PointCloud( NULL , "OUTPUT" , _TL("Output"), _TL("Point Cloud with attribute dropped."), PARAMETER_OUTPUT_OPTIONAL ); if (!SG_UI_Get_Window_Main()) { Parameters.Add_String( NULL , "FIELDS" , _TL("Fields"), _TL("The numbers (starting from 1) of the fields to drop, separated by semicolon, e.g. \"5;8;9\""), SG_T("") ); } } //--------------------------------------------------------- CPC_Drop_Attribute::~CPC_Drop_Attribute(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_Drop_Attribute::On_Execute(void) { CSG_PointCloud *pInput, *pOutput; CSG_String sName; CSG_Parameters sParms; CSG_Parameters P; CSG_Parameter *pNode; CSG_String s; std::set setCols; std::set::iterator it; pInput = Parameters("INPUT")->asPointCloud(); pOutput = Parameters("OUTPUT")->asPointCloud(); //----------------------------------------------------- if( !pOutput || pOutput == pInput ) { sName = pInput->Get_Name(); pOutput = SG_Create_PointCloud(pInput); } else { sName = CSG_String::Format(SG_T("%s_discardedAttr"), pInput->Get_Name()); pOutput->Create(pInput); } //----------------------------------------------------- if( SG_UI_Get_Window_Main() ) { P.Set_Name(_TL("Check the attributes to drop")); for(int iAttr=0; iAttrGet_Attribute_Count(); iAttr++) { s.Printf(SG_T("ATTR_%03d"), iAttr); P.Add_Value(NULL, s, CSG_String::Format(SG_T("%s"), pInput->Get_Attribute_Name(iAttr)), _TL(""), PARAMETER_TYPE_Bool, false); } //----------------------------------------------------- if( Dlg_Parameters(&P, _TL("Field Properties")) ) { setCols.clear(); for(int iAttr=0; iAttrGet_Attribute_Count(); iAttr++) { if( P(CSG_String::Format(SG_T("ATTR_%03d" ), iAttr).c_str())->asBool() ) { setCols.insert(iAttr + 3); } } } else return( false ); } else // CMD { CSG_String sFields, sPrecision; CSG_String token; int iValue; sFields = Parameters("FIELDS")->asString(); wxStringTokenizer tkz_fields(sFields.c_str(), wxT(";"), wxTOKEN_STRTOK); while( tkz_fields.HasMoreTokens() ) { token = tkz_fields.GetNextToken().wc_str(); if( token.Length() == 0 ) break; if( !token.asInt(iValue) ) { SG_UI_Msg_Add_Error(_TL("Error parsing attribute fields: can't convert to number")); return( false ); } iValue -= 1; if( iValue < 3 || iValue > pInput->Get_Field_Count()-1 ) { SG_UI_Msg_Add_Error(_TL("Error parsing attribute fields: field index out of range")); return( false ); } else setCols.insert(iValue); } } if( setCols.size() == 0 ) { SG_UI_Msg_Add_Error(_TL("You must specify at least one attribute to drop!")); return( false ); } //----------------------------------------------------- int j = 0; for(it=setCols.begin(); it!=setCols.end(); it++) { pOutput->Del_Field(*it - j); j++; } DataObject_Update(pOutput); for(int i=0; iGet_Point_Count() && SG_UI_Process_Set_Progress(i, pInput->Get_Count()); i++) { pOutput->Add_Point(pInput->Get_X(i), pInput->Get_Y(i), pInput->Get_Z(i)); for(int j=0, k=0; jGet_Attribute_Count(); j++, k++) { it = setCols.find(j + 3); if( it != setCols.end() ) { k--; continue; } pOutput->Set_Attribute(k, pInput->Get_Attribute(i, j)); } } //----------------------------------------------------- if (!Parameters("OUTPUT")->asPointCloud() || Parameters("OUTPUT")->asPointCloud() == pInput ) { pInput->Assign(pOutput); pInput->Set_Name(sName); DataObject_Update(pInput); delete(pOutput); DataObject_Get_Parameters(pInput, sParms); Set_Display_Attributes(pInput, sParms); } else { pOutput->Set_Name(sName); DataObject_Update(pOutput); DataObject_Get_Parameters(pOutput, sParms); Set_Display_Attributes(pOutput, sParms); } //----------------------------------------------------- return( true ); } //--------------------------------------------------------- void CPC_Drop_Attribute::Set_Display_Attributes(CSG_PointCloud *pPC, CSG_Parameters &sParms) { if (sParms("METRIC_ATTRIB") && sParms("COLORS_TYPE") && sParms("METRIC_COLORS") && sParms("METRIC_ZRANGE") && sParms("DISPLAY_VALUE_AGGREGATE")) { sParms("DISPLAY_VALUE_AGGREGATE")->Set_Value(3); // highest z sParms("COLORS_TYPE")->Set_Value(2); // graduated color sParms("METRIC_COLORS")->asColors()->Set_Count(255); // number of colors sParms("METRIC_ATTRIB")->Set_Value(2); // z attrib sParms("METRIC_ZRANGE")->asRange()->Set_Range(pPC->Get_Minimum(2), pPC->Get_Maximum(2)); } DataObject_Set_Parameters(pPC, sParms); DataObject_Update(pPC); return; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_drop_attribute.h000066400000000000000000000110161224124640700272460ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_drop_attribute.h 1463 2012-08-18 15:52:03Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_drop_attribute.h // // // // Copyright (C) 2010 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_Drop_Attribute_H #define HEADER_INCLUDED__PC_Drop_Attribute_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" #include #include #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_Drop_Attribute : public CSG_Module { public: CPC_Drop_Attribute(void); virtual ~CPC_Drop_Attribute(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Tools") ); } protected: virtual bool On_Execute (void); private: void Set_Display_Attributes(CSG_PointCloud *pPC, CSG_Parameters &sParms); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PC_Drop_Attribute_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_from_grid.cpp000066400000000000000000000130201224124640700265170ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_from_grid.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_from_grid.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_from_grid.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_From_Grid::CPC_From_Grid(void) { //----------------------------------------------------- Set_Name (_TL("Point Cloud from Grid Points")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Z Value"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Additional Values"), _TL(""), PARAMETER_INPUT_OPTIONAL, false ); Parameters.Add_PointCloud( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_From_Grid::On_Execute(void) { int x, y, i; TSG_Point p; CSG_Grid *pGrid; CSG_Parameter_Grid_List *pGrids; CSG_PointCloud *pPoints; //----------------------------------------------------- pGrid = Parameters("GRID") ->asGrid(); pGrids = Parameters("GRIDS") ->asGridList(); pPoints = Parameters("POINTS") ->asPointCloud(); pPoints->Create(); pPoints->Set_Name(pGrid->Get_Name()); for(i=0; iGet_Count(); i++) { pPoints->Add_Field(pGrids->asGrid(i)->Get_Name(), SG_DATATYPE_Float); } //----------------------------------------------------- for(y=0, p.y=Get_YMin(); yis_NoData(x, y) ) { pPoints->Add_Point(p.x, p.y, pGrid->asDouble(x, y)); for(i=0; iGet_Count(); i++) { pPoints->Set_Value(3 + i, pGrids->asGrid(i)->Get_Value(p)); } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_from_grid.h000066400000000000000000000101041224124640700261640ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_from_grid.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_from_grid.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_From_Grid_H #define HEADER_INCLUDED__PC_From_Grid //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_From_Grid : public CSG_Module_Grid { public: CPC_From_Grid(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Conversion") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PC_From_Grid_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.cpp000066400000000000000000000143621224124640700270670ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_from_shapes.cpp 1093 2011-06-16 15:54:00Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_from_shapes.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_from_shapes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_From_Shapes::CPC_From_Shapes(void) { //----------------------------------------------------- Set_Name (_TL("Point Cloud from Shapes")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "" )); //----------------------------------------------------- CSG_Parameter *pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "ZFIELD" , _TL("Z Value"), _TL(""), true ); Parameters.Add_PointCloud( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "OUTPUT" , _TL("Output"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("only z"), _TL("all attributes") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_From_Shapes::On_Execute(void) { int zField, iField, nFields, *Fields; CSG_PointCloud *pPoints; CSG_Shapes *pShapes; pShapes = Parameters("SHAPES") ->asShapes(); pPoints = Parameters("POINTS") ->asPointCloud(); zField = Parameters("ZFIELD") ->asInt(); if( !pShapes->is_Valid() ) { return( false ); } //----------------------------------------------------- pPoints->Create(); pPoints->Set_Name(pShapes->Get_Name()); nFields = 0; Fields = new int[pShapes->Get_Field_Count()]; if( Parameters("OUTPUT")->asInt() == 1 ) { for(iField=0, nFields=0; iFieldGet_Field_Count(); iField++) { if( iField != zField && SG_Data_Type_Get_Size(pShapes->Get_Field_Type(iField)) > 0 ) { Fields[nFields++] = iField; pPoints->Add_Field(pShapes->Get_Field_Name(iField), pShapes->Get_Field_Type(iField)); } } } //----------------------------------------------------- for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { TSG_Point p = pShape->Get_Point(iPoint, iPart); pPoints->Add_Point(p.x, p.y, zField < 0 ? pShape->Get_Z(iPoint, iPart) : pShape->asDouble(zField)); for(iField=0; iFieldSet_Value(3 + iField, pShape->asDouble(Fields[iField])); } } } } //----------------------------------------------------- delete [] Fields; return( pPoints->Get_Count() > 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_from_shapes.h000066400000000000000000000101151224124640700265240ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_from_shapes.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_from_shapes.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_From_Shapes_H #define HEADER_INCLUDED__PC_From_Shapes_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_From_Shapes : public CSG_Module { public: CPC_From_Shapes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Conversion") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PC_From_Shapes_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_merge.cpp000066400000000000000000000210651224124640700256560ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_merge.cpp 1546 2012-11-27 12:12:54Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_merge.cpp // // // // Copyright (C) 2012 by // // Magnus Bremer // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: magnus.bremer@student.uibk.ac.at // // // // contact: Magnus Bremer // // Innrain 52 // // 6020 Innsbruck // // Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_merge.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_Merge::CPC_Merge(void) { Set_Name (_TL("Merge Point Clouds")); Set_Author (SG_T("Magnus Bremer (c) 2012")); Set_Description (_TW("The module can be used to merge Point Clouds.\n" "The attribute fields of the merged point cloud resemble those " "of the main point cloud. In order to merge the attributes of the " "additional point cloud layers, these must be consistent " "(field name and type) with the main point cloud. Missing " "attribute values are set to NoData.\n\n" )); Parameters.Add_PointCloud( NULL , "PC_IN" , _TL("Main Point Cloud"), _TL("Main layer. The output layer will have the same fields in the attribute table as this layer."), PARAMETER_INPUT ); Parameters.Add_PointCloud_List( NULL , "PC_LAYERS" , _TL("Additional Point Clouds"), _TL("Additional point clouds to merge with main point cloud."), PARAMETER_INPUT ); Parameters.Add_PointCloud( NULL , "PC_OUT" , _TL("Merged Point Cloud"), _TL("The merged point cloud."), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "ADD_IDENTIFIER" , _TL("Add Identifier"), _TL("Add unique identifier attribute field to output, ID resembles processing order."), PARAMETER_TYPE_Bool, false ); } //--------------------------------------------------------- CPC_Merge::~CPC_Merge(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_Merge::On_Execute(void) { CSG_PointCloud *pMain, *pAdd, *pResult; bool bID; int iAccept = 0; CSG_Parameter_PointCloud_List *pPointCloudList; std::vector FieldNames; std::vector FieldTypes; pMain = Parameters("PC_IN")->asPointCloud(); pPointCloudList = Parameters("PC_LAYERS")->asPointCloudList(); pResult = Parameters("PC_OUT")->asPointCloud(); bID = Parameters("ADD_IDENTIFIER")->asBool(); pResult->Create(pMain); pResult->Set_Name(CSG_String::Format(_TL("%s_merged"), pMain->Get_Name())); if( bID ) pResult->Add_Field(SG_T("ID"), SG_DATATYPE_Int); DataObject_Update(pResult); //copy main layer into destination for(int iField=0; iFieldGet_Attribute_Count(); iField++) { FieldNames.push_back(pMain->Get_Attribute_Name(iField)); FieldTypes.push_back(pMain->Get_Attribute_Type(iField)); } for(int i=0; iGet_Count() && Set_Progress(i, pMain->Get_Count()); i++) { pResult->Add_Point(pMain->Get_X(i), pMain->Get_Y(i), pMain->Get_Z(i)); for(int iField=0; iFieldGet_Attribute_Count(); iField++) { pResult->Set_Attribute(iAccept, iField, pMain->Get_Attribute(i, iField)); } if( bID ) pResult->Set_Attribute(iAccept, pMain->Get_Attribute_Count(), 0); iAccept++; } //copy additional layer into destination if( (pPointCloudList = Parameters("PC_LAYERS")->asPointCloudList()) != NULL && pPointCloudList->Get_Count() > 0 ) { for(int iLayer=0; iLayerGet_Count(); iLayer++) { if( (pAdd = pPointCloudList->asPointCloud(iLayer)) != NULL ) { if( pAdd->Get_Type() == pMain->Get_Type() ) { pAdd = pPointCloudList->asPointCloud(iLayer); std::vector FieldMapping(FieldNames.size(), -1); // pMain to pAdd for(int iField=0; iFieldGet_Attribute_Count(); iField++) { CSG_String ThisField = pAdd->Get_Attribute_Name(iField); for(int j=0; jGet_Attribute_Type(iField) == FieldTypes[j] ) { FieldMapping[j] = iField; break; } } } } for(int i=0; iGet_Count() && Set_Progress(i, pAdd->Get_Count()); i++) { pResult->Add_Point(pAdd->Get_X(i), pAdd->Get_Y(i), pAdd->Get_Z(i)); for(int iField=0; iFieldGet_Attribute_Count(); iField++) { if( FieldMapping[iField] > -1 ) pResult->Set_Attribute(iAccept, iField, pAdd->Get_Attribute(i, FieldMapping[iField])); else pResult->Set_Attribute(iAccept, iField, pMain->Get_NoData_Value()); } if( bID ) pResult->Set_Attribute(iAccept, pMain->Get_Attribute_Count(), iLayer + 1); iAccept++; } } } } } CSG_Parameters sParms; DataObject_Get_Parameters(pResult, sParms); if( sParms("METRIC_ATTRIB") && sParms("COLORS_TYPE") && sParms("METRIC_COLORS") && sParms("METRIC_ZRANGE") && sParms("DISPLAY_VALUE_AGGREGATE") ) { sParms("DISPLAY_VALUE_AGGREGATE") ->Set_Value(3); sParms("COLORS_TYPE") ->Set_Value(2); sParms("METRIC_COLORS")->asColors() ->Set_Count(255); sParms("METRIC_ATTRIB") ->Set_Value(2); sParms("METRIC_ZRANGE")->asRange() ->Set_Range(pResult->Get_Minimum(2), pResult->Get_Maximum(2)); } DataObject_Set_Parameters(pResult, sParms); DataObject_Update(pResult); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //---------------------------------------------------------saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_merge.h000066400000000000000000000101431224124640700253160ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_merge.h 1546 2012-11-27 12:12:54Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_merge.h // // // // Copyright (C) 2012 by // // Magnus Bremer // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: magnus.bremer@uibk.ac.at // // // // contact: Magnus Bremer // // Innrain 52 // // 6020 Innsbruck // // Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_Merge_H #define HEADER_INCLUDED__PC_Merge_H //--------------------------------------------------------- #include "MLB_Interface.h" #include ; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_Merge : public CSG_Module { public: CPC_Merge(void); virtual ~CPC_Merge(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Tools") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PC_Merge_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.cpp000066400000000000000000000561231224124640700277500ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_reclass_extract.cpp 1517 2012-11-06 10:42:49Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_reclass_extract.cpp // // // // Copyright (C) 2009 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_reclass_extract.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_Reclass_Extract::CPC_Reclass_Extract(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name(_TL("Point Cloud Reclassifier / Subset Extractor")); Set_Author(SG_T("Volker Wichmann (c) 2009, LASERDATA GmbH")); Set_Description (_TW( "The module can be used to either reclassify a Point Cloud attribute or to extract " "a subset of a Point Cloud based on the values of an attribute.\n\n" "The module provides three different options:\n" "(a) reclassification of (or extraction based on) single values,\n" "(b) reclassification of (or extraction based on) a range of values and\n" "(c) reclassification of (or extraction based on) value ranges specified in a lookup table.\n\n" "Each of these three options provides it's own parameters. The 'new value' parameters are " "irrelevant in case a subset is extracted.\n\n" "In addition to these settings, two special cases ('NoData values' and 'other values' not " "included in the parameter setup) are supported:\n" "In mode (a) and (b) the 'NoData option' is evaluated before the method settings, in mode " "(c) the option is evaluated only if the NoData value ins't included in the lookup table.\n" "The 'other values' option is always evaluated after checking the method settings.\n\n") ); //----------------------------------------------------- Parameters.Add_PointCloud( NULL , "INPUT" ,_TL("Point Cloud"), _TL("Point Cloud to reclassify/extract"), PARAMETER_INPUT ); Parameters.Add_Table_Field( Parameters("INPUT"), "ATTRIB", _TL("Attribute"), _TL("Attribute to process."), false ); Parameters.Add_PointCloud( NULL , "RESULT" , _TL("Result"), _TL("Reclassified or extracted Point Cloud."), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "MODE" , _TL("Mode of operation"), _TL("Choose whether to reclassify a Point Cloud or to extract a subset from a Point Cloud."), _TL("Reclassify|Extract Subset|"), 0 ); Parameters.Add_Value( NULL , "CREATE_ATTRIB" , _TL("Create new Attribute"), _TL("Check this to create a new attribute with the reclassification result. If unchecked, the existing attribute is updated."), PARAMETER_TYPE_Bool, false ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL("Select the desired method: 1. a single value or a range defined by a single value is reclassified, 2. a range of values is reclassified, 3. the lookup table is used to reclassify the grid."), _TL("single|range|simple table|user supplied table|"), 0 ); //----------------------------------------------------- Parameters.Add_Value( NULL , "OLD" , _TL("old value"), _TL("Value to reclassify."), PARAMETER_TYPE_Double, 0 ); Parameters.Add_Value( NULL , "NEW" , _TL("new value"), _TL("New value."), PARAMETER_TYPE_Double, 1 ); Parameters.Add_Choice( NULL , "SOPERATOR" , _TL("operator"), _TL("Select the desired operator (<;.;=; >;.); it is possible to define a range above or below the old value."), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("="), _TL("<"), _TL("<="), _TL(">="), _TL(">") ), 0 ); //----------------------------------------------------- Parameters.Add_Value( NULL , "MIN" , _TL("minimum value"), _TL("Minimum value of the range to be reclassified."), PARAMETER_TYPE_Double, 0 ); Parameters.Add_Value( NULL , "MAX" , _TL("maximum value"), _TL("Maximum value of the range to be reclassified."), PARAMETER_TYPE_Double, 10 ); Parameters.Add_Value( NULL , "RNEW" , _TL("new value"), _TL("new value"), PARAMETER_TYPE_Double, 5 ); Parameters.Add_Choice( NULL , "ROPERATOR" , _TL("operator"), _TL("Select operator: eg. min < value < max."), CSG_String::Format(SG_T("%s|%s|"), _TL("<="), _TL("<") ), 0 ); //----------------------------------------------------- Parameters.Add_FixedTable( NULL , "RETAB" , _TL("Lookup Table"), _TL("Lookup table used in method \"table\"") ); Parameters.Add_Choice( NULL , "TOPERATOR" , _TL("operator"), _TL("Select the desired operator (min < value < max; min . value < max; min .value . max; min < value . max)."), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("min <= value < max"), _TL("min <= value <= max"), _TL("min < value <= max"), _TL("min < value < max") ), 0 ); //----------------------------------------------------- pNode = Parameters.Add_Table( NULL , "RETAB_2" , _TL("Lookup Table"), _TL("Lookup table used in method \"user supplied table\""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Table_Field( pNode , "F_MIN" , _TL("minimum value"), _TL("") ); Parameters.Add_Table_Field( pNode , "F_MAX" , _TL("maximum value"), _TL("") ); Parameters.Add_Table_Field( pNode , "F_CODE" , _TL("new value"), _TL("") ); //----------------------------------------------------- pNode = Parameters.Add_Node( NULL, "OPTIONS" , _TL("Special cases"), _TL("Parameter settings for No-Data and all other values.") ); Parameters.Add_Value( pNode , "NODATAOPT" , _TL("no data values"), _TL("Use this option to reclassify No-Data values independently of the method settings."), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( Parameters("NODATAOPT") , "NODATA" , _TL("new value"), _TL("new value"), PARAMETER_TYPE_Double, 0 ); Parameters.Add_Value( pNode , "OTHEROPT" , _TL("other values"), _TL("Use this option to reclassify all other values that are not specified in the options above."), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( Parameters("OTHEROPT") , "OTHERS" , _TL("new value"), _TL("new value"), PARAMETER_TYPE_Double, 0 ); //----------------------------------------------------- CSG_Table *pLookup; CSG_Table_Record *pRecord; pLookup = Parameters("RETAB")->asTable(); pLookup->Add_Field(_TL("minimum") , SG_DATATYPE_Double); pLookup->Add_Field(_TL("maximum") , SG_DATATYPE_Double); pLookup->Add_Field(_TL("new") , SG_DATATYPE_Double); pRecord = pLookup->Add_Record(); pRecord->Set_Value(0, 0.0); pRecord->Set_Value(1, 10.0); pRecord->Set_Value(2, 1.0); pRecord = pLookup->Add_Record(); pRecord->Set_Value(0, 10.0); pRecord->Set_Value(1, 20.0); pRecord->Set_Value(2, 2.0); } //--------------------------------------------------------- CPC_Reclass_Extract::~CPC_Reclass_Extract(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_Reclass_Extract::On_Execute(void) { int method; CSG_Parameters sParms; m_pInput = Parameters("INPUT")->asPointCloud(); m_pResult = Parameters("RESULT")->asPointCloud(); method = Parameters("METHOD")->asInt(); m_AttrField = Parameters("ATTRIB")->asInt(); m_bExtract = Parameters("MODE")->asInt() == 0 ? false : true; m_bCreateAttrib = Parameters("CREATE_ATTRIB")->asBool(); m_pResult->Create(m_pInput); if (m_bExtract) m_pResult->Set_Name(CSG_String::Format(SG_T("%s_subset_%s"), m_pInput->Get_Name(), m_pInput->Get_Field_Name(m_AttrField))); else { m_pResult->Set_Name(CSG_String::Format(SG_T("%s_reclass_%s"), m_pInput->Get_Name(), m_pInput->Get_Field_Name(m_AttrField))); if( m_bCreateAttrib ) m_pResult->Add_Field(CSG_String::Format(SG_T("%s_reclass"), m_pInput->Get_Field_Name(m_AttrField)), m_pInput->Get_Field_Type(m_AttrField)); } //----------------------------------------------------- switch( method ) { case 0: Reclass_Single(); break; case 1: Reclass_Range(); break; case 2: if( Reclass_Table(false) ) break; else return( false ); case 3: if( Reclass_Table(true) ) break; else return( false ); default: break; } //----------------------------------------------------- DataObject_Update(m_pResult); DataObject_Get_Parameters(m_pResult, sParms); if (m_bExtract) Set_Display_Attributes(m_pResult, 2, sParms); else { if( m_bCreateAttrib ) Set_Display_Attributes(m_pResult, m_pResult->Get_Field_Count()-1, sParms); else Set_Display_Attributes(m_pResult, m_AttrField, sParms); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPC_Reclass_Extract::Reclass_Range(void) { bool otherOpt, noDataOpt, floating; int opera; double minValue, maxValue, value, others, noData, noDataValue, newValue; minValue = Parameters("MIN")->asDouble(); maxValue = Parameters("MAX")->asDouble(); newValue = Parameters("RNEW")->asDouble(); others = Parameters("OTHERS")->asDouble(); noData = Parameters("NODATA")->asDouble(); opera = Parameters("ROPERATOR")->asInt(); otherOpt = m_bExtract ? false : Parameters("OTHEROPT")->asBool(); noDataOpt = m_bExtract ? false : Parameters("NODATAOPT")->asBool(); noDataValue = m_pInput->Get_NoData_Value(); if( (m_pInput->Get_Field_Type(m_AttrField) == SG_DATATYPE_Double) || (m_pInput->Get_Field_Type(m_AttrField) == SG_DATATYPE_Float) ) floating = true; else floating = false; for (int i=0; iGet_Point_Count(); i++) { if( floating == true ) value = m_pInput->Get_Value(i, m_AttrField); else value = (int)m_pInput->Get_Value(i, m_AttrField); if( opera == 0 ) // operator <= { if( noDataOpt == true && value == noDataValue ) // noData option Set_Value(i, noData); else if( minValue <= value && value <= maxValue ) // reclass old range Set_Value(i, newValue); else if( otherOpt == true && value != noDataValue ) // other values option Set_Value(i, others); else { if (!m_bExtract) Set_Value(i, value); // or original value } } if( opera == 1 ) // operator < { if( noDataOpt == true && value == noDataValue ) // noData option Set_Value(i, noData); else if( minValue < value && value < maxValue ) // reclass old range Set_Value(i, newValue); else if( otherOpt == true && value != noDataValue ) // other values option Set_Value(i, others); else { if (!m_bExtract) Set_Value(i, value); // or original value } } } return; } //--------------------------------------------------------- void CPC_Reclass_Extract::Reclass_Single(void) { bool otherOpt, noDataOpt, floating; int opera; double oldValue, newValue, value, others, noData, noDataValue; oldValue = Parameters("OLD")->asDouble(); newValue = Parameters("NEW")->asDouble(); others = Parameters("OTHERS")->asDouble(); noData = Parameters("NODATA")->asDouble(); opera = Parameters("SOPERATOR")->asInt(); otherOpt = m_bExtract ? false : Parameters("OTHEROPT")->asBool(); noDataOpt = m_bExtract ? false : Parameters("NODATAOPT")->asBool(); noDataValue = m_pInput->Get_NoData_Value(); if( (m_pInput->Get_Field_Type(m_AttrField) == SG_DATATYPE_Double) || (m_pInput->Get_Field_Type(m_AttrField) == SG_DATATYPE_Float) ) floating = true; else floating = false; for (int i=0; iGet_Point_Count(); i++) { if( floating == true ) value = m_pInput->Get_Value(i, m_AttrField); else value = (int)m_pInput->Get_Value(i, m_AttrField); if( opera == 0 ) // operator = { if( noDataOpt == true && value == noDataValue ) // noData option Set_Value(i, noData); else if( value == oldValue ) // reclass old value Set_Value(i, newValue); else if( otherOpt == true && value != noDataValue ) // other values option Set_Value(i, others); else { if (!m_bExtract) Set_Value(i, value); // or original value } } if( opera == 1 ) // operator < { if( noDataOpt == true && value == noDataValue ) // noData option Set_Value(i, noData); else if( value < oldValue ) // reclass old value Set_Value(i, newValue); else if( otherOpt == true && value != noDataValue ) // other values option Set_Value(i, others); else { if (!m_bExtract) Set_Value(i, value); // or original value } } if( opera == 2 ) // operator <= { if( noDataOpt == true && value == noDataValue ) // noData option Set_Value(i, noData); else if( value <= oldValue ) // reclass old value Set_Value(i, newValue); else if( otherOpt == true && value != noDataValue ) // other values option Set_Value(i, others); else { if (!m_bExtract) Set_Value(i, value); // or original value } } if( opera == 3 ) // operator >= { if( noDataOpt == true && value == noDataValue ) // noData option Set_Value(i, noData); else if( value >= oldValue ) // reclass old value Set_Value(i, newValue); else if( otherOpt == true && value != noDataValue ) // other values option Set_Value(i, others); else { if (!m_bExtract) Set_Value(i, value); // or original value } } if( opera == 4 ) // operator > { if( noDataOpt == true && value == noDataValue ) // noData option Set_Value(i, noData); else if( value > oldValue ) // reclass old value Set_Value(i, newValue); else if( otherOpt == true && value != noDataValue ) // other values option Set_Value(i, others); else { if (!m_bExtract) Set_Value(i, value); // or original value } } } return; } //--------------------------------------------------------- bool CPC_Reclass_Extract::Reclass_Table(bool bUser) { bool set, otherOpt, noDataOpt; int opera, field_Min, field_Max, field_Code; double value, others, noData, noDataValue; CSG_Table *pReTab; CSG_Table_Record *pRecord = NULL; if( bUser ) { pReTab = Parameters("RETAB_2") ->asTable(); field_Min = Parameters("F_MIN") ->asInt(); field_Max = Parameters("F_MAX") ->asInt(); field_Code = Parameters("F_CODE") ->asInt(); } else { pReTab = Parameters("RETAB") ->asTable(); field_Min = 0; field_Max = 1; field_Code = 2; } others = Parameters("OTHERS")->asDouble(); noData = Parameters("NODATA")->asDouble(); opera = Parameters("TOPERATOR")->asInt(); otherOpt = m_bExtract ? false : Parameters("OTHEROPT")->asBool(); noDataOpt = m_bExtract ? false : Parameters("NODATAOPT")->asBool(); noDataValue = m_pInput->Get_NoData_Value(); if( pReTab == NULL ) { Error_Set(_TL("You must specify a reclass table with a minimium (field 1), a maximum (field 2) and a code value (field 3)!\n")); return( false ); } if( pReTab->Get_Record_Count() == 0 ) { Error_Set(_TL("You must specify a reclass table with a minimium of one record!\n")); return( false ); } for (int i=0; iGet_Point_Count() && Set_Progress(i, m_pInput->Get_Point_Count()); i++) { value = m_pInput->Get_Value(i, m_AttrField); set = false; for(int iRecord=0; iRecordGet_Record_Count(); iRecord++) // reclass { pRecord = pReTab->Get_Record(iRecord); if( opera == 0 ) // min <= value < max { if( value >= pRecord->asDouble(field_Min) && value < pRecord->asDouble(field_Max) ) { Set_Value(i, pRecord->asDouble(field_Code)); set = true; break; } } else if( opera == 1 ) // min <= value <= max { if( value >= pRecord->asDouble(field_Min) && value <= pRecord->asDouble(field_Max) ) { Set_Value(i, pRecord->asDouble(field_Code)); set = true; break; } } else if( opera == 2 ) // min < value <= max { if( value > pRecord->asDouble(field_Min) && value <= pRecord->asDouble(field_Max) ) { Set_Value(i, pRecord->asDouble(field_Code)); set = true; break; } } else if( opera == 3 ) // min < value < max { if( value > pRecord->asDouble(field_Min) && value < pRecord->asDouble(field_Max) ) { Set_Value(i, pRecord->asDouble(field_Code)); set = true; break; } } } if( set == false ) { if( noDataOpt == true && value == noDataValue ) // noData option Set_Value(i, noData); else if( otherOpt == true && value != noDataValue) // other values option Set_Value(i, others); else { if (!m_bExtract) Set_Value(i, value); // or original value } } } return (true); } //--------------------------------------------------------- void CPC_Reclass_Extract::Set_Value(int i, double value) { m_pResult->Add_Point(m_pInput->Get_X(i), m_pInput->Get_Y(i), m_pInput->Get_Z(i)); for (int j=0; jGet_Attribute_Count(); j++) m_pResult->Set_Attribute(j, m_pInput->Get_Attribute(i, j)); if (!m_bExtract) { if (m_bCreateAttrib) m_pResult->Set_Value(m_pResult->Get_Field_Count()-1, value); else m_pResult->Set_Value(m_AttrField, value); } return; } //--------------------------------------------------------- void CPC_Reclass_Extract::Set_Display_Attributes(CSG_PointCloud *pPC, int iField, CSG_Parameters &sParms) { if (sParms("METRIC_ATTRIB") && sParms("COLORS_TYPE") && sParms("METRIC_COLORS") && sParms("METRIC_ZRANGE") && sParms("DISPLAY_VALUE_AGGREGATE")) { sParms("DISPLAY_VALUE_AGGREGATE")->Set_Value(3); // highest z sParms("COLORS_TYPE")->Set_Value(2); // graduated color sParms("METRIC_COLORS")->asColors()->Set_Count(255); // number of colors sParms("METRIC_ATTRIB")->Set_Value(iField); // attrib sParms("METRIC_ZRANGE")->asRange()->Set_Range(pPC->Get_Minimum(iField), pPC->Get_Maximum(iField)); } DataObject_Set_Parameters(pPC, sParms); DataObject_Update(pPC); return; } //--------------------------------------------------------- int CPC_Reclass_Extract::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) || !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("MODE")) ) { int iMode = pParameters->Get_Parameter("MODE")->asInt(); // 0 == reclassify, 1 == extract int Value = pParameters->Get_Parameter("METHOD")->asInt(); pParameters->Get_Parameter("CREATE_ATTRIB")->Set_Enabled(iMode == 0); // single pParameters->Get_Parameter("OLD" )->Set_Enabled(Value == 0); pParameters->Get_Parameter("NEW" )->Set_Enabled(Value == 0 && iMode == 0); pParameters->Get_Parameter("SOPERATOR" )->Set_Enabled(Value == 0); // range pParameters->Get_Parameter("MIN" )->Set_Enabled(Value == 1); pParameters->Get_Parameter("MAX" )->Set_Enabled(Value == 1); pParameters->Get_Parameter("RNEW" )->Set_Enabled(Value == 1 && iMode == 0); pParameters->Get_Parameter("ROPERATOR" )->Set_Enabled(Value == 1); // simple table pParameters->Get_Parameter("RETAB" )->Set_Enabled(Value == 2); pParameters->Get_Parameter("TOPERATOR" )->Set_Enabled(Value == 2); // user supplied table pParameters->Get_Parameter("RETAB_2" )->Set_Enabled(Value == 3); //pParameters->Get_Parameter("F_MIN" )->Set_Enabled(Value == 3); //pParameters->Get_Parameter("F_MAX" )->Set_Enabled(Value == 3); //pParameters->Get_Parameter("F_CODE" )->Set_Enabled(Value == 3); // other options pParameters->Get_Parameter("NODATAOPT" )->Set_Enabled(iMode == 0); pParameters->Get_Parameter("OTHEROPT" )->Set_Enabled(iMode == 0); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("NODATAOPT")) ) { pParameters->Get_Parameter("NODATA" )->Set_Enabled(pParameter->asInt() > 0); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("OTHEROPT")) ) { pParameters->Get_Parameter("OTHERS" )->Set_Enabled(pParameter->asInt() > 0); } //----------------------------------------------------- return (1); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_reclass_extract.h000066400000000000000000000115141224124640700274100ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_reclass_extract.h 1406 2012-05-21 14:22:39Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_reclass_extract.h // // // // Copyright (C) 2009 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_Reclass_Extract_H #define HEADER_INCLUDED__PC_Reclass_Extract_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_Reclass_Extract : public CSG_Module { public: CPC_Reclass_Extract(void); virtual ~CPC_Reclass_Extract(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Tools") ); } protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_Single; bool m_bExtract, m_bCreateAttrib; int m_AttrField; CSG_PointCloud *m_pInput, *m_pResult; void Reclass_Single (void); void Reclass_Range (void); bool Reclass_Table (bool bUser); void Set_Value (int i, double value); void Set_Display_Attributes (CSG_PointCloud *pPC, int iField, CSG_Parameters &sParms); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PC_Reclass_Extract_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.cpp000066400000000000000000000127251224124640700277510ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_thinning_simple.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_thinning_simple.cpp // // // // Copyright (C) 2010 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_thinning_simple.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_Thinning_Simple::CPC_Thinning_Simple(void) { Set_Name(_TL("Point Cloud Thinning (simple)")); Set_Author(SG_T("Volker Wichmann (c) 2010, LASERDATA GmbH")); Set_Description (_TW( "The module can be used to remove every i-th point from a point cloud. This thinning " "method is most suited for data in chronological order.\n\n") ); //----------------------------------------------------- Parameters.Add_PointCloud( NULL , "INPUT" ,_TL("Input"), _TL("Point Cloud to drop attribute from."), PARAMETER_INPUT ); Parameters.Add_PointCloud( NULL , "RESULT" , _TL("Result"), _TL("Resulting Point Cloud."), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "STEP" , _TL("Stepwidth"), _TL("Remove every i-th point."), PARAMETER_TYPE_Int, 2, 2, true ); } //--------------------------------------------------------- CPC_Thinning_Simple::~CPC_Thinning_Simple(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_Thinning_Simple::On_Execute(void) { CSG_PointCloud *pInput, *pResult; int step; pInput = Parameters("INPUT")->asPointCloud(); pResult = Parameters("RESULT")->asPointCloud(); step = Parameters("STEP")->asInt() - 1; pResult->Create(pInput); pResult->Set_Name(CSG_String::Format(SG_T("%s_thinned"), pInput->Get_Name())); pResult->Assign(pInput); for (int i=step; iGet_Point_Count() && Set_Progress(i, pInput->Get_Point_Count()); i+=step) { pResult->Del_Point(i); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_thinning_simple.h000066400000000000000000000106061224124640700274120ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_thinning_simple.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_thinning_simple.h // // // // Copyright (C) 2010 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_Thinning_Simple_H #define HEADER_INCLUDED__PC_Thinning_Simple_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_Thinning_Simple : public CSG_Module { public: CPC_Thinning_Simple(void); virtual ~CPC_Thinning_Simple(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Tools") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PC_Thinning_Simple_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_to_grid.cpp000066400000000000000000000206441224124640700262100ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_to_grid.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_to_grid.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_to_grid.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_To_Grid::CPC_To_Grid(void) { //----------------------------------------------------- Set_Name (_TL("Point Cloud to Grid")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_PointCloud( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_Output( NULL , "GRID" , _TL("Z Value"), _TL("") ); Parameters.Add_Grid_Output( NULL , "COUNT" , _TL("Number of Points in Cell"), _TL("") ); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Attributes"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "OUTPUT" , _TL("Output"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("only z"), _TL("all attributes") ), 0 ); Parameters.Add_Choice( NULL , "AGGREGATION" , _TL("Aggregation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("first value"), _TL("last value"), _TL("mean value"), _TL("lowest z"), _TL("highest z") ), 0 ); Parameters.Add_Value( NULL , "CELLSIZE" , _TL("Cellsize"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_To_Grid::On_Execute(void) { int x, y, iField, iGrid; CSG_Grid_System System; CSG_Parameter_Grid_List *pGrids; CSG_PointCloud *pPoints; pPoints = Parameters("POINTS") ->asPointCloud(); pGrids = Parameters("GRIDS") ->asGridList(); m_Aggregation = Parameters("AGGREGATION") ->asInt(); //----------------------------------------------------- System.Assign(Parameters("CELLSIZE")->asDouble(), pPoints->Get_Extent()); //----------------------------------------------------- pGrids->Del_Items(); if( Parameters("OUTPUT")->asInt() != 0 ) { for(iField=3; iFieldGet_Field_Count(); iField++) { pGrids->Add_Item(SG_Create_Grid(System, SG_DATATYPE_Float)); pGrids->asGrid(iField - 3)->Set_Name(CSG_String::Format(SG_T("%s - %s"), pPoints->Get_Name(), pPoints->Get_Field_Name(iField))); } } Parameters("GRID") ->Set_Value(m_pGrid = SG_Create_Grid(System, SG_DATATYPE_Float)); Parameters("COUNT") ->Set_Value(m_pCount = SG_Create_Grid(System, SG_DATATYPE_Int)); m_pGrid ->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), pPoints->Get_Field_Name(2))); m_pCount ->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Points per Cell"))); m_pCount ->Set_NoData_Value(0.0); //----------------------------------------------------- for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { pPoints->Set_Cursor(iPoint); if( System.Get_World_to_Grid(x, y, pPoints->Get_X(), pPoints->Get_Y()) ) { int n = m_pCount->asInt(x, y); double z = pPoints->Get_Z(); for(iGrid=0; iGridGet_Count(); iGrid++) { Set_Value(x, y, z, n, pPoints->Get_Value(iGrid + 3), pGrids->asGrid(iGrid)); } Set_Value(x, y, z, n, z, m_pGrid); m_pCount->Add_Value(x, y, 1); } } //----------------------------------------------------- for(y=0; yasInt(x, y); switch( n ) { case 0: m_pGrid->Set_NoData(x, y); for(iGrid=0; iGridGet_Count(); iGrid++) { pGrids->asGrid(iGrid)->Set_NoData(x, y); } break; case 1: break; default: if( m_Aggregation == 2 ) // mean value { m_pGrid->Mul_Value(x, y, 1.0 / n); for(iGrid=0; iGridGet_Count(); iGrid++) { pGrids->asGrid(iGrid)->Mul_Value(x, y, 1.0 / n); } } break; } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void CPC_To_Grid::Set_Value(int x, int y, double z, int Count, double value, CSG_Grid *pGrid) { switch( m_Aggregation ) { case 0: // first value if( Count == 0 ) { pGrid->Set_Value(x, y, value); } break; case 1: // last value pGrid->Set_Value(x, y, value); break; case 2: // mean value pGrid->Add_Value(x, y, value); break; case 3: // lowest z if( Count == 0 || z < m_pGrid->asDouble(x, y) ) { pGrid->Set_Value(x, y, value); } break; case 4: // highest z if( Count == 0 || z > m_pGrid->asDouble(x, y) ) { pGrid->Set_Value(x, y, value); } break; } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_to_grid.h000066400000000000000000000103331224124640700256470ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_to_grid.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_to_grid.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_To_Grid_H #define HEADER_INCLUDED__PC_To_Grid_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_To_Grid : public CSG_Module { public: CPC_To_Grid(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Conversion") ); } protected: virtual bool On_Execute (void); private: int m_Aggregation; CSG_Grid *m_pGrid, *m_pCount; void Set_Value (int x, int y, double z, int Count, double value, CSG_Grid *pGrid); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PC_To_Grid_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_to_shapes.cpp000066400000000000000000000126441224124640700265470ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_to_shapes.cpp 1078 2011-06-07 11:12:48Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_to_shapes.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_to_shapes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_To_Shapes::CPC_To_Shapes(void) { //----------------------------------------------------- Set_Name (_TL("Point Cloud to Shapes")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_PointCloud( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_To_Shapes::On_Execute(void) { int iField; CSG_PointCloud *pPoints; CSG_Shapes *pShapes; pPoints = Parameters("POINTS") ->asPointCloud(); pShapes = Parameters("SHAPES") ->asShapes(); //----------------------------------------------------- pShapes->Create(SHAPE_TYPE_Point, pPoints->Get_Name(), NULL, SG_VERTEX_TYPE_XYZ); for(iField=2; iFieldGet_Field_Count(); iField++) { pShapes->Add_Field(pPoints->Get_Field_Name(iField), pPoints->Get_Field_Type(iField)); } //----------------------------------------------------- for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { pPoints->Set_Cursor(iPoint); CSG_Shape *pShape = pShapes->Add_Shape(); pShape->Add_Point(pPoints->Get_X(), pPoints->Get_Y()); pShape->Set_Z(pPoints->Get_Z(), 0); for(iField=2; iFieldGet_Field_Count(); iField++) { pShape->Set_Value(iField - 2, pPoints->Get_Value(iField)); } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_to_shapes.h000066400000000000000000000101011224124640700261760ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_to_shapes.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_to_shapes.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_To_Shapes_H #define HEADER_INCLUDED__PC_To_Shapes_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_To_Shapes : public CSG_Module { public: CPC_To_Shapes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Conversion") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PC_To_Shapes_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_transform.cpp000066400000000000000000000226561224124640700266010ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_transform.cpp 1144 2011-08-04 16:43:20Z manfred-e $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_transform.cpp // // // // Copyright (C) 2010 by // // Volker Wichmann // // // // Based on TransformShapes.cpp, (C) Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pc_transform.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPC_Transform::CPC_Transform(void) { CSG_Parameter *pNode_0, *pNode_1; //----------------------------------------------------- Set_Name(_TL("Transform Point Cloud")); Set_Author(_TL("Volker Wichmann (c) 2010, LASERDATA GmbH")); Set_Description (_TW( "The module can be used to shift, rotate and/or scale a Point Cloud.\n\n") ); //----------------------------------------------------- Parameters.Add_PointCloud( NULL , "IN" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_PointCloud( NULL , "OUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT ); //----------------------------------------------------- pNode_0 = Parameters.Add_Node( NULL , "MOVE" , _TL("Move"), _TL("") ); pNode_1 = Parameters.Add_Value( pNode_0 , "DX" , _TL("dX"), _TL("dX (Map Units)"), PARAMETER_TYPE_Double, 0.0 ); pNode_1 = Parameters.Add_Value( pNode_0, "DY" , _TL("dY"), _TL("dY (Map Units)"), PARAMETER_TYPE_Double, 0.0 ); pNode_1 = Parameters.Add_Value( pNode_0, "DZ" , _TL("dZ"), _TL("dZ (Map Units)"), PARAMETER_TYPE_Double, 0.0 ); //----------------------------------------------------- pNode_0 = Parameters.Add_Node( NULL , "ROTATE" , _TL("Rotate"), _TL("")); pNode_1 = Parameters.Add_Value( pNode_0 , "ANGLEX" , _TL("Angle X"), _TL("Angle in degrees, clockwise around x axis"), PARAMETER_TYPE_Double, 0.0 ); pNode_1 = Parameters.Add_Value( pNode_0 , "ANGLEY" , _TL("Angle Y"), _TL("Angle in degrees, clockwise around y axis"), PARAMETER_TYPE_Double, 0.0 ); pNode_1 = Parameters.Add_Value( pNode_0 , "ANGLEZ" , _TL("Angle Z"), _TL("Angle in degrees, clockwise around z axis"), PARAMETER_TYPE_Double, 0.0 ); //----------------------------------------------------- pNode_0 = Parameters.Add_Node( NULL , "SCALE" , _TL("Scale"), _TL("") ); pNode_1 = Parameters.Add_Value( pNode_0 , "SCALEX" , _TL("Scale Factor X"), _TL("Scale Factor X"), PARAMETER_TYPE_Double, 1.0 ); pNode_1 = Parameters.Add_Value( pNode_0 , "SCALEY" , _TL("Scale Factor Y"), _TL("Scale Factor Y"), PARAMETER_TYPE_Double, 1.0 ); pNode_1 = Parameters.Add_Value( pNode_0 , "SCALEZ" , _TL("Scale Factor Z"), _TL("Scale Factor Z"), PARAMETER_TYPE_Double, 1.0 ); //----------------------------------------------------- pNode_0 = Parameters.Add_Node( NULL , "ANCHOR" , _TL("Anchor Point"), _TL("") ); pNode_1 = Parameters.Add_Value( pNode_0 , "ANCHORX" , _TL("X"), _TL("X"), PARAMETER_TYPE_Double, 0.0 ); pNode_1 = Parameters.Add_Value( pNode_0 , "ANCHORY" , _TL("Y"), _TL("Y"), PARAMETER_TYPE_Double, 0.0 ); pNode_1 = Parameters.Add_Value( pNode_0 , "ANCHORZ" , _TL("Z"), _TL("Z"), PARAMETER_TYPE_Double, 0.0 ); } //--------------------------------------------------------- CPC_Transform::~CPC_Transform(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPC_Transform::On_Execute(void) { bool bCopy; double angleX, angleY, angleZ; TSG_Point_Z P, Q, Move, Scale, Anchor; CSG_PointCloud *pIn, *pOut; double a11, a12, a13, a21, a22, a23, a31, a32, a33; //----------------------------------------------------- pIn = Parameters("IN") ->asPointCloud(); pOut = Parameters("OUT") ->asPointCloud(); Scale.x = Parameters("SCALEX") ->asDouble(); Scale.y = Parameters("SCALEY") ->asDouble(); Scale.z = Parameters("SCALEZ") ->asDouble(); Move.x = Parameters("DX") ->asDouble(); Move.y = Parameters("DY") ->asDouble(); Move.z = Parameters("DZ") ->asDouble(); Anchor.x = Parameters("ANCHORX") ->asDouble(); Anchor.y = Parameters("ANCHORY") ->asDouble(); Anchor.z = Parameters("ANCHORZ") ->asDouble(); angleX = Parameters("ANGLEX") ->asDouble() * -M_DEG_TO_RAD; angleY = Parameters("ANGLEY") ->asDouble() * -M_DEG_TO_RAD; angleZ = Parameters("ANGLEZ") ->asDouble() * -M_DEG_TO_RAD; if( pIn == pOut ) { bCopy = true; pOut = SG_Create_PointCloud(); } else bCopy = false; pOut->Create(pIn); pOut->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pIn->Get_Name(), _TL("Transformed"))); //----------------------------------------------------- for (int iPoint=0; iPointGet_Point_Count(); iPoint++) { P = pIn->Get_Point(iPoint); //anchor shift P.x -= Anchor.x; P.y -= Anchor.y; P.z -= Anchor.z; // create rotation matrix a11 = cos(angleY) * cos(angleZ); a12 = -cos(angleX) * sin(angleZ) + sin(angleX) * sin(angleY) * cos(angleZ); a13 = sin(angleX) * sin(angleZ) + cos(angleX) * sin(angleY) * cos(angleZ); a21 = cos(angleY) * sin(angleZ); a22 = cos(angleX) * cos(angleZ) + sin(angleX) * sin(angleY) * sin(angleZ); a23 = -sin(angleX) * cos(angleZ) + cos(angleX) * sin(angleY) * sin(angleZ); a31 = -sin(angleY); a32 = sin(angleX) * cos(angleY); a33 = cos(angleX) * cos(angleY); //transform Q.x = (P.x * a11 + P.y * a12 + P.z * a13) * Scale.x; Q.y = (P.x * a21 + P.y * a22 + P.z * a23) * Scale.y; Q.z = (P.x * a31 + P.y * a32 + P.z * a33) * Scale.z; //undo anchor shift and apply move Q.x += Anchor.x + Move.x; Q.y += Anchor.y + Move.y; Q.z += Anchor.z + Move.z; pOut->Add_Point(Q.x, Q.y, Q.z); for (int iField=0; iFieldGet_Attribute_Count(); iField++) pOut->Set_Attribute(iPoint, iField, pIn->Get_Attribute(iPoint, iField)); } //----------------------------------------------------- if( bCopy ) { pIn->Assign(pOut); delete(pOut); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_tools/pc_transform.h000066400000000000000000000105351224124640700262370ustar00rootroot00000000000000/********************************************************** * Version $Id: pc_transform.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_tools // // // //-------------------------------------------------------// // // // pc_transform.h // // // // Copyright (C) 2010 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PC_Transform_H #define HEADER_INCLUDED__PC_Transform_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPC_Transform : public CSG_Module { public: CPC_Transform(void); virtual ~CPC_Transform(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Tools") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PC_Transform_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/000077500000000000000000000000001224124640700235265ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/MLB_Interface.cpp000066400000000000000000000107161224124640700266310ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_viewer // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute for Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Shapes - Point Clouds Viewer") ); case MLB_INFO_Author: return( SG_T("O.Conrad (c) 2009") ); case MLB_INFO_Description: return( _TL("Point clouds viewer." )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Shapes|Point Clouds|Visualisation" )); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "points_view_module.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CPoints_View_Module ); default: return( NULL ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/MLB_Interface.h000066400000000000000000000076051224124640700263010ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_viewer // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute for Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__pointcloud_viewer_mlb_H #define HEADER_INCLUDED__pointcloud_viewer_mlb_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef pointcloud_viewer_EXPORTS #define pointcloud_viewer_EXPORT _SAGA_DLL_EXPORT #else #define pointcloud_viewer_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__pointcloud_viewer_mlb_H saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/Makefile.am000066400000000000000000000020611224124640700255610ustar00rootroot00000000000000if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` else DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libpointcloud_viewer.la libpointcloud_viewer_la_SOURCES =\ MLB_Interface.cpp\ points_view_control.cpp\ points_view_dialog.cpp\ points_view_extent.cpp\ points_view_module.cpp\ MLB_Interface.h\ points_view_control.h\ points_view_dialog.h\ points_view_extent.h\ points_view_module.h libpointcloud_viewer_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS) saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/Makefile.in000066400000000000000000000461351224124640700256040ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/pointcloud/pointcloud_viewer DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libpointcloud_viewer_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la \ $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la am_libpointcloud_viewer_la_OBJECTS = MLB_Interface.lo \ points_view_control.lo points_view_dialog.lo \ points_view_extent.lo points_view_module.lo libpointcloud_viewer_la_OBJECTS = \ $(am_libpointcloud_viewer_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libpointcloud_viewer_la_SOURCES) DIST_SOURCES = $(libpointcloud_viewer_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_FALSE@DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) @SAGA_UNICODE_TRUE@DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) @SAGA_UNICODE_FALSE@DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` @SAGA_UNICODE_TRUE@DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libpointcloud_viewer.la libpointcloud_viewer_la_SOURCES = \ MLB_Interface.cpp\ points_view_control.cpp\ points_view_dialog.cpp\ points_view_extent.cpp\ points_view_module.cpp\ MLB_Interface.h\ points_view_control.h\ points_view_dialog.h\ points_view_extent.h\ points_view_module.h libpointcloud_viewer_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/pointcloud/pointcloud_viewer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/pointcloud/pointcloud_viewer/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libpointcloud_viewer.la: $(libpointcloud_viewer_la_OBJECTS) $(libpointcloud_viewer_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libpointcloud_viewer_la_OBJECTS) $(libpointcloud_viewer_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/points_view_control.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/points_view_dialog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/points_view_extent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/points_view_module.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/points_view_control.cpp000066400000000000000000000561601224124640700303500ustar00rootroot00000000000000/********************************************************** * Version $Id: points_view_control.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // SAGA_GUI_API // // // //-------------------------------------------------------// // // // points_view_control.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #ifdef __BORLANDC__ #pragma hdrstop #endif #include #include #include #include //--------------------------------------------------------- #include "points_view_control.h" #include "points_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define m_Settings (*m_pSettings) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- BEGIN_EVENT_TABLE(CPoints_View_Control, wxPanel) EVT_SIZE (CPoints_View_Control::On_Size) EVT_PAINT (CPoints_View_Control::On_Paint) EVT_KEY_DOWN (CPoints_View_Control::On_Key_Down) EVT_LEFT_DOWN (CPoints_View_Control::On_Mouse_LDown) EVT_LEFT_UP (CPoints_View_Control::On_Mouse_LUp) EVT_RIGHT_DOWN (CPoints_View_Control::On_Mouse_RDown) EVT_RIGHT_UP (CPoints_View_Control::On_Mouse_RUp) EVT_MIDDLE_DOWN (CPoints_View_Control::On_Mouse_MDown) EVT_MIDDLE_UP (CPoints_View_Control::On_Mouse_MUp) EVT_MOTION (CPoints_View_Control::On_Mouse_Motion) EVT_MOUSEWHEEL (CPoints_View_Control::On_Mouse_Wheel) END_EVENT_TABLE() /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoints_View_Control::CPoints_View_Control(wxWindow *pParent, CSG_PointCloud *pPoints, CSG_Parameters &Settings) : wxPanel(pParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxSUNKEN_BORDER|wxNO_FULL_REPAINT_ON_RESIZE) { m_pPoints = pPoints; m_pSettings = &Settings; m_zField = 2; m_cField = 2; m_xRotate = 0.0; m_yRotate = 0.0; m_zRotate = 0.0; m_xShift = 0.0; m_yShift = 0.0; m_zShift = 1000.0; m_bCentral = true; m_bStereo = false; m_bScale = false; m_dCentral = 500.0; m_Detail = 1.0; //----------------------------------------------------- CSG_Parameter *pNode = m_pSettings->Add_Node(NULL, "NODE_CONTROL", _TL("3D View"), _TL("")); m_pSettings->Add_Colors( pNode , "COLORS" , _TL("Colors"), _TL("") ); m_pSettings->Add_Value( pNode , "BGCOLOR" , _TL("Background Color"), _TL(""), PARAMETER_TYPE_Color, 0 ); m_pSettings->Add_Range( pNode , "C_RANGE" , _TL("Colors Value Range"), _TL("") ); m_pSettings->Add_Value( pNode , "C_AS_RGB" , _TL("Value as RGB Code"), _TL(""), PARAMETER_TYPE_Bool, false ); m_pSettings->Add_Value( pNode , "SIZE_DEF" , _TL("Point Size: Default"), _TL(""), PARAMETER_TYPE_Int, 0, 0, true ); m_pSettings->Add_Value( pNode , "SIZE_SCALE" , _TL("Point Size: Scaling"), _TL(""), PARAMETER_TYPE_Double, 250.0, 1.0, true ); m_pSettings->Add_Value( pNode , "EXAGGERATION" , _TL("Exaggeration"), _TL(""), PARAMETER_TYPE_Double, 1.0 ); m_pSettings->Add_Value( pNode , "STEREO_DIST" , _TL("Stereo Eye Distance [Degree]"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); pNode = m_pSettings->Add_Value( pNode , "DIM" , _TL("Dim Colours"), _TL(""), PARAMETER_TYPE_Bool, false ); pNode = m_pSettings->Add_Range( pNode , "DIM_RANGE" , _TL("Dim Range"), _TL(""), 0.0, 1.0, 0.0, true ); //----------------------------------------------------- m_pSelection = (int *)SG_Malloc(m_pPoints->Get_Count() * sizeof(int)); Update_Extent(m_pPoints->Get_Extent()); } //--------------------------------------------------------- CPoints_View_Control::~CPoints_View_Control(void) { if( m_pSelection ) { SG_Free(m_pSelection); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPoints_View_Control::On_Size(wxSizeEvent &event) { _Set_Size(); event.Skip(); } //--------------------------------------------------------- void CPoints_View_Control::On_Paint(wxPaintEvent &WXUNUSED(event)) { if( m_Image.IsOk() && m_Image.GetWidth() > 0 && m_Image.GetHeight() > 0 ) { wxPaintDC dc(this); dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false); } } //--------------------------------------------------------- void CPoints_View_Control::Update_View(void) { if( _Draw_Image() ) { wxClientDC dc(this); dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false); } } //--------------------------------------------------------- void CPoints_View_Control::Update_Extent(CSG_Rect Extent) { m_Extent.Assign(Extent); m_zStats.Invalidate(); m_cStats.Invalidate(); m_nSelection = 0; for(int i=0; iGet_Count(); i++) { m_pPoints->Set_Cursor(i); TSG_Point_Z p = m_pPoints->Get_Point(); if( m_Extent.Contains(p.x, p.y) ) { m_pSelection[m_nSelection++] = i; m_zStats.Add_Value(m_pPoints->Get_Value(m_zField)); m_cStats.Add_Value(m_pPoints->Get_Value(m_cField)); } } m_Settings("C_RANGE")->asRange()->Set_Range( m_cStats.Get_Mean() - 1.5 * m_cStats.Get_StdDev(), m_cStats.Get_Mean() + 1.5 * m_cStats.Get_StdDev() ); Update_View(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPoints_View_Control::On_Key_Down(wxKeyEvent &event) { switch( event.GetKeyCode() ) { default: event.Skip(); return; case WXK_NUMPAD_ADD: case WXK_ADD: m_xRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_SUBTRACT: case WXK_SUBTRACT: m_xRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_F3: m_yRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_F4: m_yRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_MULTIPLY: case WXK_MULTIPLY: m_zRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_DIVIDE: case WXK_DIVIDE: m_zRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_INSERT: m_xShift -= 10.0; break; case WXK_DELETE: m_xShift += 10.0; break; case WXK_HOME: m_yShift -= 10.0; break; case WXK_END: m_yShift += 10.0; break; case WXK_PAGEUP: m_zShift -= 10.0; break; case WXK_PAGEDOWN: m_zShift += 10.0; break; case 'A': m_bStereo = !m_bStereo; break; case 'S': m_bScale = !m_bScale; break; case 'C': m_Settings("C_AS_RGB") ->Set_Value(m_Settings("C_AS_RGB")->asBool() ? 0.0 : 1.0); break; case WXK_F1: m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() + 0.5); break; case WXK_F2: m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() - 0.5); break; case WXK_F5: m_Settings("SIZE_DEF") ->Set_Value(m_Settings("SIZE_DEF") ->asDouble() - 1.0); break; case WXK_F6: m_Settings("SIZE_DEF") ->Set_Value(m_Settings("SIZE_DEF") ->asDouble() + 1.0); break; case WXK_F7: m_Settings("SIZE_SCALE") ->Set_Value(m_Settings("SIZE_SCALE") ->asDouble() - 10.0); break; case WXK_F8: m_Settings("SIZE_SCALE") ->Set_Value(m_Settings("SIZE_SCALE") ->asDouble() + 10.0); break; } Update_View(); ((CPoints_View_Dialog *)GetParent())->Update_Rotation(); } //--------------------------------------------------------- #define GET_MOUSE_X_RELDIFF ((double)(m_Mouse_Down.x - event.GetX()) / (double)GetClientSize().x) #define GET_MOUSE_Y_RELDIFF ((double)(m_Mouse_Down.y - event.GetY()) / (double)GetClientSize().y) //--------------------------------------------------------- void CPoints_View_Control::On_Mouse_LDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_zRotate; m_yDown = m_xRotate; CaptureMouse(); } void CPoints_View_Control::On_Mouse_LUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_zRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_xRotate = m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180; Update_View(); ((CPoints_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void CPoints_View_Control::On_Mouse_RDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_xShift; m_yDown = m_yShift; CaptureMouse(); } void CPoints_View_Control::On_Mouse_RUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_xShift = m_xDown - GET_MOUSE_X_RELDIFF * 1000.0; m_yShift = m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0; Update_View(); ((CPoints_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void CPoints_View_Control::On_Mouse_MDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_yRotate; m_yDown = m_zShift; CaptureMouse(); } void CPoints_View_Control::On_Mouse_MUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_yRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_zShift = m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0; Update_View(); ((CPoints_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void CPoints_View_Control::On_Mouse_Motion(wxMouseEvent &event) { if( HasCapture() && event.Dragging() ) { if( event.LeftIsDown() ) { m_zRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_xRotate = m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180; } else if( event.RightIsDown() ) { m_xShift = m_xDown - GET_MOUSE_X_RELDIFF * 1000.0; m_yShift = m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0; } else if( event.MiddleIsDown() ) { m_yRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_zShift = m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0; } else { return; } Update_View(); ((CPoints_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void CPoints_View_Control::On_Mouse_Wheel(wxMouseEvent &event) { if( event.GetWheelRotation() ) { m_zShift += 0.5 * event.GetWheelRotation(); Update_View(); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPoints_View_Control::_Set_Size(void) { Update_View(); } //--------------------------------------------------------- bool CPoints_View_Control::_Draw_Image(void) { wxSize dcSize = GetClientSize(); if( m_pPoints->Get_Count() <= 0 || dcSize.x <= 0 || dcSize.y <= 0 || m_Extent.Get_XRange() <= 0.0 || m_Extent.Get_YRange() <= 0.0 || m_zField < 0 || m_zField >= m_pPoints->Get_Field_Count() || m_cField < 0 || m_cField >= m_pPoints->Get_Field_Count() || m_zStats.Get_Range() <= 0.0 ) { return( false ); } //------------------------------------------------- if( !m_Image.IsOk() || dcSize.x != m_Image.GetWidth() || dcSize.y != m_Image.GetHeight() ) { m_Image .Create(dcSize.x, dcSize.y); m_Image_zMax.Create(dcSize.x, dcSize.y); } //------------------------------------------------- if( m_Settings("C_RANGE")->asRange()->Get_LoVal() >= m_Settings("C_RANGE")->asRange()->Get_HiVal() ) { m_Settings("C_RANGE")->asRange()->Set_Range( m_cStats.Get_Mean() - 1.5 * m_pPoints->Get_StdDev(m_cField), m_cStats.Get_Mean() + 1.5 * m_pPoints->Get_StdDev(m_cField) ); } m_pColors = m_Settings("COLORS")->asColors(); m_cMin = m_Settings("C_RANGE")->asRange()->Get_LoVal(); m_cScale = m_pColors->Get_Count() / (m_Settings("C_RANGE")->asRange()->Get_HiVal() - m_cMin); m_BGColor = m_Settings("BGCOLOR")->asColor(); //------------------------------------------------- if( (dcSize.x / (double)dcSize.y) > (m_Extent.Get_XRange() / m_Extent.Get_YRange()) ) { r_Scale = m_Image.GetWidth() / m_Extent.Get_XRange(); } else { r_Scale = m_Image.GetHeight() / m_Extent.Get_YRange(); } r_sin_x = sin(m_xRotate - M_PI_180); r_cos_x = cos(m_xRotate - M_PI_180); r_sin_y = sin(m_yRotate); r_cos_y = cos(m_yRotate); r_sin_z = sin(m_zRotate); r_cos_z = cos(m_zRotate); r_xc = m_Extent.Get_XCenter(); r_yc = m_Extent.Get_YCenter(); r_zc = m_zStats.Get_Minimum() + 0.5 * m_zStats.Get_Range(); r_Scale_z = r_Scale * m_Settings("EXAGGERATION")->asDouble(); //------------------------------------------------- // guess zmin, zmax TSG_Point_Z p; p.x = m_Extent.Get_XMin(); p.y = m_Extent.Get_YMin(); p.z = m_pPoints->Get_Value(m_zStats.Get_Minimum()); p = _Get_Projection(p); m_zMin = m_zMax = p.z; p.x = m_Extent.Get_XMin(); p.y = m_Extent.Get_YMin(); p.z = m_pPoints->Get_Value(m_zStats.Get_Maximum()); p = _Get_Projection(p); if( m_zMin > p.z ) m_zMin = p.z; else if( m_zMax < p.z ) m_zMax = p.z; p.x = m_Extent.Get_XMax(); p.y = m_Extent.Get_YMin(); p.z = m_pPoints->Get_Value(m_zStats.Get_Minimum()); p = _Get_Projection(p); if( m_zMin > p.z ) m_zMin = p.z; else if( m_zMax < p.z ) m_zMax = p.z; p.x = m_Extent.Get_XMax(); p.y = m_Extent.Get_YMin(); p.z = m_pPoints->Get_Value(m_zStats.Get_Maximum()); p = _Get_Projection(p); if( m_zMin > p.z ) m_zMin = p.z; else if( m_zMax < p.z ) m_zMax = p.z; p.x = m_Extent.Get_XMin(); p.y = m_Extent.Get_YMax(); p.z = m_pPoints->Get_Value(m_zStats.Get_Minimum()); p = _Get_Projection(p); if( m_zMin > p.z ) m_zMin = p.z; else if( m_zMax < p.z ) m_zMax = p.z; p.x = m_Extent.Get_XMin(); p.y = m_Extent.Get_YMax(); p.z = m_pPoints->Get_Value(m_zStats.Get_Maximum()); p = _Get_Projection(p); if( m_zMin > p.z ) m_zMin = p.z; else if( m_zMax < p.z ) m_zMax = p.z; p.x = m_Extent.Get_XMax(); p.y = m_Extent.Get_YMax(); p.z = m_pPoints->Get_Value(m_zStats.Get_Minimum()); p = _Get_Projection(p); if( m_zMin > p.z ) m_zMin = p.z; else if( m_zMax < p.z ) m_zMax = p.z; p.x = m_Extent.Get_XMax(); p.y = m_Extent.Get_YMax(); p.z = m_pPoints->Get_Value(m_zStats.Get_Maximum()); p = _Get_Projection(p); if( m_zMin > p.z ) m_zMin = p.z; else if( m_zMax < p.z ) m_zMax = p.z; //------------------------------------------------- m_Size_Def = m_Settings("SIZE_DEF")->asInt(); m_Size_Scale = 1.0 / m_Settings("SIZE_SCALE")->asDouble(); m_bColorAsRGB = m_Settings("C_AS_RGB")->asBool(); m_bDim = m_Settings("DIM")->asBool(); m_Dim_A = m_zMin + m_Settings("DIM_RANGE")->asRange()->Get_LoVal() * (m_zMax - m_zMin); m_Dim_B = m_zMin + m_Settings("DIM_RANGE")->asRange()->Get_HiVal() * (m_zMax - m_zMin); int iSelection; int nSkip = 1 + (int)(0.001 * m_pPoints->Get_Count() * SG_Get_Square(1.0 - m_Detail)); _Draw_Background(); //------------------------------------------------- if( m_bStereo == false ) { m_Image_zMax.Assign(999999.0); m_Color_Mode = COLOR_MODE_RGB; for(iSelection=0; iSelectionasDouble() / 2.0; m_Image_zMax.Assign(999999.0); r_sin_y = sin(m_yRotate - d * M_DEG_TO_RAD); r_cos_y = cos(m_yRotate - d * M_DEG_TO_RAD); m_Color_Mode = COLOR_MODE_RED; for(iSelection=0; iSelectionSet_Cursor(iPoint); p = m_pPoints->Get_Point(); p.z = m_pPoints->Get_Value(m_zField); p = _Get_Projection(p); p.x = (int)(p.x + 0.5 * m_Image.GetWidth()); p.y = (int)(p.y + 0.5 * m_Image.GetHeight()); if( !m_bColorAsRGB ) { iColor = (int)(m_cScale * (m_pPoints->Get_Value(m_cField) - m_cMin)); iColor = m_pColors->Get_Color(iColor < 0 ? 0 : (iColor >= m_pColors->Get_Count() ? m_pColors->Get_Count() - 1 : iColor)); } else { iColor = (int)m_pPoints->Get_Value(m_cField); } if( m_bDim ) { double dim = 1.0 - (p.z - m_Dim_A) / (m_Dim_B - m_Dim_A); if( dim < 1.0 ) { if( dim <= 0.1 ) { dim = 0.1; } iColor = SG_GET_RGB( SG_GET_R(m_BGColor) + (int)((SG_GET_R(iColor) - SG_GET_R(m_BGColor)) * dim), SG_GET_G(m_BGColor) + (int)((SG_GET_G(iColor) - SG_GET_G(m_BGColor)) * dim), SG_GET_B(m_BGColor) + (int)((SG_GET_B(iColor) - SG_GET_B(m_BGColor)) * dim) ); } } _Draw_Point(p.x, p.y, p.z, iColor, m_Size_Def + (!m_bScale ? 0 : (int)(20.0 * exp(-m_Size_Scale * p.z)))); } //--------------------------------------------------------- inline void CPoints_View_Control::_Draw_Point(int x, int y, double z, int color, int Size) { if( z > 0.0 ) { _Draw_Pixel(x, y, z, color); if( Size > 0 && Size < 50 ) { for(int iy=1; iy<=Size; iy++) { for(int ix=0; ix<=Size; ix++) { if( ix*ix + iy*iy <= Size*Size ) { _Draw_Pixel(x + ix, y + iy, z, color); _Draw_Pixel(x + iy, y - ix, z, color); _Draw_Pixel(x - ix, y - iy, z, color); _Draw_Pixel(x - iy, y + ix, z, color); } } } } } } //--------------------------------------------------------- inline void CPoints_View_Control::_Draw_Pixel(int x, int y, double z, int color) { if( x >= 0 && x < m_Image.GetWidth() && y >= 0 && y < m_Image.GetHeight() && z < m_Image_zMax[y][x] ) { BYTE *pRGB = m_Image.GetData() + 3 * (y * m_Image.GetWidth() + x); switch( m_Color_Mode ) { case COLOR_MODE_RGB: *pRGB = SG_GET_R(color); pRGB++; *pRGB = SG_GET_G(color); pRGB++; *pRGB = SG_GET_B(color); break; case COLOR_MODE_RED: *pRGB = ((SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3); break; case COLOR_MODE_BLUE: *(pRGB + 1) = ((SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3); *(pRGB + 2) = ((SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3); break; } m_Image_zMax[y][x] = z; } } //--------------------------------------------------------- inline TSG_Point_Z CPoints_View_Control::_Get_Projection(TSG_Point_Z p) { TSG_Point_Z q; p.x = (p.x - r_xc) * r_Scale; p.y = (p.y - r_yc) * r_Scale; p.z = (p.z - r_zc) * r_Scale_z; double a = (r_cos_y * p.z + r_sin_y * (r_sin_z * p.y + r_cos_z * p.x)); double b = (r_cos_z * p.y - r_sin_z * p.x); q.x = r_cos_y * (r_sin_z * p.y + r_cos_z * p.x) - r_sin_y * p.z; q.y = r_sin_x * a + r_cos_x * b; q.z = r_cos_x * a - r_sin_x * b; q.x += m_xShift; q.y += m_yShift; q.z += m_zShift; if( m_bCentral ) { q.x *= m_dCentral / q.z; q.y *= m_dCentral / q.z; } else { double z = m_dCentral / m_zShift; q.x *= z; q.y *= z; // q.z = -q.z; } return( q ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/points_view_control.h000066400000000000000000000151551224124640700300140ustar00rootroot00000000000000/********************************************************** * Version $Id: points_view_control.h 1094 2011-06-16 15:55:03Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // SAGA_GUI_API // // // //-------------------------------------------------------// // // // points_view_control.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__points_view_control_H #define HEADER_INCLUDED__points_view_control_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { COLOR_MODE_RGB, COLOR_MODE_RED, COLOR_MODE_BLUE }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoints_View_Control : public wxPanel { public: CPoints_View_Control(wxWindow *pParent, CSG_PointCloud *pPoints, CSG_Parameters &Settings); virtual ~CPoints_View_Control(void); bool m_bCentral, m_bStereo, m_bScale; int m_zField, m_cField; double m_xRotate, m_yRotate, m_zRotate, m_xShift, m_yShift, m_zShift, m_dCentral, m_Detail; void Update_View (void); void Update_Extent (CSG_Rect Extent); void On_Size (wxSizeEvent &event); void On_Paint (wxPaintEvent &event); void On_Key_Down (wxKeyEvent &event); void On_Mouse_LDown (wxMouseEvent &event); void On_Mouse_LUp (wxMouseEvent &event); void On_Mouse_RDown (wxMouseEvent &event); void On_Mouse_RUp (wxMouseEvent &event); void On_Mouse_MDown (wxMouseEvent &event); void On_Mouse_MUp (wxMouseEvent &event); void On_Mouse_Motion (wxMouseEvent &event); void On_Mouse_Wheel (wxMouseEvent &event); private: bool m_bColorAsRGB, m_bDim; int m_nSelection, *m_pSelection, m_Color_Mode, m_Size_Def, m_BGColor; double m_xDown, m_yDown, m_cMin, m_cScale, m_Size_Scale, m_Dim_A, m_Dim_B, m_zMin, m_zMax; double r_sin_x, r_sin_y, r_sin_z, r_cos_x, r_cos_y, r_cos_z, r_xc, r_yc, r_zc, r_Scale, r_Scale_z; CSG_Rect m_Extent; CSG_Matrix m_Image_zMax; CSG_Simple_Statistics m_zStats, m_cStats; CSG_Parameters *m_pSettings; CSG_Colors *m_pColors; CSG_PointCloud *m_pPoints; wxPoint m_Mouse_Down; wxImage m_Image; void _Set_Size (void); bool _Draw_Image (void); void _Draw_Background (void); void _Draw_Point (int iPoint); void _Draw_Point (int x, int y, double z, int color, int Size); void _Draw_Pixel (int x, int y, double z, int color); TSG_Point_Z _Get_Projection (TSG_Point_Z p); DECLARE_EVENT_TABLE() }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__points_view_control_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.cpp000066400000000000000000000225451224124640700301270ustar00rootroot00000000000000/********************************************************** * Version $Id: points_view_dialog.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_kriging_variogram // // // //-------------------------------------------------------// // // // points_view_dialog.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "points_view_control.h" #include "points_view_extent.h" #include "points_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- BEGIN_EVENT_TABLE(CPoints_View_Dialog, CSGDI_Dialog) EVT_MOUSEWHEEL (CPoints_View_Dialog::On_Mouse_Wheel) EVT_BUTTON (wxID_ANY , CPoints_View_Dialog::On_Button) EVT_CHECKBOX (wxID_ANY , CPoints_View_Dialog::On_Update_Control) EVT_TEXT_ENTER (wxID_ANY , CPoints_View_Dialog::On_Update_Control) EVT_SLIDER (wxID_ANY , CPoints_View_Dialog::On_Update_Control) EVT_CHOICE (wxID_ANY , CPoints_View_Dialog::On_Update_Choices) END_EVENT_TABLE() //--------------------------------------------------------- CPoints_View_Dialog::CPoints_View_Dialog(CSG_PointCloud *pPoints) : CSGDI_Dialog(_TL("Point Cloud Viewer"), SGDI_DLG_STYLE_START_MAXIMISED) { SetWindowStyle(wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE); //----------------------------------------------------- m_Settings.Create(NULL, _TL("Point Cloud Viewer Settings"), _TL("")); m_pView = new CPoints_View_Control (this, pPoints, m_Settings); m_pExtent = new CPoints_View_Extent (this, pPoints, m_Settings, wxSize(200, 200)); //----------------------------------------------------- wxArrayString Attributes; for(int i=0; iGet_Field_Count(); i++) { Attributes.Add(pPoints->Get_Field_Name(i)); } //----------------------------------------------------- Add_Button(_TL("Close"), wxID_OK); m_pBtn_Prop = Add_Button (_TL("Advanced Settings") , wxID_ANY); Add_Spacer(); m_pField_Z = Add_Choice (_TL("Z Attribute") , Attributes, m_pView->m_zField); m_pField_Color = Add_Choice (_TL("Color Attribute") , Attributes, m_pView->m_cField); Add_Spacer(); m_pCheck_Central = Add_CheckBox (_TL("Central Projection") , m_pView->m_bCentral); m_pCheck_Stereo = Add_CheckBox (_TL("Anaglyph") , m_pView->m_bStereo); m_pCheck_Scale = Add_CheckBox (_TL("Scale Point Size") , m_pView->m_bScale); Add_Spacer(); m_pSlide_xRotate = Add_Slider (_TL("X-Rotation") , m_pView->m_xRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_yRotate = Add_Slider (_TL("Y-Rotation") , m_pView->m_yRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_zRotate = Add_Slider (_TL("Z-Rotation") , m_pView->m_zRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_Central = Add_Slider (_TL("Eye Distance") , m_pView->m_dCentral, 1.0, 2000.0); m_pSlide_Detail = Add_Slider (_TL("Level of Detail") , m_pView->m_Detail, 0.0, 1.0); // Add_Spacer(); // m_pParameters = Add_TextCtrl (_TL("Function Parameters"), wxTE_MULTILINE|wxTE_READONLY); Add_Spacer(); Add_CustomCtrl(_TL("Extent"), m_pExtent); Add_Output(m_pView); } //--------------------------------------------------------- void CPoints_View_Dialog::On_Mouse_Wheel(wxMouseEvent &event) { m_pView->On_Mouse_Wheel(event); } //--------------------------------------------------------- void CPoints_View_Dialog::On_Update_Control(wxCommandEvent &event) { if( event.GetEventObject() == m_pCheck_Central ) { m_pView->m_bCentral = m_pCheck_Central ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pCheck_Stereo ) { m_pView->m_bStereo = m_pCheck_Stereo ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pCheck_Scale ) { m_pView->m_bScale = m_pCheck_Scale ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pSlide_xRotate ) { m_pView->m_xRotate = m_pSlide_xRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_yRotate ) { m_pView->m_yRotate = m_pSlide_yRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_zRotate ) { m_pView->m_zRotate = m_pSlide_zRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_Central ) { m_pView->m_dCentral = m_pSlide_Central ->Get_Value(); } else if( event.GetEventObject() == m_pSlide_Detail ) { m_pView->m_Detail = m_pSlide_Detail ->Get_Value(); } else { return; } m_pView->Update_View(); } //--------------------------------------------------------- void CPoints_View_Dialog::On_Update_Choices(wxCommandEvent &event) { if( event.GetEventObject() == m_pField_Z ) { m_pView ->m_zField = m_pField_Z ->GetSelection(); m_pView ->Update_View(); } else if( event.GetEventObject() == m_pField_Color ) { m_Settings("C_RANGE")->asRange()->Set_Range(0.0, 0.0); m_pExtent ->m_cField = m_pField_Color->GetSelection(); m_pView ->m_cField = m_pField_Color->GetSelection(); m_pExtent ->Update_View(); m_pView ->Update_Extent(m_pExtent->Get_Extent()); } else { return; } } //--------------------------------------------------------- void CPoints_View_Dialog::On_Button(wxCommandEvent &event) { if( event.GetEventObject() == m_pBtn_Prop ) { if( SG_UI_Dlg_Parameters(&m_Settings, m_Settings.Get_Name()) ) { m_pExtent ->Update_View(); m_pView ->Update_View(); } } else { event.Skip(); } } //--------------------------------------------------------- void CPoints_View_Dialog::Update_Extent(void) { m_pView->Update_Extent(m_pExtent->Get_Extent()); } //--------------------------------------------------------- void CPoints_View_Dialog::Update_Rotation(void) { double d; d = fmod(M_RAD_TO_DEG * m_pView->m_xRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_xRotate->Set_Value(d); d = fmod(M_RAD_TO_DEG * m_pView->m_yRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_yRotate->Set_Value(d); d = fmod(M_RAD_TO_DEG * m_pView->m_zRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_zRotate->Set_Value(d); m_pCheck_Scale ->SetValue(m_pView->m_bScale); m_pCheck_Stereo ->SetValue(m_pView->m_bStereo); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/points_view_dialog.h000066400000000000000000000123771224124640700275760ustar00rootroot00000000000000/********************************************************** * Version $Id: points_view_dialog.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // image_io // // // //-------------------------------------------------------// // // // points_view_dialog.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__points_view_dialog_H #define HEADER_INCLUDED__points_view_dialog_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoints_View_Dialog : public CSGDI_Dialog { public: CPoints_View_Dialog(CSG_PointCloud *pPoints); void Update_Rotation (void); void Update_Extent (void); private: wxButton *m_pBtn_Prop; wxCheckBox *m_pCheck_Central, *m_pCheck_Stereo, *m_pCheck_Scale; wxChoice *m_pField_Color, *m_pField_Z; wxTextCtrl *m_pFormula, *m_pParameters; CSGDI_Slider *m_pSlide_xRotate, *m_pSlide_yRotate, *m_pSlide_zRotate, *m_pSlide_Central, *m_pSlide_Detail; class CPoints_View_Control *m_pView; class CPoints_View_Extent *m_pExtent; CSG_Parameters m_Settings; void On_Update_Control (wxCommandEvent &event); void On_Update_Choices (wxCommandEvent &event); void On_Button (wxCommandEvent &event); void On_Mouse_Wheel (wxMouseEvent &event); DECLARE_EVENT_TABLE() }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__points_view_dialog_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/points_view_extent.cpp000066400000000000000000000321271224124640700301740ustar00rootroot00000000000000/********************************************************** * Version $Id: points_view_extent.cpp 1702 2013-05-23 10:29:26Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // SAGA_GUI_API // // // //-------------------------------------------------------// // // // points_view_extent.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #ifdef __BORLANDC__ #pragma hdrstop #endif #include #include #include #include //--------------------------------------------------------- #include "points_view_extent.h" #include "points_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define m_Settings (*m_pSettings) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- BEGIN_EVENT_TABLE(CPoints_View_Extent, wxPanel) EVT_SIZE (CPoints_View_Extent::On_Size) EVT_ERASE_BACKGROUND (CPoints_View_Extent::On_EraseBackGround) EVT_PAINT (CPoints_View_Extent::On_Paint) EVT_LEFT_DOWN (CPoints_View_Extent::On_Mouse_LDown) EVT_LEFT_UP (CPoints_View_Extent::On_Mouse_LUp) EVT_RIGHT_DOWN (CPoints_View_Extent::On_Mouse_RDown) EVT_RIGHT_UP (CPoints_View_Extent::On_Mouse_RUp) EVT_MOTION (CPoints_View_Extent::On_Mouse_Motion) END_EVENT_TABLE() /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoints_View_Extent::CPoints_View_Extent(wxWindow *pParent, CSG_PointCloud *pPoints, CSG_Parameters &Settings, wxSize Size) : wxPanel(pParent, wxID_ANY, wxDefaultPosition, Size, wxTAB_TRAVERSAL|wxSUNKEN_BORDER|wxNO_FULL_REPAINT_ON_RESIZE) { m_pPoints = pPoints; m_pSettings = &Settings; m_cField = 2; m_Select = wxRect(0, 0, GetClientSize().x - 1, GetClientSize().y - 1); //----------------------------------------------------- CSG_Parameter *pNode = m_pSettings->Add_Node(NULL, "NODE_EXTENT", _TL("Zoom View"), _TL("")); m_pSettings->Add_Range( pNode , "EXT_C_RANGE" , _TL("Colors Value Range"), _TL("") ); //----------------------------------------------------- _Draw_Image(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPoints_View_Extent::On_Size(wxSizeEvent &event) { _Draw_Image(); event.Skip(); } //--------------------------------------------------------- void CPoints_View_Extent::On_EraseBackGround(wxEraseEvent &event) { // event.Skip(); } //--------------------------------------------------------- void CPoints_View_Extent::On_Paint(wxPaintEvent &WXUNUSED(event)) { if( m_Image.IsOk() && m_Image.GetWidth() > 0 && m_Image.GetHeight() > 0 ) { wxPaintDC dc(this); dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false); dc.SetPen(wxPen(*wxRED)); int ax = m_Select.GetX(); int ay = m_Select.GetY(); int bx = m_Select.GetX() + m_Select.GetWidth(); int by = m_Select.GetY() + m_Select.GetHeight(); dc.DrawLine(ax, ay, bx, ay); dc.DrawLine(bx, ay, bx, by); dc.DrawLine(bx, by, ax, by); dc.DrawLine(ax, by, ax, ay); } } //--------------------------------------------------------- void CPoints_View_Extent::Update_View(void) { if( _Draw_Image() ) { Refresh(false); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPoints_View_Extent::On_Mouse_LDown(wxMouseEvent &event) { m_Mouse_Down = m_Mouse_Move = event.GetPosition(); CaptureMouse(); } //--------------------------------------------------------- void CPoints_View_Extent::On_Mouse_LUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } _Draw_Inverse(m_Mouse_Down, m_Mouse_Move); wxPoint p; p.x = event.GetX() < 0 ? 0 : event.GetX() >= GetClientSize().x ? GetClientSize().x - 1 : event.GetX(); p.y = event.GetY() < 0 ? 0 : event.GetY() >= GetClientSize().y ? GetClientSize().y - 1 : event.GetY(); if( m_Mouse_Down.x != p.x || m_Mouse_Down.y != p.y ) { m_Select = wxRect(wxPoint(m_Mouse_Down.x, m_Mouse_Down.y), p); } else { m_Select.SetX(p.x - m_Select.GetWidth () / 2); m_Select.SetY(p.y - m_Select.GetHeight() / 2); } Refresh(false); ((CPoints_View_Dialog *)GetParent())->Update_Extent(); } //--------------------------------------------------------- void CPoints_View_Extent::On_Mouse_RDown(wxMouseEvent &event) { m_Mouse_Down = m_Mouse_Move = event.GetPosition(); CaptureMouse(); } //--------------------------------------------------------- void CPoints_View_Extent::On_Mouse_RUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } m_Select = wxRect(0, 0, GetClientSize().x - 1, GetClientSize().y - 1); Refresh(false); ((CPoints_View_Dialog *)GetParent())->Update_Extent(); } //--------------------------------------------------------- void CPoints_View_Extent::On_Mouse_Motion(wxMouseEvent &event) { if( HasCapture() && event.Dragging() ) { if( event.LeftIsDown() ) { _Draw_Inverse(m_Mouse_Down, m_Mouse_Move); _Draw_Inverse(m_Mouse_Down, event.GetPosition()); } } m_Mouse_Move = event.GetPosition(); } //--------------------------------------------------------- TSG_Rect CPoints_View_Extent::Get_Extent(void) { TSG_Rect r; double d = m_Extent.Get_XRange() / m_Image.GetWidth(); r.xMin = m_Extent.Get_XMin() + d * m_Select.GetX(); r.xMax = m_Extent.Get_XMin() + d * (m_Select.GetX() + m_Select.GetWidth()); r.yMax = m_Extent.Get_YMax() - d * m_Select.GetY(); r.yMin = m_Extent.Get_YMax() - d * (m_Select.GetY() + m_Select.GetHeight()); return( r ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoints_View_Extent::_Draw_Image(void) { if( m_pPoints->Get_Count() <= 0 || m_pPoints->Get_Extent().Get_XRange() <= 0.0 || m_pPoints->Get_Extent().Get_YRange() <= 0.0 || m_cField < 0 || m_cField >= m_pPoints->Get_Field_Count() ) { return( false ); } //------------------------------------------------- wxSize Size; double dx, dy; Size = GetClientSize(); if (Size.x <= 0 || Size.y <= 0) // temporary hack for wxGTK to suppress 'assert "isOK()" failed in Get_Height(): invalid image' return( false ); // when dlg.ShowModal() is called; during construction everything is fine, but the first call of // the On_Size() event returns a client size of 0 m_Image .Create(Size.x, Size.y); m_Image_Value .Create(Size.x, Size.y); m_Image_Count .Create(Size.x, Size.y); //------------------------------------------------- m_Extent = m_pPoints->Get_Extent(); if( (dx = Size.y / (double)Size.x) < (m_Extent.Get_YRange() / m_Extent.Get_XRange()) ) { dx = 0.5 * (m_Extent.Get_XRange() - m_Extent.Get_YRange() / dx); m_Extent.m_rect.xMin += dx; m_Extent.m_rect.xMax -= dx; } else { dy = 0.5 * (m_Extent.Get_YRange() - m_Extent.Get_XRange() * dx); m_Extent.m_rect.yMin += dy; m_Extent.m_rect.yMax -= dy; } dx = Size.x / m_Extent.Get_XRange(); dy = Size.y / m_Extent.Get_YRange(); //------------------------------------------------- bool bColorAsRGB = m_Settings("C_AS_RGB")->asBool(); for(int i=0; iGet_Count(); i++) { TSG_Point_Z p = m_pPoints->Get_Point(i); p.z = m_pPoints->Get_Value(i, m_cField); int ix = (p.x - m_Extent.Get_XMin()) * dx; int iy = (p.y - m_Extent.Get_YMin()) * dy; if( ix >= 0 && ix <= m_Image.GetWidth() && iy >= 0 && iy < m_Image.GetHeight() ) { if( !bColorAsRGB ) { m_Image_Value[iy][ix] += p.z; } else { m_Image_Value[iy][ix] = p.z; } m_Image_Count[iy][ix]++; } } //------------------------------------------------- double zMin = m_pPoints->Get_Mean(m_cField) - 1.5 * m_pPoints->Get_StdDev(m_cField); double zRange = m_pPoints->Get_Mean(m_cField) + 1.5 * m_pPoints->Get_StdDev(m_cField) - zMin; CSG_Colors *pColors = m_Settings("COLORS")->asColors(); for(int iy=0; iy 0 ) { if( !bColorAsRGB ) { int ic = (int)(pColors->Get_Count() * (m_Image_Value[iy][ix] / m_Image_Count[iy][ix] - zMin) / zRange); int c = pColors->Get_Color(ic < 0 ? 0 : ic >= pColors->Get_Count() ? pColors->Get_Count() - 1 : ic); _Draw_Pixel(ix, iy, c); } else { _Draw_Pixel(ix, iy, m_Image_Value[iy][ix]); } } else { _Draw_Pixel(ix, iy, 0); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void CPoints_View_Extent::_Draw_Pixel(int x, int y, int color) { if( x >= 0 && x < m_Image.GetWidth() && y >= 0 && y < m_Image.GetHeight() ) { BYTE *pRGB = m_Image.GetData() + 3 * ((m_Image.GetHeight() - y - 1) * m_Image.GetWidth() + x); *pRGB = SG_GET_R(color); pRGB++; *pRGB = SG_GET_G(color); pRGB++; *pRGB = SG_GET_B(color); } } //--------------------------------------------------------- void CPoints_View_Extent::_Draw_Inverse(wxPoint pa, wxPoint pb) { wxClientDC dc(this); dc.SetLogicalFunction(wxINVERT); dc.DrawRectangle(pa.x, pa.y, pb.x - pa.x, pb.y - pa.y); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/points_view_extent.h000066400000000000000000000127271224124640700276450ustar00rootroot00000000000000/********************************************************** * Version $Id: points_view_extent.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // SAGA_GUI_API // // // //-------------------------------------------------------// // // // points_view_extent.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__points_view_extent_H #define HEADER_INCLUDED__points_view_extent_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoints_View_Extent : public wxPanel { public: CPoints_View_Extent(wxWindow *pParent, CSG_PointCloud *pPoints, CSG_Parameters &Settings, wxSize Size); int m_cField; void Update_View (void); void On_Size (wxSizeEvent &event); void On_EraseBackGround (wxEraseEvent &event); void On_Paint (wxPaintEvent &event); void On_Mouse_LDown (wxMouseEvent &event); void On_Mouse_LUp (wxMouseEvent &event); void On_Mouse_RDown (wxMouseEvent &event); void On_Mouse_RUp (wxMouseEvent &event); void On_Mouse_Motion (wxMouseEvent &event); TSG_Rect Get_Extent (void); private: CSG_Rect m_Extent; CSG_Matrix m_Image_Value, m_Image_Count; CSG_PointCloud *m_pPoints; CSG_Parameters *m_pSettings; wxPoint m_Mouse_Down, m_Mouse_Move; wxRect m_Select; wxImage m_Image; bool _Draw_Image (void); void _Draw_Pixel (int x, int y, int color); void _Draw_Inverse (wxPoint pa, wxPoint pb); DECLARE_EVENT_TABLE() }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__points_view_extent_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/points_view_module.cpp000066400000000000000000000124631224124640700301530ustar00rootroot00000000000000/********************************************************** * Version $Id: points_view_module.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // points_view_module // // // //-------------------------------------------------------// // // // points_view_module.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute for Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "points_view_module.h" #include "points_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoints_View_Module::CPoints_View_Module(void) { //----------------------------------------------------- Set_Name (_TL("Point Cloud Viewer")); Set_Author (SG_T("O. Conrad (c) 2009")); Set_Description (_TW( "This module is a 3D viewer for SAGA Point Clouds. Amongst others, " "the viewer supports attribute based coloring, a map view to control " "the area-of-interest, point size scaling based on distance, level " "of detail control and an anaglyph modus (to use with red/blue or " "red/green glasses).\n\n" "Module development was supported by " "http://Laserdata GmbH, Austria\n" "and " "http://alpS GmbH, Austria\n" )); //----------------------------------------------------- Parameters.Add_PointCloud( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoints_View_Module::On_Execute(void) { if( !SG_UI_Get_Window_Main() ) { Message_Add(_TL("point cloud viewer can only be run from graphical user interface")); return( false ); } CSG_PointCloud *pPoints = Parameters("POINTS")->asPointCloud(); if( pPoints->Get_Count() <= 0 ) { Message_Add(_TL("point cloud viewer will not be started, because point cloud has no points")); return( false ); } CPoints_View_Dialog dlg(pPoints); dlg.ShowModal(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/pointcloud/pointcloud_viewer/points_view_module.h000066400000000000000000000101031224124640700276050ustar00rootroot00000000000000/********************************************************** * Version $Id: points_view_module.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // points_view_module // // // //-------------------------------------------------------// // // // points_view_module.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__points_view_module_H #define HEADER_INCLUDED__points_view_module_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoints_View_Module : public CSG_Module { public: CPoints_View_Module(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__points_view_module_H saga-2.1.0+dfsg/src/modules/shapes/000077500000000000000000000000001224124640700170705ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/shapes/Makefile.am000066400000000000000000000001371224124640700211250ustar00rootroot00000000000000SUBDIRS = shapes_tools shapes_polygons shapes_points shapes_lines shapes_grid shapes_transect saga-2.1.0+dfsg/src/modules/shapes/Makefile.in000066400000000000000000000425441224124640700211460ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/shapes DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = shapes_tools shapes_polygons shapes_points shapes_lines shapes_grid shapes_transect all: all-recursive .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) --gnu src/modules/shapes/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/shapes/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/000077500000000000000000000000001224124640700213605ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.cpp000066400000000000000000000463161224124640700264050ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Classes_To_Shapes.cpp 1084 2011-06-08 08:10:42Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_Classes_To_Shapes.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Classes_To_Shapes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Classes_To_Shapes::CGrid_Classes_To_Shapes(void) { //----------------------------------------------------- Set_Name (_TL("Vectorising Grid Classes")); Set_Author (SG_T("(c) 2008 by O.Conrad")); Set_Description (_TW( "Vectorising grid classes." )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Choice( NULL , "CLASS_ALL" , _TL("Class Selection"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("one single class specified by class identifier"), _TL("all classes") ), 1 ); Parameters.Add_Value( NULL , "CLASS_ID" , _TL("Class Identifier"), _TL(""), PARAMETER_TYPE_Double, 1 ); Parameters.Add_Choice( NULL , "SPLIT" , _TL("Vectorised class as..."), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("one single (multi-)polygon object"), _TL("each island as separated polygon") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Classes_To_Shapes::On_Execute(void) { //----------------------------------------------------- if( !Get_Classes() || !Get_Edges() ) { m_Classes.Destroy(); return( false ); } //----------------------------------------------------- if( Parameters("SPLIT")->asInt() == 1 ) { Split_Polygons(); } m_Classes.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Classes_To_Shapes::Get_Classes(void) { long i; int id, x, y; double Value; CSG_Grid *pGrid; //----------------------------------------------------- pGrid = Parameters("GRID") ->asGrid(); m_pPolygons = Parameters("POLYGONS") ->asShapes(); m_pPolygons->Create(SHAPE_TYPE_Polygon); m_pPolygons->Add_Field(pGrid->Get_Name(), SG_DATATYPE_Double); m_pPolygons->Add_Field(SG_T("ID") , SG_DATATYPE_Int); m_pPolygons->Add_Field(SG_T("NAME") , SG_DATATYPE_String); DataObject_Set_Parameter(m_pPolygons, DataObject_Get_Parameter(pGrid, "LUT")); // Lookup Table DataObject_Set_Parameter(m_pPolygons, DataObject_Get_Parameter(pGrid, "COLORS_TYPE")); // Color Classification Type: Lookup Table DataObject_Set_Parameter(m_pPolygons, "LUT_ATTRIB", 0); // Color Attribute m_pPolygons->Set_Name(pGrid->Get_Name()); //----------------------------------------------------- Process_Set_Text(_TL("class identification")); m_Classes.Create(pGrid->Get_System(), SG_DATATYPE_Int); m_Classes.Set_NoData_Value(-1); m_Classes.Assign_NoData(); //----------------------------------------------------- if( Parameters("CLASS_ALL")->asInt() == 1 ) { for(i=0, id=-1; iGet_Sorted(i, x, y, false) ) { if( m_pPolygons->Get_Count() == 0 || Value != pGrid->asDouble(x, y) ) { CSG_Shape *pPolygon = m_pPolygons->Add_Shape(); pPolygon->Set_Value(0, Value = pGrid->asDouble(x, y)); pPolygon->Set_Value(1, 1 + id++); pPolygon->Set_Value(2, CSG_String::Format(SG_T("%d"), m_pPolygons->Get_Count())); } m_Classes.Set_Value(x, y, id); } } } //----------------------------------------------------- else { CSG_Shape *pPolygon = m_pPolygons->Add_Shape(); pPolygon->Set_Value(0, Value = Parameters("CLASS_ID")->asDouble()); pPolygon->Set_Value(1, m_pPolygons->Get_Count()); pPolygon->Set_Value(2, CSG_String::Format(SG_T("%d"), m_pPolygons->Get_Count())); for(y=0; yasDouble(x, y) == Value ) { m_Classes.Set_Value(x, y, 0); } } } } //----------------------------------------------------- return( m_pPolygons->Get_Count() > 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Classes_To_Shapes::Get_Edges(void) { /////////////////////////////////////////////////////// //----------------------------------------------------- Process_Set_Text(_TL("edge detection")); int y, nEdges = 0; m_Edges.Create(SG_DATATYPE_Int, 2 * Get_NX() + 1, 2 * Get_NY() + 1, 0.5 * Get_Cellsize(), Get_XMin() - 0.5 * Get_Cellsize(), Get_YMin() - 0.5 * Get_Cellsize()); m_Edges.Set_NoData_Value(-2); m_Edges.Assign_NoData(); //----------------------------------------------------- for(y=0; y= 0 ) { for(int i=0; i<8; i+=2) { if( m_Edges.asInt(Get_xTo(i, x), Get_yTo(i, y)) == -1 ) { Get_Edge(Get_xTo(i, x), Get_yTo(i, y), i + 2, m_Edges.asInt(x, y)); break; } } } } } /////////////////////////////////////////////////////// //----------------------------------------------------- m_Edges.Destroy(); return( true ); } //--------------------------------------------------------- bool CGrid_Classes_To_Shapes::Get_Edge(int x, int y, int i, int Class) { CSG_Shape *pPolygon = m_pPolygons->Get_Shape(Class); if( !pPolygon ) { return( false ); } //----------------------------------------------------- int xFirst, yFirst, ix, iy, iPart; xFirst = x; yFirst = y; iPart = pPolygon->Get_Part_Count(); pPolygon->Add_Point(m_Edges.Get_System().Get_Grid_to_World(x, y), iPart); //----------------------------------------------------- do { ix = Get_xTo(i + 2, x); iy = Get_yTo(i + 2, y); if( m_Edges.is_InGrid(ix, iy) && m_Edges.asInt(ix, iy) == -1 ) // go right ? { pPolygon->Add_Point(m_Edges.Get_System().Get_Grid_to_World(x, y), iPart); i = (i + 2) % 8; } else { if( m_Edges.asInt(ix, iy) == Class ) { m_Edges.Set_NoData(ix, iy); // erase class id in right cells } ix = Get_xTo(i, x); iy = Get_yTo(i, y); if( m_Edges.is_InGrid(ix, iy) && m_Edges.asInt(ix, iy) == -1 ) // go ahead ? { // nop } else { ix = Get_xTo(i + 6, x); iy = Get_yTo(i + 6, y); if( m_Edges.is_InGrid(ix, iy) && m_Edges.asInt(ix, iy) == -1 ) // go left ? { pPolygon->Add_Point(m_Edges.Get_System().Get_Grid_to_World(x, y), iPart); i = (i + 6) % 8; } else { return( false ); } } } x = ix; y = iy; } while( x != xFirst || y != yFirst ); pPolygon->Add_Point(m_Edges.Get_System().Get_Grid_to_World(x, y), iPart); if( pPolygon->Get_Point_Count(iPart) < 4 ) { pPolygon->Del_Part(iPart); return( false ); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Classes_To_Shapes::Split_Polygons(void) { Process_Set_Text(_TL("splitting polygon parts")); CSG_Shapes Polygons(*m_pPolygons); m_pPolygons->Del_Records(); for(int iPolygon=0; iPolygonGet_Part_Count() && Process_Get_Okay(); iPart++) { if( !pPolygon->is_Lake(iPart) ) { CSG_Shape *pShape = m_pPolygons->Add_Shape(pPolygon, SHAPE_COPY_ATTR); for(iPoint=0, jPart=0; iPointGet_Point_Count(iPart); iPoint++) { pShape->Add_Point(pPolygon->Get_Point(iPoint, iPart), jPart); } for(int kPart=0; kPartGet_Part_Count(); kPart++) { if( pPolygon->is_Lake(kPart) && pPolygon->Contains(pPolygon->Get_Point(0, kPart), iPart) ) { jPart++; for(iPoint=0; iPointGet_Point_Count(kPart); iPoint++) { pShape->Add_Point(pPolygon->Get_Point(iPoint, kPart), jPart); } } } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// /*/--------------------------------------------------------- class CSG_Vector_Topology { public: CSG_Vector_Topology(void) { m_Nodes.Create(SHAPE_TYPE_Point, SG_T("NODES")); m_Nodes.Add_Field(SG_T("ID") , SG_DATATYPE_Int); m_Edges.Create(SHAPE_TYPE_Line , SG_T("EDGES")); m_Edges.Add_Field(SG_T("ID") , SG_DATATYPE_Int); m_Edges.Add_Field(SG_T("NODE_FROM") , SG_DATATYPE_Int); m_Edges.Add_Field(SG_T("NODE_TO") , SG_DATATYPE_Int); m_Edges.Add_Field(SG_T("FACE_LEFT") , SG_DATATYPE_Int); m_Edges.Add_Field(SG_T("FACE_RIGHT"), SG_DATATYPE_Int); m_Edges.Add_Field(SG_T("PROCESSED") , SG_DATATYPE_Int); } virtual ~CSG_Vector_Topology(void) { Destroy(); } bool Destroy (void) { m_Nodes.Del_Records(); m_Edges.Del_Records(); return( true ); } bool Add_Node (int ID, double x, double y) { CSG_Shape *pNode = m_Nodes.Add_Shape(); pNode->Set_Point(x, y, 0); pNode->Set_Value(0, ID); return( true ); } bool Add_Node (int ID, const TSG_Point &Point) { return( Add_Node(ID, Point.x, Point.y) ); } CSG_Shapes m_Nodes, m_Edges; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Classes_To_Shapes::Get_Edges(void) { /////////////////////////////////////////////////////// //----------------------------------------------------- Process_Set_Text(_TL("edge detection")); int y, nEdges = 0; m_Topology.Destroy(); m_Edges.Create(SG_DATATYPE_Int, 2 * Get_NX() + 1, 2 * Get_NY() + 1, 0.5 * Get_Cellsize(), Get_XMin() - 0.5 * Get_Cellsize(), Get_YMin() - 0.5 * Get_Cellsize()); m_Edges.Set_NoData_Value(-2); m_Edges.Assign_NoData(); //----------------------------------------------------- for(y=0; y 2 ) { m_Topology.Add_Node(nNodes, m_Edges.Get_System().Get_Grid_to_World(x, y)); m_Edges.Set_Value(x, y, nNodes++); } } else { m_Edges.Set_Value(x, y, -2); } } } /////////////////////////////////////////////////////// //----------------------------------------------------- Process_Set_Text(_TL("edge collection")); //----------------------------------------------------- for(y=0; y= 0 ) // node { for(int i=0; i<8; i+=2) { if( m_Edges.is_InGrid(Get_xTo(i, x), Get_yTo(i, y)) ) { Get_Edge(x, y, i); } } } } } //----------------------------------------------------- for(y=0; yAdd_Point(m_Edges.Get_System().Get_Grid_to_World(x, y), 0); pEdge->Set_Value(0, m_Topology.m_Edges.Get_Count() - 1); // edge id pEdge->Set_Value(1, m_Edges.asInt(x, y)); // from node int ix, iy; ix = Get_xTo(i - 1, x) / 2; iy = Get_yTo(i - 1, y) / 2; pEdge->Set_Value(3, m_Classes.is_InGrid(ix, iy) ? m_Classes.asInt(ix, iy) : -1); // left face ix = Get_xTo(i + 1, x) / 2; iy = Get_yTo(i + 1, y) / 2; pEdge->Set_Value(4, m_Classes.is_InGrid(ix, iy) ? m_Classes.asInt(ix, iy) : -1); // right face //----------------------------------------------------- do { x = Get_xTo(i, x); y = Get_yTo(i, y); if( m_Edges.asInt(x, y) >= 0 ) // node { pEdge->Add_Point(m_Edges.Get_System().Get_Grid_to_World(x, y), 0); pEdge->Set_Value(2, m_Edges.asInt(x, y)); // to node return( true ); } m_Edges.Set_NoData(x, y); //------------------------------------------------- if( !m_Edges.is_InGrid(Get_xTo(i, x), Get_yTo(i, y)) ) // do not go ahead ? { pEdge->Add_Point(m_Edges.Get_System().Get_Grid_to_World(x, y), 0); if( m_Edges.is_InGrid(Get_xTo(i + 2, x), Get_yTo(i + 2, y)) ) // go right ? { i = (i + 2) % 8; } else if( m_Edges.is_InGrid(Get_xTo(i + 6, x), Get_yTo(i + 6, y)) ) // go left ? { i = (i + 6) % 8; } else { i = -1; } } } while( i >= 0 ); //----------------------------------------------------- m_Topology.m_Edges.Del_Record(m_Topology.m_Edges.Get_Count() - 1); return( false ); }/**/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_Classes_To_Shapes.h000066400000000000000000000110071224124640700260370ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Classes_To_Shapes.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_Classes_To_Shapes.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Classes_To_Shapes_H #define HEADER_INCLUDED__Grid_Classes_To_Shapes_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Classes_To_Shapes : public CSG_Module_Grid { public: CGrid_Classes_To_Shapes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Vectorization") ); } protected: virtual bool On_Execute (void); private: CSG_Grid m_Classes, m_Edges; CSG_Shapes *m_pPolygons; bool Get_Classes (void); bool Get_Edges (void); bool Get_Edge (int x, int y, int i, int Class); bool Split_Polygons (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Classes_To_Shapes_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_Polygon_Clip.cpp000066400000000000000000000275371224124640700254450ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Polygon_Clip.cpp 1591 2013-01-23 13:13:15Z manfred-e $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_Polygon_Clip.cpp // // // // Copyright (C) 2006 by // // Stefan Liersch // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: stefan.liersch@ufz.de // // stliersch@freenet.de // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Polygon_Clip.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define MASK_OFF -1 #define MASK_ON 1 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // constructor //--------------------------------------------------------- CGrid_Polygon_Clip::CGrid_Polygon_Clip(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Clip Grid with Polygon")); Set_Author (_TL("copyrights (c) 2006 Stefan Liersch")); Set_Description (_TW( "Clips the input grid with a polygon shapefile. Select " "polygons from the shapefile prior to module execution " "in case you like to use only a subset from the shapefile " "for clipping." )); //----------------------------------------------------- // Parameters list... Parameters.Add_Grid_List( NULL, "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT, false ); Parameters.Add_Grid_List( NULL, "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL, "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Value( NULL, "NODATA" , _TL("Exclude No-Data Area"), _TL(""), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // This function is executed if the user is pressing the OK button //--------------------------------------------------------- bool CGrid_Polygon_Clip::On_Execute(void) { int x, y, ix, iy, ax, ay, nx, ny; CSG_Parameter_Grid_List *pGrids_in, *pGrids_out; CSG_Grid *pGrid_in, *pGrid_out, Mask; CSG_Shapes *pShapes; //----------------------------------------------------- pGrids_in = Parameters("INPUT" )->asGridList(); pGrids_out = Parameters("OUTPUT" )->asGridList(); pShapes = Parameters("POLYGONS")->asShapes(); m_bNoData = Parameters("NODATA" )->asBool(); //----------------------------------------------------- if( pShapes->Get_Type() == SHAPE_TYPE_Polygon && pShapes->Get_Count() > 0 && Get_System()->Get_Extent().Intersects(pShapes->Get_Extent()) ) { // create temporary grid. // Cells within the shapefile get the value +1 // Cells outside the shapefile get the value -1 Mask.Create(*Get_System(), SG_DATATYPE_Byte); //------------------------------------------------- // Get_Mask assignes +1 values to gridcells within the shapefile // The function has been copied from Module: 'Grid_Statistics_AddTo_Polygon' // Function: Get_ShapeIDs(...) // and check extent of valid values in Mask to // calculate GridSystem parameters pGrid_out if( Get_Mask(pShapes, &Mask) && Get_Extent(ax, nx, ay, ny, &Mask, pGrids_in) ) { for(int iGrid=0; iGridGet_Count(); iGrid++) { pGrid_in = pGrids_in->asGrid(iGrid); pGrid_out = SG_Create_Grid( // creating the output grid GridSystem pGrid_in->Get_Type(), nx, ny, Get_Cellsize(), Get_XMin() + ax * Get_Cellsize(), Get_YMin() + ay * Get_Cellsize() ); pGrid_out ->Set_Name(pGrid_in->Get_Name()); pGrid_out ->Set_NoData_Value(pGrid_in->Get_NoData_Value()); pGrids_out ->Add_Item(pGrid_out); // Assign valid values from input grid to the cells of the // output grid that are within the borders of the shapefile // Assign NoData values to the cells outside the shapefile borders for(y=0, iy=ay; ySet_Value(x, y, pGrid_in->asDouble(ix, iy)); } else { pGrid_out->Set_NoData(x, y); } } } } return( true ); } } return( false ); } /////////////////////////////////////////////////////////// //--------------------------------------------------------- // This function modifies the incoming integer variables!!! //--------------------------------------------------------- bool CGrid_Polygon_Clip::Get_Extent(int &xMin, int &xCount, int &yMin, int &yCount, CSG_Grid *pMask, CSG_Parameter_Grid_List *pGrids) { bool bFound; for(yMin=0, bFound=false; yMin=yMin && !bFound && Process_Get_Okay(true); yMax--) { for(int x=0; x=xMin && !bFound && Process_Get_Okay(true); xMax--) { for(int y=yMin; y 0 && yCount > 0 ); } return( false ); } //--------------------------------------------------------- bool CGrid_Polygon_Clip::is_InGrid(int x, int y, CSG_Grid *pMask, CSG_Parameter_Grid_List *pGrids) { if( pMask->asInt(x, y) == MASK_ON ) { if( !m_bNoData ) { return( true ); } for(int i=0; iGet_Count(); i++) { if( !pGrids->asGrid(i)->is_NoData(x, y) ) { return( true ); } } } return( false ); } /////////////////////////////////////////////////////////// //--------------------------------------------------------- // This function has been copied from Module: 'Grid_Statistics_AddTo_Polygon' // Function: Get_ShapeIDs(...) // copyright by Olaf Conrad // // added support to clip only with selected polygons (Volker Wichmann) //--------------------------------------------------------- bool CGrid_Polygon_Clip::Get_Mask(CSG_Shapes *pShapes, CSG_Grid *pMask) { bool bFill, *bCrossing; bool bOnlySelected = false; int x, y, ix, xStart, xStop, iShape, iPart, iPoint; double yPos; TSG_Point pLeft, pRight, pa, pb, p; TSG_Rect Extent; CSG_Shape *pShape; //----------------------------------------------------- pMask->Assign(MASK_OFF); bCrossing = (bool *)SG_Malloc(pMask->Get_NX() * sizeof(bool)); if (pShapes->Get_Selection_Count() > 0) bOnlySelected = true; //----------------------------------------------------- for(iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { if (bOnlySelected && !pShapes->Get_Shape(iShape)->is_Selected()) continue; pShape = pShapes->Get_Shape(iShape); Extent = pShape->Get_Extent().m_rect; xStart = Get_System()->Get_xWorld_to_Grid(Extent.xMin) - 1; if( xStart < 0 ) xStart = 0; xStop = Get_System()->Get_xWorld_to_Grid(Extent.xMax) + 1; if( xStop >= Get_NX() ) xStop = Get_NX() - 1; pLeft.x = pMask->Get_XMin() - 1.0; pRight.x = pMask->Get_XMax() + 1.0; //------------------------------------------------- for(y=0, yPos=pMask->Get_YMin(); yGet_NY(); y++, yPos+=pMask->Get_Cellsize()) { if( yPos >= Extent.yMin && yPos <= Extent.yMax ) { memset(bCrossing, 0, pMask->Get_NX() * sizeof(bool)); pLeft.y = pRight.y = yPos; //----------------------------------------- for(iPart=0; iPartGet_Part_Count(); iPart++) { pb = pShape->Get_Point(pShape->Get_Point_Count(iPart) - 1, iPart); for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { pa = pb; pb = pShape->Get_Point(iPoint, iPart); if( ( (pa.y <= yPos && yPos < pb.y) || (pa.y > yPos && yPos >= pb.y) ) ) { SG_Get_Crossing(p, pa, pb, pLeft, pRight, false); ix = (int)((p.x - pMask->Get_XMin()) / pMask->Get_Cellsize() + 1.0); if( ix < 0) { ix = 0; } else if( ix >= pMask->Get_NX() ) { continue; } bCrossing[ix] = !bCrossing[ix]; } } } //----------------------------------------- for(x=xStart, bFill=false; x<=xStop; x++) { if( bCrossing[x] ) { bFill = !bFill; } if( bFill ) { pMask->Set_Value(x, y, MASK_ON); } } } } } //----------------------------------------------------- SG_Free(bCrossing); return( true ); } saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_Polygon_Clip.h000066400000000000000000000106071224124640700251000ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Polygon_Clip.h 1422 2012-06-01 08:43:45Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_Polygon_Clip.h // // // // Copyright (C) 2006 by // // Stefan Liersch // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: stefan.liersch@ufz.de // // stliersch@freenet.de // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Polygon_Clip_H #define HEADER_INCLUDED__Grid_Polygon_Clip_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Polygon_Clip : public CSG_Module_Grid { public: // constructor CGrid_Polygon_Clip(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Spatial Extent") ); } protected: // execute module virtual bool On_Execute (void); private: bool m_bNoData; // estimates the Extent of the new grid bool Get_Extent (int &xMin, int &xCount, int &yMin, int &yCount, CSG_Grid *pMask, CSG_Parameter_Grid_List *pGrids); bool is_InGrid (int x, int y, CSG_Grid *pMask, CSG_Parameter_Grid_List *pGrids); // This function has been copied from Module: 'Grid_Statistics_AddTo_Polygon' // Function: Get_ShapeIDs // copyright by Olaf Conrad bool Get_Mask (CSG_Shapes *pShapes, CSG_Grid *pMask); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Polygon_Clip_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.cpp000066400000000000000000000426531224124640700277570ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Statistics_AddTo_Polygon.cpp 1491 2012-10-17 13:55:27Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_Statistics_AddTo_Polygon.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // // quantile calculation: // // Copyright (C) 2007 by // // Johan Van de Wauw // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include #include "Grid_Statistics_AddTo_Polygon.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Statistics_AddTo_Polygon::CGrid_Statistics_AddTo_Polygon(void) { CSG_Parameter *pNode; //----------------------------------------------------- // 1. Info... Set_Name (_TL("Grid Statistics for Polygons")); Set_Author (SG_T("(c) 2003 by Olaf Conrad, Quantile Calculation (c) 2007 by Johan Van de Wauw")); Set_Description (_TW( "For each polygon statistics about the values of all contained grid nodes will be generated." )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("standard"), _TL("shape wise, supports overlapping polygons") ), 0 ); Parameters.Add_Choice( NULL , "NAMING" , _TL("Field Naming"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("grid number"), _TL("grid name") ), 1 ); pNode = Parameters.Add_Shapes( NULL , "RESULT" , _TL("Statistics"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon ); Parameters.Add_Value(pNode, "COUNT" , _TL("Number of Cells") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(pNode, "MIN" , _TL("Minimum") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(pNode, "MAX" , _TL("Maximum") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(pNode, "RANGE" , _TL("Range") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(pNode, "SUM" , _TL("Sum") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(pNode, "MEAN" , _TL("Mean") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(pNode, "VAR" , _TL("Variance") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(pNode, "STDDEV" , _TL("Standard Deviation"), _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(pNode, "QUANTILE", _TL("Quantile") , _TL("Calculate distribution quantiles. Value specifies interval (median=50, quartiles=25, deciles=10, ...). Set to zero to omit quantile calculation."), PARAMETER_TYPE_Int, 0, 0, true, 50, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define GET_FIELD_NAME(VAR) Naming == 0 ? CSG_String::Format(SG_T("G%02d_%s"), iGrid + 1, VAR) : CSG_String::Format(SG_T("%s [%s]"), pGrid->Get_Name(), VAR) //--------------------------------------------------------- bool CGrid_Statistics_AddTo_Polygon::On_Execute(void) { int Method, Naming, Quantile; CSG_Parameter_Grid_List *pGrids; CSG_Shapes *pShapes; //----------------------------------------------------- pGrids = Parameters("GRIDS" )->asGridList(); pShapes = Parameters("POLYGONS")->asShapes(); Method = Parameters("METHOD" )->asInt(); Naming = Parameters("NAMING" )->asInt(); Quantile = Parameters("QUANTILE")->asInt(); int nFields = 0; int fCOUNT = Parameters("COUNT" )->asBool() ? nFields++ : -1; int fMIN = Parameters("MIN" )->asBool() ? nFields++ : -1; int fMAX = Parameters("MAX" )->asBool() ? nFields++ : -1; int fRANGE = Parameters("RANGE" )->asBool() ? nFields++ : -1; int fSUM = Parameters("SUM" )->asBool() ? nFields++ : -1; int fMEAN = Parameters("MEAN" )->asBool() ? nFields++ : -1; int fVAR = Parameters("VAR" )->asBool() ? nFields++ : -1; int fSTDDEV = Parameters("STDDEV" )->asBool() ? nFields++ : -1; int fQUANTILE = Quantile > 0 ? nFields++ : -1; if( nFields == 0 ) { Error_Set(_TL("no output parameter in selection")); return( false ); } if( pShapes->Get_Count() <= 0 ) { Error_Set(_TL("no polygons in polygon layer")); return( false ); } if( !Get_System()->Get_Extent().Intersects(pShapes->Get_Extent()) ) { Error_Set(_TL("no spatial intersection between grid(s) and polygon layer")); return( false ); } if( Method == 0 && !Get_ShapeIDs(pShapes) ) { return( false ); } //----------------------------------------------------- if( Parameters("RESULT")->asShapes() != NULL && Parameters("RESULT")->asShapes() != pShapes ) { pShapes = Parameters("RESULT")->asShapes(); pShapes ->Assign(Parameters("POLYGONS")->asShapes()); } //----------------------------------------------------- for(int iGrid=0; iGridGet_Count() && Process_Get_Okay(); iGrid++) { CSG_Simple_Statistics *Statistics = new CSG_Simple_Statistics[pShapes->Get_Count()]; CSG_Table *Values = fQUANTILE >= 0 ? new CSG_Table[pShapes->Get_Count()] : NULL; CSG_Grid *pGrid = pGrids->asGrid(iGrid); Process_Set_Text(CSG_String::Format(SG_T("[%d/%d] %s"), 1 + iGrid, pGrids->Get_Count(), pGrid->Get_Name())); if( (Method == 0 && Get_Statistics (pGrid, pShapes, Statistics, Values)) || (Method == 1 && Get_Statistics_Alt(pGrid, pShapes, Statistics, Values)) ) { nFields = pShapes->Get_Field_Count(); if( fCOUNT >= 0 ) pShapes->Add_Field(GET_FIELD_NAME(_TL("CELLS") ), SG_DATATYPE_Int ); if( fMIN >= 0 ) pShapes->Add_Field(GET_FIELD_NAME(_TL("MIN") ), SG_DATATYPE_Double); if( fMAX >= 0 ) pShapes->Add_Field(GET_FIELD_NAME(_TL("MAX") ), SG_DATATYPE_Double); if( fRANGE >= 0 ) pShapes->Add_Field(GET_FIELD_NAME(_TL("RANGE") ), SG_DATATYPE_Double); if( fSUM >= 0 ) pShapes->Add_Field(GET_FIELD_NAME(_TL("SUM") ), SG_DATATYPE_Double); if( fMEAN >= 0 ) pShapes->Add_Field(GET_FIELD_NAME(_TL("MEAN") ), SG_DATATYPE_Double); if( fVAR >= 0 ) pShapes->Add_Field(GET_FIELD_NAME(_TL("VARIANCE")), SG_DATATYPE_Double); if( fSTDDEV >= 0 ) pShapes->Add_Field(GET_FIELD_NAME(_TL("STDDEV") ), SG_DATATYPE_Double); if( fQUANTILE >= 0 ) { for(int iQuantile=Quantile; iQuantile<100; iQuantile+=Quantile) { pShapes->Add_Field(GET_FIELD_NAME(CSG_String::Format(SG_T("Q%02d"), iQuantile).c_str()), SG_DATATYPE_Double); } } //--------------------------------------------- for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); if( Statistics[iShape].Get_Count() == 0 ) { if( fCOUNT >= 0 ) pShape->Set_NoData(nFields + fCOUNT); if( fMIN >= 0 ) pShape->Set_NoData(nFields + fMIN); if( fMAX >= 0 ) pShape->Set_NoData(nFields + fMAX); if( fRANGE >= 0 ) pShape->Set_NoData(nFields + fRANGE); if( fSUM >= 0 ) pShape->Set_NoData(nFields + fSUM); if( fMEAN >= 0 ) pShape->Set_NoData(nFields + fMEAN); if( fVAR >= 0 ) pShape->Set_NoData(nFields + fVAR); if( fSTDDEV >= 0 ) pShape->Set_NoData(nFields + fSTDDEV); if( fQUANTILE >= 0 ) { for(int iQuantile=Quantile, iField=nFields + fQUANTILE; iQuantile<100; iQuantile+=Quantile, iField++) { pShape->Set_NoData(iField); } } } else { if( fCOUNT >= 0 ) pShape->Set_Value(nFields + fCOUNT , Statistics[iShape].Get_Count ()); if( fMIN >= 0 ) pShape->Set_Value(nFields + fMIN , Statistics[iShape].Get_Minimum ()); if( fMAX >= 0 ) pShape->Set_Value(nFields + fMAX , Statistics[iShape].Get_Maximum ()); if( fRANGE >= 0 ) pShape->Set_Value(nFields + fRANGE , Statistics[iShape].Get_Range ()); if( fSUM >= 0 ) pShape->Set_Value(nFields + fSUM , Statistics[iShape].Get_Sum ()); if( fMEAN >= 0 ) pShape->Set_Value(nFields + fMEAN , Statistics[iShape].Get_Mean ()); if( fVAR >= 0 ) pShape->Set_Value(nFields + fVAR , Statistics[iShape].Get_Variance()); if( fSTDDEV >= 0 ) pShape->Set_Value(nFields + fSTDDEV , Statistics[iShape].Get_StdDev ()); if( fQUANTILE >= 0 ) { Values[iShape].Set_Index(0, TABLE_INDEX_Ascending); double dQuantile = Values[iShape].Get_Count() / 100.0; for(int iQuantile=Quantile, iField=nFields + fQUANTILE; iQuantile<100; iQuantile+=Quantile, iField++) { pShape->Set_Value(iField, Values[iShape].Get_Record_byIndex((int)(iQuantile * dQuantile))->asDouble(0)); } } } } } //------------------------------------------------- delete[](Statistics); if( Values ) { delete[](Values); } } //----------------------------------------------------- DataObject_Update(pShapes); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Statistics_AddTo_Polygon::Get_Statistics(CSG_Grid *pGrid, CSG_Shapes *pShapes, CSG_Simple_Statistics *Statistics, CSG_Table *Values) { int x, y, iShape; for(y=0; yis_NoData(x, y) && (iShape = m_ShapeIDs.asInt(x, y)) >= 0 && iShape < pShapes->Get_Count() ) { Statistics[iShape].Add_Value(pGrid->asDouble(x, y)); if( Values ) { if( Values[iShape].Get_Field_Count() == 0 ) { Values[iShape].Add_Field("Z", SG_DATATYPE_Double); } Values[iShape].Add_Record()->Set_Value(0, pGrid->asDouble(x, y)); } } } } return( true ); } //--------------------------------------------------------- bool CGrid_Statistics_AddTo_Polygon::Get_Statistics_Alt(CSG_Grid *pGrid, CSG_Shapes *pShapes, CSG_Simple_Statistics *Statistics, CSG_Table *Values) { for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape_Polygon *pShape = (CSG_Shape_Polygon *)pShapes->Get_Shape(iShape); int ax = Get_System()->Get_xWorld_to_Grid(pShapes->Get_Extent().Get_XMin()) - 1; if( ax < 0 ) ax = 0; int bx = Get_System()->Get_xWorld_to_Grid(pShapes->Get_Extent().Get_XMax()) + 1; if( bx >= Get_NX() ) bx = Get_NX() - 1; int ay = Get_System()->Get_yWorld_to_Grid(pShapes->Get_Extent().Get_YMin()) - 1; if( ay < 0 ) ay = 0; int by = Get_System()->Get_yWorld_to_Grid(pShapes->Get_Extent().Get_YMax()) + 1; if( by >= Get_NY() ) by = Get_NY() - 1; double py = Get_System()->Get_yGrid_to_World(ay); for(int y=ay; y<=by; y++, py+=Get_Cellsize()) { double px = Get_System()->Get_xGrid_to_World(ax); for(int x=ax; x<=bx; x++, px+=Get_Cellsize()) { if( !pGrid->is_NoData(x, y) && pShape->Contains(px, py) ) { Statistics[iShape].Add_Value(pGrid->asDouble(x, y)); if( Values ) { if( Values[iShape].Get_Field_Count() == 0 ) { Values[iShape].Add_Field("Z", SG_DATATYPE_Double); } Values[iShape].Add_Record()->Set_Value(0, pGrid->asDouble(x, y)); } } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Statistics_AddTo_Polygon::Get_ShapeIDs(CSG_Shapes *pShapes) { bool bFill, *bCrossing; int x, y, ix, xStart, xStop, iShape, iPart, iPoint; double yPos; TSG_Point pLeft, pRight, pa, pb, p; TSG_Rect Extent; CSG_Shape *pShape; //----------------------------------------------------- m_ShapeIDs.Create(*Get_System(), pShapes->Get_Count() < 32767 ? SG_DATATYPE_Short : SG_DATATYPE_Int); m_ShapeIDs.Assign(-1.0); bCrossing = (bool *)SG_Malloc(Get_NX() * sizeof(bool)); //----------------------------------------------------- for(iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { pShape = pShapes->Get_Shape(iShape); Extent = pShape->Get_Extent().m_rect; xStart = Get_System()->Get_xWorld_to_Grid(Extent.xMin) - 1; if( xStart < 0 ) xStart = 0; xStop = Get_System()->Get_xWorld_to_Grid(Extent.xMax) + 1; if( xStop >= Get_NX() ) xStop = Get_NX() - 1; pLeft.x = Get_XMin() - 1.0; pRight.x = Get_XMax() + 1.0; //------------------------------------------------- for(y=0, yPos=Get_YMin(); y= Extent.yMin && yPos <= Extent.yMax ) { memset(bCrossing, 0, Get_NX() * sizeof(bool)); pLeft.y = pRight.y = yPos; //----------------------------------------- for(iPart=0; iPartGet_Part_Count(); iPart++) { pb = pShape->Get_Point(pShape->Get_Point_Count(iPart) - 1, iPart); for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { pa = pb; pb = pShape->Get_Point(iPoint, iPart); if( ( (pa.y <= yPos && yPos < pb.y) || (pa.y > yPos && yPos >= pb.y) ) ) { SG_Get_Crossing(p, pa, pb, pLeft, pRight, false); ix = (int)((p.x - Get_XMin()) / Get_Cellsize() + 1.0); if( ix < 0) { ix = 0; } else if( ix >= Get_NX() ) { continue; } bCrossing[ix] = !bCrossing[ix]; } } } //----------------------------------------- for(x=xStart, bFill=false; x<=xStop; x++) { if( bCrossing[x] ) { bFill = !bFill; } if( bFill ) { m_ShapeIDs.Set_Value(x, y, iShape); } } } } } //----------------------------------------------------- SG_Free(bCrossing); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.h000066400000000000000000000117071224124640700274200ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Statistics_AddTo_Polygon.h 1491 2012-10-17 13:55:27Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_Statistics_AddTo_Polygon.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Statistics_AddTo_Polygon_H #define HEADER_INCLUDED__Grid_Statistics_AddTo_Polygon_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Statistics_AddTo_Polygon : public CSG_Module_Grid { public: CGrid_Statistics_AddTo_Polygon(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Grid Values") ); } protected: virtual bool On_Execute (void); private: CSG_Grid m_ShapeIDs; bool Get_Statistics (CSG_Grid *pGrid, CSG_Shapes *pShapes, CSG_Simple_Statistics *Statistics, CSG_Table *Values); bool Get_Statistics_Alt (CSG_Grid *pGrid, CSG_Shapes *pShapes, CSG_Simple_Statistics *Statistics, CSG_Table *Values); bool Get_ShapeIDs (CSG_Shapes *pShapes); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Statistics_AddTo_Polygon_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_To_Contour.cpp000066400000000000000000000245311224124640700251310ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_To_Contour.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_To_Contour.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_To_Contour.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_To_Contour::CGrid_To_Contour(void) { //----------------------------------------------------- Set_Name (_TL("Contour Lines from Grid")); Set_Author (SG_T("(c) 2001 by O.Conrad")); Set_Description (_TW( "Create contour lines (isolines) from grid values. " )); //----------------------------------------------------- Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL, "CONTOUR" , _TL("Contour Lines"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL, "ZMIN" , _TL("Minimum Contour Value"), _TL(""), PARAMETER_TYPE_Double, 0.0 ); Parameters.Add_Value( NULL, "ZMAX" , _TL("Maximum Contour Value"), _TL(""), PARAMETER_TYPE_Double, 10000.0 ); Parameters.Add_Value( NULL, "ZSTEP" , _TL("Equidistance"), _TL(""), PARAMETER_TYPE_Double, 10.0, 0, true ); } //--------------------------------------------------------- CGrid_To_Contour::~CGrid_To_Contour(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_To_Contour::On_Execute(void) { double zMin, zMax, zStep; pGrid = Parameters("INPUT" )->asGrid(); pLayer = Parameters("CONTOUR")->asShapes(); zMin = Parameters("ZMIN" )->asDouble() / pGrid->Get_ZFactor(); zMax = Parameters("ZMAX" )->asDouble() / pGrid->Get_ZFactor(); zStep = Parameters("ZSTEP" )->asDouble() / pGrid->Get_ZFactor(); if( zMin <= zMax && zStep > 0 ) { if( zMin < pGrid->Get_ZMin() ) { zMin += zStep * (int)((pGrid->Get_ZMin() - zMin) / zStep); } if( zMax > pGrid->Get_ZMax() ) { zMax = pGrid->Get_ZMax(); } pLayer->Create(SHAPE_TYPE_Line, pGrid->Get_Name()); pLayer->Add_Field("ID", SG_DATATYPE_Int); pLayer->Add_Field(CSG_String::Format(SG_T("%s"),pGrid->Get_Name()).BeforeFirst(SG_Char('.')), SG_DATATYPE_Double); Contour_Create(zMin, zMax, zStep); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_To_Contour::Contour_Create(double zMin, double zMax, double zStep) { int x, y, i, ID; double zValue; //----------------------------------------------------- // Initialize... col = (char **)SG_Calloc(Get_NY(), sizeof(char *)); row = (char **)SG_Calloc(Get_NY(), sizeof(char *)); for(y=0; yasDouble(x,y) >= zValue ) { row[y][x] = pGrid->asDouble(x+1,y ) < zValue ? 1 : 0; col[y][x] = pGrid->asDouble(x ,y+1) < zValue ? 1 : 0; } else { row[y][x] = pGrid->asDouble(x+1,y ) >= zValue ? 1 : 0; col[y][x] = pGrid->asDouble(x ,y+1) >= zValue ? 1 : 0; } //------------------------------------------------- // Step2: Interpolation + Delineation for(y=0; yGet_XMin(), yMin = pGrid->Get_YMin(); CSG_Shape *pShape = pLayer->Add_Shape(); pShape->Set_Value(0, ID); pShape->Set_Value(1, z); do { //------------------------------------------------- // Interpolation... d = pGrid->asDouble(x,y); d = (d - z) / (d - pGrid->asDouble(zx,zy)); xPos = xMin + Get_Cellsize() * (x + d * (zx - x)); yPos = yMin + Get_Cellsize() * (y + d * (zy - y)); pShape->Add_Point(xPos, yPos); //------------------------------------------------- // Naechstes (x/y) (col/row) finden... if( !Contour_FindNext(Dir, x ,y ,doRow) ) doContinue = Contour_FindNext(Dir, x, y, doRow); Dir = (Dir + 5) % 8; //------------------------------------------------- // Loeschen und initialisieren... if(doRow) { row[y][x] = 0; zx = x + 1; zy = y; } else { col[y][x] = 0; zx = x; zy = y + 1; } } while(doContinue); } //--------------------------------------------------------- inline bool CGrid_To_Contour::Contour_FindNext(int &Dir, int &x, int &y, bool &doRow) { bool doContinue; if(doRow) { switch(Dir) { case 0: // Norden if(row[y+1][x ]) { y++; Dir=0; doContinue=true; break; } case 1: // Nord-Ost if(col[y ][x+1]) { x++; doRow=false; Dir=1; doContinue=true; break; } case 2: // Osten ist nicht... case 3: // Sued-Ost if(y-1>=0) if(col[y-1][x+1]) { x++; y--; doRow=false; Dir=3; doContinue=true; break; } case 4: // Sueden if(y-1>=0) if(row[y-1][x ]) { y--; Dir=4; doContinue=true; break; } case 5: // Sued-West if(y-1>=0) if(col[y-1][x ]) { y--; doRow=false; Dir=5; doContinue=true; break; } case 6: // Westen ist nicht... case 7: // Nord-West if(col[y ][x ]) { doRow=false; Dir=7; doContinue=true; break; } default: Dir=0; doContinue=false; } } else { switch(Dir) { case 0: // Norden ist nicht... case 1: // Nord-Ost if(row[y+1][x ]) { y++; doRow=true; Dir=1; doContinue=true; break; } case 2: // Osten if(col[y ][x+1]) { x++; Dir=2; doContinue=true; break; } case 3: // Sued-Ost if(row[y ][x ]) { doRow=true; Dir=3; doContinue=true; break; } case 4: // Sueden ist nicht... case 5: // Sued-West if(x-1>=0) if(row[y ][x-1]) { x--; doRow=true; Dir=5; doContinue=true; break; } case 6: // Westen if(x-1>=0) if(col[y ][x-1]) { x--; Dir=6; doContinue=true; break; } case 7: // Nord-West if(x-1>=0) if(row[y+1][x-1]) { x--; y++; doRow=true; Dir=7; doContinue=true; break; } default: Dir=0; doContinue=false; } } return(doContinue); } saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_To_Contour.h000066400000000000000000000105241224124640700245730ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_To_Contour.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_To_Contour.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_To_Contour_H #define HEADER_INCLUDED__Grid_To_Contour_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_To_Contour : public CSG_Module_Grid { public: CGrid_To_Contour(void); virtual ~CGrid_To_Contour(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Vectorization") ); } protected: virtual bool On_Execute (void); private: char **col, **row; CSG_Grid *pGrid; CSG_Shapes *pLayer; void Contour_Create (double zStart, double zStop, double zDist); void Contour_Find (int x, int y, double z, bool doRow, int ID); bool Contour_FindNext (int &Dir, int &x, int &y, bool &doRow); }; #endif // #ifndef HEADER_INCLUDED__Grid_To_Contour_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_To_Gradient.cpp000066400000000000000000000270021224124640700252310ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_To_Gradient.cpp 1025 2011-04-28 16:16:37Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_To_Gradient.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_To_Gradient.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_To_Gradient::CGrid_To_Gradient(int Method) { m_Method = Method; Set_Author (SG_T("O.Conrad (c) 2006")); //----------------------------------------------------- switch( m_Method ) { case 0: // surface Set_Name (_TL("Gradient Vectors from Surface")); Set_Description (_TW( "Create lines indicating the gradient. " )); Parameters.Add_Grid( NULL , "SURFACE" , _TL("Surface"), _TL(""), PARAMETER_INPUT ); break; case 1: // direction and length Set_Name (_TL("Gradient Vectors from Direction and Length")); Set_Description (_TW( "Create lines indicating the gradient. " )); Parameters.Add_Grid( NULL , "DIR" , _TL("Direction"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "LEN" , _TL("Length"), _TL(""), PARAMETER_INPUT ); break; case 2: // directional components Set_Name (_TL("Gradient Vectors from Directional Components")); Set_Description (_TW( "Create lines indicating the gradient. " )); Parameters.Add_Grid( NULL , "X" , _TL("X Component"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "Y" , _TL("Y Component"), _TL(""), PARAMETER_INPUT ); break; } //----------------------------------------------------- Parameters.Add_Shapes( NULL , "VECTORS" , _TL("Gradient Vectors"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "STEP" , _TL("Step"), _TL(""), PARAMETER_TYPE_Int , 1.0, 1.0, true ); Parameters.Add_Range( NULL , "SIZE" , _TL("Size Range"), _TL("size range as percentage of step"), 25.0, 100.0, 0.0, true ); Parameters.Add_Choice( NULL , "AGGR" , _TL("Aggregation"), _TL("how to request values if step size is more than one cell"), CSG_String::Format(SG_T("%s|%s|"), _TL("nearest neighbour"), _TL("mean value") ), 1 ); Parameters.Add_Choice( NULL , "STYLE" , _TL("Style"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("simple line"), _TL("arrow"), _TL("arrow (centered to cell)") ), 2 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_To_Gradient::On_Execute(void) { int x, y, Step; double sMin, sRange, ex, ey, d; TSG_Point p; TSG_Grid_Interpolation Interpolation; CSG_Grid_System System; CSG_Grid EX, EY, D; CSG_Shapes *pVectors; //----------------------------------------------------- pVectors = Parameters("VECTORS") ->asShapes(); Step = Parameters("STEP") ->asInt(); m_Style = Parameters("STYLE") ->asInt(); sMin = Parameters("SIZE") ->asRange()->Get_LoVal() * Step * Get_Cellsize() / 100.0; sRange = Parameters("SIZE") ->asRange()->Get_HiVal() * Step * Get_Cellsize() / 100.0 - sMin; Interpolation = Parameters("AGGR") ->asInt() == 0 ? GRID_INTERPOLATION_NearestNeighbour : GRID_INTERPOLATION_Mean_Cells; //----------------------------------------------------- if( Step > Get_NX() || Step > Get_NY() ) { Error_Set(_TL("step size should not exceed number of cells in x or y direction")); return( false ); } //----------------------------------------------------- // System.Assign(Step * Get_Cellsize(), Get_XMin(), Get_YMin(), Get_NX() / Step, Get_NY() / Step); System.Assign(Step * Get_Cellsize(), Get_XMin(), Get_YMin(), Get_System()->Get_XMax(), Get_System()->Get_YMax()); EX.Create(System); EY.Create(System); D .Create(System); D .Assign_NoData(); switch( m_Method ) { //----------------------------------------------------- case 0: // surface { CSG_Grid Surface(System), *pSurface = Parameters("SURFACE")->asGrid(); Surface.Assign(pSurface, Interpolation); pVectors->Create(SHAPE_TYPE_Line, CSG_String::Format(SG_T("%s [%s]"), pSurface->Get_Name(), _TL("Gradient"))); for(y=0; yasGrid(); Dir.Assign(pDir, Interpolation); CSG_Grid Len(System), *pLen = Parameters("LEN")->asGrid(); Len.Assign(pLen, Interpolation); pVectors->Create(SHAPE_TYPE_Line, CSG_String::Format(SG_T("%s [%s|%s]"), _TL("Gradient"), pDir->Get_Name(), pLen->Get_Name())); for(y=0; yasGrid(); X.Assign(pX, Interpolation); CSG_Grid Y(System), *pY = Parameters("Y")->asGrid(); Y.Assign(pY, Interpolation); pVectors->Create(SHAPE_TYPE_Line, CSG_String::Format(SG_T("%s [%s|%s]"), _TL("Gradient"), pX->Get_Name(), pY->Get_Name())); for(y=0; y 0.0 ) { EX.Set_Value(x, y, X.asDouble(x, y) / d); EY.Set_Value(x, y, Y.asDouble(x, y) / d); D .Set_Value(x, y, d); } } } } break; } //----------------------------------------------------- pVectors->Add_Field("EX" , SG_DATATYPE_Double); pVectors->Add_Field("EY" , SG_DATATYPE_Double); pVectors->Add_Field("LEN" , SG_DATATYPE_Double); pVectors->Add_Field("DIR" , SG_DATATYPE_Double); if( D.Get_ZRange() > 0.0 ) { sRange = sRange / D.Get_ZRange(); } //----------------------------------------------------- for(y=0, p.y=System.Get_YMin(); yAdd_Shape(); ex = EX.asDouble(x, y); ey = EY.asDouble(x, y); d = D .asDouble(x, y); pVector->Set_Value(0, ex); pVector->Set_Value(1, ey); pVector->Set_Value(2, d); pVector->Set_Value(3, atan2(ex, ey) * M_RAD_TO_DEG); if( (d = sMin + sRange * (d - D.Get_ZMin())) > 0.0 ) { Set_Vector(pVector, p, d * ex, d * ey); } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define ADD_TO_VECTOR(I, X, Y) (pVector->Add_Point(Point.x + ((X) * dy + (Y) * dx), Point.y + ((Y) * dy - (X) * dx), I)) //--------------------------------------------------------- inline void CGrid_To_Gradient::Set_Vector(CSG_Shape *pVector, const TSG_Point &Point, double dx, double dy) { switch( m_Style ) { case 0: ADD_TO_VECTOR(0, 0.00, 0.00); ADD_TO_VECTOR(0, 0.00, 1.00); break; case 1: ADD_TO_VECTOR(0, 0.00, 0.00); ADD_TO_VECTOR(0, 0.00, 1.00); ADD_TO_VECTOR(1, 0.20, 0.75); ADD_TO_VECTOR(1, 0.00, 1.00); ADD_TO_VECTOR(1, -0.20, 0.75); break; case 2: ADD_TO_VECTOR(0, 0.00, -0.50); ADD_TO_VECTOR(0, 0.00, 0.50); ADD_TO_VECTOR(1, 0.20, 0.25); ADD_TO_VECTOR(1, 0.00, 0.50); ADD_TO_VECTOR(1, -0.20, 0.25); break; } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_To_Gradient.h000066400000000000000000000107241224124640700247010ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_To_Gradient.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_To_Gradient.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_To_Gradient_H #define HEADER_INCLUDED__Grid_To_Gradient_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_To_Gradient : public CSG_Module_Grid { public: CGrid_To_Gradient(int Method); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Vectorization") ); } protected: virtual bool On_Execute (void); bool Initialize (void); private: int m_Method, m_Style; void Set_Vector (CSG_Shape *pVector, const TSG_Point &Point, double dx, double dy); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_To_Gradient_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_To_Points.cpp000066400000000000000000000202111224124640700247430ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_To_Points.cpp 1096 2011-06-16 16:01:39Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_To_Points.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_To_Points.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_To_Points::CGrid_To_Points(void) { //----------------------------------------------------- Set_Name (_TL("Grid Values to Points")); Set_Author (SG_T("O.Conrad (c) 2001")); Set_Description (_TW( "This module saves grid values to point (grid nodes) or polygon (grid cells) shapes. Optionally only points " "can be saved, which are contained by polygons of the specified shapes layer. " "In addition, it is possible to exclude all cells that are coded NoData in the " "first grid of the grid list." )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT_OPTIONAL, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "NODATA" , _TL("Exclude NoData Cells"), _TL(""), PARAMETER_TYPE_Bool , true ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("nodes"), _TL("cells") ) ); } //--------------------------------------------------------- CGrid_To_Points::~CGrid_To_Points(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_To_Points::On_Execute(void) { bool bZFactor, bNoNoData; int x, y, iGrid, iPoint, Type; double xPos, yPos; CSG_Grid *pGrid; CSG_Parameter_Grid_List *pGrids; CSG_Shape *pShape; CSG_Shapes *pShapes, *pPolygons; //----------------------------------------------------- pGrids = Parameters("GRIDS") ->asGridList(); pPolygons = Parameters("POLYGONS")->asShapes(); pShapes = Parameters("SHAPES") ->asShapes(); bNoNoData = Parameters("NODATA") ->asBool(); Type = Parameters("TYPE") ->asInt(); bZFactor = true; //----------------------------------------------------- if( pGrids->Get_Count() > 0 ) { switch( Type ) { case 0: pShapes->Create(SHAPE_TYPE_Point , _TL("Grid Values [Nodes]")); break; case 1: pShapes->Create(SHAPE_TYPE_Polygon, _TL("Grid Values [Cells]")); break; } pShapes->Add_Field("ID" , SG_DATATYPE_Int); pShapes->Add_Field("X" , SG_DATATYPE_Double); pShapes->Add_Field("Y" , SG_DATATYPE_Double); for(iGrid=0; iGridGet_Count(); iGrid++) { pShapes->Add_Field(CSG_String::Format(SG_T("%s"),pGrids->asGrid(iGrid)->Get_Name()).BeforeFirst(SG_Char('.')).c_str(), SG_DATATYPE_Double); } //------------------------------------------------- for(y=0, yPos=Get_YMin() - (Type ? 0.5 * Get_Cellsize() : 0.0), iPoint=0; yasGrid(0)->is_NoData(x, y))) && (!pPolygons || is_Contained(xPos, yPos, pPolygons)) ) { pShape = pShapes->Add_Shape(); switch( Type ) { case 0: pShape->Add_Point(xPos, yPos); break; case 1: pShape->Add_Point(xPos , yPos ); pShape->Add_Point(xPos + Get_Cellsize(), yPos ); pShape->Add_Point(xPos + Get_Cellsize(), yPos + Get_Cellsize()); pShape->Add_Point(xPos , yPos + Get_Cellsize()); break; } pShape->Set_Value(0, ++iPoint); pShape->Set_Value(1, xPos); pShape->Set_Value(2, yPos); for(iGrid=0; iGridGet_Count(); iGrid++) { pGrid = pGrids->asGrid(iGrid); pShape->Set_Value(iGrid + 3, pGrid->is_NoData(x, y) ? -99999 : pGrid->asDouble(x, y, bZFactor)); } } } } return( pShapes->Get_Count() > 0 ); } return( false ); } //--------------------------------------------------------- inline bool CGrid_To_Points::is_Contained(double x, double y, CSG_Shapes *pPolygons) { if( pPolygons && pPolygons->Get_Type() == SHAPE_TYPE_Polygon ) { for(int iPolygon=0; iPolygonGet_Count(); iPolygon++) { CSG_Shape_Polygon *pPolygon = (CSG_Shape_Polygon *)pPolygons->Get_Shape(iPolygon); if( pPolygon->Contains(x, y) ) { return( true ); } } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_To_Points.h000066400000000000000000000110321224124640700244110ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_To_Points.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_To_Points.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_To_Points_H #define HEADER_INCLUDED__Grid_To_Points_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_To_Points : public CSG_Module_Grid { public: CGrid_To_Points(void); virtual ~CGrid_To_Points(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Vectorization") ); } protected: virtual bool On_Execute (void); private: bool is_Contained (double x, double y, CSG_Shapes *pPolygons); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_To_Points_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_To_Points_Random.cpp000066400000000000000000000125011224124640700262460ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_To_Points_Random.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_To_Points_Random.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "Grid_To_Points_Random.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_To_Points_Random::CGrid_To_Points_Random() { Set_Name (_TL("Grid Values to Points (randomly)")); Set_Author (SG_T("(c) 2003 by O.Conrad")); Set_Description (_TW( "Extract randomly points from gridded data." )); Parameters.Add_Grid( NULL, "GRID" , _TL("Grid") , _TL(""), PARAMETER_INPUT); Parameters.Add_Value( NULL, "FREQ" , _TL("Frequency") , _TL("One per x"), PARAMETER_TYPE_Int, 100, 1, true); Parameters.Add_Shapes( NULL, "POINTS" , _TL("Points") , _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point); } //--------------------------------------------------------- CGrid_To_Points_Random::~CGrid_To_Points_Random() {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_To_Points_Random::On_Execute(void) { int x, y, n; double frequency; CSG_Grid *pGrid; CSG_Shape *pShape; CSG_Shapes *pShapes; pGrid = Parameters("GRID")->asGrid(); frequency = 1.0 / Parameters("FREQ")->asDouble(); pShapes = Parameters("POINTS")->asShapes(); pShapes->Create(SHAPE_TYPE_Point, pGrid->Get_Name()); pShapes->Add_Field("ID" , SG_DATATYPE_Int); pShapes->Add_Field("VALUE" , SG_DATATYPE_Double); srand((unsigned)time(NULL)); for(n=0, y=0; yAdd_Shape(); pShape->Add_Point( pGrid->Get_XMin() + x * Get_Cellsize(), pGrid->Get_YMin() + y * Get_Cellsize() ); pShape->Set_Value(0, ++n); pShape->Set_Value(1, pGrid->asDouble(x, y)); } } } return( true ); } saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_To_Points_Random.h000066400000000000000000000104411224124640700257140ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_To_Points_Random.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_To_Points_Random.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_To_Points_Random_H #define HEADER_INCLUDED__Grid_To_Points_Random_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_To_Points_Random : public CSG_Module_Grid { public: CGrid_To_Points_Random(void); virtual ~CGrid_To_Points_Random(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Vectorization") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_To_Points_Random_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.cpp000066400000000000000000000154311224124640700267030ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Values_AddTo_Points.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_Values_AddTo_Points.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Values_AddTo_Points.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Values_AddTo_Points::CGrid_Values_AddTo_Points(void) { //----------------------------------------------------- Set_Name (_TL("Add Grid Values to Points")); Set_Author (SG_T("O.Conrad (c) 2003")); Set_Description (_TW( "Spatial Join: Retrieves information from the selected grids at the positions " "of the points of the selected points layer and adds it to the resulting layer." )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Points"), _TL(""), PARAMETER_INPUT , SHAPE_TYPE_Point ); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT , false ); Parameters.Add_Shapes( NULL , "RESULT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); Parameters.Add_Choice( NULL , "INTERPOL" , _TL("Interpolation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 4 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Values_AddTo_Points::On_Execute(void) { int iShape, iGrid, iField, Offset, Interpolation; double Value; CSG_Shapes *pShapes; CSG_Parameter_Grid_List *pGrids; //----------------------------------------------------- pShapes = Parameters("RESULT") ->asShapes(); pGrids = Parameters("GRIDS" ) ->asGridList(); Interpolation = Parameters("INTERPOL") ->asInt(); //----------------------------------------------------- if( pGrids->Get_Count() <= 0 ) { return( false ); } //----------------------------------------------------- if( pShapes == NULL ) { pShapes = Parameters("SHAPES")->asShapes(); } else if( pShapes != Parameters("SHAPES")->asShapes() ) { pShapes->Create(*Parameters("SHAPES")->asShapes()); } Offset = pShapes->Get_Field_Count(); //----------------------------------------------------- for(iGrid=0; iGridGet_Count(); iGrid++) { pShapes->Add_Field(pGrids->asGrid(iGrid)->Get_Name(), SG_DATATYPE_Double); } //----------------------------------------------------- for(iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); for(iGrid=0, iField=Offset; iGridGet_Count(); iGrid++, iField++) { CSG_Grid *pGrid = pGrids->asGrid(iGrid); if( pGrid->Get_Value(pShape->Get_Point(0), Value, Interpolation) ) { pShape->Set_Value(iField, Value); } else { pShape->Set_NoData(iField); } } } //----------------------------------------------------- if( pShapes == Parameters("SHAPES")->asShapes() ) { DataObject_Update(pShapes); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Points.h000066400000000000000000000104541224124640700263500ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Values_AddTo_Points.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_Values_AddTo_Points.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Values_AddTo_Points_H #define HEADER_INCLUDED__Grid_Values_AddTo_Points_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Values_AddTo_Points : public CSG_Module { public: CGrid_Values_AddTo_Points(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Grid Values") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Values_AddTo_Points_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.cpp000066400000000000000000000262121224124640700266510ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Values_AddTo_Shapes.cpp 1714 2013-06-04 11:14:00Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_Values_AddTo_Shapes.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Grid_Values_AddTo_Shapes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Values_AddTo_Shapes::CGrid_Values_AddTo_Shapes(void) { //----------------------------------------------------- Set_Name (_TL("Add Grid Values to Shapes")); Set_Author (SG_T("O.Conrad (c) 2003")); Set_Description (_TW( "Spatial Join: Retrieves information from the selected grids at the positions " "of the shapes of the selected shapes layer and adds it to the resulting shapes layer. " "For points this is similar to 'Add Grid Values to Points' module. " "For lines and polygons average values will be calculated from interfering grid cells. " "For polygons the 'Grid Statistics for Polygons' module offers more advanced options. " )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT, false ); Parameters.Add_Shapes( NULL , "RESULT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "INTERPOL" , _TL("Interpolation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 4 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGrid_Values_AddTo_Shapes::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SHAPES")) ) { pParameters->Get_Parameter("INTERPOL")->Set_Enabled(pParameter->asShapes() && ( pParameter->asShapes()->Get_Type() == SHAPE_TYPE_Point || pParameter->asShapes()->Get_Type() == SHAPE_TYPE_Points || pParameter->asShapes()->Get_Type() == SHAPE_TYPE_Line )); } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Values_AddTo_Shapes::On_Execute(void) { CSG_Parameter_Grid_List *pGrids; CSG_Shapes *pShapes; //----------------------------------------------------- pShapes = Parameters("RESULT" )->asShapes(); pGrids = Parameters("GRIDS" )->asGridList(); m_Interpolation = Parameters("INTERPOL")->asInt(); //----------------------------------------------------- if( pGrids->Get_Count() <= 0 ) { return( false ); } //----------------------------------------------------- if( pShapes == NULL ) { pShapes = Parameters("SHAPES")->asShapes(); } else if( pShapes != Parameters("SHAPES")->asShapes() ) { pShapes->Create(*Parameters("SHAPES")->asShapes()); } //----------------------------------------------------- for(int iGrid=0; iGridGet_Count(); iGrid++) { CSG_Grid *pGrid = pGrids->asGrid(iGrid); int Field = pShapes->Get_Field_Count(); pShapes->Add_Field(pGrid->Get_Name(), SG_DATATYPE_Double); for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Simple_Statistics Statistics; CSG_Shape *pShape = pShapes->Get_Shape(iShape); if( pShape->Get_Extent().Intersects(pGrid->Get_Extent()) ) { switch( pShapes->Get_Type() ) { case SHAPE_TYPE_Point: default: case SHAPE_TYPE_Points: Get_Data_Point (Statistics, pShape, pGrid); break; case SHAPE_TYPE_Line: Get_Data_Line (Statistics, pShape, pGrid); break; case SHAPE_TYPE_Polygon: Get_Data_Polygon(Statistics, pShape, pGrid); break; } } if( Statistics.Get_Count() > 0 ) { pShape->Set_Value(Field, Statistics.Get_Mean()); } else { pShape->Set_NoData(Field); } } } //----------------------------------------------------- if( pShapes == Parameters("SHAPES")->asShapes() ) { DataObject_Update(pShapes); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_Values_AddTo_Shapes::Get_Data_Point(CSG_Simple_Statistics &Statistics, CSG_Shape *pShape, CSG_Grid *pGrid) { for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { double Value; if( pGrid->Get_Value(pShape->Get_Point(iPoint, iPart), Value, m_Interpolation) ) { Statistics += Value; } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_Values_AddTo_Shapes::Get_Data_Line(CSG_Simple_Statistics &Statistics, CSG_Shape *pShape, CSG_Grid *pGrid) { double dStep = pGrid->Get_Cellsize(); for(int iPart=0; iPartGet_Part_Count(); iPart++) { if( pShape->Get_Point_Count(iPart) > 0 ) { double Value; TSG_Point B, A = pShape->Get_Point(0, iPart); if( pGrid->Get_Value(A, Value, m_Interpolation) ) { Statistics += Value; } for(int iPoint=1; iPointGet_Point_Count(iPart); iPoint++) { B = A; A = pShape->Get_Point(iPoint, iPart); //----------------------------------------- double Distance = SG_Get_Distance(A, B); if( Distance > 0.0 ) { double dx = (B.x - A.x) * dStep / Distance; double dy = (B.y - A.y) * dStep / Distance; TSG_Point C = A; for(double d=0.0; dGet_Value(C, Value, m_Interpolation) ) { Statistics += Value; } } } } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_Values_AddTo_Shapes::Get_Data_Polygon(CSG_Simple_Statistics &Statistics, CSG_Shape *pShape, CSG_Grid *pGrid) { int xMin = pGrid->Get_System().Get_xWorld_to_Grid(pShape->Get_Extent().Get_XMin()); int xMax = pGrid->Get_System().Get_xWorld_to_Grid(pShape->Get_Extent().Get_XMax()); int yMin = pGrid->Get_System().Get_yWorld_to_Grid(pShape->Get_Extent().Get_YMin()); int yMax = pGrid->Get_System().Get_yWorld_to_Grid(pShape->Get_Extent().Get_YMax()); if( xMin < 0 ) xMin = 0; else if( xMin >= pGrid->Get_NX() ) xMin = pGrid->Get_NX() - 1; if( xMax < 0 ) xMax = 0; else if( xMax >= pGrid->Get_NX() ) xMax = pGrid->Get_NX() - 1; if( yMin < 0 ) yMin = 0; else if( yMin >= pGrid->Get_NY() ) yMin = pGrid->Get_NY() - 1; if( yMax < 0 ) yMax = 0; else if( yMax >= pGrid->Get_NY() ) yMax = pGrid->Get_NY() - 1; //----------------------------------------------------- for(int y=yMin; y<=yMax; y++) { double p_y = pGrid->Get_System().Get_yGrid_to_World(y); for(int x=xMin; x<=xMax; x++) { double p_x = pGrid->Get_System().Get_xGrid_to_World(x); if( !pGrid->is_NoData(x, y) && ((CSG_Shape_Polygon *)pShape)->Contains(p_x, p_y) ) { Statistics += pGrid->asDouble(x, y); } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Grid_Values_AddTo_Shapes.h000066400000000000000000000113511224124640700263140ustar00rootroot00000000000000/********************************************************** * Version $Id: Grid_Values_AddTo_Shapes.h 1714 2013-06-04 11:14:00Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // Grid_Values_AddTo_Shapes.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Values_AddTo_Shapes_H #define HEADER_INCLUDED__Grid_Values_AddTo_Shapes_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Values_AddTo_Shapes : public CSG_Module { public: CGrid_Values_AddTo_Shapes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Grid Values") ); } protected: virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: int m_Interpolation; void Get_Data_Point (CSG_Simple_Statistics &Statistics, CSG_Shape *pShape, CSG_Grid *pGrid); void Get_Data_Line (CSG_Simple_Statistics &Statistics, CSG_Shape *pShape, CSG_Grid *pGrid); void Get_Data_Polygon (CSG_Simple_Statistics &Statistics, CSG_Shape *pShape, CSG_Grid *pGrid); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Values_AddTo_Shapes_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/MLB_Interface.cpp000066400000000000000000000131401224124640700244550ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1758 2013-06-27 13:35:47Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Shapes - Grid") ); case MLB_INFO_Author: return( SG_T("O. Conrad, V.Wichmann (c) 2002-13") ); case MLB_INFO_Description: return( _TL("Tools related to gridded and vector data (conversions, combinations, etc.).") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Shapes|Grid") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Grid_Values_AddTo_Points.h" #include "Grid_Values_AddTo_Shapes.h" #include "Grid_Statistics_AddTo_Polygon.h" #include "Grid_To_Points.h" #include "Grid_To_Points_Random.h" #include "Grid_To_Contour.h" #include "Grid_Classes_To_Shapes.h" #include "Grid_Polygon_Clip.h" #include "Grid_To_Gradient.h" #include "grid_local_extremes_to_points.h" #include "grid_extent.h" #include "grid_rectangle_clip.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CGrid_Values_AddTo_Points ); case 1: return( new CGrid_Values_AddTo_Shapes ); case 2: return( new CGrid_Statistics_AddTo_Polygon ); case 3: return( new CGrid_To_Points ); case 4: return( new CGrid_To_Points_Random ); case 5: return( new CGrid_To_Contour ); case 6: return( new CGrid_Classes_To_Shapes ); case 7: return( new CGrid_Polygon_Clip ); case 9: return( new CGrid_Local_Extremes_to_Points ); case 10: return( new CGrid_Extent ); case 11: return( new CGrid_Rectangle_Clip ); case 15: return( new CGrid_To_Gradient(0) ); case 16: return( new CGrid_To_Gradient(1) ); case 17: return( new CGrid_To_Gradient(2) ); case 20: return( NULL ); } return( MLB_INTERFACE_SKIP_MODULE ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/MLB_Interface.h000066400000000000000000000077151224124640700241350ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__shapes_grid_H #define HEADER_INCLUDED__shapes_grid_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef shapes_grid_EXPORTS #define shapes_grid_EXPORT _SAGA_DLL_EXPORT #else #define shapes_grid_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__shapes_grid_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Makefile.am000066400000000000000000000022561224124640700234210ustar00rootroot00000000000000# # $Id: Makefile.am 1758 2013-06-27 13:35:47Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libshapes_grid.la libshapes_grid_la_SOURCES =\ Grid_Classes_To_Shapes.cpp\ grid_extent.cpp\ grid_local_extremes_to_points.cpp\ Grid_Polygon_Clip.cpp\ grid_rectangle_clip.cpp\ Grid_Statistics_AddTo_Polygon.cpp\ Grid_To_Contour.cpp\ Grid_To_Gradient.cpp\ Grid_To_Points.cpp\ Grid_To_Points_Random.cpp\ Grid_Values_AddTo_Points.cpp\ Grid_Values_AddTo_Shapes.cpp\ MLB_Interface.cpp\ Grid_Classes_To_Shapes.h\ grid_extent.h\ grid_local_extremes_to_points.h\ Grid_Polygon_Clip.h\ grid_rectangle_clip.h\ Grid_Statistics_AddTo_Polygon.h\ Grid_To_Contour.h\ Grid_To_Gradient.h\ Grid_To_Points.h\ Grid_To_Points_Random.h\ Grid_Values_AddTo_Points.h\ Grid_Values_AddTo_Shapes.h\ MLB_Interface.h libshapes_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS) saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/Makefile.in000066400000000000000000000476151224124640700234420ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/shapes/shapes_grid DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libshapes_grid_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libshapes_grid_la_OBJECTS = Grid_Classes_To_Shapes.lo \ grid_extent.lo grid_local_extremes_to_points.lo \ Grid_Polygon_Clip.lo grid_rectangle_clip.lo \ Grid_Statistics_AddTo_Polygon.lo Grid_To_Contour.lo \ Grid_To_Gradient.lo Grid_To_Points.lo Grid_To_Points_Random.lo \ Grid_Values_AddTo_Points.lo Grid_Values_AddTo_Shapes.lo \ MLB_Interface.lo libshapes_grid_la_OBJECTS = $(am_libshapes_grid_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libshapes_grid_la_SOURCES) DIST_SOURCES = $(libshapes_grid_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1758 2013-06-27 13:35:47Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libshapes_grid.la libshapes_grid_la_SOURCES = \ Grid_Classes_To_Shapes.cpp\ grid_extent.cpp\ grid_local_extremes_to_points.cpp\ Grid_Polygon_Clip.cpp\ grid_rectangle_clip.cpp\ Grid_Statistics_AddTo_Polygon.cpp\ Grid_To_Contour.cpp\ Grid_To_Gradient.cpp\ Grid_To_Points.cpp\ Grid_To_Points_Random.cpp\ Grid_Values_AddTo_Points.cpp\ Grid_Values_AddTo_Shapes.cpp\ MLB_Interface.cpp\ Grid_Classes_To_Shapes.h\ grid_extent.h\ grid_local_extremes_to_points.h\ Grid_Polygon_Clip.h\ grid_rectangle_clip.h\ Grid_Statistics_AddTo_Polygon.h\ Grid_To_Contour.h\ Grid_To_Gradient.h\ Grid_To_Points.h\ Grid_To_Points_Random.h\ Grid_Values_AddTo_Points.h\ Grid_Values_AddTo_Shapes.h\ MLB_Interface.h libshapes_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/shapes/shapes_grid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/shapes/shapes_grid/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libshapes_grid.la: $(libshapes_grid_la_OBJECTS) $(libshapes_grid_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libshapes_grid_la_OBJECTS) $(libshapes_grid_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Classes_To_Shapes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Polygon_Clip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Statistics_AddTo_Polygon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_To_Contour.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_To_Gradient.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_To_Points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_To_Points_Random.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Values_AddTo_Points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid_Values_AddTo_Shapes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_extent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_local_extremes_to_points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_rectangle_clip.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/grid_extent.cpp000066400000000000000000000134461224124640700244100ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_extent.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // grid_extent.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_extent.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Extent::CGrid_Extent(void) { //----------------------------------------------------- Set_Name (_TL("Grid System Extent")); Set_Author (_TL("O. Conrad (c) 2011")); Set_Description (_TW( "Creates a polygon (rectangle) from a grid system's extent." )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Extent"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Choice( NULL , "CELLS" , _TL("Border"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("grid cells"), _TL("grid nodes") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Extent::On_Execute(void) { bool bCells; CSG_Grid_System *pSystem; CSG_Shapes *pShapes; //----------------------------------------------------- pSystem = Get_System(); pShapes = Parameters("SHAPES") ->asShapes(); bCells = Parameters("CELLS") ->asInt() == 0; //----------------------------------------------------- if( pSystem == NULL || !pSystem->is_Valid() ) { Error_Set(_TL("invalid grid system")); return( false ); } //----------------------------------------------------- pShapes->Create(SHAPE_TYPE_Polygon, _TL("Grid System Extent")); pShapes->Add_Field(_TL("NX") , SG_DATATYPE_Int); pShapes->Add_Field(_TL("NY") , SG_DATATYPE_Int); pShapes->Add_Field(_TL("CELLSIZE") , SG_DATATYPE_Double); CSG_Shape *pExtent = pShapes->Add_Shape(); pExtent->Set_Value(0, pSystem->Get_NX()); pExtent->Set_Value(1, pSystem->Get_NY()); pExtent->Set_Value(2, pSystem->Get_Cellsize()); pExtent->Add_Point(pSystem->Get_XMin(bCells), pSystem->Get_YMin(bCells)); pExtent->Add_Point(pSystem->Get_XMin(bCells), pSystem->Get_YMax(bCells)); pExtent->Add_Point(pSystem->Get_XMax(bCells), pSystem->Get_YMax(bCells)); pExtent->Add_Point(pSystem->Get_XMax(bCells), pSystem->Get_YMin(bCells)); pExtent->Add_Point(pSystem->Get_XMin(bCells), pSystem->Get_YMin(bCells)); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/grid_extent.h000066400000000000000000000104031224124640700240430ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_extent.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // grid_extent.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_extent_H #define HEADER_INCLUDED__grid_extent_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Extent : public CSG_Module_Grid { public: CGrid_Extent(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Spatial Extent") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_extent_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/grid_local_extremes_to_points.cpp000066400000000000000000000147171224124640700302070ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_local_extremes_to_points.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // grid_local_extremes_to_points.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_local_extremes_to_points.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Local_Extremes_to_Points::CGrid_Local_Extremes_to_Points(void) { Set_Name (_TL("Local Minima and Maxima")); Set_Author (SG_T("(c) 2009 by O.Conrad")); Set_Description (_TW( "Extracts local grid value minima and maxima of to vector points." )); Parameters.Add_Grid( NULL, "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL, "MINIMA" , _TL("Minima"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL, "MAXIMA" , _TL("Maxima"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Local_Extremes_to_Points::On_Execute(void) { bool bMinimum, bMaximum; int x, y, i, ix, iy; double z, iz; CSG_Grid *pGrid; TSG_Point p; CSG_Shape *pPoint; CSG_Shapes *pMinima, *pMaxima; pGrid = Parameters("GRID") ->asGrid(); pMinima = Parameters("MINIMA") ->asShapes(); pMaxima = Parameters("MAXIMA") ->asShapes(); pMinima->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), pGrid->Get_Name(), _TL("Local Minima"))); pMinima->Add_Field(SG_T("GRID_X") , SG_DATATYPE_Int); pMinima->Add_Field(SG_T("GRID_Y") , SG_DATATYPE_Int); pMinima->Add_Field(SG_T("X") , SG_DATATYPE_Double); pMinima->Add_Field(SG_T("Y") , SG_DATATYPE_Double); pMinima->Add_Field(SG_T("Z") , SG_DATATYPE_Double); pMaxima->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), pGrid->Get_Name(), _TL("Local Maxima"))); pMaxima->Add_Field(SG_T("GRID_X") , SG_DATATYPE_Int); pMaxima->Add_Field(SG_T("GRID_Y") , SG_DATATYPE_Int); pMaxima->Add_Field(SG_T("X") , SG_DATATYPE_Double); pMaxima->Add_Field(SG_T("Y") , SG_DATATYPE_Double); pMaxima->Add_Field(SG_T("Z") , SG_DATATYPE_Double); for(y=0; yasDouble(x, y); for(i=0, bMinimum=true, bMaximum=true; i<8 && (bMinimum || bMaximum); i++) { if( !Get_System()->Get_Neighbor_Pos(i, x, y, ix, iy) || pGrid->is_NoData(ix, iy) ) { bMinimum = bMaximum = false; } else { iz = pGrid->asDouble(ix, iy); if( iz <= z ) { bMinimum = false; } else if( iz >= z ) { bMaximum = false; } } } pPoint = bMinimum ? pMinima->Add_Shape() : (bMaximum ? pMaxima->Add_Shape() : NULL); if( pPoint ) { p = Get_System()->Get_Grid_to_World(x, y); pPoint->Set_Point(p, 0); pPoint->Set_Value(0, x); pPoint->Set_Value(1, y); pPoint->Set_Value(2, p.x); pPoint->Set_Value(3, p.y); pPoint->Set_Value(4, z); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/grid_local_extremes_to_points.h000066400000000000000000000102551224124640700276450ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_local_extremes_to_points.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // grid_local_extremes_to_points.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_local_extremes_to_points_H #define HEADER_INCLUDED__grid_local_extremes_to_points_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Local_Extremes_to_Points : public CSG_Module_Grid { public: CGrid_Local_Extremes_to_Points(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Grid Values") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_local_extremes_to_points_H saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/grid_rectangle_clip.cpp000066400000000000000000000160741224124640700260540ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_rectangle_clip.cpp 1758 2013-06-27 13:35:47Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // grid_rectangle_clip.cpp // // // // Copyright (C) 2013 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_rectangle_clip.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Rectangle_Clip::CGrid_Rectangle_Clip(void) { //----------------------------------------------------- Set_Name (_TL("Clip Grid with Rectangle")); Set_Author (_TL("V. Wichmann (c) 2013")); Set_Description (_TW( "Clips the input grid with the (rectangular) extent of a shapefile. " "The clipped grid will have the extent of the shapefile.\n" "Select shapes from the shapefile prior to module execution " "in case you like to use only a subset from the shapefile " "for clipping.\n\n" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "INPUT" , _TL("Input"), _TL("The grid to clip."), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Extent"), _TL("The shapefile to use for clipping."), PARAMETER_INPUT ); Parameters.Add_Choice( NULL , "CELLS" , _TL("Border"), _TL("Set grid extent to grid cells (pixel as area) or to grid nodes (pixel as point)."), CSG_String::Format(SG_T("%s|%s|"), _TL("grid cells"), _TL("grid nodes") ), 0 ); Parameters.Add_Grid_Output( NULL , "OUTPUT" , _TL("Output"), _TL("The clipped grid.") ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Rectangle_Clip::On_Execute(void) { CSG_Grid *pGrid_in, *pGrid_out; CSG_Shapes *pShapes; bool bCells; //----------------------------------------------------- pGrid_in = Parameters("INPUT") ->asGrid(); pShapes = Parameters("SHAPES") ->asShapes(); bCells = Parameters("CELLS") ->asInt() == 0; //----------------------------------------------------- CSG_Rect Extent; if( pShapes->Get_Selection_Count() > 0 ) { bool bFirst = true; for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { if( pShapes->Get_Shape(iShape)->is_Selected() ) { if( bFirst ) { Extent = pShapes->Get_Shape(iShape)->Get_Extent(); bFirst = false; } else { Extent.Union(pShapes->Get_Shape(iShape)->Get_Extent()); } } } } else Extent = pShapes->Get_Extent(); //----------------------------------------------------- if( bCells ) Extent.Deflate(0.5 * pGrid_in->Get_Cellsize(), 0.5 * pGrid_in->Get_Cellsize(), false); CSG_Grid_System GridSystem(pGrid_in->Get_Cellsize(), Extent); pGrid_out = SG_Create_Grid(GridSystem, pGrid_in->Get_Type()); pGrid_out->Set_NoData_Value(pGrid_in->Get_NoData_Value()); pGrid_out->Set_Name(CSG_String::Format(SG_T("%s_clip"), pGrid_in->Get_Name())); pGrid_out->Assign_NoData(); //----------------------------------------------------- for(int y=0; yGet_NY() && Set_Progress(y, pGrid_out->Get_NY()); y++) { #pragma omp parallel for for(int x=0; xGet_NX(); x++) { double xWorld = GridSystem.Get_xGrid_to_World(x); double yWorld = GridSystem.Get_yGrid_to_World(y); int xGrid, yGrid; pGrid_in->Get_System().Get_World_to_Grid(xGrid, yGrid, xWorld, yWorld); if (pGrid_in->is_InGrid(xGrid, yGrid)) pGrid_out->Set_Value(x, y, pGrid_in->asDouble(xGrid, yGrid)); } } //----------------------------------------------------- Parameters("OUTPUT")->Set_Value(pGrid_out); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_grid/grid_rectangle_clip.h000066400000000000000000000105531224124640700255150ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_rectangle_clip.h 1758 2013-06-27 13:35:47Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_Shapes // // // //-------------------------------------------------------// // // // grid_rectangle_clip.h // // // // Copyright (C) 2013 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_rectangle_clip_H #define HEADER_INCLUDED__grid_rectangle_clip_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Rectangle_Clip : public CSG_Module { public: CGrid_Rectangle_Clip(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Spatial Extent") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_rectangle_clip_H saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/000077500000000000000000000000001224124640700215455ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/Lines_From_Points.cpp000066400000000000000000000146541224124640700256540ustar00rootroot00000000000000/********************************************************** * Version $Id: Lines_From_Points.cpp 1512 2012-11-05 16:58:58Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // Lines_From_Points.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Lines_From_Points.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CLines_From_Points::CLines_From_Points(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Convert Points to Line(s)")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "Converts points to line(s)." )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "LINES" , _TL("Lines"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "ORDER" , _TL("Order by..."), _TL(""), true ); Parameters.Add_Table_Field( pNode , "SEPARATE" , _TL("Separate by..."), _TL(""), true ); Parameters.Add_Table_Field( pNode , "ELEVATION" , _TL("Elevation"), _TL(""), true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLines_From_Points::On_Execute(void) { int Order, Separate, Elevation; CSG_String s; CSG_Shape *pLine , *pPoint; CSG_Shapes *pLines, *pPoints; pPoints = Parameters("POINTS" )->asShapes(); pLines = Parameters("LINES" )->asShapes(); Order = Parameters("ORDER" )->asInt(); Separate = Parameters("SEPARATE" )->asInt(); Elevation = Parameters("ELEVATION")->asInt(); //------------------------------------------------- if( pPoints->Get_Count() < 1 ) { return( false ); } //------------------------------------------------- pLines->Create(SHAPE_TYPE_Line, pPoints->Get_Name(), NULL, Elevation >= 0 ? SG_VERTEX_TYPE_XYZ : SG_VERTEX_TYPE_XY); pLines->Add_Field(SG_T("ID"), SG_DATATYPE_Int); if( Separate >= 0 ) { pLines->Add_Field(pPoints->Get_Field_Name(Separate), pPoints->Get_Field_Type(Separate)); pPoints->Set_Index(Separate, TABLE_INDEX_Ascending, Order, TABLE_INDEX_Ascending); } else { pPoints->Set_Index(Order, TABLE_INDEX_Ascending); } //------------------------------------------------- for(int iPoint=0; iPointGet_Count(); iPoint++) { pPoint = pPoints->Get_Shape_byIndex(iPoint); if( pLines->Get_Count() == 0 || (Separate >= 0 && s.Cmp(pPoint->asString(Separate))) ) { pLine = pLines->Add_Shape(); pLine->Set_Value(0, pLines->Get_Count()); if( Separate >= 0 ) { pLine->Set_Value(1, s = pPoint->asString(Separate)); } } pLine->Add_Point(pPoint->Get_Point(0)); if( Elevation >= 0 ) { pLine->Set_Z(pPoint->asDouble(Elevation), iPoint); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/Lines_From_Points.h000066400000000000000000000107111224124640700253070ustar00rootroot00000000000000/********************************************************** * Version $Id: Lines_From_Points.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // Lines_From_Points.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Lines_From_Points_H #define HEADER_INCLUDED__Lines_From_Points_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CLines_From_Points : public CSG_Module { public: CLines_From_Points(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Conversion") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Lines_From_Points_H saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/Lines_From_Polygons.cpp000066400000000000000000000130661224124640700262060ustar00rootroot00000000000000/********************************************************** * Version $Id: Lines_From_Polygons.cpp 915 2011-02-15 08:43:36Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // Lines_From_Polygons.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Lines_From_Polygons.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CLines_From_Polygons::CLines_From_Polygons(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Convert Polygons to Lines")); Set_Author (SG_T("O.Conrad (c) 2005")); Set_Description (_TW( "Convert polygons to lines." )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "LINES" , _TL("Lines"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); pNode = Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLines_From_Polygons::On_Execute(void) { CSG_Shapes *pLines, *pPolygons; pPolygons = Parameters("POLYGONS") ->asShapes(); pLines = Parameters("LINES") ->asShapes(); //----------------------------------------------------- if( pPolygons->Get_Count() <= 0 ) { Error_Set(_TL("no polygons in input")); return( false ); } //----------------------------------------------------- pLines->Create(SHAPE_TYPE_Line, pPolygons->Get_Name(), pPolygons); for(int iPolygon=0; iPolygonGet_Count(); iPolygon++) { CSG_Shape *pPolygon = pPolygons ->Get_Shape(iPolygon); CSG_Shape *pLine = pLines ->Add_Shape(pPolygon, SHAPE_COPY_ATTR); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { pLine->Add_Point(pPolygon->Get_Point(iPoint, iPart), iPart); } pLine->Add_Point(pPolygon->Get_Point(0, iPart), iPart); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/Lines_From_Polygons.h000066400000000000000000000107251224124640700256520ustar00rootroot00000000000000/********************************************************** * Version $Id: Lines_From_Polygons.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // Lines_From_Polygons.h // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Lines_From_Polygons_H #define HEADER_INCLUDED__Lines_From_Polygons_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CLines_From_Polygons : public CSG_Module { public: CLines_From_Polygons(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Conversion") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Lines_From_Polygons_H saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/MLB_Interface.cpp000066400000000000000000000116061224124640700246470ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Shapes - Lines") ); case MLB_INFO_Author: return( SG_T("O. Conrad (c) 2005") ); case MLB_INFO_Description: return( _TL("Tools for lines.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Shapes|Lines") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Lines_From_Polygons.h" #include "Lines_From_Points.h" #include "line_properties.h" #include "line_polygon_intersection.h" #include "line_simplification.h" #include "line_dissolve.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CLines_From_Polygons ); case 1: return( new CLines_From_Points ); case 2: return( new CLine_Properties ); case 3: return( new CLine_Polygon_Intersection ); case 4: return( new CLine_Simplification ); case 5: return( new CLine_Dissolve ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/MLB_Interface.h000066400000000000000000000077231224124640700243210ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__shapes_lines_H #define HEADER_INCLUDED__shapes_lines_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef shapes_lines_EXPORTS #define shapes_lines_EXPORT _SAGA_DLL_EXPORT #else #define shapes_lines_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__shapes_lines_H saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/Makefile.am000066400000000000000000000015361224124640700236060ustar00rootroot00000000000000# # $Id: Makefile.am 911 2011-02-14 16:38:15Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libshapes_lines.la libshapes_lines_la_SOURCES =\ line_dissolve.cpp\ Lines_From_Points.cpp\ Lines_From_Polygons.cpp\ line_polygon_intersection.cpp\ line_properties.cpp\ line_simplification.cpp\ MLB_Interface.cpp\ line_dissolve.h\ Lines_From_Points.h\ Lines_From_Polygons.h\ line_polygon_intersection.h\ line_properties.h\ line_simplification.h\ MLB_Interface.h libshapes_lines_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/Makefile.in000066400000000000000000000456271224124640700236300ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/shapes/shapes_lines DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libshapes_lines_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libshapes_lines_la_OBJECTS = line_dissolve.lo Lines_From_Points.lo \ Lines_From_Polygons.lo line_polygon_intersection.lo \ line_properties.lo line_simplification.lo MLB_Interface.lo libshapes_lines_la_OBJECTS = $(am_libshapes_lines_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libshapes_lines_la_SOURCES) DIST_SOURCES = $(libshapes_lines_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 911 2011-02-14 16:38:15Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libshapes_lines.la libshapes_lines_la_SOURCES = \ line_dissolve.cpp\ Lines_From_Points.cpp\ Lines_From_Polygons.cpp\ line_polygon_intersection.cpp\ line_properties.cpp\ line_simplification.cpp\ MLB_Interface.cpp\ line_dissolve.h\ Lines_From_Points.h\ Lines_From_Polygons.h\ line_polygon_intersection.h\ line_properties.h\ line_simplification.h\ MLB_Interface.h libshapes_lines_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/shapes/shapes_lines/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/shapes/shapes_lines/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libshapes_lines.la: $(libshapes_lines_la_OBJECTS) $(libshapes_lines_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libshapes_lines_la_OBJECTS) $(libshapes_lines_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Lines_From_Points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Lines_From_Polygons.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_dissolve.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_polygon_intersection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_properties.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_simplification.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/line_dissolve.cpp000066400000000000000000000222011224124640700251050ustar00rootroot00000000000000/********************************************************** * Version $Id: line_dissolve.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // line_dissolve.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "line_dissolve.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CLine_Dissolve::CLine_Dissolve(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Line Dissolve")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Dissolves line shapes, which share the same attribute value(s)." )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "LINES" , _TL("Lines"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Line ); Parameters.Add_Table_Field( pNode , "FIELD_1" , _TL("1. Attribute"), _TL(""), false ); Parameters.Add_Table_Field( pNode , "FIELD_2" , _TL("2. Attribute"), _TL(""), true ); Parameters.Add_Table_Field( pNode , "FIELD_3" , _TL("3. Attribute"), _TL(""), true ); Parameters.Add_Shapes( NULL , "DISSOLVED" , _TL("Dissolved Lines"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); Parameters.Add_Choice( NULL , "ALL" , _TL("Dissolve..."), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("lines with same attribute value(s)"), _TL("all lines") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CLine_Dissolve::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("LINES")) && pParameters->Get_Parameter("LINES")->asShapes() != NULL ) { int nFields = pParameters->Get_Parameter("LINES")->asShapes()->Get_Field_Count(); pParameters->Get_Parameter("FIELD_2")->Set_Value(nFields); pParameters->Get_Parameter("FIELD_3")->Set_Value(nFields); } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLine_Dissolve::On_Execute(void) { bool bAll; int Field_1, Field_2, Field_3, iLine; CSG_String Value; CSG_Shape *pLine , *pUnion; CSG_Shapes *pLines, *pUnions; //----------------------------------------------------- pLines = Parameters("LINES") ->asShapes(); pUnions = Parameters("DISSOLVED") ->asShapes(); Field_1 = Parameters("FIELD_1") ->asInt(); Field_2 = Parameters("FIELD_2") ->asInt(); Field_3 = Parameters("FIELD_3") ->asInt(); bAll = Parameters("ALL") ->asInt() == 1; //----------------------------------------------------- if( pLines->is_Valid() ) { pUnions->Create(SHAPE_TYPE_Line); //------------------------------------------------- if( bAll || Field_1 >= pLines->Get_Field_Count() ) { pUnions->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pLines->Get_Name(), _TL("Dissolved"))); pUnions->Add_Field(_TL("ID"), SG_DATATYPE_Int); pUnion = pUnions->Add_Shape(); for(iLine=0; iLineGet_Count() && Set_Progress(iLine, pLines->Get_Count()); iLine++) { Add_Line(pUnion, pLines->Get_Shape(iLine)); } } //------------------------------------------------- else { Value = pLines->Get_Field_Name(Field_1); pUnions ->Add_Field(pLines->Get_Field_Name(Field_1), pLines->Get_Field_Type(Field_1)); if( Field_2 >= 0 ) { Value += CSG_String::Format(SG_T(", %s"), pLines->Get_Field_Name(Field_2)); pUnions ->Add_Field(pLines->Get_Field_Name(Field_2), pLines->Get_Field_Type(Field_2)); } if( Field_3 >= 0 ) { Value += CSG_String::Format(SG_T(", %s"), pLines->Get_Field_Name(Field_3)); pUnions ->Add_Field(pLines->Get_Field_Name(Field_3), pLines->Get_Field_Type(Field_3)); } pLines->Set_Index(Field_1, TABLE_INDEX_Ascending, Field_2, TABLE_INDEX_Ascending, Field_3, TABLE_INDEX_Ascending); pUnions->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pLines->Get_Name(), _TL("Dissolved"), Value.c_str())); for(iLine=0; iLineGet_Count() && Set_Progress(iLine, pLines->Get_Count()); iLine++) { pLine = pLines->Get_Shape(pLines->Get_Record_byIndex(iLine)->Get_Index()); CSG_String s(pLine->asString(Field_1)); if( Field_2 >= 0 ) s += pLine->asString(Field_2); if( Field_3 >= 0 ) s += pLine->asString(Field_3); if( iLine == 0 || Value.Cmp(s) ) { Value = s; pUnion = pUnions->Add_Shape(pLine, SHAPE_COPY_GEOM); pUnion->Set_Value(0, pLine->asString(Field_1)); if( Field_2 >= 0 ) pUnion->Set_Value(1, pLine->asString(Field_2)); if( Field_3 >= 0 ) pUnion->Set_Value(2, pLine->asString(Field_3)); } else { Add_Line(pUnion, pLine); } } } //------------------------------------------------- return( pUnions->is_Valid() ); } //----------------------------------------------------- return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLine_Dissolve::Add_Line(CSG_Shape *pLine, CSG_Shape *pAdd) { if( pLine && pAdd ) { int nParts = pLine->Get_Part_Count(); for(int iPart=0; iPartGet_Part_Count(); iPart++) { if( pAdd->Get_Point_Count(iPart) > 1 ) { int jPart = pLine->Get_Part_Count(); for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { pLine->Add_Point(pAdd->Get_Point(iPoint, iPart), jPart); } } } return( nParts < pLine->Get_Part_Count() ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/line_dissolve.h000066400000000000000000000106011224124640700245530ustar00rootroot00000000000000/********************************************************** * Version $Id: line_dissolve.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // line_dissolve.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__line_dissolve_H #define HEADER_INCLUDED__line_dissolve_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CLine_Dissolve : public CSG_Module { public: CLine_Dissolve(void); protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: bool Add_Line (CSG_Shape *pLine, CSG_Shape *pAdd); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__line_dissolve_H saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/line_polygon_intersection.cpp000066400000000000000000000215341224124640700275420ustar00rootroot00000000000000/********************************************************** * Version $Id: line_polygon_intersection.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // line_polygon_intersection.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "line_polygon_intersection.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CLine_Polygon_Intersection::CLine_Polygon_Intersection(void) { //----------------------------------------------------- Set_Name (_TL("Line-Polygon Intersection")); Set_Author (SG_T("O. Conrad (c) 2010")); Set_Description (_TW( "Line-polygon intersection." )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "LINES" , _TL("Lines"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Line ); Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "INTERSECT" , _TL("Intersection"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Output"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("one multi-line per polygon"), _TL("keep original line attributes") ), 1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLine_Polygon_Intersection::On_Execute(void) { int Method; CSG_Shapes *pLines, *pPolygons, *pNew_Lines, New_Lines; pLines = Parameters("LINES") ->asShapes(); pPolygons = Parameters("POLYGONS") ->asShapes(); pNew_Lines = Parameters("INTERSECT") ->asShapes(); Method = Parameters("METHOD") ->asInt(); if( !pLines ->is_Valid() || pLines ->Get_Count() < 1 || !pPolygons->is_Valid() || pPolygons->Get_Count() < 1 || pLines->Get_Extent().Intersects(pPolygons->Get_Extent()) == INTERSECTION_None ) { Error_Set(_TL("no shapes for intersection found")); return( false ); } //-------------------------------------------------------- switch( Method ) { case 0: pNew_Lines->Create(SHAPE_TYPE_Line, CSG_String::Format(SG_T("%s [%s: %s]"), pLines->Get_Name(), _TL("Intersection"), pPolygons->Get_Name()), pPolygons ); break; case 1: default: pNew_Lines->Create(SHAPE_TYPE_Line, CSG_String::Format(SG_T("%s [%s: %s]"), pLines->Get_Name(), _TL("Intersection"), pPolygons->Get_Name()), pLines ); break; } New_Lines.Create(SHAPE_TYPE_Line, NULL, pLines); //-------------------------------------------------------- for(int iPolygon=0; iPolygonGet_Count() && Set_Progress(iPolygon, pPolygons->Get_Count()); iPolygon++) { if( Get_Intersection((CSG_Shape_Polygon *)pPolygons->Get_Shape(iPolygon), pLines, New_Lines) ) { switch( Method ) { case 0: { CSG_Shape *pNew_Line = pNew_Lines->Add_Shape(pPolygons->Get_Shape(iPolygon), SHAPE_COPY_ATTR); for(int iLine=0, jPart=0; iLineGet_Part_Count(); iPart++, jPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { pNew_Line->Add_Point(pLine->Get_Point(iPoint), jPart); } } } } break; case 1: { for(int iLine=0; iLineAdd_Shape(New_Lines.Get_Shape(iLine)); } } break; } } } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLine_Polygon_Intersection::Get_Intersection(CSG_Shape_Polygon *pPolygon, CSG_Shapes *pLines, CSG_Shapes &New_Lines) { if( !pLines->Select(pPolygon->Get_Extent()) ) { return( false ); } New_Lines.Del_Records(); for(int iSelection=0; iSelectionGet_Selection_Count(); iSelection++) { CSG_Shape *pNew_Line, *pLine = pLines->Get_Selection(iSelection); for(int iPart=0; iPartGet_Part_Count(); iPart++) { TSG_Point B, A = pLine->Get_Point(0, iPart); if( pPolygon->Contains(A) ) { pNew_Line = New_Lines.Add_Shape(pLine, SHAPE_COPY_ATTR); pNew_Line ->Add_Point(A); } else { pNew_Line = NULL; } for(int iPoint=1; iPointGet_Point_Count(iPart); iPoint++) { B = A; A = pLine->Get_Point(iPoint, iPart); if( pNew_Line ) { if( pPolygon->Contains(A) ) { pNew_Line ->Add_Point(A); } else { pNew_Line ->Add_Point(Get_Intersection(pPolygon, A, B)); pNew_Line = NULL; } } else if( pPolygon->Contains(A) ) { pNew_Line = New_Lines.Add_Shape(pLine, SHAPE_COPY_ATTR); pNew_Line ->Add_Point(Get_Intersection(pPolygon, A, B)); pNew_Line ->Add_Point(A); } } } } return( New_Lines.Get_Count() > 0 ); } //--------------------------------------------------------- TSG_Point CLine_Polygon_Intersection::Get_Intersection(CSG_Shape_Polygon *pPolygon, const TSG_Point &a, const TSG_Point &b) { TSG_Point c = a; for(int iPart=0; iPartGet_Part_Count(); iPart++) { TSG_Point A, B; B = pPolygon->Get_Point(pPolygon->Get_Point_Count(iPart) - 1, iPart); for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { A = B; B = pPolygon->Get_Point(iPoint, iPart); if( SG_Get_Crossing(c, A, B, a, b) ) { return( c ); } } } return( c ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/line_polygon_intersection.h000066400000000000000000000107711224124640700272100ustar00rootroot00000000000000/********************************************************** * Version $Id: line_polygon_intersection.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // line_polygon_intersection.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__line_polygon_intersection_H #define HEADER_INCLUDED__line_polygon_intersection_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CLine_Polygon_Intersection : public CSG_Module { public: CLine_Polygon_Intersection(void); protected: virtual bool On_Execute (void); private: bool Get_Intersection (CSG_Shape_Polygon *pPolygon, CSG_Shapes *pLines, CSG_Shapes &New_Lines); TSG_Point Get_Intersection (CSG_Shape_Polygon *pPolygon, const TSG_Point &a, const TSG_Point &b); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__line_polygon_intersection_H saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/line_properties.cpp000066400000000000000000000151421224124640700254570ustar00rootroot00000000000000/********************************************************** * Version $Id: line_properties.cpp 1065 2011-05-18 15:58:45Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // line_properties.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "line_properties.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CLine_Properties::CLine_Properties(void) { //----------------------------------------------------- Set_Name (_TL("Line Properties")); Set_Author (SG_T("O. Conrad (c) 2009")); Set_Description (_TW( "Line properties: length, number of vertices." )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "LINES" , _TL("Lines"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Line ); Parameters.Add_Shapes( NULL , "OUTPUT" , _TL("Lines with Property Attributes"), _TL("If not set property attributes will be added to the orignal layer."), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Line ); Parameters.Add_Value( NULL , "BPARTS" , _TL("Number of Parts"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "BPOINTS" , _TL("Number of Vertices"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "BLENGTH" , _TL("Length"), _TL(""), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLine_Properties::On_Execute(void) { //------------------------------------------------- int bParts = Parameters("BPARTS") ->asBool() ? 0 : -1; int bPoints = Parameters("BPOINTS") ->asBool() ? 0 : -1; int bLength = Parameters("BLENGTH") ->asBool() ? 0 : -1; if( bParts && bPoints && bLength ) { Error_Set(_TL("no properties selected")); return( false ); } //------------------------------------------------- CSG_Shapes *pLines = Parameters("LINES")->asShapes(); if( !pLines->is_Valid() || pLines->Get_Count() <= 0 ) { Error_Set(_TL("invalid lines layer")); return( false ); } if( Parameters("OUTPUT")->asShapes() && Parameters("OUTPUT")->asShapes() != pLines ) { pLines = Parameters("OUTPUT")->asShapes(); pLines->Create(*Parameters("LINES")->asShapes()); } //------------------------------------------------- if( !bParts ) { bParts = pLines->Get_Field_Count(); pLines->Add_Field(SG_T("NPARTS") , SG_DATATYPE_Int ); } if( !bPoints ) { bPoints = pLines->Get_Field_Count(); pLines->Add_Field(SG_T("NPOINTS"), SG_DATATYPE_Int ); } if( !bLength ) { bLength = pLines->Get_Field_Count(); pLines->Add_Field(SG_T("LENGTH") , SG_DATATYPE_Double); } //------------------------------------------------- for(int i=0; iGet_Count() && Set_Progress(i, pLines->Get_Count()); i++) { CSG_Shape *pLine = pLines->Get_Shape(i); if( bParts >= 0 ) pLine->Set_Value(bParts , pLine->Get_Part_Count()); if( bPoints >= 0 ) pLine->Set_Value(bPoints, pLine->Get_Point_Count()); if( bLength >= 0 ) pLine->Set_Value(bLength, ((CSG_Shape_Line *)pLine)->Get_Length()); } //------------------------------------------------- if( pLines == Parameters("LINES")->asShapes() ) { DataObject_Update(pLines); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/line_properties.h000066400000000000000000000103551224124640700251250ustar00rootroot00000000000000/********************************************************** * Version $Id: line_properties.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // line_properties.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__line_properties_H #define HEADER_INCLUDED__line_properties_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CLine_Properties : public CSG_Module { public: CLine_Properties(void); protected: virtual bool On_Execute(void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__line_properties_H saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/line_simplification.cpp000066400000000000000000000234461224124640700263030ustar00rootroot00000000000000/********************************************************** * Version $Id: line_simplification.cpp 1314 2012-01-19 14:46:45Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // line_simplification.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "line_simplification.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CStack : public CSG_Stack { public: CStack(void) : CSG_Stack(2 * sizeof(int)) {} bool Push (int iAnchor, int iFloater) { int *Record = (int *)Get_Record_Push(); if( Record ) { Record[0] = iAnchor; Record[1] = iFloater; return( true ); } return( false ); } bool Pop (int &iAnchor, int &iFloater) { int *Record = (int *)Get_Record_Pop(); if( Record ) { iAnchor = Record[0]; iFloater = Record[1]; return( true ); } return( false ); } }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CLine_Simplification::CLine_Simplification(void) { //----------------------------------------------------- Set_Name (_TL("Line Simplification")); Set_Author (SG_T("O. Conrad (c) 2010")); Set_Description (_TW( "Line simplification implementing the Ramer-Douglas-Peucker algorithm.\n" "\n" "Refererences:\n" "- Ramer, U. (1972): An iterative procedure for the polygonal approximation of plane curves. Computer Graphics and Image Processing, 1(3), 244-256\n" "- Douglas, D., Peucker, T. (1973): Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. The Canadian Cartographer 10(2), 112-122\n" "\n" "- Polyline Reduction source code at mappinghacks.com\n" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "LINES" , _TL("Lines"), _TL("Line or polygon shapefile to simplify."), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "OUTPUT" , _TL("Simplified Lines"), _TL("If not set points will be removed from the input data set."), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Value( NULL , "TOLERANCE" , _TL("Tolerance"), _TL("Maximum deviation allowed between original and simplified curve [map units]."), PARAMETER_TYPE_Double, 1.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLine_Simplification::On_Execute(void) { CSG_Shapes *pLines = Parameters("LINES")->asShapes(); if( !pLines->is_Valid() || pLines->Get_Count() <= 0 ) { Error_Set(_TL("invalid or empty shapes layer")); return( false ); } if( pLines->Get_Type() != SHAPE_TYPE_Line && pLines->Get_Type() != SHAPE_TYPE_Polygon ) { Error_Set(_TL("line simplification can only be applied to lines and polygons")); return( false ); } if( Parameters("OUTPUT")->asShapes() && Parameters("OUTPUT")->asShapes() != pLines ) { pLines = Parameters("OUTPUT")->asShapes(); pLines->Create(*Parameters("LINES")->asShapes()); } //----------------------------------------------------- CSG_Array Keep(sizeof(bool)); m_Tolerance = Parameters("TOLERANCE")->asDouble(); int nTotal = 0; int nRemoved = 0; for(int iLine=0; iLineGet_Count() && Set_Progress(iLine, pLines->Get_Count()); iLine++) { CSG_Shape *pLine = pLines->Get_Shape(iLine); for(int iPart=0; iPartGet_Part_Count(); iPart++) { nTotal += pLine->Get_Point_Count(iPart); Keep.Set_Array(pLine->Get_Point_Count(iPart), false); if( Simplify(pLine, iPart, (bool *)Keep.Get_Array()) ) { for(int iPoint=pLine->Get_Point_Count(iPart)-1; iPoint>=0; iPoint--) { if( !((bool *)Keep.Get_Array())[iPoint] ) { pLine->Del_Point(iPoint, iPart); nRemoved ++; } } } } } Message_Add(CSG_String::Format(SG_T("\n%s: %0.2f%% (%d / %d)"), _TL("Reduction"), 100.0 * nRemoved / (double)nTotal, nRemoved, nTotal), false); return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLine_Simplification::Simplify(CSG_Shape *pLine, int iPart, bool *Keep) { int iVertexMax, iVertex, iAnchor, iFloater; double dVertexMax, dVertex, dLength, dProjScalar; TSG_Point Anchor, Floater, Vertex, vAnchor, vVertex; CStack Stack; memset(Keep, 0, sizeof(bool) * pLine->Get_Point_Count(iPart)); Stack.Push(0, pLine->Get_Point_Count(iPart) - 1); while( Stack.Pop(iAnchor, iFloater) && Process_Get_Okay() ) { Anchor = pLine->Get_Point(iAnchor , iPart); Floater = pLine->Get_Point(iFloater, iPart); while( Anchor.x == Floater.x && Anchor.y == Floater.y ) { if( iAnchor >= iFloater - 1 ) { return( false ); } Keep[iFloater--] = iAnchor == 0 && iFloater == pLine->Get_Point_Count(iPart) - 1; Floater = pLine->Get_Point(iFloater, iPart); } vAnchor.x = Floater.x - Anchor.x; vAnchor.y = Floater.y - Anchor.y; dLength = SG_Get_Length(vAnchor.x, vAnchor.y); vAnchor.x = vAnchor.x / dLength; vAnchor.y = vAnchor.y / dLength; for(iVertex=iVertexMax=iAnchor+1, dVertexMax=0.0; iVertexGet_Point(iVertex, iPart); vVertex.x = Vertex.x - Anchor.x; vVertex.y = Vertex.y - Anchor.y; dLength = SG_Get_Length(Vertex.x, Vertex.y); dProjScalar = vVertex.x * vAnchor.x + vVertex.y * vAnchor.y; //dot product: if( dProjScalar < 0.0 ) { dVertex = dLength; } else { vVertex.x = Vertex.x - Floater.x; vVertex.y = Vertex.y - Floater.y; dLength = SG_Get_Length(vVertex.x, vVertex.y); dProjScalar = vVertex.x * (-vAnchor.x) + vVertex.y * (-vAnchor.y); //dot product: if( dProjScalar < 0.0 ) { dVertex = dLength; } else //calculate perpendicular distance to line (pythagorean theorem): { dVertex = sqrt(fabs(dLength*dLength - dProjScalar*dProjScalar)); } } if( dVertexMax < dVertex ) { dVertexMax = dVertex; iVertexMax = iVertex; } } if( dVertexMax <= m_Tolerance ) { Keep[iAnchor] = true; Keep[iFloater] = true; } else { Stack.Push(iAnchor , iVertexMax); Stack.Push(iVertexMax, iFloater ); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_lines/line_simplification.h000066400000000000000000000105401224124640700257370ustar00rootroot00000000000000/********************************************************** * Version $Id: line_simplification.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_lines // // // //-------------------------------------------------------// // // // line_simplification.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__line_simplification_H #define HEADER_INCLUDED__line_simplification_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CLine_Simplification : public CSG_Module { public: CLine_Simplification(void); protected: virtual bool On_Execute (void); private: double m_Tolerance; bool Simplify (CSG_Shape *pLine, int iPart, bool *Keep); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__line_simplification_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/000077500000000000000000000000001224124640700217475ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/shapes/shapes_points/AddCoordinates.cpp000066400000000000000000000045631224124640700253460ustar00rootroot00000000000000/********************************************************** * Version $Id: AddCoordinates.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* AddCoordinates.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "AddCoordinates.h" //--------------------------------------------------------- CAddCoordinates::CAddCoordinates(void) { Set_Name (_TL("Add Coordinates to points")); Set_Author (SG_T("Victor Olaya (c) 2004")); Set_Description (_TW( "(c) 2004 by Victor Olaya." )); Parameters.Add_Shapes( NULL, "INPUT" , _TL("Points"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL, "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); } //--------------------------------------------------------- bool CAddCoordinates::On_Execute(void) { CSG_Shapes *pShapes = Parameters("OUTPUT")->asShapes(); if( pShapes ) { pShapes->Assign(Parameters("INPUT")->asShapes()); } else { pShapes = Parameters("INPUT")->asShapes(); } //----------------------------------------------------- int xField = pShapes->Get_Field_Count(); pShapes->Add_Field("X", SG_DATATYPE_Double); int yField = pShapes->Get_Field_Count(); pShapes->Add_Field("Y", SG_DATATYPE_Double); //----------------------------------------------------- for(int i=0; iGet_Count(); i++) { CSG_Shape *pShape = pShapes->Get_Shape(i); pShape->Set_Value(xField, pShape->Get_Point(0).x); pShape->Set_Value(yField, pShape->Get_Point(0).y); } return( true ); } saga-2.1.0+dfsg/src/modules/shapes/shapes_points/AddCoordinates.h000066400000000000000000000024021224124640700250010ustar00rootroot00000000000000/********************************************************** * Version $Id: AddCoordinates.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* AddCoordinates.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "MLB_Interface.h" class CAddCoordinates : public CSG_Module { public: CAddCoordinates(void); protected: virtual bool On_Execute(void); }; saga-2.1.0+dfsg/src/modules/shapes/shapes_points/Clip_Points.cpp000066400000000000000000000167201224124640700247040ustar00rootroot00000000000000/********************************************************** * Version $Id: Clip_Points.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // Clip_Points.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Clip_Points.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CClip_Points::CClip_Points(void) { Set_Name (_TL("Clip Points with Polygons")); Set_Author (SG_T("(c) 2008 by O.Conrad")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); CSG_Parameter *pNode = Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Add Attribute to Clipped Points"), _TL(""), true ); Parameters.Add_Shapes_List( NULL , "CLIPS" , _TL("Clipped Points"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Clipping Options"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("one layer for all points"), _TL("separate layer for each polygon") ), 0 ); } //--------------------------------------------------------- CClip_Points::~CClip_Points(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CClip_Points::On_Execute(void) { int Method, iField; CSG_Shapes *pPoints, *pPolygons, *pClip; CSG_Parameter_Shapes_List *pClips; //----------------------------------------------------- pPoints = Parameters("POINTS") ->asShapes(); pPolygons = Parameters("POLYGONS") ->asShapes(); pClips = Parameters("CLIPS") ->asShapesList(); Method = Parameters("METHOD") ->asInt(); iField = Parameters("FIELD") ->asInt(); //----------------------------------------------------- if( !pPoints->is_Valid() ) { Message_Add(_TL("Invalid points layer.")); return( false ); } else if( !pPolygons->is_Valid() ) { Message_Add(_TL("Invalid polygon layer.")); return( false ); } //----------------------------------------------------- if( iField >= pPolygons->Get_Field_Count() ) { iField = -1; } pClips->Del_Items(); if( Method == 0 ) { pClip = SG_Create_Shapes(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), pPolygons->Get_Name()), pPoints); if( iField >= 0 ) { pClip->Add_Field(pPolygons->Get_Field_Name(iField), pPolygons->Get_Field_Type(iField)); } } //----------------------------------------------------- for(int iPolygon=0; iPolygonGet_Count() && Set_Progress(iPolygon, pPolygons->Get_Count()); iPolygon++) { CSG_Shape_Polygon *pPolygon = (CSG_Shape_Polygon *)pPolygons->Get_Shape(iPolygon); if( Method == 1 ) { CSG_String Name(pPoints->Get_Name()); Name += iField >= 0 ? CSG_String::Format(SG_T(" [%s]"), pPolygon->asString(iField)) : CSG_String::Format(SG_T(" [%00d]"), 1 + pClips->Get_Count()); pClip = SG_Create_Shapes(SHAPE_TYPE_Point, Name, pPoints); if( iField >= 0 ) { pClip->Add_Field(pPolygons->Get_Field_Name(iField), pPolygons->Get_Field_Type(iField)); } } for(int iPoint=0; iPointGet_Count() && Process_Get_Okay(false); iPoint++) { CSG_Shape *pPoint = pPoints->Get_Shape(iPoint); if( pPolygon->Contains(pPoint->Get_Point(0)) ) { pPoint = pClip->Add_Shape(pPoint, SHAPE_COPY); if( iField >= 0 ) { pPoint->Set_Value(pPoints->Get_Field_Count(), pPolygon->asString(iField)); } } } if( Method == 1 ) { if( pClip->Get_Count() > 0 ) { pClips->Add_Item(pClip); } else { delete(pClip); } } } //----------------------------------------------------- if( Method == 0 ) { if( pClip->Get_Count() > 0 ) { pClips->Add_Item(pClip); } else { delete(pClip); } } return( pClips->Get_Count() > 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/Clip_Points.h000066400000000000000000000101231224124640700243400ustar00rootroot00000000000000/********************************************************** * Version $Id: Clip_Points.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Clip_Points.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Clip_Points_H #define HEADER_INCLUDED__Clip_Points_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CClip_Points : public CSG_Module { public: CClip_Points(void); virtual ~CClip_Points(void); protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Clip_Points_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/CountPoints.cpp000066400000000000000000000063321224124640700247440ustar00rootroot00000000000000/********************************************************** * Version $Id: CountPoints.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CountPoints.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "CountPoints.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CCountPoints::CCountPoints(void) { Set_Name (_TL("Count Points in Polygons")); Set_Author (SG_T("Victor Olaya (c) 2004")); Set_Description (_TW( "Count Points in Polygons." )); Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CCountPoints::On_Execute(void) { CSG_Shapes *pPoints = Parameters("POINTS") ->asShapes(); CSG_Shapes *pPolygons = Parameters("POLYGONS")->asShapes(); int Field = pPolygons->Get_Field_Count(); pPolygons->Add_Field(_TL("Points"), SG_DATATYPE_Int); for(int iPolygon=0; iPolygonGet_Count() && Set_Progress(iPolygon, pPolygons->Get_Count()); iPolygon++) { CSG_Shape_Polygon *pPolygon = (CSG_Shape_Polygon *)pPolygons->Get_Shape(iPolygon); int nPoints = 0; for(int iPoint=0; iPointGet_Count(); iPoint++) { CSG_Shape *pPoint = pPoints->Get_Shape(iPoint); if( pPolygon->Contains(pPoint->Get_Point(iPoint)) ) { nPoints++; } } pPolygon->Set_Value(Field, nPoints); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/CountPoints.h000066400000000000000000000037221224124640700244110ustar00rootroot00000000000000/********************************************************** * Version $Id: CountPoints.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CountPoints.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CCountPoints : public CSG_Module { public: CCountPoints(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/CreatePointGrid.cpp000066400000000000000000000054751224124640700255110ustar00rootroot00000000000000/********************************************************** * Version $Id: CreatePointGrid.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CreatePointGrid.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "CreatePointGrid.h" CCreatePointGrid::CCreatePointGrid(void){ Parameters.Set_Name(_TL("Create Point Grid")); Parameters.Set_Description(_TW( "(c) 2004 by Victor Olaya. Creates a regular grid of points.")); Parameters.Add_Shapes(NULL, "POINTS", _TL("Point Grid"), _TL(""), PARAMETER_OUTPUT); Parameters.Add_Range(NULL, "X_EXTENT", _TL("X-Extent"), _TL("")); Parameters.Add_Range(NULL, "Y_EXTENT", _TL("Y-Extent"), _TL("")); Parameters.Add_Value(NULL, "DIST", _TL("Distance"), _TL("Distance between points (grid units)."), PARAMETER_TYPE_Double, 100); }//constructor CCreatePointGrid::~CCreatePointGrid(void) {} bool CCreatePointGrid::On_Execute(void){ CSG_Shape *pShape; double dXMin = ((CSG_Parameter_Range *) Parameters("X_EXTENT")->Get_Data())->Get_LoVal(); double dYMin = ((CSG_Parameter_Range *) Parameters("Y_EXTENT")->Get_Data())->Get_LoVal(); double dXMax = ((CSG_Parameter_Range *) Parameters("X_EXTENT")->Get_Data())->Get_HiVal(); double dYMax = ((CSG_Parameter_Range *) Parameters("Y_EXTENT")->Get_Data())->Get_HiVal(); double dDistance = Parameters("DIST")->asDouble(); if (dDistance<=0){ return false; }//if CSG_Shapes *pShapes = Parameters("POINTS")->asShapes(); pShapes->Create(SHAPE_TYPE_Point, _TL("Point Grid")); pShapes->Add_Field("X", SG_DATATYPE_Double); pShapes->Add_Field("Y", SG_DATATYPE_Double); for (double x=dXMin; xAdd_Shape(); pShape->Add_Point(x,y); pShape->Set_Value(0, x); pShape->Set_Value(1, y); }//for }//for return true; }//method saga-2.1.0+dfsg/src/modules/shapes/shapes_points/CreatePointGrid.h000066400000000000000000000026451224124640700251520ustar00rootroot00000000000000/********************************************************** * Version $Id: CreatePointGrid.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CreatePointGrid.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CCreatePointGrid : public CSG_Module { public: CCreatePointGrid(void); virtual ~CCreatePointGrid(void); virtual bool is_ProjectDependent(void) {return( false );} protected: virtual bool On_Execute(void); }; saga-2.1.0+dfsg/src/modules/shapes/shapes_points/DistanceMatrix.cpp000066400000000000000000000054021224124640700253730ustar00rootroot00000000000000/********************************************************** * Version $Id: DistanceMatrix.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* DistanceMatrix.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "DistanceMatrix.h" #include CDistanceMatrix::CDistanceMatrix(void){ Parameters.Set_Name(_TL("Distance Matrix")); Parameters.Set_Description(_TW( "(c) 2004 by Victor Olaya. Computes distance between pairs of points in a layer.")); Parameters.Add_Shapes(NULL, "POINTS", _TL("Points"), _TL(""), PARAMETER_INPUT); Parameters.Add_Table(NULL, "TABLE", _TL("Distance Matrix Table"), _TL(""), PARAMETER_OUTPUT); }//constructor CDistanceMatrix::~CDistanceMatrix(void) {} bool CDistanceMatrix::On_Execute(void){ int i,j,k; double dDist; CSG_Points Points; CSG_Shapes *pShapes = Parameters("POINTS")->asShapes(); CSG_Table *pTable = Parameters("TABLE")->asTable(); CSG_Shape *pShape; CSG_Table_Record *pRecord; pTable->Create((CSG_Table*)NULL); pTable->Set_Name(_TL("Distance Matrix")); for(i = 0; i < pShapes->Get_Count(); i++){ pShape = pShapes->Get_Shape(i); for(j = 0; j < pShape->Get_Part_Count(); j++){ for(k = 0; k < pShape->Get_Point_Count(j); k++){ Points.Add(pShape->Get_Point(k, j).x, pShape->Get_Point(k, j).y); }//for }//for }//for for (i = 0; i < Points.Get_Count(); i++){ pTable->Add_Field(SG_Get_String(i).c_str(), SG_DATATYPE_Double); }//for for (i = 0; i < Points.Get_Count(); i++){ pTable->Add_Record(); }//for for (i = 0; i < Points.Get_Count(); i++){ pRecord = pTable->Get_Record(i); for (j = i; j < Points.Get_Count(); j++){ dDist = sqrt(pow(Points[i].x-Points[j].x,2) + pow(Points[i].y-Points[j].y,2)); pRecord->Set_Value(j, dDist); pTable->Get_Record(j)->Set_Value(i, dDist); }//for }//for return true; }//method saga-2.1.0+dfsg/src/modules/shapes/shapes_points/DistanceMatrix.h000066400000000000000000000026321224124640700250420ustar00rootroot00000000000000/********************************************************** * Version $Id: DistanceMatrix.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* DistanceMatrix.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CDistanceMatrix : public CSG_Module { public: CDistanceMatrix(void); virtual ~CDistanceMatrix(void); virtual bool is_ProjectDependent(void) {return( false );} protected: virtual bool On_Execute(void); };saga-2.1.0+dfsg/src/modules/shapes/shapes_points/FitNPointsToShape.cpp000066400000000000000000000074441224124640700260050ustar00rootroot00000000000000/********************************************************** * Version $Id: FitNPointsToShape.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* FitNPointsToShape.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "FitNPointsToShape.h" #define MAX_REP 30 #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif CFitNPointsToShape::CFitNPointsToShape(void){ Parameters.Set_Name(_TL("Fit N Points to shape")); Parameters.Set_Description(_TW( "(c) 2004 by Victor Olaya. Fit N Points to shape")); Parameters.Add_Shapes(NULL, "POINTS", _TL("Points"), _TL(""), PARAMETER_OUTPUT); Parameters.Add_Shapes(NULL, "SHAPES", _TL("Shapes"), _TL(""), PARAMETER_INPUT); Parameters.Add_Value(NULL, "NUMPOINTS", _TL("Number of points"), _TL("Number of points"), PARAMETER_TYPE_Int, 100, 1, true); }//constructor CFitNPointsToShape::~CFitNPointsToShape(void) {} bool CFitNPointsToShape::On_Execute(void){ CSG_Shapes *pShapes, *pPoints; CSG_Shape *pShape, *pShape2; bool bCopy; int iPoints; int iPointsIn = 0; int iRep = 0; int i,j; double x,y; double dArea; double dDist; double dDistInf, dDistSup; bool bFirstTime; TSG_Rect Extent; pShapes = Parameters("SHAPES")->asShapes(); pPoints = Parameters("POINTS")->asShapes(); iPoints = Parameters("NUMPOINTS")->asInt(); if(pShapes == pPoints){ bCopy = true; pPoints = SG_Create_Shapes(); }//if else{ bCopy = false; }//else pPoints->Create(SHAPE_TYPE_Point, _TL("Point Grid")); pPoints->Add_Field("X", SG_DATATYPE_Double); pPoints->Add_Field("Y", SG_DATATYPE_Double); for (i = 0; i < pShapes->Get_Selection_Count(); i++){ iRep = 0; pShape = pShapes->Get_Selection(i); dArea = ((CSG_Shape_Polygon*)pShape)->Get_Area(); dDist = sqrt(dArea / (double) iPoints); dDistInf = sqrt(dArea / (double) (iPoints + 2)); dDistSup = sqrt(dArea / (double) (iPoints - min(2, iPoints-1))); Extent = ((CSG_Shape_Polygon*)pShape)->Get_Extent(); bFirstTime = true; do{ if (!bFirstTime){ for (j = 0; j < iPointsIn; j++){ pPoints->Del_Shape(pPoints->Get_Count()-1); }//for }//if iPointsIn = 0; iRep++; for (x=Extent.xMin; xContains(x,y)){ pShape2 = pPoints->Add_Shape(); pShape2->Add_Point(x,y); pShape2->Set_Value(0, x); pShape2->Set_Value(1, y); iPointsIn++; }//if }//for }//for if (iPointsIn > iPoints){ dDistInf = dDist; dDist = (dDistInf + dDistSup) / 2.; }//if else if (iPointsIn < iPoints){ dDistSup = dDist; dDist = (dDistInf + dDistSup) / 2.; }//if bFirstTime = false; }while(iPointsIn != iPoints && iRep < MAX_REP); }//for if(bCopy){ pShapes->Assign(pPoints); delete(pPoints); }//if return true; }//method saga-2.1.0+dfsg/src/modules/shapes/shapes_points/FitNPointsToShape.h000066400000000000000000000026541224124640700254500ustar00rootroot00000000000000/********************************************************** * Version $Id: FitNPointsToShape.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* FitNPointsToShape.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CFitNPointsToShape : public CSG_Module { public: CFitNPointsToShape(void); virtual ~CFitNPointsToShape(void); virtual bool is_ProjectDependent(void) {return( false );} protected: virtual bool On_Execute(void); }; saga-2.1.0+dfsg/src/modules/shapes/shapes_points/MLB_Interface.cpp000066400000000000000000000134361224124640700250540ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1568 2012-12-14 13:00:29Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: volaya@ya.com // // // // contact: Victor Olaya Ferrero // // Madrid // // Spain // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Shapes - Points") ); case MLB_INFO_Author: return( _TL("Various Authors") ); case MLB_INFO_Description: return( _TL("Tools for the manipulation of point vector data.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Shapes|Points") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Points_From_Table.h" #include "Points_From_Lines.h" #include "CountPoints.h" #include "CreatePointGrid.h" #include "DistanceMatrix.h" #include "FitNPointsToShape.h" #include "AddCoordinates.h" #include "remove_duplicates.h" #include "Clip_Points.h" #include "separate_by_direction.h" #include "add_polygon_attributes.h" #include "points_filter.h" #include "convex_hull.h" #include "select_points.h" #include "points_thinning.h" #include "thiessen_polygons.h" #include "gps_track_aggregation.h" #include "snap_points_to_features.h" #include "snap_points_to_grid.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CPoints_From_Table ); case 1: return( new CCountPoints ); case 2: return( new CCreatePointGrid ); case 3: return( new CDistanceMatrix ); case 4: return( new CFitNPointsToShape ); case 5: return( new CPoints_From_Lines ); case 6: return( new CAddCoordinates ); case 7: return( new CRemove_Duplicates ); case 8: return( new CClip_Points ); case 9: return( new CSeparate_by_Direction ); case 10: return( new CAdd_Polygon_Attributes ); case 11: return( new CPoints_Filter ); case 12: return( new CConvex_Hull ); case 13: return( new CSelect_Points ); case 14: return( new CPoints_Thinning ); case 15: return( new CPoints_From_MultiPoints ); case 16: return( new CThiessen_Polygons ); case 17: return( new CGPS_Track_Aggregation ); case 18: return( new CSnap_Points_to_Features(SHAPE_TYPE_Point) ); case 19: return( new CSnap_Points_to_Features(SHAPE_TYPE_Line) ); case 20: return( new CSnap_Points_to_Grid() ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/shapes/shapes_points/MLB_Interface.h000066400000000000000000000074451224124640700245240ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2004 by // // Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: volaya@ya.com // // // // contact: Victor Olaya Ferrero // // Madrid // // Spain // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__shapes_points_H #define HEADER_INCLUDED__shapes_points_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef shapes_points_EXPORTS #define shapes_points_EXPORT _SAGA_DLL_EXPORT #else #define shapes_points_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__shapes_points_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/Makefile.am000066400000000000000000000025631224124640700240110ustar00rootroot00000000000000# # $Id: Makefile.am 1568 2012-12-14 13:00:29Z oconrad $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libshapes_points.la libshapes_points_la_SOURCES =\ add_polygon_attributes.cpp\ AddCoordinates.cpp\ Clip_Points.cpp\ convex_hull.cpp\ CountPoints.cpp\ CreatePointGrid.cpp\ DistanceMatrix.cpp\ FitNPointsToShape.cpp\ gps_track_aggregation.cpp\ MLB_Interface.cpp\ points_filter.cpp\ Points_From_Lines.cpp\ Points_From_Table.cpp\ points_thinning.cpp\ remove_duplicates.cpp\ select_points.cpp\ separate_by_direction.cpp\ snap_points_to_features.cpp\ snap_points_to_grid.cpp\ thiessen_polygons.cpp\ add_polygon_attributes.h\ AddCoordinates.h\ convex_hull.h\ CountPoints.h\ Clip_Points.h\ CreatePointGrid.h\ DistanceMatrix.h\ FitNPointsToShape.h\ gps_track_aggregation.h\ MLB_Interface.h\ points_filter.h\ Points_From_Lines.h\ Points_From_Table.h\ points_thinning.h\ remove_duplicates.h\ select_points.h\ separate_by_direction.h\ snap_points_to_features.h\ snap_points_to_grid.h\ thiessen_polygons.h libshapes_points_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/shapes/shapes_points/Makefile.in000066400000000000000000000513321224124640700240200ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/shapes/shapes_points DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libshapes_points_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libshapes_points_la_OBJECTS = add_polygon_attributes.lo \ AddCoordinates.lo Clip_Points.lo convex_hull.lo CountPoints.lo \ CreatePointGrid.lo DistanceMatrix.lo FitNPointsToShape.lo \ gps_track_aggregation.lo MLB_Interface.lo points_filter.lo \ Points_From_Lines.lo Points_From_Table.lo points_thinning.lo \ remove_duplicates.lo select_points.lo separate_by_direction.lo \ snap_points_to_features.lo snap_points_to_grid.lo \ thiessen_polygons.lo libshapes_points_la_OBJECTS = $(am_libshapes_points_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libshapes_points_la_SOURCES) DIST_SOURCES = $(libshapes_points_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1568 2012-12-14 13:00:29Z oconrad $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libshapes_points.la libshapes_points_la_SOURCES = \ add_polygon_attributes.cpp\ AddCoordinates.cpp\ Clip_Points.cpp\ convex_hull.cpp\ CountPoints.cpp\ CreatePointGrid.cpp\ DistanceMatrix.cpp\ FitNPointsToShape.cpp\ gps_track_aggregation.cpp\ MLB_Interface.cpp\ points_filter.cpp\ Points_From_Lines.cpp\ Points_From_Table.cpp\ points_thinning.cpp\ remove_duplicates.cpp\ select_points.cpp\ separate_by_direction.cpp\ snap_points_to_features.cpp\ snap_points_to_grid.cpp\ thiessen_polygons.cpp\ add_polygon_attributes.h\ AddCoordinates.h\ convex_hull.h\ CountPoints.h\ Clip_Points.h\ CreatePointGrid.h\ DistanceMatrix.h\ FitNPointsToShape.h\ gps_track_aggregation.h\ MLB_Interface.h\ points_filter.h\ Points_From_Lines.h\ Points_From_Table.h\ points_thinning.h\ remove_duplicates.h\ select_points.h\ separate_by_direction.h\ snap_points_to_features.h\ snap_points_to_grid.h\ thiessen_polygons.h libshapes_points_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/shapes/shapes_points/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/shapes/shapes_points/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libshapes_points.la: $(libshapes_points_la_OBJECTS) $(libshapes_points_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libshapes_points_la_OBJECTS) $(libshapes_points_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AddCoordinates.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Clip_Points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CountPoints.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CreatePointGrid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DistanceMatrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FitNPointsToShape.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Points_From_Lines.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Points_From_Table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_polygon_attributes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convex_hull.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gps_track_aggregation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/points_filter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/points_thinning.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remove_duplicates.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select_points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/separate_by_direction.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snap_points_to_features.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snap_points_to_grid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thiessen_polygons.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/shapes/shapes_points/Points_From_Lines.cpp000066400000000000000000000143651224124640700260550ustar00rootroot00000000000000/********************************************************** * Version $Id: Points_From_Lines.cpp 1070 2011-05-27 08:37:29Z oconrad $ *********************************************************/ /******************************************************************************* Points_From_Lines.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Points_From_Lines.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoints_From_Lines::CPoints_From_Lines(void) { Set_Name (_TL("Convert Lines to Points")); Set_Author (_TL("Victor Olaya (c) 2004")); Set_Description (_TW( "Converts lines to points. " "Optionally inserts additional points in user-defined distances. " )); Parameters.Add_Shapes( NULL, "POINTS" , _TL("Points"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL, "LINES" , _TL("Lines"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Value( NULL, "ADD" , _TL("Insert Additional Points"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL, "DIST" , _TL("Insert Distance"), _TL(""), PARAMETER_TYPE_Double, 100, 0.0, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoints_From_Lines::On_Execute(void) { int iLine, iPart, iPoint, jPoint, nPoints; double dx, dy, dDist; TSG_Point Pt_A, Pt_B; CSG_Shapes *pLines, *pPoints; CSG_Shape *pLine, *pPoint; //----------------------------------------------------- pLines = Parameters("LINES") ->asShapes(); pPoints = Parameters("POINTS") ->asShapes(); dDist = Parameters("ADD") ->asBool() ? Parameters("DIST")->asDouble() : -1.0; pPoints->Create(SHAPE_TYPE_Point, pLines->Get_Name(), pLines); //----------------------------------------------------- for(iLine=0; iLineGet_Count() && Set_Progress(iLine, pLines->Get_Count()); iLine++) { pLine = pLines->Get_Shape(iLine); for(iPart=0; iPartGet_Part_Count(); iPart++) { //--------------------------------------------- if( dDist > 0.0 ) // insert additional points... { Pt_B = pLine->Get_Point(0, iPart); for(iPoint=1; iPointGet_Point_Count(iPart); iPoint++) { Pt_A = Pt_B; Pt_B = pLine->Get_Point(iPoint, iPart); dx = Pt_B.x - Pt_A.x; dy = Pt_B.y - Pt_A.y; nPoints = 1 + (int)(sqrt(dx*dx + dy*dy) / dDist); dx /= nPoints; dy /= nPoints; pPoint = pPoints->Add_Shape(pLine, SHAPE_COPY_ATTR); pPoint ->Add_Point(Pt_A); for(jPoint=1; jPointAdd_Shape(pLine, SHAPE_COPY_ATTR); pPoint ->Add_Point(Pt_A); } } } //--------------------------------------------- else // just copy points... { for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { pPoint = pPoints->Add_Shape(pLine, SHAPE_COPY_ATTR); pPoint ->Add_Point(pLine->Get_Point(iPoint, iPart)); } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoints_From_MultiPoints::CPoints_From_MultiPoints(void) { Set_Name (_TL("Convert Multipoints to Points")); Set_Author (_TL("O.Conrad (c) 2011")); Set_Description (_TW( "Converts multipoints to points. " )); Parameters.Add_Shapes( NULL , "MULTIPOINTS" , _TL("Multipoints"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Points ); Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoints_From_MultiPoints::On_Execute(void) { //----------------------------------------------------- CSG_Shapes *pMultipoints = Parameters("MULTIPOINTS") ->asShapes(); CSG_Shapes *pPoints = Parameters("POINTS") ->asShapes(); pPoints->Create(SHAPE_TYPE_Point, pMultipoints->Get_Name(), pMultipoints); //----------------------------------------------------- for(int iMultipoint=0; iMultipointGet_Count() && Set_Progress(iMultipoint, pMultipoints->Get_Count()); iMultipoint++) { CSG_Shape *pMultipoint = pMultipoints->Get_Shape(iMultipoint); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { CSG_Shape *pPoint = pPoints->Add_Shape(pMultipoint, SHAPE_COPY_ATTR); pPoint->Add_Point(pMultipoint->Get_Point(iPoint, iPart)); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/Points_From_Lines.h000066400000000000000000000055721224124640700255220ustar00rootroot00000000000000/********************************************************** * Version $Id: Points_From_Lines.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Points_From_Lines.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Points_From_Lines_H #define HEADER_INCLUDED__Points_From_Lines_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoints_From_Lines : public CSG_Module { public: CPoints_From_Lines(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Conversion") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoints_From_MultiPoints : public CSG_Module { public: CPoints_From_MultiPoints(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Conversion") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Points_From_Lines_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/Points_From_Table.cpp000066400000000000000000000074061224124640700260300ustar00rootroot00000000000000/********************************************************** * Version $Id: Points_From_Table.cpp 1512 2012-11-05 16:58:58Z oconrad $ *********************************************************/ /******************************************************************************* Points_From_Table.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Points_From_Table.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoints_From_Table::CPoints_From_Table(void) { CSG_Parameter *pNode; Set_Name (_TL("Convert Table to Points")); Set_Author (_TL("Victor Olaya (c) 2004")); Set_Description (_TW( "Create Point Theme From Table" )); Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "X" , _TL("X"), _TL("") ); Parameters.Add_Table_Field( pNode , "Y" , _TL("Y"), _TL("") ); Parameters.Add_Table_Field( pNode , "Z" , _TL("Z"), _TL(""), true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoints_From_Table::On_Execute(void) { int xField, yField, zField; CSG_Table *pTable; CSG_Shapes *pShapes; pTable = Parameters("TABLE") ->asTable(); pShapes = Parameters("POINTS") ->asShapes(); xField = Parameters("X") ->asInt(); yField = Parameters("Y") ->asInt(); zField = Parameters("Z") ->asInt(); if( pTable->Get_Field_Count() < 1 || pTable->Get_Record_Count() <= 0 ) { return( false ); } pShapes->Create(SHAPE_TYPE_Point, pTable->Get_Name(), pTable, zField < 0 ? SG_VERTEX_TYPE_XY : SG_VERTEX_TYPE_XYZ); for(int iRecord=0; iRecordGet_Record_Count() && Set_Progress(iRecord, pTable->Get_Record_Count()); iRecord++) { CSG_Table_Record *pRecord = pTable->Get_Record(iRecord); if( !pRecord->is_NoData(xField) && !pRecord->is_NoData(yField) ) { CSG_Shape *pShape = pShapes->Add_Shape(pRecord, SHAPE_COPY_ATTR); pShape->Add_Point(pRecord->asDouble(xField), pRecord->asDouble(yField)); if( zField >= 0 ) { pShape->Set_Z(pRecord->asDouble(zField), 0); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/Points_From_Table.h000066400000000000000000000047071224124640700254760ustar00rootroot00000000000000/********************************************************** * Version $Id: Points_From_Table.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Points_From_Table.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Points_From_Table_H #define HEADER_INCLUDED__Points_From_Table_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoints_From_Table : public CSG_Module { public: CPoints_From_Table(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Conversion") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Points_From_Table_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/add_polygon_attributes.cpp000066400000000000000000000156501224124640700272270ustar00rootroot00000000000000/********************************************************** * Version $Id: add_polygon_attributes.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // add_polygon_attributes.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "add_polygon_attributes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CAdd_Polygon_Attributes::CAdd_Polygon_Attributes(void) { Set_Name (_TL("Add Polygon Attributes to Points")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "INPUT" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL , "OUTPUT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); CSG_Parameter *pNode = Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("Attribute to add. Select none to add all"), true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CAdd_Polygon_Attributes::On_Execute(void) { int inField, outField; CSG_Shapes *pInput, *pOutput, *pPolygons; //----------------------------------------------------- pInput = Parameters("INPUT") ->asShapes(); pOutput = Parameters("OUTPUT") ->asShapes(); pPolygons = Parameters("POLYGONS") ->asShapes(); inField = Parameters("FIELD") ->asInt(); //----------------------------------------------------- if( !pInput->is_Valid() ) { Message_Add(_TL("Invalid points layer.")); return( false ); } else if( !pPolygons->is_Valid() ) { Message_Add(_TL("Invalid polygon layer.")); return( false ); } //----------------------------------------------------- if( pOutput && pOutput != pInput ) { pOutput->Create(*pInput); } else { Parameters("RESULT")->Set_Value(pOutput = pInput); } pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), pPolygons->Get_Name())); //----------------------------------------------------- outField = pOutput->Get_Field_Count(); if( inField >= 0 && inField < pPolygons->Get_Field_Count() ) { // add single attribute pOutput->Add_Field(pPolygons->Get_Field_Name(inField), pPolygons->Get_Field_Type(inField)); } else { // add all attributes inField = -1; for(int iField=0; iFieldGet_Field_Count(); iField++) { pOutput->Add_Field(pPolygons->Get_Field_Name(iField), pPolygons->Get_Field_Type(iField)); } } //----------------------------------------------------- for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pOutput->Get_Count()); iPoint++) { CSG_Shape *pPoint = pOutput ->Get_Shape(iPoint); CSG_Shape *pPolygon = pPolygons ->Get_Shape(pPoint->Get_Point(0)); if( pPolygon ) { if( inField >= 0 ) { // add single attribute pPoint->Set_Value(outField, pPolygon->asString(inField)); } else { // add all attributes for(int iField=0; iFieldGet_Field_Count(); iField++) { switch( pPolygons->Get_Field_Type(iField) ) { case SG_DATATYPE_String: case SG_DATATYPE_Date: pPoint->Set_Value(outField + iField, pPolygon->asString(iField)); break; default: pPoint->Set_Value(outField + iField, pPolygon->asDouble(iField)); break; } } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/add_polygon_attributes.h000066400000000000000000000077631224124640700267020ustar00rootroot00000000000000/********************************************************** * Version $Id: add_polygon_attributes.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // add_polygon_attributes.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__add_polygon_attributes_H #define HEADER_INCLUDED__add_polygon_attributes_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CAdd_Polygon_Attributes : public CSG_Module { public: CAdd_Polygon_Attributes(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__add_polygon_attributes_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/convex_hull.cpp000066400000000000000000000405461224124640700250120ustar00rootroot00000000000000/********************************************************** * Version $Id: remove_duplicates.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // convex_hull.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "convex_hull.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CConvex_Hull::CConvex_Hull(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Convex Hull")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Implementation of 'Andrew's Monotone Chain Algorithm' for convex hull construction. " "\nReferences:\n" "Algorithmist (2011): Monotone Chain Convex Hull. algorithmist.com.\n" "Andrew, A.M. (1979): Another Efficient Algorithm for Convex Hulls in Two Dimensions. Info. Proc. Letters 9, pp.216-219.\n" "Sunday, D. (2001-2006): The Convex Hull of a 2D Point Set or Polygon. Softsurfer.com.\n" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Points"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "HULLS" , _TL("Convex Hull"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "BOXES" , _TL("Minimum Bounding Box"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon ); Parameters.Add_Choice( NULL , "POLYPOINTS" , _TL("Hull Construction"), _TL("This option does not apply to simple point layers."), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("one hull for all shapes"), _TL("one hull per shape"), _TL("one hull per shape part") ), 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CConvex_Hull::On_Execute(void) { CSG_Shapes *pShapes, *pHulls, *pBoxes; //----------------------------------------------------- pShapes = Parameters("SHAPES") ->asShapes(); pHulls = Parameters("HULLS") ->asShapes(); pBoxes = Parameters("BOXES") ->asShapes(); //----------------------------------------------------- pHulls->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("Convex Hull"))); pHulls->Add_Field(_TL("ID") , SG_DATATYPE_Int); pHulls->Add_Field(_TL("AREA") , SG_DATATYPE_Double); pHulls->Add_Field(_TL("PERIMETER") , SG_DATATYPE_Double); //----------------------------------------------------- int nOkay = 0; //----------------------------------------------------- if( pShapes->Get_Type() == SHAPE_TYPE_Point ) { nOkay = Get_Chain_Hull(pShapes, pHulls) ? 1 : 0; } //----------------------------------------------------- else { CSG_Shapes Points(SHAPE_TYPE_Point); int Construction = Parameters("POLYPOINTS")->asInt(); for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { Points.Add_Shape()->Add_Point(pShape->Get_Point(iPoint, iPart)); } if( Construction == 2 ) // one hull per shape part { if( Get_Chain_Hull(&Points, pHulls) ) nOkay++; Points.Del_Records(); } } if( Construction == 1 ) // one hull per shape { if( Get_Chain_Hull(&Points, pHulls) ) nOkay++; Points.Del_Records(); } } if( Construction == 0 ) // one hull for all shapes { if( Get_Chain_Hull(&Points, pHulls) ) nOkay++; Points.Del_Records(); } } if( nOkay <= 0 ) { return( false ); } //----------------------------------------------------- if( pBoxes ) { pBoxes->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("Bounding Box"))); pBoxes->Add_Field(_TL("ID") , SG_DATATYPE_Int); pBoxes->Add_Field(_TL("AREA") , SG_DATATYPE_Double); pBoxes->Add_Field(_TL("PERIMETER") , SG_DATATYPE_Double); for(int iHull=0; iHullGet_Count() && Set_Progress(iHull, pHulls->Get_Count()); iHull++) { Get_Bounding_Box(pHulls->Get_Shape(iHull), pBoxes->Add_Shape()); } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CConvex_Hull::Get_Bounding_Box(CSG_Shape *pHull, CSG_Shape *pBox) { int i, iBox; double a, aBox, d, dBox, dSin, dCos; TSG_Rect r, rBox; TSG_Point A, B; B = pHull->Get_Point(pHull->Get_Point_Count() - 1); for(i=0; iGet_Point_Count(); i++) { A = B; B = pHull->Get_Point(i); d = SG_Get_Angle_Of_Direction(A, B); dSin = sin(-d); dCos = cos(-d); for(int j=0; jGet_Point_Count(); j++) { TSG_Point q, p = pHull->Get_Point(j); q.x = p.x * dCos - p.y * dSin; q.y = p.x * dSin + p.y * dCos; if( j == 0 ) { r.xMin = r.xMax = q.x; r.yMin = r.yMax = q.y; } else { if( r.xMin > q.x ) r.xMin = q.x; else if( r.xMax < q.x ) r.xMax = q.x; if( r.yMin > q.y ) r.yMin = q.y; else if( r.yMax < q.y ) r.yMax = q.y; } } a = (r.xMax - r.xMin) * (r.yMax - r.yMin); if( i == 0 || a < aBox ) { iBox = i; aBox = a; dBox = d; rBox = r; } } //----------------------------------------------------- dSin = sin(dBox); dCos = cos(dBox); pBox->Add_Point(rBox.xMin * dCos - rBox.yMin * dSin, rBox.xMin * dSin + rBox.yMin * dCos); pBox->Add_Point(rBox.xMin * dCos - rBox.yMax * dSin, rBox.xMin * dSin + rBox.yMax * dCos); pBox->Add_Point(rBox.xMax * dCos - rBox.yMax * dSin, rBox.xMax * dSin + rBox.yMax * dCos); pBox->Add_Point(rBox.xMax * dCos - rBox.yMin * dSin, rBox.xMax * dSin + rBox.yMin * dCos); pBox->Add_Point(pBox->Get_Point(0)); pBox->Set_Value(0, pBox->Get_Index()); pBox->Set_Value(1, aBox); pBox->Set_Value(2, 2.0 * ((rBox.xMax - rBox.xMin) + (rBox.yMax - rBox.yMin))); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CConvex_Hull::Get_Chain_Hull(CSG_Shapes *pPoints, CSG_Shapes *pHulls) { int i, n; CSG_Points Points, Hull; //----------------------------------------------------- if( pPoints->Get_Count() < 3 ) { return( false ); } //----------------------------------------------------- m_pPoints = pPoints; CSG_Index Index(m_pPoints->Get_Count(), (TSG_PFNC_Compare)CConvex_Hull::Compare); m_pPoints = NULL; if( !Index.is_Okay() ) { return( false ); } for(i=0; iGet_Count(); i++) { Points.Add(pPoints->Get_Shape(Index[i])->Get_Point(0)); } //----------------------------------------------------- if( (n = Get_Chain_Hull(Points, Hull)) < 3 ) { return( false ); } //----------------------------------------------------- CSG_Shape *pHull = pHulls->Add_Shape(); for(i=0; iAdd_Point(Hull[i]); } pHull->Set_Value(0, pHull->Get_Index()); pHull->Set_Value(1, ((CSG_Shape_Polygon *)pHull)->Get_Area()); pHull->Set_Value(2, ((CSG_Shape_Polygon *)pHull)->Get_Perimeter()); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Shapes * CConvex_Hull::m_pPoints = NULL; //--------------------------------------------------------- int CConvex_Hull::Compare(const int iElement_1, const int iElement_2) { TSG_Point a = m_pPoints->Get_Shape(iElement_1)->Get_Point(0); TSG_Point b = m_pPoints->Get_Shape(iElement_2)->Get_Point(0); if( a.x < b.x ) { return( -1 ); } if( a.x > b.x ) { return( 1 ); } if( a.y < b.y ) { return( -1 ); } if( a.y > b.y ) { return( 1 ); } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // Copyright 2001, softSurfer (www.softsurfer.com) // This code may be freely used and modified for any purpose // providing that this copyright notice is included with it. // SoftSurfer makes no warranty for this code, and cannot be held // liable for any real or imagined damage resulting from its use. // Users of this code must verify correctness for their application. //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // is_Left(): tests if a point is Left|On|Right of an infinite line. // Input: three points Line_A, Line_B, and Point // Return: >0 for Point left of the line through P0 and P1 // =0 for Point on the line // <0 for Point right of the line // See: the January 2001 Algorithm on Area of Triangles //--------------------------------------------------------- inline double CConvex_Hull::is_Left(const TSG_Point &Line_A, const TSG_Point &Line_B, const TSG_Point &Point) { return( (Line_B.x - Line_A.x) * (Point.y - Line_A.y) - (Point.x - Line_A.x) * (Line_B.y - Line_A.y) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // chainHull_2D(): Andrew's monotone chain 2D convex hull algorithm // Input: P[] = an array of 2D points // presorted by increasing x- and y-coordinates // n = the number of points in P[] // Output: H[] = an array of the convex hull vertices (max is n) // Return: the number of points in H[] //--------------------------------------------------------- int CConvex_Hull::Get_Chain_Hull(CSG_Points &P, CSG_Points &H) { int i, n, bot, top, minmin, minmax, maxmin, maxmax; double xmin, xmax; //----------------------------------------------------- // the output array H[] will be used as the stack n = P.Get_Count(); H.Set_Count(2 * n); bot = 0; // index for bottom of the stack top = -1; // index for top of the stack //----------------------------------------------------- // Get the indices of points with min x-coord and min|max y-coord minmin = 0; xmin = P[0].x; for(i=1; i=0; i--) { if( P[i].x != xmax ) { break; } } maxmin = i + 1; //----------------------------------------------------- // Compute the lower hull on the stack H H[++top] = P[minmin]; // push minmin point onto stack i = minmax; while( ++i <= maxmin && Process_Get_Okay() ) { // the lower line joins P[minmin] with P[maxmin] if( is_Left(P[minmin], P[maxmin], P[i]) >= 0 && i < maxmin ) continue; // ignore P[i] above or on the lower line while( top > 0 ) // there are at least 2 points on the stack { // test if P[i] is left of the line at the stack top if( is_Left(H[top-1], H[top], P[i]) > 0 ) break; // P[i] is a new hull vertex else top--; // pop top point off stack } H[++top] = P[i]; // push P[i] onto stack } //----------------------------------------------------- // Next, compute the upper hull on the stack H above the bottom hull if( maxmax != maxmin ) // if distinct xmax points { H[++top] = P[maxmax]; // push maxmax point onto stack } bot = top; // the bottom point of the upper hull stack i = maxmin; while( --i >= minmax && Process_Get_Okay() ) { // the upper line joins P[maxmax] with P[minmax] if( is_Left(P[maxmax], P[minmax], P[i]) >= 0 && i > minmax ) continue; // ignore P[i] below or on the upper line while( top > bot ) // at least 2 points on the upper stack { // test if P[i] is left of the line at the stack top if( is_Left(H[top-1], H[top], P[i]) > 0 ) break; // P[i] is a new hull vertex else top--; // pop top point off stack } H[++top] = P[i]; // push P[i] onto stack } if( minmax != minmin ) { H[++top] = P[minmin]; // push joining endpoint onto stack } return( top + 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/convex_hull.h000066400000000000000000000106331224124640700244510ustar00rootroot00000000000000/********************************************************** * Version $Id: points_filter.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // convex_hull.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__convex_hull_H #define HEADER_INCLUDED__convex_hull_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CConvex_Hull : public CSG_Module { public: CConvex_Hull(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Tools") ); } protected: virtual bool On_Execute (void); private: static CSG_Shapes *m_pPoints; static int Compare (const int iElement_1, const int iElement_2); double is_Left (const TSG_Point &Line_A, const TSG_Point &Line_B, const TSG_Point &Point); bool Get_Chain_Hull (CSG_Shapes *pPoints, CSG_Shapes *pHulls); int Get_Chain_Hull (CSG_Points &P, CSG_Points &H); bool Get_Bounding_Box (CSG_Shape *pHull, CSG_Shape *pBox); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__convex_hull_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/gps_track_aggregation.cpp000066400000000000000000000355531224124640700270120ustar00rootroot00000000000000/********************************************************** * Version $Id: gps_track_aggregation.cpp 911 2011-11-11 11:11:11Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // gps_track_aggregation.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gps_track_aggregation.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { AGG_ID = 0, AGG_TRACK, AGG_DATE, AGG_TIME, AGG_PARM, AGG_MIN, AGG_MAX, AGG_RANGE, AGG_STDDEV, AGG_COUNT, AGG_DROPPED, AGG_DTIME, AGG_X, AGG_Y }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGPS_Track_Aggregation::CGPS_Track_Aggregation(void) { CSG_Parameter *pNode; //----------------------------------------------------- // 1. Info... Set_Name (_TL("Aggregate Point Observations")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "" )); //----------------------------------------------------- // 2. Parameters... pNode = Parameters.Add_Shapes( NULL , "REFERENCE" , _TL("Reference Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "REFERENCE_ID" , _TL("ID"), _TL("") ); pNode = Parameters.Add_Table( NULL , "OBSERVATIONS" , _TL("Observations"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "X" , _TL("X"), _TL("") ); Parameters.Add_Table_Field( pNode , "Y" , _TL("Y"), _TL("") ); Parameters.Add_Table_Field( pNode , "TRACK" , _TL("Track"), _TL("") ); Parameters.Add_Table_Field( pNode , "DATE" , _TL("Date"), _TL("") ); Parameters.Add_Table_Field( pNode , "TIME" , _TL("Time"), _TL("expected to be the second of day") ); Parameters.Add_Table_Field( pNode , "PARAMETER" , _TL("Parameter"), _TL("") ); Parameters.Add_Table( NULL , "AGGREGATED" , _TL("Aggregated"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "TIME_SPAN" , _TL("Time Span Aggregation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("ignore"), _TL("floating"), _TL("fixed") ), 1 ); Parameters.Add_Value( NULL , "FIX_TIME" , _TL("Fixed Time Span (minutes)"), _TL("ignored if set to zero"), PARAMETER_TYPE_Double, 20.0, 0.0, true ); Parameters.Add_Value( NULL , "OFF_TIME" , _TL("Fixed Time Span Offset (minutes)"), _TL("offset in minutes relative to 00:00 (midnight)"), PARAMETER_TYPE_Double, -10.0 ); Parameters.Add_Value( NULL , "EPS_TIME" , _TL("Maximum Time Span (Seconds)"), _TL("ignored if set to zero"), PARAMETER_TYPE_Double, 60.0, 0.0, true ); Parameters.Add_Value( NULL , "EPS_SPACE" , _TL("Maximum Distance"), _TL("given as map units or meters if polar coordinates switch is on; ignored if set to zero"), PARAMETER_TYPE_Double, 100.0, 0.0, true ); Parameters.Add_Value( NULL , "VERBOSE" , _TL("Verbose"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "POLAR" , _TL("Polar Coordinates"), _TL(""), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGPS_Track_Aggregation::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TIME_SPAN")) ) { pParameters->Get_Parameter("FIX_TIME")->Set_Enabled(pParameter->asInt() == 2); pParameters->Get_Parameter("OFF_TIME")->Set_Enabled(pParameter->asInt() == 2); pParameters->Get_Parameter("EPS_TIME")->Set_Enabled(pParameter->asInt() == 1); } return( -1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGPS_Track_Aggregation::On_Execute(void) { bool bVerbose, bPolar; int Time_Span, fRefID, fX, fY, fTrack, fDate, fTime, fParameter, Observation, iDropped, nDropped; double eps_Space, eps_Time, off_Time, iTime; TSG_Point Position; CSG_String iTrack, iDate; CSG_Table_Record *pAggregate, *pObservation; CSG_Shape *pReference, *pNearest; CSG_Simple_Statistics Statistic, Time; CSG_Table *pObservations, *pAggregated, Observations; CSG_Shapes_Search Reference; //----------------------------------------------------- pObservations = Parameters("OBSERVATIONS") ->asTable (); pAggregated = Parameters("AGGREGATED") ->asTable (); fRefID = Parameters("REFERENCE_ID") ->asInt (); fX = Parameters("X") ->asInt (); fY = Parameters("Y") ->asInt (); fTrack = Parameters("TRACK") ->asInt (); fDate = Parameters("DATE") ->asInt (); fTime = Parameters("TIME") ->asInt (); fParameter = Parameters("PARAMETER") ->asInt (); Time_Span = Parameters("TIME_SPAN") ->asInt (); eps_Space = Parameters("EPS_SPACE") ->asDouble(); off_Time = Parameters("OFF_TIME") ->asDouble() * 60.0; bVerbose = Parameters("VERBOSE") ->asBool (); bPolar = Parameters("POLAR") ->asBool (); switch( Time_Span ) { default: eps_Time = 0.0; break; case 1: eps_Time = Parameters("EPS_TIME")->asDouble(); break; case 2: eps_Time = Parameters("FIX_TIME")->asDouble() * 60.0; break; } if( eps_Time <= 0.0 ) { Time_Span = 0; } //----------------------------------------------------- if( !Reference.Create(Parameters("REFERENCE")->asShapes()) ) { Error_Set(_TL("could not initialize reference point search engine")); return( false ); } //----------------------------------------------------- if( Time_Span == 2 ) // pre-processing for 'fix' time span { Observations.Create(*pObservations); Observations.Add_Field(SG_T("REF_ID"), SG_DATATYPE_String); fTrack = pObservations->Get_Field_Count(); pObservations = &Observations; for(Observation=0; ObservationGet_Count() && Set_Progress(Observation, pObservations->Get_Count()); Observation++) { pObservation = pObservations->Get_Record(Observation); pNearest = Reference.Get_Point_Nearest(pObservation->asDouble(fX), pObservation->asDouble(fY)); pObservation ->Set_Value(fTrack, pNearest->asString(fRefID)); } } //----------------------------------------------------- if( !pObservations->Set_Index(fTrack, TABLE_INDEX_Ascending, fDate, TABLE_INDEX_Ascending, fTime, TABLE_INDEX_Ascending) ) { Error_Set(_TL("could not create index on observations")); return( false ); } //----------------------------------------------------- pAggregated->Destroy(); pAggregated->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pObservations->Get_Name(), _TL("aggregated"))); pAggregated->Add_Field(SG_T("REFID") , SG_DATATYPE_String); // AGG_ID pAggregated->Add_Field(SG_T("TRACK") , SG_DATATYPE_String); // AGG_TRACK pAggregated->Add_Field(SG_T("DATE") , SG_DATATYPE_String); // AGG_DATE pAggregated->Add_Field(SG_T("TIME") , SG_DATATYPE_String); // AGG_TIME pAggregated->Add_Field(pObservations->Get_Field_Name(fParameter), SG_DATATYPE_Double); // AGG_PARM if( bVerbose ) { pAggregated->Add_Field(SG_T("MIN") , SG_DATATYPE_Double); // AGG_MIN, pAggregated->Add_Field(SG_T("MAX") , SG_DATATYPE_Double); // AGG_MAX pAggregated->Add_Field(SG_T("RANGE") , SG_DATATYPE_Double); // AGG_RANGE pAggregated->Add_Field(SG_T("STDDEV") , SG_DATATYPE_Double); // AGG_STDDEV, pAggregated->Add_Field(SG_T("COUNT") , SG_DATATYPE_Int ); // AGG_COUNT, pAggregated->Add_Field(SG_T("DROPPED") , SG_DATATYPE_Int ); // AGG_DROPPED, pAggregated->Add_Field(SG_T("DTIME") , SG_DATATYPE_Double); // AGG_DTIME, pAggregated->Add_Field(SG_T("X") , SG_DATATYPE_Double); // AGG_X pAggregated->Add_Field(SG_T("Y") , SG_DATATYPE_Double); // AGG_Y } //----------------------------------------------------- pAggregate = NULL; nDropped = 0; iDropped = 0; //----------------------------------------------------- for(Observation=0; ObservationGet_Count() && Set_Progress(Observation, pObservations->Get_Count()); Observation++) { pObservation = pObservations->Get_Record_byIndex(Observation); if( !pAggregate || iTrack.Cmp(pObservation->asString(fTrack)) || iDate .Cmp(pObservation->asString(fDate )) || (eps_Time > 0.0 && eps_Time <= pObservation->asDouble(fTime) - iTime) ) { pReference = NULL; } Position.x = pObservation->asDouble(fX); Position.y = pObservation->asDouble(fY); pNearest = Reference.Get_Point_Nearest(Position.x, Position.y); if( eps_Space > 0.0 && eps_Space <= (bPolar ? SG_Get_Distance_Polar(Position, pNearest->Get_Point(0)) : SG_Get_Distance(Position, pNearest->Get_Point(0))) ) { nDropped++; iDropped++; } else { if( pReference != pNearest ) { Set_Statistic(pAggregate, Statistic, Time, iDropped, bVerbose); Statistic .Invalidate(); Time .Invalidate(); iDropped = 0; iTrack = pObservation->asString(fTrack); iDate = pObservation->asString(fDate ); switch( Time_Span ) { default: iTime = 0.0; break; case 1: iTime = pObservation->asDouble(fTime); break; case 2: iTime = (int)(pObservation->asDouble(fTime) / eps_Time) * eps_Time - off_Time; break; } pReference = pNearest; pAggregate = pAggregated->Add_Record(); pAggregate ->Set_Value(AGG_ID , pReference->asString(fRefID)); pAggregate ->Set_Value(AGG_TRACK, iTrack); pAggregate ->Set_Value(AGG_DATE , iDate ); if( bVerbose ) { pAggregate ->Set_Value(AGG_X, pReference->Get_Point(0).x); pAggregate ->Set_Value(AGG_Y, pReference->Get_Point(0).y); } } Statistic += pObservation->asDouble(fParameter); Time += pObservation->asDouble(fTime ); } } Set_Statistic(pAggregate, Statistic, Time, iDropped, bVerbose); //----------------------------------------------------- if( nDropped > 0 ) { Message_Add(CSG_String::Format(SG_T("%s: %d"), _TL("number of dropped observations"), nDropped)); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGPS_Track_Aggregation::Set_Statistic(CSG_Table_Record *pAggregate, CSG_Simple_Statistics &Statistic, CSG_Simple_Statistics &Time, int nDropped, bool bVerbose) { if( pAggregate ) { pAggregate ->Set_Value(AGG_PARM , Statistic.Get_Mean()); pAggregate ->Set_Value(AGG_TIME , Time .Get_Mean()); if( bVerbose ) { pAggregate ->Set_Value(AGG_MIN , Statistic.Get_Minimum()); pAggregate ->Set_Value(AGG_MAX , Statistic.Get_Maximum()); pAggregate ->Set_Value(AGG_RANGE , Statistic.Get_Range ()); pAggregate ->Set_Value(AGG_STDDEV , Statistic.Get_StdDev ()); pAggregate ->Set_Value(AGG_COUNT , Statistic.Get_Count ()); pAggregate ->Set_Value(AGG_DTIME , Time .Get_Range ()); pAggregate ->Set_Value(AGG_DROPPED, nDropped); } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/gps_track_aggregation.h000066400000000000000000000113161224124640700264460ustar00rootroot00000000000000/********************************************************** * Version $Id: gps_track_aggregation.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // gps_track_aggregation.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gps_track_aggregation_H #define HEADER_INCLUDED__gps_track_aggregation_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGPS_Track_Aggregation : public CSG_Module { public: CGPS_Track_Aggregation(void); // virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: bool Set_Statistic (CSG_Table_Record *pAggregate, CSG_Simple_Statistics &Statistic, CSG_Simple_Statistics &Time, int nDropped, bool bVerbose); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gps_track_aggregation_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/points_filter.cpp000066400000000000000000000251151224124640700253400ustar00rootroot00000000000000/********************************************************** * Version $Id: remove_duplicates.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // points_filter.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "points_filter.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoints_Filter::CPoints_Filter(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Points Filter")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("") ); Parameters.Add_Shapes( NULL , "FILTER" , _TL("Filtered Points"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); Parameters.Add_Value( NULL , "RADIUS" , _TL("Radius"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); Parameters.Add_Value( NULL , "MINNUM" , _TL("Minimum Number of Points"), _TL("only points with given minimum number of points in search radius will be processed"), PARAMETER_TYPE_Int, 0, 0.0, true ); Parameters.Add_Value( NULL , "MAXNUM" , _TL("Maximum Number of Points"), _TL("Number of nearest points, which will be evaluated for filtering. Set to zero to investigate all points in search radius."), PARAMETER_TYPE_Int, 0, 0.0, true ); Parameters.Add_Value( NULL , "QUADRANTS" , _TL("Quadrants"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Filter Criterion"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"), _TL("keep maxima (with tolerance)"), _TL("keep minima (with tolerance)"), _TL("remove maxima (with tolerance)"), _TL("remove minima (with tolerance)"), _TL("remove below percentile"), _TL("remove above percentile") ), 0 ); Parameters.Add_Value( NULL , "TOLERANCE" , _TL("Tolerance"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true ); Parameters.Add_Value( NULL , "PERCENT" , _TL("Percentile"), _TL(""), PARAMETER_TYPE_Double, 50.0, 0.0, true, 100.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoints_Filter::On_Execute(void) { bool bQuadrants; int zField; CSG_Shapes *pPoints, *pFilter; //----------------------------------------------------- pPoints = Parameters("POINTS") ->asShapes(); pFilter = Parameters("FILTER") ->asShapes(); zField = Parameters("FIELD") ->asInt(); bQuadrants = Parameters("QUADRANTS") ->asBool(); m_Method = Parameters("METHOD") ->asInt(); m_nMinPoints = Parameters("MINNUM") ->asInt(); m_nMaxPoints = Parameters("MAXNUM") ->asInt(); m_Radius = Parameters("RADIUS") ->asDouble(); m_Tolerance = Parameters("TOLERANCE") ->asDouble(); m_Percentile = Parameters("PERCENT") ->asDouble(); //----------------------------------------------------- if( !pPoints->is_Valid() ) { Error_Set(_TL("invalid points layer")); return( false ); } if( pPoints->Get_Count() <= 0 ) { Error_Set(_TL("no points in layer")); return( false ); } if( !m_Search.Create(pPoints, zField) ) { Error_Set(_TL("failed to initialise search engine")); return( false ); } //----------------------------------------------------- if( pFilter ) { pFilter->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Filtered")), pPoints); } else { pPoints->Select(); } //----------------------------------------------------- int nFiltered = 0; for(int i=0; iGet_Count() && Set_Progress(i, pPoints->Get_Count()); i++) { CSG_Shape *pPoint = pPoints->Get_Shape(i); if( pPoint ) { bool bFilter = bQuadrants ? Do_Filter(pPoint->Get_Point(0), pPoint->asDouble(zField), 0) || Do_Filter(pPoint->Get_Point(0), pPoint->asDouble(zField), 1) || Do_Filter(pPoint->Get_Point(0), pPoint->asDouble(zField), 2) || Do_Filter(pPoint->Get_Point(0), pPoint->asDouble(zField), 3) : Do_Filter(pPoint->Get_Point(0), pPoint->asDouble(zField)); if( bFilter ) { nFiltered++; if( !pFilter ) { pPoints->Select(i, true); } } else if( pFilter ) { pFilter->Add_Shape(pPoint); } } } //----------------------------------------------------- if( !pFilter ) { pPoints->Del_Selection(); DataObject_Update(pPoints); } Message_Add(CSG_String::Format(SG_T("%d %s"), nFiltered, _TL("points have been filtered"))); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoints_Filter::Do_Filter(TSG_Point Point, double zPoint, int Quadrant) { if( !m_Search.Select_Nearest_Points(Point.x, Point.y, m_nMaxPoints, m_Radius, Quadrant) ) { return( false ); } if( m_Search.Get_Selected_Count() <= m_nMinPoints ) { return( true ); } switch( m_Method ) { //----------------------------------------------------- case 0: // keep maxima case 1: // keep minima case 2: // remove maxima case 3: // remove minima { for(int i=0; ihas_Statistics() ) { switch( m_Method ) { case 0: z = ((CSG_PRQuadTree_Leaf_List *)pLeaf)->Get_Maximum(); break; // keep maxima case 1: z = ((CSG_PRQuadTree_Leaf_List *)pLeaf)->Get_Minimum(); break; // keep minima case 2: z = ((CSG_PRQuadTree_Leaf_List *)pLeaf)->Get_Maximum(); break; // remove maxima case 3: z = ((CSG_PRQuadTree_Leaf_List *)pLeaf)->Get_Minimum(); break; // remove minima } } else { z = pLeaf->Get_Z(); } switch( m_Method ) { case 0: if( zPoint < (z - m_Tolerance) ) return( true ); break; // keep maxima case 1: if( zPoint > (z + m_Tolerance) ) return( true ); break; // keep minima case 2: if( zPoint < (z - m_Tolerance) ) return( false ); break; // remove maxima case 3: if( zPoint > (z + m_Tolerance) ) return( false ); break; // remove minima } } } return( m_Method <= 1 ? false : true ); } //----------------------------------------------------- case 4: // remove below percentile case 5: // remove above percentile { double n = 0.0; for(int i=0; ihas_Statistics() ) { for(int j=0; j<((CSG_PRQuadTree_Leaf_List *)pLeaf)->Get_Count(); j++) { if( zPoint > ((CSG_PRQuadTree_Leaf_List *)pLeaf)->Get_Value(j) ) { n++; } } } else if( zPoint > pLeaf->Get_Z() ) { n++; } } } n *= 100.0 / m_Search.Get_Selected_Count(); return( m_Method == 4 ? n < m_Percentile : n > m_Percentile ); } } //----------------------------------------------------- return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/points_filter.h000066400000000000000000000102211224124640700247750ustar00rootroot00000000000000/********************************************************** * Version $Id: points_filter.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // points_filter.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__points_filter_H #define HEADER_INCLUDED__points_filter_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoints_Filter : public CSG_Module { public: CPoints_Filter(void); protected: virtual bool On_Execute (void); private: int m_Method, m_nMinPoints, m_nMaxPoints; double m_Radius, m_Tolerance, m_Percentile; CSG_PRQuadTree m_Search; bool Do_Filter (TSG_Point Point, double zPoint, int Quadrant = -1); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__points_filter_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/points_thinning.cpp000066400000000000000000000226151224124640700256730ustar00rootroot00000000000000/********************************************************** * Version $Id: points_thinning.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // points_thinning.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "points_thinning.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoints_Thinning::CPoints_Thinning(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Points Thinning")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("") ); Parameters.Add_Shapes( NULL , "THINNED" , _TL("Thinned Points"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Value( NULL , "RESOLUTION" , _TL("Resolution"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoints_Thinning::On_Execute(void) { int Field; CSG_Shapes *pPoints; //----------------------------------------------------- pPoints = Parameters("POINTS") ->asShapes(); Field = Parameters("FIELD") ->asInt(); m_pPoints = Parameters("THINNED") ->asShapes(); m_Resolution = Parameters("RESOLUTION") ->asDouble(); //----------------------------------------------------- if( m_Resolution <= 0.0 ) { Error_Set(_TL("resolution has to be greater than zero")); return( false ); } if( !pPoints->is_Valid() ) { Error_Set(_TL("invalid points layer")); return( false ); } if( pPoints->Get_Count() < 2 ) { Error_Set(_TL("not more than one point in layer")); return( false ); } if( !Set_Search_Engine(pPoints, Field) ) { Error_Set(_TL("failed to initialise search engine")); return( false ); } //----------------------------------------------------- m_pPoints->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), pPoints->Get_Field_Name(Field))); m_pPoints->Add_Field(_TL("Count") , SG_DATATYPE_Int); m_pPoints->Add_Field(_TL("Mean") , SG_DATATYPE_Double); m_pPoints->Add_Field(_TL("Minimun") , SG_DATATYPE_Double); m_pPoints->Add_Field(_TL("Maximun") , SG_DATATYPE_Double); m_pPoints->Add_Field(_TL("StdDev") , SG_DATATYPE_Double); pPoints->Select(); //----------------------------------------------------- Get_Points(m_Search.Get_Root_Pointer()); //----------------------------------------------------- if( m_pPoints->Get_Count() == pPoints->Get_Count() ) { Message_Add(_TL("no points removed")); } else { Message_Add(CSG_String::Format(SG_T("%d %s"), pPoints->Get_Count() - m_pPoints->Get_Count(), _TL("no points removed"))); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoints_Thinning::Set_Search_Engine(CSG_Shapes *pPoints, int Field) { CSG_Rect r(pPoints->Get_Extent()); r.Assign( r.Get_XCenter() - 0.5 * m_Resolution, r.Get_YCenter() - 0.5 * m_Resolution, r.Get_XCenter() + 0.5 * m_Resolution, r.Get_YCenter() + 0.5 * m_Resolution ); while( r.Intersects(pPoints->Get_Extent()) != INTERSECTION_Contains ) { r.Inflate(200.0); } if( !m_Search.Create(r, true) ) { return( false ); } for(int i=0; iGet_Count() && Set_Progress(i, pPoints->Get_Count()); i++) { CSG_Shape *pPoint = pPoints->Get_Shape(i); m_Search.Add_Point( pPoint->Get_Point(0).x, pPoint->Get_Point(0).y, pPoint->asDouble(Field) ); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPoints_Thinning::Get_Points(CSG_PRQuadTree_Item *pItem) { if( pItem ) { if( pItem->is_Leaf() ) { Add_Point(pItem->asLeaf()); } else if( pItem->Get_Size() <= m_Resolution ) { Add_Point((CSG_PRQuadTree_Node_Statistics *)pItem); } else { for(int i=0; i<4; i++) { Get_Points(pItem->asNode()->Get_Child(i)); } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPoints_Thinning::Add_Point(CSG_PRQuadTree_Leaf *pLeaf) { CSG_Shape *pPoint = m_pPoints->Add_Shape(); pPoint->Add_Point(pLeaf->Get_X(), pLeaf->Get_Y()); if( pLeaf->has_Statistics() ) { CSG_PRQuadTree_Leaf_List *pList = (CSG_PRQuadTree_Leaf_List *)pLeaf; pPoint->Set_Value(0, pList->Get_Count()); // Count pPoint->Set_Value(1, pList->Get_Mean()); // Mean pPoint->Set_Value(2, pList->Get_Minimum()); // Minimun pPoint->Set_Value(3, pList->Get_Maximum()); // Maximun pPoint->Set_Value(4, pList->Get_StdDev()); // StdDev } else { pPoint->Set_Value(0, 1); // Count pPoint->Set_Value(1, pLeaf->Get_Z()); // Mean pPoint->Set_Value(2, pLeaf->Get_Z()); // Minimun pPoint->Set_Value(3, pLeaf->Get_Z()); // Maximun pPoint->Set_Value(4, 0.0); // StdDev } } //--------------------------------------------------------- void CPoints_Thinning::Add_Point(CSG_PRQuadTree_Node_Statistics *pNode) { CSG_Shape *pPoint = m_pPoints->Add_Shape(); pPoint->Add_Point(pNode->Get_X()->Get_Mean(), pNode->Get_Y()->Get_Mean()); pPoint->Set_Value(0, pNode->Get_Z()->Get_Count()); // Count pPoint->Set_Value(1, pNode->Get_Z()->Get_Mean()); // Mean pPoint->Set_Value(2, pNode->Get_Z()->Get_Minimum()); // Minimun pPoint->Set_Value(3, pNode->Get_Z()->Get_Maximum()); // Maximun pPoint->Set_Value(4, pNode->Get_Z()->Get_StdDev()); // StdDev } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/points_thinning.h000066400000000000000000000104621224124640700253350ustar00rootroot00000000000000/********************************************************** * Version $Id: points_thinning.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // points_thinning.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__points_thinning_H #define HEADER_INCLUDED__points_thinning_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoints_Thinning : public CSG_Module { public: CPoints_Thinning(void); protected: virtual bool On_Execute (void); private: double m_Resolution; CSG_PRQuadTree m_Search; CSG_Shapes *m_pPoints; bool Set_Search_Engine (CSG_Shapes *pPoints, int Field); void Get_Points (CSG_PRQuadTree_Item *pItem); void Add_Point (CSG_PRQuadTree_Leaf *pLeaf); void Add_Point (CSG_PRQuadTree_Node_Statistics *pNode); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__points_thinning_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/remove_duplicates.cpp000066400000000000000000000235441224124640700261750ustar00rootroot00000000000000/********************************************************** * Version $Id: remove_duplicates.cpp 1047 2011-05-05 16:13:56Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // Remove_Duplicates.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "remove_duplicates.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CRemove_Duplicates::CRemove_Duplicates(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Remove Duplicate Points")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("") ); Parameters.Add_Shapes( NULL , "RESULT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Point to Keep"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("first point"), _TL("last point"), _TL("point with minimum attribute value"), _TL("point with maximum attribute value") ), 0 ); Parameters.Add_Choice( NULL , "NUMERIC" , _TL("Numeric Attribute Values"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("take value from the point to be kept"), _TL("minimum value of all duplicates"), _TL("maximum value of all duplicates"), _TL("mean value of all duplicates") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CRemove_Duplicates::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { //----------------------------------------------------- if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) ) { pParameters->Get_Parameter("FIELD")->Set_Enabled(pParameter->asInt() >= 2); } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CRemove_Duplicates::On_Execute(void) { CSG_PRQuadTree Search; //----------------------------------------------------- m_pPoints = Parameters("RESULT") ->asShapes(); m_Field = Parameters("FIELD") ->asInt(); m_Method = Parameters("METHOD") ->asInt(); m_Numeric = Parameters("NUMERIC") ->asInt(); //----------------------------------------------------- if( m_pPoints == NULL ) { m_pPoints = Parameters("POINTS")->asShapes(); } else if( m_pPoints != Parameters("POINTS")->asShapes() ) { m_pPoints ->Assign(Parameters("POINTS")->asShapes()); } //----------------------------------------------------- if( !m_pPoints->is_Valid() ) { Error_Set(_TL("invalid points layer")); return( false ); } if( m_pPoints->Get_Count() <= 0 ) { Error_Set(_TL("no points in layer")); return( false ); } if( !Search.Create(m_pPoints, -1) ) { Error_Set(_TL("failed to initialise search engine")); return( false ); } //----------------------------------------------------- m_pPoints->Add_Field(_TL("Duplicates"), SG_DATATYPE_Int); m_pPoints->Select(); for(int i=0; iGet_Count() && Set_Progress(i, m_pPoints->Get_Count()); i++) { CSG_Shape *pPoint = m_pPoints->Get_Shape(i); if( !pPoint->is_Selected() ) { double Distance; CSG_PRQuadTree_Leaf *pLeaf = Search.Get_Nearest_Leaf(pPoint->Get_Point(0), Distance); if( Distance == 0.0 && pLeaf && pLeaf->has_Statistics() ) { Set_Attributes(pPoint, (CSG_PRQuadTree_Leaf_List *)pLeaf); } } } //----------------------------------------------------- if( m_pPoints->Get_Selection_Count() == 0 ) { Message_Add(_TL("No duplicates found.")); } else { Message_Add(CSG_String::Format(SG_T("%d %s"), m_pPoints->Get_Selection_Count(), _TL("duplicates have been identified."))); m_pPoints->Del_Selection(); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CRemove_Duplicates::Set_Attributes(CSG_Shape *pPoint, CSG_PRQuadTree_Leaf_List *pList) { int iDuplicate; double dKeep; CSG_Shape *pKeep; //----------------------------------------------------- for(iDuplicate=0, pKeep=NULL; iDuplicateGet_Count(); iDuplicate++) { CSG_Shape *pDuplicate = m_pPoints->Get_Shape((int)pList->Get_Value(iDuplicate)); if( pDuplicate != pPoint ) { m_pPoints->Select(pDuplicate->Get_Index(), true); } switch( m_Method ) { case 2: // point with minimum attribute value if( !pKeep || (!pDuplicate->is_NoData(m_Field) && pDuplicate->asDouble(m_Field) < dKeep) ) { dKeep = pDuplicate->asDouble(m_Field); pKeep = pDuplicate; } break; case 3: // point with maximum attribute value") if( !pKeep || (!pDuplicate->is_NoData(m_Field) && pDuplicate->asDouble(m_Field) > dKeep) ) { dKeep = pDuplicate->asDouble(m_Field); pKeep = pDuplicate; } break; } } //----------------------------------------------------- if( m_Method == 1 ) // last point { pKeep = m_pPoints->Get_Shape((int)pList->Get_Value(pList->Get_Count() - 1)); } if( pKeep ) { ((CSG_Table_Record *)pPoint)->Assign(pKeep); } pPoint->Set_Value(m_pPoints->Get_Field_Count() - 1, pList->Get_Count()); //----------------------------------------------------- if( m_Numeric > 0 ) { for(int iField=0; iFieldGet_Field_Count()-1; iField++) { if( SG_Data_Type_is_Numeric(m_pPoints->Get_Field_Type(iField)) ) { CSG_Simple_Statistics s; for(iDuplicate=0; iDuplicateGet_Count(); iDuplicate++) { CSG_Shape *pDuplicate = m_pPoints->Get_Shape((int)pList->Get_Value(iDuplicate)); if( !pDuplicate->is_NoData(iField) ) { s += m_pPoints->Get_Shape((int)pList->Get_Value(iDuplicate))->asDouble(iField); } } switch( m_Numeric ) { case 1: pPoint->Set_Value(iField, s.Get_Minimum()); break; // minimun value case 2: pPoint->Set_Value(iField, s.Get_Maximum()); break; // maximum value case 3: pPoint->Set_Value(iField, s.Get_Mean()); break; // mean value } } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/remove_duplicates.h000066400000000000000000000105241224124640700256340ustar00rootroot00000000000000/********************************************************** * Version $Id: remove_duplicates.h 1047 2011-05-05 16:13:56Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Remove_Duplicates.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Remove_Duplicates_H #define HEADER_INCLUDED__Remove_Duplicates_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CRemove_Duplicates : public CSG_Module { public: CRemove_Duplicates(void); protected: virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: int m_Field, m_Method, m_Numeric; CSG_Shapes *m_pPoints; void Set_Attributes (CSG_Shape *pPoint, CSG_PRQuadTree_Leaf_List *pList); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Remove_Duplicates_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/select_points.cpp000066400000000000000000000161351224124640700253340ustar00rootroot00000000000000 /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // select_points.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "select_points.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSelect_Points::CSelect_Points(void) { Set_Name (_TL("Select Points")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL , "SELECTION" , _TL("Selection"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Value( NULL , "RADIUS" , _TL("Radius"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); Parameters.Add_Value( NULL , "MAXNUM" , _TL("Maximum Number of Points"), _TL(""), PARAMETER_TYPE_Int, 0.0, 0.0, true ); Parameters.Add_Choice( NULL , "QUADRANT" , _TL("Quadrant"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("all quadrants"), _TL("1. quadrant (upper right)"), _TL("2. quadrant (lower right)"), _TL("3. quadrant (lower left)"), _TL("4. quadrant (upper left)") ), 0 ); Parameters.Add_Value( NULL , "ADDCENTER" , _TL("Add Center"), _TL(""), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSelect_Points::On_Execute(void) { //----------------------------------------------------- m_pPoints = Parameters("POINTS") ->asShapes(); m_pSelection = Parameters("SELECTION") ->asShapes(); m_Radius = Parameters("RADIUS") ->asDouble(); m_MaxPoints = Parameters("MAXNUM") ->asInt(); m_Quadrant = Parameters("QUADRANT") ->asInt() - 1; m_bAddCenter = Parameters("ADDCENTER") ->asBool(); //----------------------------------------------------- if( !m_pPoints->is_Valid() ) { Error_Set(_TL("invalid points layer")); return( false ); } if( m_pPoints->Get_Count() <= 0 ) { Error_Set(_TL("no points in layer")); return( false ); } if( !m_Search.Create(m_pPoints, -1) ) { Error_Set(_TL("failed to initialise search engine")); return( false ); } //----------------------------------------------------- m_pSelection->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_pPoints->Get_Name(), _TL("Selection")), m_pPoints); m_pSelection->Add_Field(_TL("Order") , SG_DATATYPE_Int); m_pSelection->Add_Field(_TL("Distance") , SG_DATATYPE_Double); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSelect_Points::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode) { switch( Mode ) { case MODULE_INTERACTIVE_LUP: m_pSelection->Del_Records(); if( m_bAddCenter ) { m_pSelection->Add_Shape()->Add_Point(ptWorld); } if( m_Search.Select_Nearest_Points(ptWorld.Get_X(), ptWorld.Get_Y(), m_MaxPoints, m_Radius, m_Quadrant) ) { for(int i=0; iAdd_Shape(m_pPoints->Get_Shape((int)m_Search.Get_Selected_Z(i))); pPoint->Set_Value(m_pSelection->Get_Field_Count() - 2, i + 1); pPoint->Set_Value(m_pSelection->Get_Field_Count() - 1, m_Search.Get_Selected_Distance(i)); } } DataObject_Update(m_pSelection); break; default: break; } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/select_points.h000066400000000000000000000103301224124640700247700ustar00rootroot00000000000000 /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // select_points.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__select_points_H #define HEADER_INCLUDED__select_points_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSelect_Points : public CSG_Module_Interactive { public: CSelect_Points(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Selection") ); } protected: virtual bool On_Execute (void); virtual bool On_Execute_Position (CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode); private: bool m_bAddCenter; int m_MaxPoints, m_Quadrant; double m_Radius; CSG_Shapes *m_pPoints, *m_pSelection; CSG_PRQuadTree m_Search; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__select_points_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/separate_by_direction.cpp000066400000000000000000000165411224124640700270200ustar00rootroot00000000000000/********************************************************** * Version $Id: separate_by_direction.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Tools // // // //-------------------------------------------------------// // // // separate_by_direction.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "separate_by_direction.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSeparate_by_Direction::CSeparate_by_Direction(void) { Set_Name (_TL("Separate points by direction")); Set_Author (SG_T("O. Conrad (c) 2008")); Set_Description (_TW( "Separates points by direction. Direction is determined as average direction of three consecutive points A, B, C. " "If the angle between the directions of A-B and B-C is higher than given tolerance angle the point is dropped. " "This module has been designed to separate GPS tracks recorded by tractors while preparing a field. " )); //----------------------------------------------------- Parameters.Add_Shapes_List( NULL , "OUTPUT" , _TL("Ouput"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Value( NULL , "DIRECTIONS" , _TL("Number of Directions"), _TL(""), PARAMETER_TYPE_Double , 4.0, 2.0, true ); Parameters.Add_Value( NULL , "TOLERANCE" , _TL("Tolerance (Degree)"), _TL(""), PARAMETER_TYPE_Double , 5.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSeparate_by_Direction::On_Execute(void) { int iSector, dir_Field; CSG_Shapes *pPoints; CSG_Parameter_Shapes_List *pOutput; //----------------------------------------------------- pOutput = Parameters("OUTPUT") ->asShapesList(); pPoints = Parameters("POINTS") ->asShapes(); m_Tolerance = Parameters("TOLERANCE") ->asDouble() * M_DEG_TO_RAD; m_nSectors = Parameters("DIRECTIONS") ->asInt(); m_dSector = M_PI_360 / m_nSectors; if( !pPoints || !pPoints->is_Valid() || pPoints->Get_Count() < 3 ) { return( false ); } //----------------------------------------------------- pOutput->Del_Items(); dir_Field = pPoints->Get_Field_Count(); for(iSector=0; iSectorAdd_Item(SG_Create_Shapes(SHAPE_TYPE_Point, CSG_String::Format(SG_T("Direction %.2f"), iSector * m_dSector * M_RAD_TO_DEG), pPoints)); pOutput->asShapes(iSector)->Add_Field(_TL("Direction"), SG_DATATYPE_Double); } //----------------------------------------------------- int iPoint; double dir_A, dir_B, dir, dif; CSG_Shape *pt_A, *pt_B; pt_B = pPoints->Get_Shape(pPoints->Get_Count() - 2); pt_A = pPoints->Get_Shape(pPoints->Get_Count() - 1); dir_A = SG_Get_Angle_Of_Direction(pt_B->Get_Point(0), pt_A->Get_Point(0)); for(iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { pt_B = pt_A; pt_A = pPoints->Get_Shape(iPoint); dir_B = dir_A; dir_A = SG_Get_Angle_Of_Direction(pt_B->Get_Point(0), pt_A->Get_Point(0)); dif = fmod(dir_A - dir_B, M_PI_360); if( dif > M_PI_180 ) { dif -= M_PI_360; } else if( dif < -M_PI_180 ) { dif += M_PI_360; } if( fabs(dif) <= m_Tolerance ) { dir = dir_B + 0.5 * dif; iSector = (int)(fmod(M_PI_360 + 0.5 * m_dSector + dir, M_PI_360) / m_dSector); if( iSector >= 0 && iSector < m_nSectors ) { pOutput->asShapes(iSector)->Add_Shape(pt_B)->Set_Value(dir_Field, dir * M_RAD_TO_DEG); } } } //----------------------------------------------------- for(iSector=pOutput->Get_Count()-1; iSector>=0; iSector--) { if( pOutput->asShapes(iSector)->Get_Count() == 0 ) { delete(pOutput->asShapes(iSector)); pOutput->Del_Item(iSector); } } //----------------------------------------------------- return( pOutput->Get_Count() > 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/separate_by_direction.h000066400000000000000000000103501224124640700264550ustar00rootroot00000000000000/********************************************************** * Version $Id: separate_by_direction.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Tools // // // //-------------------------------------------------------// // // // separate_by_direction.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__separate_by_direction_H #define HEADER_INCLUDED__separate_by_direction_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSeparate_by_Direction : public CSG_Module { public: CSeparate_by_Direction(void); protected: virtual bool On_Execute (void); private: int m_nSectors; double m_Tolerance, m_dSector; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__separate_by_direction_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/snap_points_to_features.cpp000066400000000000000000000220151224124640700274100ustar00rootroot00000000000000/********************************************************** * Version $Id: snap_points_to_features.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // snap_points_to_features.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "snap_points_to_features.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSnap_Points_to_Features::CSnap_Points_to_Features(TSG_Shape_Type Type) { //----------------------------------------------------- Set_Name (Type == SHAPE_TYPE_Point ? _TL("Snap Points to Points") : _TL("Snap Points to Lines") ); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "INPUT" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL , "SNAP" , _TL("Snap Features"), _TL(""), PARAMETER_INPUT, Type ); Parameters.Add_Shapes( NULL , "OUTPUT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL , "MOVES" , _TL("Moves"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Line ); Parameters.Add_Value( NULL , "DISTANCE" , _TL("Search Distance"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSnap_Points_to_Features::On_Execute(void) { double Distance; CSG_Shapes *pInput, *pPoints, *pSnap, *pMoves; //----------------------------------------------------- pInput = Parameters("INPUT" )->asShapes(); pPoints = Parameters("OUTPUT" )->asShapes(); pSnap = Parameters("SNAP" )->asShapes(); pMoves = Parameters("MOVES" )->asShapes(); Distance = Parameters("DISTANCE")->asDouble(); //----------------------------------------------------- if( !pInput->is_Valid() ) { Error_Set(_TL("invalid points layer")); return( false ); } if( !pSnap->is_Valid() || pSnap->Get_Count() <= 0 ) { Error_Set(_TL("invalid snap features")); return( false ); } //----------------------------------------------------- if( pPoints && pPoints != pInput ) { pPoints->Create(*pInput); } else { Parameters("RESULT")->Set_Value(pPoints = pInput); } pPoints->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pInput->Get_Name(), _TL("snapped"), pSnap->Get_Name())); if( pMoves ) { pMoves->Create(SHAPE_TYPE_Line, CSG_String::Format(SG_T("%s [%s: %s]"), pInput->Get_Name(), _TL("snap move"), pSnap->Get_Name()), pPoints); } //----------------------------------------------------- bool bDistance = Distance > 0.0; if( !bDistance ) { CSG_Rect r(pPoints->Get_Extent()); r.Union(pSnap->Get_Extent()); Distance = SG_Get_Distance(r.Get_BottomRight(), r.Get_TopLeft()); } //----------------------------------------------------- for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { CSG_Shape *pPoint = pPoints->Get_Shape(iPoint); TSG_Point Point = pPoint->Get_Point(0), snap_Point; double snap_Dist = Distance; if( bDistance ) { if( pSnap->Select(CSG_Rect(Point.x - Distance, Point.y - Distance, Point.x + Distance, Point.y + Distance)) ) { for(int i=0; iGet_Selection_Count() && snap_Dist>0.0; i++) { if( pSnap->Get_Type() == SHAPE_TYPE_Point ) { Snap_To_Point(Point, pSnap->Get_Selection(i), snap_Point, snap_Dist); } else { Snap_To_Line (Point, pSnap->Get_Selection(i), snap_Point, snap_Dist); } } } } else { for(int i=0; iGet_Count() && snap_Dist>0.0; i++) { if( pSnap->Get_Type() == SHAPE_TYPE_Point ) { Snap_To_Point(Point, pSnap->Get_Shape(i), snap_Point, snap_Dist); } else { Snap_To_Line (Point, pSnap->Get_Shape(i), snap_Point, snap_Dist); } } } //------------------------------------------------- if( snap_Dist < Distance ) { pPoint->Set_Point(snap_Point, 0); if( pMoves ) { CSG_Shape *pMove = pMoves->Add_Shape(pPoint, SHAPE_COPY_ATTR); pMove->Add_Point(Point); pMove->Add_Point(snap_Point); } } } //----------------------------------------------------- if( bDistance ) { pSnap->Select(); // reset selection } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CSnap_Points_to_Features::Snap_To_Point(const TSG_Point &Point, CSG_Shape *pPoint, TSG_Point &snap_Point, double &snap_Dist) { double d = SG_Get_Distance(Point, pPoint->Get_Point(0)); if( d < snap_Dist ) { snap_Dist = d; snap_Point = pPoint->Get_Point(0); } } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CSnap_Points_to_Features::Snap_To_Line(const TSG_Point &Point, CSG_Shape *pLine, TSG_Point &snap_Point, double &snap_Dist) { CSG_Rect r(pLine->Get_Extent()); r.Inflate(snap_Dist, false); if( r.Contains(Point) ) { for(int iPart=0; iPartGet_Part_Count(); iPart++) { TSG_Point C, B, A = pLine->Get_Point(0, iPart); for(int iPoint=1; iPointGet_Point_Count(iPart); iPoint++) { B = A; A = pLine->Get_Point(iPoint, iPart); r.Assign(A, B); r.Inflate(snap_Dist, false); if( r.Contains(Point) ) { double d = SG_Get_Nearest_Point_On_Line(Point, A, B, C, true); if( d >= 0.0 && d < snap_Dist ) { snap_Dist = d; snap_Point = C; } } } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/snap_points_to_features.h000066400000000000000000000103561224124640700270620ustar00rootroot00000000000000/********************************************************** * Version $Id: snap_points_to_features.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // snap_points_to_features.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__snap_points_to_features_H #define HEADER_INCLUDED__snap_points_to_features_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSnap_Points_to_Features : public CSG_Module { public: CSnap_Points_to_Features(TSG_Shape_Type Type); protected: virtual bool On_Execute (void); private: void Snap_To_Point (const TSG_Point &Point, CSG_Shape *pPoint, TSG_Point &snap_Point, double &snap_Dist); void Snap_To_Line (const TSG_Point &Point, CSG_Shape *pLine , TSG_Point &snap_Point, double &snap_Dist); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__snap_points_to_features_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/snap_points_to_grid.cpp000066400000000000000000000176201224124640700265250ustar00rootroot00000000000000/********************************************************** * Version $Id: snap_points_to_grid.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // snap_points_to_grid.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "snap_points_to_grid.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSnap_Points_to_Grid::CSnap_Points_to_Grid(void) { //----------------------------------------------------- Set_Name (_TL("Snap Points to Grid")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "Moves all points to grid cell positions that have the highest or" "lowest value respectively within the given search distance around " "each point." )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "INPUT" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "OUTPUT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL , "MOVES" , _TL("Moves"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Line ); Parameters.Add_Value( NULL , "DISTANCE" , _TL("Search Distance (Map Units)"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true ); Parameters.Add_Choice( NULL , "SHAPE" , _TL("Search Shape"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("circle"), _TL("square") ), 0 ); Parameters.Add_Choice( NULL , "EXTREME" , _TL("Extreme"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("minimum"), _TL("maximum") ), 1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSnap_Points_to_Grid::On_Execute(void) { double Distance, Sign; CSG_Shapes *pInput, *pPoints, *pMoves; CSG_Grid *pGrid; //----------------------------------------------------- pInput = Parameters("INPUT" )->asShapes(); pPoints = Parameters("OUTPUT" )->asShapes(); pGrid = Parameters("GRID" )->asGrid(); pMoves = Parameters("MOVES" )->asShapes(); Distance = Parameters("DISTANCE")->asDouble() / Get_Cellsize(); Sign = Parameters("EXTREME" )->asInt() == 1 ? 1 : -1; //----------------------------------------------------- if( !pInput->is_Valid() ) { Error_Set(_TL("invalid points layer")); return( false ); } if( pInput->Get_Extent().Intersects(pGrid->Get_Extent()) == INTERSECTION_None ) { Error_Set(_TL("points layer and grid do not intersect at all")); return( false ); } if( Distance < 0.5 ) { if( !Error_Set(_TL("search distance is less than half of grid cell size")) ) // ignore { return( false ); } } //----------------------------------------------------- if( pPoints && pPoints != pInput ) { pPoints->Create(*pInput); } else { Parameters("RESULT")->Set_Value(pPoints = pInput); } pPoints->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pInput->Get_Name(), _TL("snapped"), pGrid->Get_Name())); if( pMoves ) { pMoves->Create(SHAPE_TYPE_Line, CSG_String::Format(SG_T("%s [%s: %s]"), pInput->Get_Name(), _TL("snap move"), pGrid->Get_Name()), pPoints); } //----------------------------------------------------- CSG_Grid_Cell_Addressor Search; Search.Set_Radius(Distance, Parameters("SHAPE")->asInt() == 1); //----------------------------------------------------- for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { CSG_Shape *pPoint = pPoints->Get_Shape(iPoint); TSG_Point Point = pPoint->Get_Point(0); int x = Get_System()->Get_xWorld_to_Grid(Point.x); int y = Get_System()->Get_yWorld_to_Grid(Point.y); int iMax = -1; double dMax; for(int i=0; iis_InGrid(ix, iy) ) { if( iMax < 0 || dMax < Sign * pGrid->asDouble(ix, iy) ) { iMax = i; dMax = Sign * pGrid->asDouble(ix, iy); } } } //------------------------------------------------- if( iMax >= 0 ) { TSG_Point snap_Point = pGrid->Get_System().Get_Grid_to_World(Search.Get_X(iMax, x), Search.Get_Y(iMax, y)); if( SG_Get_Distance(Point, snap_Point) > 0.0 ) { pPoint->Set_Point(snap_Point, 0); if( pMoves ) { CSG_Shape *pMove = pMoves->Add_Shape(pPoint, SHAPE_COPY_ATTR); pMove->Add_Point(Point); pMove->Add_Point(snap_Point); } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/snap_points_to_grid.h000066400000000000000000000101341224124640700261630ustar00rootroot00000000000000/********************************************************** * Version $Id: snap_points_to_grid.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // snap_points_to_grid.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__snap_points_to_grid_H #define HEADER_INCLUDED__snap_points_to_grid_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSnap_Points_to_Grid : public CSG_Module_Grid { public: CSnap_Points_to_Grid(void); protected: virtual bool On_Execute (void); private: void Snap_To_Grid (const TSG_Point &Point, CSG_Shape *pPoint, TSG_Point &snap_Point, double &snap_Dist); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__snap_points_to_grid_H saga-2.1.0+dfsg/src/modules/shapes/shapes_points/thiessen_polygons.cpp000066400000000000000000000162471224124640700262410ustar00rootroot00000000000000/********************************************************** * Version $Id: thiessen_polygons.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // thiessen_polygons.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "thiessen_polygons.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CThiessen_Polygons::CThiessen_Polygons(void) { //----------------------------------------------------- Set_Name (_TL("Thiessen Polygons")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description(_TW( "Creates Thiessen or Voronoi polygons for given point data set." )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); CSG_Parameter *pNode = Parameters.Add_Choice( NULL , "FRAME" , _TL("Add Frame"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("no"), _TL("four points"), _TL("eight points") ), 1 ); Parameters.Add_Value( pNode , "FRAME_SIZE" , _TL("Frame Size"), _TL(""), PARAMETER_TYPE_Double, 0.5, 0.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CThiessen_Polygons::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FRAME")) ) { pParameters->Get_Parameter("FRAME_SIZE")->Set_Enabled(pParameter->asInt() > 0 ); } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CThiessen_Polygons::On_Execute(void) { //----------------------------------------------------- CSG_TIN TIN; if( !TIN.Create(Parameters("POINTS")->asShapes()) ) { return( false ); } //----------------------------------------------------- int nNodes = TIN.Get_Node_Count(); if( Parameters("FRAME")->asInt() > 0 ) { CSG_Rect Frame(TIN.Get_Extent()); Frame.Inflate(100.0 * Parameters("FRAME_SIZE")->asDouble()); TIN.Add_Node(CSG_Point(Frame.Get_XMin(), Frame.Get_YMin()), NULL, false); TIN.Add_Node(CSG_Point(Frame.Get_XMin(), Frame.Get_YMax()), NULL, false); TIN.Add_Node(CSG_Point(Frame.Get_XMax(), Frame.Get_YMax()), NULL, false); TIN.Add_Node(CSG_Point(Frame.Get_XMax(), Frame.Get_YMin()), NULL, false); if( Parameters("FRAME")->asInt() > 1 ) { Frame.Inflate(41.42); TIN.Add_Node(CSG_Point(Frame.Get_XMin() , Frame.Get_YCenter()), NULL, false); TIN.Add_Node(CSG_Point(Frame.Get_XMax() , Frame.Get_YCenter()), NULL, false); TIN.Add_Node(CSG_Point(Frame.Get_XCenter(), Frame.Get_YMin()) , NULL, false); TIN.Add_Node(CSG_Point(Frame.Get_XCenter(), Frame.Get_YMax()) , NULL, false); } TIN.Update(); } //----------------------------------------------------- CSG_Shapes *pPolygons = Parameters("POLYGONS")->asShapes(); pPolygons->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), TIN.Get_Name(), _TL("Thiessen Polygons")), &TIN); //----------------------------------------------------- for(int iNode=0; iNodeGet_Polygon(Points) ) { CSG_Shape *pPolygon = pPolygons->Add_Shape(TIN.Get_Record(iNode), SHAPE_COPY_ATTR); for(int iPoint=0; iPointAdd_Point(Points[iPoint]); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_points/thiessen_polygons.h000066400000000000000000000101621224124640700256740ustar00rootroot00000000000000/********************************************************** * Version $Id: thiessen_polygons.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_points // // // //-------------------------------------------------------// // // // thiessen_polygons.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__thiessen_polygons_H #define HEADER_INCLUDED__thiessen_polygons_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CThiessen_Polygons : public CSG_Module { public: CThiessen_Polygons(void); protected: virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__thiessen_polygons_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/000077500000000000000000000000001224124640700223055ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/MLB_Interface.cpp000066400000000000000000000134531224124640700254110ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1690 2013-05-15 12:55:26Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Shapes - Polygons") ); case MLB_INFO_Author: return( SG_T("O. Conrad, V. Olaya (c) 2002-5") ); case MLB_INFO_Description: return( _TL("Tools for polygons.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Shapes|Polygons") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Polygon_Intersection.h" #include "Polygon_Centroids.h" #include "Polygon_Geometrics.h" #include "Polygons_From_Lines.h" #include "Polygon_StatisticsFromPoints.h" #include "Polygon_Union.h" #include "polygon_to_points.h" #include "shape_index.h" #include "polygon_line_intersection.h" #include "polygon_to_edges_nodes.h" #include "polygon_split_parts.h" #include "Polygon_Clip.h" #include "Polygon_SelfIntersection.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 1: return( new CPolygon_Centroids ); case 2: return( new CPolygon_Geometrics ); case 3: return( new CPolygons_From_Lines ); case 4: return( new CPolygonStatisticsFromPoints ); case 5: return( new CPolygon_Dissolve ); case 6: return( new CPolygon_To_Points ); case 7: return( new CShape_Index ); case 8: return( new CPolygon_Line_Intersection ); case 9: return( new CPolygon_to_Edges_Nodes ); case 10: return( new CPolygon_Split_Parts ); case 11: return( new CPolygon_Clip ); case 12: return( new CPolygon_SelfIntersection ); case 14: return( new CPolygon_Intersection ); case 15: return( new CPolygon_Difference ); case 16: return( new CPolygon_SymDifference ); case 17: return( new CPolygon_Union ); case 18: return( new CPolygon_Update ); case 19: return( new CPolygon_Identity ); //----------------------------------------------------- case 20: return( NULL ); default: return( MLB_INTERFACE_SKIP_MODULE ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/MLB_Interface.h000066400000000000000000000077441224124640700250640ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__shapes_polygons_H #define HEADER_INCLUDED__shapes_polygons_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef shapes_polygons_EXPORTS #define shapes_polygons_EXPORT _SAGA_DLL_EXPORT #else #define shapes_polygons_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__shapes_polygon_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Makefile.am000066400000000000000000000022771224124640700243510ustar00rootroot00000000000000# # $Id: Makefile.am 1352 2012-03-14 10:03:01Z oconrad $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libshapes_polygons.la libshapes_polygons_la_SOURCES =\ MLB_Interface.cpp\ Polygon_Centroids.cpp\ Polygon_Clip.cpp\ Polygon_Geometrics.cpp\ Polygon_Intersection.cpp\ Polygon_SelfIntersection.cpp\ Polygon_StatisticsFromPoints.cpp\ Polygon_Union.cpp\ Polygons_From_Lines.cpp\ polygon_line_intersection.cpp\ polygon_split_parts.cpp\ polygon_to_edges_nodes.cpp\ polygon_to_points.cpp\ shape_index.cpp\ MLB_Interface.h\ Polygon_Centroids.h\ Polygon_Clip.h\ Polygon_Geometrics.h\ Polygon_Intersection.h\ Polygon_SelfIntersection.h\ Polygon_StatisticsFromPoints.h\ Polygon_Union.h\ Polygons_From_Lines.h\ polygon_line_intersection.h\ polygon_split_parts.h\ polygon_to_edges_nodes.h\ polygon_to_points.h\ shape_index.h libshapes_polygons_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Makefile.in000066400000000000000000000500431224124640700243540ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/shapes/shapes_polygons DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libshapes_polygons_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libshapes_polygons_la_OBJECTS = MLB_Interface.lo \ Polygon_Centroids.lo Polygon_Clip.lo Polygon_Geometrics.lo \ Polygon_Intersection.lo Polygon_SelfIntersection.lo \ Polygon_StatisticsFromPoints.lo Polygon_Union.lo \ Polygons_From_Lines.lo polygon_line_intersection.lo \ polygon_split_parts.lo polygon_to_edges_nodes.lo \ polygon_to_points.lo shape_index.lo libshapes_polygons_la_OBJECTS = $(am_libshapes_polygons_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libshapes_polygons_la_SOURCES) DIST_SOURCES = $(libshapes_polygons_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1352 2012-03-14 10:03:01Z oconrad $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libshapes_polygons.la libshapes_polygons_la_SOURCES = \ MLB_Interface.cpp\ Polygon_Centroids.cpp\ Polygon_Clip.cpp\ Polygon_Geometrics.cpp\ Polygon_Intersection.cpp\ Polygon_SelfIntersection.cpp\ Polygon_StatisticsFromPoints.cpp\ Polygon_Union.cpp\ Polygons_From_Lines.cpp\ polygon_line_intersection.cpp\ polygon_split_parts.cpp\ polygon_to_edges_nodes.cpp\ polygon_to_points.cpp\ shape_index.cpp\ MLB_Interface.h\ Polygon_Centroids.h\ Polygon_Clip.h\ Polygon_Geometrics.h\ Polygon_Intersection.h\ Polygon_SelfIntersection.h\ Polygon_StatisticsFromPoints.h\ Polygon_Union.h\ Polygons_From_Lines.h\ polygon_line_intersection.h\ polygon_split_parts.h\ polygon_to_edges_nodes.h\ polygon_to_points.h\ shape_index.h libshapes_polygons_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/shapes/shapes_polygons/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/shapes/shapes_polygons/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libshapes_polygons.la: $(libshapes_polygons_la_OBJECTS) $(libshapes_polygons_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libshapes_polygons_la_OBJECTS) $(libshapes_polygons_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Polygon_Centroids.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Polygon_Clip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Polygon_Geometrics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Polygon_Intersection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Polygon_SelfIntersection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Polygon_StatisticsFromPoints.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Polygon_Union.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Polygons_From_Lines.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polygon_line_intersection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polygon_split_parts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polygon_to_edges_nodes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polygon_to_points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shape_index.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_Centroids.cpp000066400000000000000000000141531224124640700264560ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Centroids.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygon_Centroids.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Polygon_Centroids.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Centroids::CPolygon_Centroids(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Polygon Centroids")); Set_Author (SG_T("(c) 2003 by O.Conrad")); Set_Description (_TW( "Creates a points layer containing the centroids of the input polygon layer." )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "CENTROIDS" , _TL("Centroids"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); //----------------------------------------------------- pNode = Parameters.Add_Value( NULL , "METHOD" , _TL("Centroids for each part"), _TL(""), PARAMETER_TYPE_Bool, false ); //----------------------------------------------------- } //--------------------------------------------------------- CPolygon_Centroids::~CPolygon_Centroids(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Centroids::On_Execute(void) { bool bPart; int iShape, iPart; CSG_Shape *pCentroid; CSG_Shape_Polygon *pPolygon; CSG_Shapes *pPolygons, *pCentroids; pPolygons = Parameters("POLYGONS") ->asShapes(); pCentroids = Parameters("CENTROIDS") ->asShapes(); bPart = Parameters("METHOD") ->asBool(); if( pPolygons->Get_Type() == SHAPE_TYPE_Polygon && pPolygons->Get_Count() > 0 ) { pCentroids->Create(SHAPE_TYPE_Point, pPolygons->Get_Name(), pPolygons); //------------------------------------------------- for(iShape=0; iShapeGet_Count(); iShape++) { pPolygon = (CSG_Shape_Polygon *)pPolygons->Get_Shape(iShape); if( bPart ) { for(iPart=0; iPartGet_Part_Count(); iPart++) { pCentroid = pCentroids->Add_Shape(pPolygon, SHAPE_COPY_ATTR); pCentroid->Add_Point(pPolygon->Get_Centroid(iPart)); } } else { pCentroid = pCentroids->Add_Shape(pPolygon, SHAPE_COPY_ATTR); pCentroid->Add_Point(pPolygon->Get_Centroid()); } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_Centroids.h000066400000000000000000000106261224124640700261240ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Centroids.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygon_Centroids.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Polygon_Centroids_H #define HEADER_INCLUDED__Polygon_Centroids_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_Centroids : public CSG_Module { public: CPolygon_Centroids(void); virtual ~CPolygon_Centroids(void); protected: virtual bool On_Execute(void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Polygon_Centroids_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_Clip.cpp000066400000000000000000000312731224124640700254150ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Clip.cpp 1230 2011-11-22 11:12:10Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygon_Clip.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Polygon_Clip.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Clip::CPolygon_Clip(void) { //----------------------------------------------------- Set_Name (_TL("Polygon Clipping")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "Clipping of vector layers with a polygon layer.\n" "Uses the free and open source software library Clipper created by Angus Johnson.\n" "Clipper Homepage\n" "Clipper at SourceForge\n" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "CLIP" , _TL("Clip Features"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "S_INPUT" , _TL("Input Features"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "S_OUTPUT" , _TL("Output Features"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Shapes_List( NULL , "M_INPUT" , _TL("Input Features"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes_List( NULL , "M_OUTPUT" , _TL("Output Features"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "DISSOLVE" , _TL("Dissolve Clip Features"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( NULL , "MULTIPLE" , _TL("Multiple Input Features"), _TL(""), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CPolygon_Clip::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("MULTIPLE")) ) { pParameters->Get_Parameter("S_INPUT" )->Set_Enabled(pParameter->asBool() == false); pParameters->Get_Parameter("S_OUTPUT")->Set_Enabled(pParameter->asBool() == false); pParameters->Get_Parameter("M_INPUT" )->Set_Enabled(pParameter->asBool() == true); pParameters->Get_Parameter("M_OUTPUT")->Set_Enabled(pParameter->asBool() == true); } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Clip::On_Execute(void) { CSG_Shapes Clip, *pClip = Parameters("CLIP")->asShapes(); if( Parameters("DISSOLVE")->asBool() && Dissolve(pClip, &Clip) ) { pClip = &Clip; } //----------------------------------------------------- if( !Parameters("MULTIPLE")->asBool() ) // single input mode { return( Clip_Shapes(pClip, Parameters("S_INPUT" )->asShapes(), Parameters("S_OUTPUT")->asShapes() )); } //----------------------------------------------------- else // multiple input mode { CSG_Parameter_Shapes_List *pInput = Parameters("M_INPUT" )->asShapesList(); CSG_Parameter_Shapes_List *pOutput = Parameters("M_OUTPUT")->asShapesList(); pOutput->Del_Items(); for(int i=0; iGet_Count() && Process_Get_Okay(); i++) { CSG_Shapes *pShapes = SG_Create_Shapes(); if( Clip_Shapes(pClip, pInput->asShapes(i), pShapes) ) { pOutput->Add_Item(pShapes); } else { delete(pShapes); } } return( pOutput->Get_Count() > 0 ); } } //--------------------------------------------------------- bool CPolygon_Clip::Clip_Shapes(CSG_Shapes *pClip, CSG_Shapes *pInput, CSG_Shapes *pOutput) { pOutput->Create(pInput->Get_Type(), CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), _TL("clipped")), pInput); switch( pInput->Get_Type() ) { case SHAPE_TYPE_Point: Clip_Points (pClip, pInput, pOutput); break; case SHAPE_TYPE_Points: Clip_Points (pClip, pInput, pOutput); break; case SHAPE_TYPE_Line: Clip_Lines (pClip, pInput, pOutput); break; case SHAPE_TYPE_Polygon: Clip_Polygons(pClip, pInput, pOutput); break; } return( pOutput->Get_Count() > 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPolygon_Clip::Clip_Points(CSG_Shapes *pClips, CSG_Shapes *pInputs, CSG_Shapes *pOutputs) { for(int iClip=0; iClipGet_Count() && Set_Progress(iClip, pClips->Get_Count()); iClip++) { CSG_Shape_Polygon *pClip = (CSG_Shape_Polygon *)pClips->Get_Shape(iClip); for(int iInput=0; iInputGet_Count(); iInput++) { CSG_Shape *pInput = pInputs->Get_Shape(iInput); CSG_Shape *pOutput = NULL; for(int iPoint=0; iPointGet_Point_Count(0); iPoint++) { if( pClip->Contains(pInput->Get_Point(iPoint, 0)) ) { if( pOutput == NULL ) { pOutput = pOutputs->Add_Shape(pInput, SHAPE_COPY_ATTR); } pOutput->Add_Point(pInput->Get_Point(iPoint, 0)); } } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPolygon_Clip::Clip_Lines(CSG_Shapes *pClips, CSG_Shapes *pInputs, CSG_Shapes *pOutputs) { for(int iClip=0; iClipGet_Count() && Set_Progress(iClip, pClips->Get_Count()); iClip++) { CSG_Shape_Polygon *pClip = (CSG_Shape_Polygon *)pClips->Get_Shape(iClip); if( pInputs->Select(pClip->Get_Extent()) ) { for(int iInput=0; iInputGet_Selection_Count(); iInput++) { CSG_Shape *pNew_Line, *pLine = pInputs->Get_Selection(iInput); for(int iPart=0, jPart=-1; iPartGet_Part_Count(); iPart++) { TSG_Point B, A = pLine->Get_Point(0, iPart); bool bIn = pClip->Contains(A); if( bIn ) { pNew_Line = pOutputs->Add_Shape(pLine, SHAPE_COPY_ATTR); pNew_Line->Add_Point(A, ++jPart); } for(int iPoint=1; iPointGet_Point_Count(iPart); iPoint++) { B = A; A = pLine->Get_Point(iPoint, iPart); if( bIn ) { if( pClip->Contains(A) ) { pNew_Line->Add_Point(A, jPart); } else { pNew_Line->Add_Point(Get_Crossing(pClip, A, B), jPart); bIn = false; } } else if( pClip->Contains(A) ) { if( jPart < 0 ) { pNew_Line = pOutputs->Add_Shape(pLine, SHAPE_COPY_ATTR); } pNew_Line->Add_Point(Get_Crossing(pClip, A, B), ++jPart); pNew_Line->Add_Point(A, jPart); bIn = true; } } } } } } } //--------------------------------------------------------- TSG_Point CPolygon_Clip::Get_Crossing(CSG_Shape_Polygon *pPolygon, const TSG_Point &a, const TSG_Point &b) { TSG_Point c = a; for(int iPart=0; iPartGet_Part_Count(); iPart++) { TSG_Point A, B; B = pPolygon->Get_Point(pPolygon->Get_Point_Count(iPart) - 1, iPart); for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { A = B; B = pPolygon->Get_Point(iPoint, iPart); if( SG_Get_Crossing(c, A, B, a, b) ) { return( c ); } } } return( c ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPolygon_Clip::Clip_Polygons(CSG_Shapes *pClips, CSG_Shapes *pInputs, CSG_Shapes *pOutputs) { for(int iClip=0; iClipGet_Count() && Process_Get_Okay(); iClip++) { Process_Set_Text(CSG_String::Format(SG_T("%s: %d/%d"), _TL("clip features"), iClip + 1, pClips->Get_Count())); CSG_Shape *pClip = pClips->Get_Shape(iClip); for(int iInput=0; iInputGet_Count() && Set_Progress(iInput, pInputs->Get_Count()); iInput++) { CSG_Shape *pOutput = pOutputs->Add_Shape(pInputs->Get_Shape(iInput)); if( !SG_Polygon_Intersection(pOutput, pClip) ) { pOutputs->Del_Shape(pOutputs->Get_Count() - 1); } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Clip::Dissolve(CSG_Shapes *pPolygons, CSG_Shapes *pOutput) { pOutput->Create(SHAPE_TYPE_Polygon); pOutput->Add_Field(_TL("ID"), SG_DATATYPE_Int); CSG_Shape *pDissolved = pOutput->Add_Shape(pPolygons->Get_Shape(0), SHAPE_COPY_GEOM); for(int iPolygon=1; iPolygonGet_Count() && Set_Progress(iPolygon, pPolygons->Get_Count()); iPolygon++) { CSG_Shape *pPolygon = pPolygons->Get_Shape(iPolygon); for(int iPart=0; iPartGet_Part_Count(); iPart++) { CSG_Shape_Part *pPart = ((CSG_Shape_Polygon *)pPolygon)->Get_Part(iPart); for(int iPoint=0, nParts=pDissolved->Get_Part_Count(); iPointGet_Count(); iPoint++) { pDissolved->Add_Point(pPart->Get_Point(iPoint), nParts); } } } return( SG_Polygon_Dissolve(pDissolved) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_Clip.h000066400000000000000000000115071224124640700250600ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Clip.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygon_Clip.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Polygon_Clip_H #define HEADER_INCLUDED__Polygon_Clip_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_Clip : public CSG_Module { public: CPolygon_Clip(void); protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: bool Clip_Shapes (CSG_Shapes *pClip, CSG_Shapes *pInput, CSG_Shapes *pOutput); void Clip_Points (CSG_Shapes *pClip, CSG_Shapes *pInput, CSG_Shapes *pOutput); void Clip_Lines (CSG_Shapes *pClip, CSG_Shapes *pInput, CSG_Shapes *pOutput); void Clip_Polygons (CSG_Shapes *pClip, CSG_Shapes *pInput, CSG_Shapes *pOutput); TSG_Point Get_Crossing (CSG_Shape_Polygon *pPolygon, const TSG_Point &a, const TSG_Point &b); bool Dissolve (CSG_Shapes *pPolygons, CSG_Shapes *pOutput); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Polygon_Clip_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_Geometrics.cpp000066400000000000000000000122461224124640700266260ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Geometrics.cpp 1334 2012-02-21 13:34:44Z reklov_w $ *********************************************************/ /******************************************************************************* Polygon_Geometrics.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Polygon_Geometrics.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Geometrics::CPolygon_Geometrics(void) { Set_Name (_TL("Polygon Properties")); Set_Author (_TL("V.Olaya (c) 2004, O.Conrad (c) 2011")); Set_Description (_TW( "General and geometric properties of polygons." )); Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "OUTPUT" , _TL("Polygons with Property Attributes"), _TL("If not set property attributes will be added to the orignal layer."), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon ); Parameters.Add_Value( NULL , "BPARTS" , _TL("Number of Parts"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "BPOINTS" , _TL("Number of Vertices"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "BLENGTH" , _TL("Perimeter"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( NULL , "BAREA" , _TL("Area"), _TL(""), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Geometrics::On_Execute(void) { //------------------------------------------------- int bParts = Parameters("BPARTS") ->asBool() ? 0 : -1; int bPoints = Parameters("BPOINTS") ->asBool() ? 0 : -1; int bLength = Parameters("BLENGTH") ->asBool() ? 0 : -1; int bArea = Parameters("BAREA") ->asBool() ? 0 : -1; if( bParts && bPoints && bLength && bArea ) { Error_Set(_TL("no properties selected")); return( false ); } //------------------------------------------------- CSG_Shapes *pPolygons = Parameters("POLYGONS")->asShapes(); if( !pPolygons->is_Valid() || pPolygons->Get_Count() <= 0 ) { Error_Set(_TL("invalid lines layer")); return( false ); } if( Parameters("OUTPUT")->asShapes() && Parameters("OUTPUT")->asShapes() != pPolygons ) { pPolygons = Parameters("OUTPUT")->asShapes(); pPolygons->Create(*Parameters("POLYGONS")->asShapes()); } //------------------------------------------------- if( !bParts ) { bParts = pPolygons->Get_Field_Count(); pPolygons->Add_Field(SG_T("NPARTS") , SG_DATATYPE_Int ); } if( !bPoints ) { bPoints = pPolygons->Get_Field_Count(); pPolygons->Add_Field(SG_T("NPOINTS") , SG_DATATYPE_Int ); } if( !bLength ) { bLength = pPolygons->Get_Field_Count(); pPolygons->Add_Field(SG_T("PERIMETER"), SG_DATATYPE_Double); } if( !bArea ) { bArea = pPolygons->Get_Field_Count(); pPolygons->Add_Field(SG_T("AREA") , SG_DATATYPE_Double); } //------------------------------------------------- for(int i=0; iGet_Count() && Set_Progress(i, pPolygons->Get_Count()); i++) { CSG_Shape *pPolygon = pPolygons->Get_Shape(i); if( bParts >= 0 ) pPolygon->Set_Value(bParts , pPolygon->Get_Part_Count()); if( bPoints >= 0 ) pPolygon->Set_Value(bPoints, pPolygon->Get_Point_Count()); if( bLength >= 0 ) pPolygon->Set_Value(bLength, ((CSG_Shape_Polygon *)pPolygon)->Get_Perimeter()); if( bArea >= 0 ) pPolygon->Set_Value(bArea , ((CSG_Shape_Polygon *)pPolygon)->Get_Area()); } //------------------------------------------------- if( pPolygons == Parameters("POLYGONS")->asShapes() ) { DataObject_Update(pPolygons); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_Geometrics.h000066400000000000000000000045641224124640700262770ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Geometrics.h 1065 2011-05-18 15:58:45Z oconrad $ *********************************************************/ /******************************************************************************* Polygon_Geometrics.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Polygon_Geometrics_H #define HEADER_INCLUDED__Polygon_Geometrics_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_Geometrics : public CSG_Module { public: CPolygon_Geometrics(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Polygon_Geometrics_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_Intersection.cpp000066400000000000000000000356771224124640700272100ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Intersection.cpp 1690 2013-05-15 12:55:26Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygon_Intersection.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Polygon_Intersection.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Overlay::CPolygon_Overlay(const CSG_String &Name) { //----------------------------------------------------- Set_Name (Name); Set_Author (SG_T("O.Conrad (c) 2003-13")); Set_Description (_TW( "Uses the free and open source software library Clipper created by Angus Johnson.\n" "Clipper Homepage\n" "Clipper at SourceForge\n" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "A" , _TL("Layer A"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "B" , _TL("Layer B"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "RESULT" , Name, _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Value( NULL , "SPLIT" , _TL("Split Parts"), _TL("Set true if you want multipart polygons to become separate polygons."), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Overlay::Add_Description(const CSG_String &Text) { Set_Description(Text + "\n" + Get_Description()); return( true ); } //--------------------------------------------------------- bool CPolygon_Overlay::Initialize(CSG_Shapes **ppA, CSG_Shapes **ppB, bool bBothAttributes) { *ppA = Parameters("A")->asShapes(); if( (*ppA)->Get_Type() != SHAPE_TYPE_Polygon || !(*ppA)->is_Valid() ) return( false ); *ppB = Parameters("B")->asShapes(); if( (*ppB)->Get_Type() != SHAPE_TYPE_Polygon || !(*ppB)->is_Valid() ) return( false ); m_bSplit = Parameters("SPLIT")->asBool(); m_pA = NULL; m_pB = NULL; m_pAB = Parameters("RESULT")->asShapes(); m_pAB->Create(SHAPE_TYPE_Polygon, SG_T(""), *ppA); m_pAB->Set_Name(CSG_String::Format(SG_T("%s [%s]-[%s]"), Get_Name().c_str(), (*ppA)->Get_Name(), (*ppB)->Get_Name())); if( bBothAttributes ) { for(int i=0; i<(*ppB)->Get_Field_Count(); i++) { m_pAB->Add_Field((*ppB)->Get_Field_Name(i), (*ppB)->Get_Field_Type(i)); } } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Overlay::Get_Intersection(CSG_Shapes *pA, CSG_Shapes *pB) { m_bInvert = false; m_pA = pA; m_pB = pB; CSG_Shapes Tmp(SHAPE_TYPE_Polygon); CSG_Shape *pShape_AB = Tmp.Add_Shape(); //----------------------------------------------------- for(int id_A=0; id_AGet_Count() && Set_Progress(id_A, m_pA->Get_Count()); id_A++) { if( m_pB->Select(m_pA->Get_Shape(id_A)->Get_Extent()) ) { CSG_Shape *pShape_A = m_pA->Get_Shape(id_A); for(int id_B=0; id_BGet_Selection_Count(); id_B++) { CSG_Shape *pShape_B = m_pB->Get_Selection(id_B); if( SG_Polygon_Intersection(pShape_A, pShape_B, pShape_AB) ) { Add_Polygon(pShape_AB, id_A, pShape_B->Get_Index()); } } } } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Overlay::Get_Difference(CSG_Shapes *pA, CSG_Shapes *pB, bool bInvert) { m_bInvert = bInvert; m_pA = pA; m_pB = pB; CSG_Shapes Tmp(SHAPE_TYPE_Polygon); CSG_Shape *pShape_A = Tmp.Add_Shape(); //----------------------------------------------------- for(int id_A=0; id_AGet_Count() && Set_Progress(id_A, m_pA->Get_Count()); id_A++) { if( m_pB->Select(m_pA->Get_Shape(id_A)->Get_Extent()) ) { int nIntersections = 0; pShape_A->Assign(m_pA->Get_Shape(id_A)); for(int id_B=0; id_BGet_Selection_Count(); id_B++) { if( SG_Polygon_Difference(pShape_A, m_pB->Get_Selection(id_B)) ) { nIntersections++; } } if( nIntersections > 0 && pShape_A->is_Valid() ) { Add_Polygon(pShape_A, id_A); } } else { Add_Polygon(m_pA->Get_Shape(id_A), id_A); } } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Shape * CPolygon_Overlay::Add_Polygon(int id_A, int id_B) { CSG_Shape *pOriginal, *pNew = m_pAB->Add_Shape(); if( pNew ) { if( (pOriginal = m_pA->Get_Shape(id_A)) != NULL ) { for(int i=0, j=m_bInvert ? m_pB->Get_Field_Count() : 0; iGet_Field_Count(); i++, j++) { if( pNew->Get_Value(j) ) *pNew->Get_Value(j) = *pOriginal->Get_Value(i); } } if( (pOriginal = m_pB->Get_Shape(id_B)) != NULL ) { for(int i=0, j=m_bInvert ? 0 : m_pA->Get_Field_Count(); iGet_Field_Count(); i++, j++) { if( pNew->Get_Value(j) ) *pNew->Get_Value(j) = *pOriginal->Get_Value(i); } } } return( pNew ); } //--------------------------------------------------------- void CPolygon_Overlay::Add_Polygon(CSG_Shape *pShape, int id_A, int id_B) { int iPoint, iPart, jPart, nParts; CSG_Shape *pShape_Add; for(iPart=pShape->Get_Part_Count()-1; iPart>=0; iPart--) { if( ((CSG_Shape_Polygon *)pShape)->Get_Area(iPart) <= 0.0 ) { pShape->Del_Part(iPart); } else if( pShape->Get_Point_Count(iPart) <= 3 ) { CSG_Point a(pShape->Get_Point(0, iPart)), b(pShape->Get_Point(1, iPart)), c(pShape->Get_Point(2, iPart)); if( a == b || b == c || c == a ) { pShape->Del_Part(iPart); } } } if( pShape->is_Valid() ) { if( m_bSplit && pShape->Get_Part_Count() > 1 ) { for(iPart=0; iPartGet_Part_Count(); iPart++) { if( !((CSG_Shape_Polygon *)pShape)->is_Lake(iPart) && (pShape_Add = Add_Polygon(id_A, id_B)) != NULL ) { for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { pShape_Add->Add_Point(pShape->Get_Point(iPoint, iPart), 0); } for(jPart=0, nParts=0; jPartGet_Part_Count(); jPart++) { if( ((CSG_Shape_Polygon *)pShape)->is_Lake(jPart) && ((CSG_Shape_Polygon *)pShape)->Contains(pShape->Get_Point(0, jPart), iPart) ) { nParts++; for(iPoint=0; iPointGet_Point_Count(jPart); iPoint++) { pShape_Add->Add_Point(pShape->Get_Point(iPoint, jPart), nParts); } } } } } } else if( (pShape_Add = Add_Polygon(id_A, id_B)) != NULL ) { pShape_Add->Assign(pShape, false); } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Intersection::CPolygon_Intersection(void) : CPolygon_Overlay(_TL("Intersect")) { Add_Description(_TW( "Calculates the geometric intersection of the overlayed polygon layers, " "i.e. layer A and layer B." )); } //--------------------------------------------------------- bool CPolygon_Intersection::On_Execute(void) { CSG_Shapes *pA, *pB; if( !CPolygon_Overlay::Initialize(&pA, &pB, true) ) { return( false ); } return( Get_Intersection(pA, pB) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Difference::CPolygon_Difference(void) : CPolygon_Overlay(_TL("Difference")) { Add_Description(_TW( "Calculates the geometric difference of the overlayed polygon layers, " "i.e. layer A less layer B. Sometimes referred to as \'Erase\' command." )); } //--------------------------------------------------------- bool CPolygon_Difference::On_Execute(void) { CSG_Shapes *pA, *pB; if( !CPolygon_Overlay::Initialize(&pA, &pB, false) ) { return( false ); } return( Get_Difference(pA, pB) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_SymDifference::CPolygon_SymDifference(void) : CPolygon_Overlay(_TL("Symmetrical Difference")) { Add_Description(_TW( "Calculates the symmetrical geometric difference of the overlayed polygon layers, " "i.e. layer A less layer B plus layer B less layer A." )); } //--------------------------------------------------------- bool CPolygon_SymDifference::On_Execute(void) { CSG_Shapes *pA, *pB; if( !CPolygon_Overlay::Initialize(&pA, &pB, true) ) { return( false ); } return( Get_Difference(pA, pB) && Get_Difference(pB, pA, true) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Union::CPolygon_Union(void) : CPolygon_Overlay(_TL("Union")) { Add_Description(_TW( "Calculates the geometric union of the overlayed polygon layers, " "i.e. the intersection plus the symmetrical difference of layers A and B." )); } //--------------------------------------------------------- bool CPolygon_Union::On_Execute(void) { CSG_Shapes *pA, *pB; if( !CPolygon_Overlay::Initialize(&pA, &pB, true) ) { return( false ); } return( Get_Intersection(pA, pB) && Get_Difference (pA, pB) && Get_Difference (pB, pA, true) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Identity::CPolygon_Identity(void) : CPolygon_Overlay(_TL("Identity")) { Add_Description(_TW( "Calculates the geometric intersection between both layers " "and adds the difference of layer A less layer B." )); } //--------------------------------------------------------- bool CPolygon_Identity::On_Execute(void) { CSG_Shapes *pA, *pB; if( !CPolygon_Overlay::Initialize(&pA, &pB, true) ) { return( false ); } return( Get_Intersection(pA, pB) && Get_Difference (pA, pB) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Update::CPolygon_Update(void) : CPolygon_Overlay(_TL("Update")) { Add_Description(_TW( "Updates features of layer A with the features of layer B, " "i.e. all features of layer B will be supplemented with the " "difference of layer A less layer B plus. It is assumed, " "that both input layers share the same attribute structure." )); } //--------------------------------------------------------- bool CPolygon_Update::On_Execute(void) { CSG_Shapes *pA, *pB; if( !CPolygon_Overlay::Initialize(&pA, &pB, false) ) { return( false ); } if( !Get_Difference(pA, pB) ) { return( false ); } //----------------------------------------------------- CSG_Shapes *pAB = Parameters("RESULT")->asShapes(); for(int i=0; iGet_Count(); i++) { pAB->Add_Shape(pB->Get_Shape(i)); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_Intersection.h000066400000000000000000000143441224124640700266410ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Intersection.h 1690 2013-05-15 12:55:26Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygon_Intersection.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Polygon_Intersection_H #define HEADER_INCLUDED__Polygon_Intersection_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_Overlay : public CSG_Module { public: CPolygon_Overlay(const CSG_String &Name); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Overlay") ); } protected: bool Add_Description (const CSG_String &Text); bool Initialize (CSG_Shapes **ppA, CSG_Shapes **ppB, bool bBothAttributes); bool Get_Intersection (CSG_Shapes *pA, CSG_Shapes *pB); bool Get_Difference (CSG_Shapes *pA, CSG_Shapes *pB, bool bInvert = false); private: bool m_bSplit, m_bInvert; CSG_Shapes *m_pA, *m_pB, *m_pAB; CSG_Shape * Add_Polygon (int id_A, int id_B); void Add_Polygon (CSG_Shape *pShape, int id_A, int id_B = -1); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_Intersection : public CPolygon_Overlay { public: CPolygon_Intersection(void); protected: virtual bool On_Execute (void); }; //--------------------------------------------------------- class CPolygon_Difference : public CPolygon_Overlay { public: CPolygon_Difference(void); protected: virtual bool On_Execute (void); }; //--------------------------------------------------------- class CPolygon_SymDifference : public CPolygon_Overlay { public: CPolygon_SymDifference(void); protected: virtual bool On_Execute (void); }; //--------------------------------------------------------- class CPolygon_Union : public CPolygon_Overlay { public: CPolygon_Union(void); protected: virtual bool On_Execute (void); }; //--------------------------------------------------------- class CPolygon_Identity : public CPolygon_Overlay { public: CPolygon_Identity(void); protected: virtual bool On_Execute (void); }; //--------------------------------------------------------- class CPolygon_Update : public CPolygon_Overlay { public: CPolygon_Update(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Polygon_Intersection_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_SelfIntersection.cpp000066400000000000000000000174571224124640700300160ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_SelfIntersection.cpp 1230 2011-11-22 11:12:10Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygon_SelfIntersection.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Polygon_SelfIntersection.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_SelfIntersection::CPolygon_SelfIntersection(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Polygon Self-Intersection")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "Self-intersection of one layer's polygons.\n" "Uses the free and open source software library Clipper created by Angus Johnson.\n" "Clipper Homepage\n" "Clipper at SourceForge\n" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Table_Field( pNode , "ID" , _TL("Identifier"), _TL(""), true ); Parameters.Add_Shapes( NULL , "INTERSECT" , _TL("Intersection"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_SelfIntersection::On_Execute(void) { int ID; CSG_Shapes *pPolygons, Intersect; pPolygons = Parameters("POLYGONS" )->asShapes(); m_pIntersect = Parameters("INTERSECT")->asShapes() ? Parameters("INTERSECT")->asShapes() : &Intersect; ID = Parameters("ID")->asInt(); if( ID >= pPolygons->Get_Field_Count() ) { ID = -1; } m_pIntersect->Create(SHAPE_TYPE_Polygon, pPolygons->Get_Name(), pPolygons); m_pIntersect->Add_Field("ID", SG_DATATYPE_String); //----------------------------------------------------- for(int i=0; iGet_Count() && Set_Progress(i, pPolygons->Get_Count()); i++) { Add_Polygon(pPolygons->Get_Shape(i), ID); } //----------------------------------------------------- if( m_pIntersect->Get_Count() != pPolygons->Get_Count() ) { Message_Add(CSG_String::Format(SG_T("%s: %d"), _TL("number of added polygons"), m_pIntersect->Get_Count() - pPolygons->Get_Count())); if( m_pIntersect == &Intersect ) { pPolygons->Create(Intersect); DataObject_Update(pPolygons); } else { m_pIntersect->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPolygons->Get_Name(), _TL("self-intersection"))); } } else { Message_Add(_TL("no self-intersecting polygons detected")); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CPolygon_SelfIntersection::Add_Polygon(CSG_Shape *pPolygon, int ID) { CSG_String sID; if( ID >= 0 ) { sID = pPolygon->asString(ID); } else { sID = SG_Get_String(pPolygon->Get_Index() + 1, 0); } ID = m_pIntersect->Get_Field_Count() - 1; //----------------------------------------------------- if( !m_pIntersect->Select(pPolygon->Get_Extent()) ) { pPolygon = m_pIntersect->Add_Shape(pPolygon); pPolygon ->Set_Value(ID, sID); return; } //----------------------------------------------------- CSG_Shapes Intersect(m_pIntersect->Get_Type(), SG_T(""), m_pIntersect); int nIntersects = m_pIntersect->Get_Count(); pPolygon = m_pIntersect->Add_Shape(pPolygon); pPolygon ->Set_Value(ID, sID); for(int i=0; iis_Valid(); i++) { if( pPolygon != m_pIntersect->Get_Shape(i) && pPolygon->Intersects(m_pIntersect->Get_Shape(i)) ) { CSG_Shape *pOriginal = Intersect.Add_Shape(m_pIntersect->Get_Shape(i)); CSG_Shape *pIntersect = Intersect.Add_Shape(); if( SG_Polygon_Intersection(pOriginal, pPolygon, pIntersect) ) { pIntersect = m_pIntersect->Add_Shape(pIntersect); pIntersect ->Set_Value(ID, CSG_String::Format(SG_T("%s|%s"), pPolygon->asString(ID), pOriginal->asString(ID))); SG_Polygon_Difference(m_pIntersect->Get_Shape(i), pPolygon); SG_Polygon_Difference(pPolygon, pOriginal); } Intersect.Del_Shapes(); } } m_pIntersect->Select(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_SelfIntersection.h000066400000000000000000000105761224124640700274560ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_SelfIntersection.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygon_SelfIntersection.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Polygon_SelfIntersection_H #define HEADER_INCLUDED__Polygon_SelfIntersection_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_SelfIntersection : public CSG_Module { public: CPolygon_SelfIntersection(void); protected: virtual bool On_Execute (void); private: CSG_Shapes *m_pIntersect; void Add_Polygon (CSG_Shape *pPolygon, int ID); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Polygon_SelfIntersection_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.cpp000066400000000000000000000230161224124640700306750ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_StatisticsFromPoints.cpp 1750 2013-06-25 08:22:44Z oconrad $ *********************************************************/ /******************************************************************************* CPolygonStatisticsFromPoints.cpp Copyright (C) 2005 Victor Olaya Reworked (C) 2010 Olaf Conrad 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Polygon_StatisticsFromPoints.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygonStatisticsFromPoints::CPolygonStatisticsFromPoints(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Point Statistics for Polygons")); Set_Author (SG_T("V. Olaya, O. Conrad (c) 2005, 2010")); Set_Description (_TW( "Calculates statistics over all points falling in a polygon." )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL, "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Fields( pNode , "FIELDS" , _TL("Attributes"), _TL("") ); Parameters.Add_Shapes( NULL, "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL, "STATISTICS" , _TL("Statistics"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon ); Parameters.Add_Value(NULL, "SUM", _TL("Sum" ), _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(NULL, "AVG", _TL("Mean" ), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value(NULL, "VAR", _TL("Variance" ), _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(NULL, "DEV", _TL("Deviation"), _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(NULL, "MIN", _TL("Minimum" ), _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(NULL, "MAX", _TL("Maximum" ), _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(NULL, "NUM", _TL("Count" ), _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Choice( NULL, "FIELD_NAME" , _TL("Field Naming"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("variable type + original name"), _TL("original name + variable type"), _TL("original name"), _TL("variable type") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygonStatisticsFromPoints::On_Execute(void) { //----------------------------------------------------- bool bSum = Parameters("SUM")->asBool(); bool bAvg = Parameters("AVG")->asBool(); bool bVar = Parameters("VAR")->asBool(); bool bDev = Parameters("DEV")->asBool(); bool bMin = Parameters("MIN")->asBool(); bool bMax = Parameters("MAX")->asBool(); bool bNum = Parameters("NUM")->asBool(); if( !bSum && !bAvg && !bVar && !bDev && !bMin && !bMax && !bNum ) { Error_Set(_TL("no target variable in selection")); return( false ); } //----------------------------------------------------- CSG_Parameter_Table_Fields *pFields = Parameters("FIELDS")->asTableFields(); if( pFields->Get_Count() <= 0 ) { Error_Set(_TL("no attributes in selection")); return( false ); } //----------------------------------------------------- CSG_Shapes *pPoints = Parameters("POINTS" )->asShapes(); CSG_Shapes *pPolygons = Parameters("POLYGONS")->asShapes(); if( pPolygons->Get_Count() <= 0 || pPoints->Get_Count() <= 0 ) { Error_Set(_TL("no records in input data")); return( false ); } //----------------------------------------------------- if( Parameters("STATISTICS")->asShapes() == NULL ) { Parameters("STATISTICS")->Set_Value(pPolygons); } else if( pPolygons != Parameters("STATISTICS")->asShapes() ) { Parameters("STATISTICS")->asShapes()->Assign(pPolygons); pPolygons = Parameters("STATISTICS")->asShapes(); } //----------------------------------------------------- int i, n, Offset = pPolygons->Get_Field_Count(); for(i=0, n=0; iGet_Count(); i++) { CSG_String sName = pPoints->Get_Field_Name(pFields->Get_Index(i)); if( bSum ) { pPolygons->Add_Field(Get_Field_Name("SUM", sName), SG_DATATYPE_Double); n++; } if( bAvg ) { pPolygons->Add_Field(Get_Field_Name("AVG", sName), SG_DATATYPE_Double); n++; } if( bVar ) { pPolygons->Add_Field(Get_Field_Name("VAR", sName), SG_DATATYPE_Double); n++; } if( bDev ) { pPolygons->Add_Field(Get_Field_Name("DEV", sName), SG_DATATYPE_Double); n++; } if( bMin ) { pPolygons->Add_Field(Get_Field_Name("MIN", sName), SG_DATATYPE_Double); n++; } if( bMax ) { pPolygons->Add_Field(Get_Field_Name("MAX", sName), SG_DATATYPE_Double); n++; } if( bNum ) { pPolygons->Add_Field(Get_Field_Name("NUM", sName), SG_DATATYPE_Int ); n++; } } //----------------------------------------------------- CSG_Simple_Statistics *Statistics = new CSG_Simple_Statistics[pFields->Get_Count()]; for(int iPolygon=0; iPolygonGet_Count() && Set_Progress(iPolygon, pPolygons->Get_Count()); iPolygon++) { CSG_Shape_Polygon *pPolygon = (CSG_Shape_Polygon *)pPolygons->Get_Shape(iPolygon); //------------------------------------------------- for(i=0; iGet_Index(i); i++) { Statistics[i].Invalidate(); } //------------------------------------------------- for(int iPoint=0; iPointGet_Count() && Process_Get_Okay(); iPoint++) { CSG_Shape *pPoint = pPoints->Get_Shape(iPoint); if( pPolygon->Contains(pPoint->Get_Point(0)) ) { for(i=0; iGet_Count(); i++) { if( !pPoint->is_NoData(pFields->Get_Index(i))) { Statistics[i].Add_Value(pPoint->asDouble(pFields->Get_Index(i))); } } } } //------------------------------------------------- for(i=0, n=Offset; iGet_Index(i); i++) { if( Statistics[i].Get_Count() > 0 ) { if( bSum ) { pPolygon->Set_Value (n++, Statistics[i].Get_Sum()); } if( bAvg ) { pPolygon->Set_Value (n++, Statistics[i].Get_Mean()); } if( bVar ) { pPolygon->Set_Value (n++, Statistics[i].Get_Variance()); } if( bDev ) { pPolygon->Set_Value (n++, Statistics[i].Get_StdDev()); } if( bMin ) { pPolygon->Set_Value (n++, Statistics[i].Get_Minimum()); } if( bMax ) { pPolygon->Set_Value (n++, Statistics[i].Get_Maximum()); } if( bNum ) { pPolygon->Set_Value (n++, Statistics[i].Get_Count()); } } else { if( bSum ) { pPolygon->Set_NoData(n++); } if( bAvg ) { pPolygon->Set_NoData(n++); } if( bVar ) { pPolygon->Set_NoData(n++); } if( bDev ) { pPolygon->Set_NoData(n++); } if( bMin ) { pPolygon->Set_NoData(n++); } if( bMax ) { pPolygon->Set_NoData(n++); } if( bNum ) { pPolygon->Set_Value (n++, 0.0); } } } } //----------------------------------------------------- delete[](Statistics); DataObject_Update(pPolygons); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_String CPolygonStatisticsFromPoints::Get_Field_Name(const CSG_String &Type, const CSG_String &Name) { CSG_String s; switch( Parameters("FIELD_NAME")->asInt() ) { default: case 0: s.Printf(SG_T("%s_%s"), Type.c_str(), Name.c_str()); break; case 1: s.Printf(SG_T("%s_%s"), Name.c_str(), Type.c_str()); break; case 2: s.Printf(SG_T("%s" ), Name.c_str() ); break; case 3: s.Printf(SG_T("%s" ), Type.c_str() ); break; } return( s ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_StatisticsFromPoints.h000066400000000000000000000052741224124640700303500ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_StatisticsFromPoints.h 1449 2012-07-16 13:04:43Z oconrad $ *********************************************************/ /******************************************************************************* PolygonStatisticsFromPoints.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PolygonStatisticsFromPoints_H #define HEADER_INCLUDED__PolygonStatisticsFromPoints_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygonStatisticsFromPoints : public CSG_Module { public: CPolygonStatisticsFromPoints(void); protected: virtual bool On_Execute (void); private: CSG_String Get_Field_Name (const CSG_String &Type, const CSG_String &Name); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PolygonStatisticsFromPoints_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_Union.cpp000066400000000000000000000247021224124640700256150ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Union.cpp 1595 2013-01-25 14:16:26Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygon_Union.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Polygon_Union.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Dissolve::CPolygon_Dissolve(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Polygon Dissolve")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "Merges polygons, which share the same attribute value, and " "(optionally) dissolves borders between adjacent polygon parts.\n" "Uses the free and open source software library Clipper created by Angus Johnson.\n" "Clipper Homepage\n" "Clipper at SourceForge\n" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Table_Field( pNode , "FIELD_1" , _TL("1. Attribute"), _TL(""), true ); Parameters.Add_Table_Field( pNode , "FIELD_2" , _TL("2. Attribute"), _TL(""), true ); Parameters.Add_Table_Field( pNode , "FIELD_3" , _TL("3. Attribute"), _TL(""), true ); Parameters.Add_Shapes( NULL , "DISSOLVED" , _TL("Dissolved Polygons"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Value( NULL , "BND_KEEP" , _TL("Keep Boundaries"), _TL(""), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CPolygon_Dissolve::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("POLYGONS")) && pParameters->Get_Parameter("POLYGONS")->asShapes() != NULL ) { int nFields = pParameters->Get_Parameter("POLYGONS")->asShapes()->Get_Field_Count(); pParameters->Get_Parameter("FIELD_2")->Set_Value(nFields); pParameters->Get_Parameter("FIELD_3")->Set_Value(nFields); } return( 0 ); } //--------------------------------------------------------- int CPolygon_Dissolve::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FIELD_1")) ) { pParameters->Get_Parameter("FIELD_2")->Set_Enabled(pParameter->asInt() >= 0); pParameters->Get_Parameter("FIELD_3")->Set_Enabled(pParameter->asInt() >= 0 && pParameters->Get_Parameter("FIELD_2")->asInt() >= 0); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FIELD_2")) ) { pParameters->Get_Parameter("FIELD_3")->Set_Enabled(pParameter->asInt() >= 0 && pParameters->Get_Parameter("FIELD_1")->asInt() >= 0); } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Dissolve::On_Execute(void) { bool bDissolve; int Field_1, Field_2, Field_3, iPolygon; CSG_String Value; CSG_Shape *pPolygon , *pUnion; CSG_Shapes *pPolygons, *pUnions; //----------------------------------------------------- pPolygons = Parameters("POLYGONS" )->asShapes(); pUnions = Parameters("DISSOLVED")->asShapes(); Field_1 = Parameters("FIELD_1" )->asInt(); Field_2 = Parameters("FIELD_2" )->asInt(); Field_3 = Parameters("FIELD_3" )->asInt(); if( Field_2 < 0 ) Field_3 = -1; bDissolve = Parameters("BND_KEEP" )->asBool() == false; //----------------------------------------------------- if( !pPolygons->is_Valid() || pPolygons->Get_Count() < 2 ) { Error_Set(_TL("invalid or empty polygons layer")); return( false ); } pUnions ->Create(SHAPE_TYPE_Polygon); //----------------------------------------------------- if( Field_1 >= pPolygons->Get_Field_Count() ) { pUnions->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPolygons->Get_Name(), _TL("Dissolved"))); pUnions->Add_Field(_TL("ID"), SG_DATATYPE_Int); pUnion = pUnions->Add_Shape(pPolygons->Get_Shape(0), SHAPE_COPY_GEOM); for(iPolygon=1; iPolygonGet_Count() && Set_Progress(iPolygon, pPolygons->Get_Count()); iPolygon++) { pPolygon = pPolygons->Get_Shape(iPolygon); for(int iPart=0; iPartGet_Part_Count(); iPart++) { CSG_Shape_Part *pPart = ((CSG_Shape_Polygon *)pPolygon)->Get_Part(iPart); for(int iPoint=0, nParts=pUnion->Get_Part_Count(); iPointGet_Count(); iPoint++) { pUnion->Add_Point(pPart->Get_Point(iPoint), nParts); } } } if( bDissolve ) { SG_Polygon_Dissolve(pUnion); } } //----------------------------------------------------- else { Value = pPolygons->Get_Field_Name(Field_1); pUnions ->Add_Field(pPolygons->Get_Field_Name(Field_1), pPolygons->Get_Field_Type(Field_1)); if( Field_2 >= 0 ) { Value += CSG_String::Format(SG_T(", %s"), pPolygons->Get_Field_Name(Field_2)); pUnions ->Add_Field(pPolygons->Get_Field_Name(Field_2), pPolygons->Get_Field_Type(Field_2)); } if( Field_3 >= 0 ) { Value += CSG_String::Format(SG_T(", %s"), pPolygons->Get_Field_Name(Field_3)); pUnions ->Add_Field(pPolygons->Get_Field_Name(Field_3), pPolygons->Get_Field_Type(Field_3)); } pPolygons->Set_Index(Field_1, TABLE_INDEX_Ascending, Field_2, TABLE_INDEX_Ascending, Field_3, TABLE_INDEX_Ascending); pUnions->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pPolygons->Get_Name(), _TL("Dissolved"), Value.c_str())); for(iPolygon=0, pUnion=NULL; iPolygonGet_Count() && Set_Progress(iPolygon, pPolygons->Get_Count()); iPolygon++) { pPolygon = pPolygons->Get_Shape(pPolygons->Get_Record_byIndex(iPolygon)->Get_Index()); CSG_String s(pPolygon->asString(Field_1)); if( Field_2 >= 0 ) s += pPolygon->asString(Field_2); if( Field_3 >= 0 ) s += pPolygon->asString(Field_3); if( iPolygon == 0 || Value.Cmp(s) ) { if( pUnion && bDissolve ) { SG_Polygon_Dissolve(pUnion); } Value = s; pUnion = pUnions->Add_Shape(pPolygon, SHAPE_COPY_GEOM); pUnion->Set_Value(0, pPolygon->asString(Field_1)); if( Field_2 >= 0 ) pUnion->Set_Value(1, pPolygon->asString(Field_2)); if( Field_3 >= 0 ) pUnion->Set_Value(2, pPolygon->asString(Field_3)); } else { for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0, nParts=pUnion->Get_Part_Count(); iPointGet_Point_Count(iPart); iPoint++) { pUnion->Add_Point(pPolygon->Get_Point(iPoint, iPart), nParts); } } } } if( pUnion && bDissolve ) { SG_Polygon_Dissolve(pUnion); } } //----------------------------------------------------- return( pUnions->is_Valid() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygon_Union.h000066400000000000000000000110431224124640700252540ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Union.h 1595 2013-01-25 14:16:26Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygon_Union.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Polygon_Union_H #define HEADER_INCLUDED__Polygon_Union_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_Dissolve : public CSG_Module { public: CPolygon_Dissolve(void); protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Polygon_Union_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygons_From_Lines.cpp000066400000000000000000000137571224124640700267550ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygons_From_Lines.cpp 1322 2012-01-26 16:28:14Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygons_From_Lines.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Polygons_From_Lines.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygons_From_Lines::CPolygons_From_Lines(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Convert Lines to Polygons")); Set_Author (SG_T("O.Conrad (c) 2005")); Set_Description (_TW( "Converts lines to polygons. Line arcs are closed to polygons simply by connecting the last point with the first." )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); pNode = Parameters.Add_Shapes( NULL , "LINES" , _TL("Lines"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Line ); pNode = Parameters.Add_Value( NULL , "SINGLE" , _TL("Create Single Multipart Polygon"), _TL(""), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygons_From_Lines::On_Execute(void) { bool bSingle; CSG_Shape *pLine , *pPolygon; CSG_Shapes *pLines, *pPolygons; pPolygons = Parameters("POLYGONS")->asShapes(); pLines = Parameters("LINES" )->asShapes(); bSingle = Parameters("SINGLE" )->asBool (); if( pLines->Get_Count() <= 0 ) { return( false ); } if( !bSingle ) { pPolygons ->Create(SHAPE_TYPE_Polygon, pLines->Get_Name(), pLines); } else { pPolygons ->Create(SHAPE_TYPE_Polygon, pLines->Get_Name()); pPolygons ->Add_Field(SG_T("ID"), SG_DATATYPE_Int); pPolygon = pPolygons ->Add_Shape(); pPolygon ->Set_Value(0, 1); } //----------------------------------------------------- for(int iLine=0; iLineGet_Count() && Set_Progress(iLine, pLines->Get_Count()); iLine++) { pLine = pLines->Get_Shape(iLine); if( !bSingle ) { pPolygon = pPolygons->Add_Shape(pLine, SHAPE_COPY_ATTR); } for(int iPart=0, jPart=pPolygon->Get_Part_Count(); iPartGet_Part_Count(); iPart++, jPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { pPolygon->Add_Point(pLine->Get_Point(iPoint, iPart), jPart); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/Polygons_From_Lines.h000066400000000000000000000107251224124640700264120ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygons_From_Lines.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // Polygons_From_Lines.h // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Polygons_From_Lines_H #define HEADER_INCLUDED__Polygons_From_Lines_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygons_From_Lines : public CSG_Module { public: CPolygons_From_Lines(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Conversion") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Polygons_From_Lines_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/polygon_line_intersection.cpp000066400000000000000000000603571224124640700303100ustar00rootroot00000000000000/********************************************************** * Version $Id: polygon_line_intersection.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // polygon_line_intersection.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "polygon_line_intersection.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSG_Network_Node { friend class CSG_Network; public: int Get_ID (void) const { return( m_ID ); } const TSG_Point & Get_Point (void) const { return( m_Point ); } int Get_Edge_Count (void) const { return( m_Edges.Get_Count() ); } int Get_Edge (int iEdge) const { return( iEdge >= 0 && iEdge < m_Edges.Get_Count() ? m_Edges[iEdge].asInt(0) : -1 ); } double Get_Direction (int iEdge) const { return( m_Edges[iEdge][1] ); } int Get_Edge_Next (int iEdge, bool bClockwise = true) const { if( Get_Edge_Count() > 1 ) { for(int i=0; iasInt(0) == iEdge ) { i = bClockwise ? i < m_Edges.Get_Count() - 1 ? i + 1 : 0 : i > 0 ? i - 1 : m_Edges.Get_Count() - 1; return( m_Edges.Get_Record_byIndex(i)->asInt(0) ); } } } return( -1 ); } private: int m_ID; TSG_Point m_Point; CSG_Table m_Edges; CSG_Network_Node(int ID, const TSG_Point &Point) { m_ID = ID; m_Point = Point; m_Edges.Add_Field(SG_T("ID") , SG_DATATYPE_Int); m_Edges.Add_Field(SG_T("DIR"), SG_DATATYPE_Double); } bool Add_Edge (int ID, double Direction) { CSG_Table_Record *pEdge = m_Edges.Add_Record(); pEdge->Set_Value(0, ID); pEdge->Set_Value(1, Direction); m_Edges.Set_Index(1, TABLE_INDEX_Ascending); return( true ); } bool Del_Edge (int ID) { int n = 0; for(int i=m_Edges.Get_Count()-1; i>=0; i--) { if( m_Edges[i].asInt(0) == ID ) { m_Edges.Del_Record(i); n++; } } if( n > 0 ) { m_Edges.Set_Index(1, TABLE_INDEX_Ascending); return( true ); } return( false ); } }; //--------------------------------------------------------- class CSG_Network { public: CSG_Network (void); bool Create (void); CSG_Network (CSG_Shapes *pLines); bool Create (CSG_Shapes *pLines); virtual ~CSG_Network (void); bool Destroy (void); const CSG_Shapes & Get_Edges (void) const { return( m_Edges ); } int Get_Node_Count (void) const { return( (int)m_Nodes.Get_Size() ); } CSG_Network_Node & Get_Node (int i) const { return( *((CSG_Network_Node **)m_Nodes.Get_Array())[i] ); } bool Add_Shape (CSG_Shape *pShape); bool Update (void); bool Remove_End_Nodes (void); private: CSG_Array m_Nodes; CSG_Shapes m_Edges; void _On_Construction (void); bool _Add_Line (CSG_Shape *pLine, int ID); int _Add_Node (CSG_PRQuadTree &Search, int Edge_ID, const TSG_Point &Node_Point, const TSG_Point &Dir_Point); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Network::CSG_Network(void) { _On_Construction(); Create(); } bool CSG_Network::Create(void) { Destroy(); return( true ); } //--------------------------------------------------------- CSG_Network::CSG_Network(CSG_Shapes *pLines) { _On_Construction(); Create(pLines); } bool CSG_Network::Create(CSG_Shapes *pLines) { Destroy(); if( !pLines || pLines->Get_Type() != SHAPE_TYPE_Line || !pLines->is_Valid() ) { return( false ); } for(int iLine=0; iLineGet_Count(); iLine++) { Add_Shape(pLines->Get_Shape(iLine)); } return( true ); } //--------------------------------------------------------- CSG_Network::~CSG_Network(void) { Destroy(); } bool CSG_Network::Destroy(void) { for(int i=0; iis_Valid() ) { return( false ); } //----------------------------------------------------- CSG_Shapes Part(SHAPE_TYPE_Line); CSG_Shape *pPart = Part.Add_Shape(); for(int iPart=0; iPartGet_Part_Count(); iPart++) { if( pShape->Get_Point_Count(iPart) > 1 ) { bool bAscending = pShape->Get_Type() != SHAPE_TYPE_Polygon || ((CSG_Shape_Polygon *)pShape)->is_Lake(iPart) != ((CSG_Shape_Polygon *)pShape)->is_Clockwise(iPart); CSG_Point q, p = pShape->Get_Point(0, iPart, bAscending); pPart->Add_Point(p); for(int iPoint=1; iPointGet_Point_Count(iPart); iPoint++) { if( !p.is_Equal(q = pShape->Get_Point(iPoint, iPart, bAscending)) ) { p = q; pPart->Add_Point(p); } } if( pPart->Get_Point_Count(0) > 1 ) { _Add_Line(pPart, pShape->Get_Type()); } pPart->Del_Parts(); } } return( true ); } //--------------------------------------------------------- bool CSG_Network::_Add_Line(CSG_Shape *pLine, int ID) { int iEdge, iPoint, iCrossing; CSG_Shape *pEdge, *pCrossing; CSG_Shapes Crossings(SHAPE_TYPE_Point); //----------------------------------------------------- // 1. find crossings Crossings.Add_Field(SG_T("LINE_POINT") , SG_DATATYPE_Int); Crossings.Add_Field(SG_T("EDGE_ID") , SG_DATATYPE_Int); Crossings.Add_Field(SG_T("EDGE_POINT") , SG_DATATYPE_Int); Crossings.Add_Field(SG_T("EDGE_DIST") , SG_DATATYPE_Double); for(iEdge=0; iEdgeIntersects(pLine) ) { TSG_Point a = pEdge->Get_Point(0); for(int iEdge_Point=1; iEdge_PointGet_Point_Count(0); iEdge_Point++) { TSG_Point b = a; a = pEdge->Get_Point(iEdge_Point); TSG_Point A = pLine->Get_Point(0); for(iPoint=1; iPointGet_Point_Count(0); iPoint++) { TSG_Point C, B = A; A = pLine->Get_Point(iPoint); if( SG_Get_Crossing(C, A, B, a, b) ) { pCrossing = Crossings.Add_Shape(); pCrossing->Add_Point(C); pCrossing->Set_Value(0, iPoint); pCrossing->Set_Value(1, iEdge); pCrossing->Set_Value(2, iEdge_Point); pCrossing->Set_Value(3, SG_Get_Distance(C, b)); } } } } } //----------------------------------------------------- // 2. add new line's vertices Crossings.Set_Index(0, TABLE_INDEX_Ascending); pEdge = m_Edges.Add_Shape(); pEdge ->Set_Value(3, ID); for(iCrossing=0, iPoint=0; iCrossingasInt(0) ) { pEdge->Add_Point(pLine->Get_Point(iPoint++)); } pEdge->Add_Point(pCrossing->Get_Point(0)); pEdge = m_Edges.Add_Shape(); pEdge ->Set_Value(3, ID); pEdge ->Add_Point(pCrossing->Get_Point(0)); } while( iPoint < pLine->Get_Point_Count(0) ) { pEdge->Add_Point(pLine->Get_Point(iPoint++)); } //----------------------------------------------------- // 3. split edges, if necessary Crossings.Set_Index(1, TABLE_INDEX_Descending, 2, TABLE_INDEX_Ascending, 3, TABLE_INDEX_Ascending); for(iCrossing=0; iCrossingasInt(1); pLine = m_Edges.Get_Shape(iEdge); ID = pLine->asInt(0); iPoint = 0; pEdge = m_Edges.Add_Shape(); pEdge ->Set_Value(3, pLine->asInt(3)); while( 1 ) { while( iPoint < pCrossing->asInt(2) ) { pEdge->Add_Point(pLine->Get_Point(iPoint++)); } pEdge->Add_Point(pCrossing->Get_Point(0)); if( ++iCrossing < Crossings.Get_Count() && iEdge == Crossings.Get_Shape_byIndex(iCrossing)->asInt(1) ) { pEdge = m_Edges.Add_Shape(); pEdge ->Set_Value(3, pLine->asInt(3)); pEdge->Add_Point(pCrossing->Get_Point(0)); pCrossing = Crossings.Get_Shape_byIndex(iCrossing); } else { if( iPoint < pLine->Get_Point_Count() ) { pEdge = m_Edges.Add_Shape(); pEdge ->Set_Value(3, pLine->asInt(3)); pEdge->Add_Point(pCrossing->Get_Point(0)); while( iPoint < pLine->Get_Point_Count() ) { pEdge->Add_Point(pLine->Get_Point(iPoint++)); } } break; } } m_Edges.Del_Shape(iEdge); } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Network::Update(void) { int iEdge; //----------------------------------------------------- for(iEdge=m_Edges.Get_Count()-1; iEdge>=0; iEdge--) { CSG_Shape *pEdge = m_Edges.Get_Shape(iEdge); if( !(((CSG_Shape_Line *)pEdge)->Get_Length() > 0.0) ) { m_Edges.Del_Shape(iEdge); } } //----------------------------------------------------- for(int i=0; iSet_Value(0, iEdge); pEdge->Set_Value(1, _Add_Node(Search, iEdge, pEdge->Get_Point(0), pEdge->Get_Point(1) )); pEdge->Set_Value(2, _Add_Node(Search, iEdge, pEdge->Get_Point(pEdge->Get_Point_Count(0) - 1), pEdge->Get_Point(pEdge->Get_Point_Count(0) - 2) )); } //----------------------------------------------------- return( true ); } //--------------------------------------------------------- int CSG_Network::_Add_Node(CSG_PRQuadTree &Search, int Edge_ID, const TSG_Point &Node_Point, const TSG_Point &Dir_Point) { int Node_ID; double Distance; CSG_PRQuadTree_Leaf *pLeaf = Search.Get_Nearest_Leaf(Node_Point, Distance); if( !pLeaf || Distance > 0.0 )//00001 ) { Node_ID = Get_Node_Count(); m_Nodes.Inc_Array(); ((CSG_Network_Node **)m_Nodes.Get_Array())[Node_ID] = new CSG_Network_Node(Node_ID, Node_Point); Search.Add_Point(Node_Point.x, Node_Point.y, Node_ID); } else { Node_ID = (int)pLeaf->Get_Z(); } Get_Node(Node_ID).Add_Edge(Edge_ID, SG_Get_Angle_Of_Direction(Node_Point, Dir_Point)); return( Node_ID ); } //--------------------------------------------------------- bool CSG_Network::Remove_End_Nodes(void) { int iEdge, n; //----------------------------------------------------- for(iEdge=0; iEdgeasInt(3) == SHAPE_TYPE_Line ) { bool bRemove = false; for(int iNode=1; iNode<=2 && !bRemove; iNode++) { CSG_Network_Node &Node = Get_Node(pEdge->asInt(iNode)); CSG_Point Point = Node.Get_Point(); CSG_Shape *pNext; if( ( (pNext = m_Edges.Get_Shape(Node.Get_Edge_Next(pEdge->asInt(0), true))) != NULL && pNext->asInt(3) == SHAPE_TYPE_Polygon && !Point.is_Equal(pNext->Get_Point(0, 0, false)) ) || ( (pNext = m_Edges.Get_Shape(Node.Get_Edge_Next(pEdge->asInt(0), false))) != NULL && pNext->asInt(3) == SHAPE_TYPE_Polygon && !Point.is_Equal(pNext->Get_Point(0, 0, true)) ) ) { bRemove = true; } } if( bRemove ) { Get_Node(pEdge->asInt(1)).Del_Edge(pEdge->asInt(0)); Get_Node(pEdge->asInt(2)).Del_Edge(pEdge->asInt(0)); pEdge->Set_Value(4, 1); } } } //----------------------------------------------------- do { for(n=0, iEdge=0; iEdgeasInt(3) == SHAPE_TYPE_Line && pEdge->asInt(4) == 0 ) { if( Get_Node(pEdge->asInt(1)).Get_Edge_Count() <= 1 || Get_Node(pEdge->asInt(2)).Get_Edge_Count() <= 1 ) { Get_Node(pEdge->asInt(1)).Del_Edge(pEdge->asInt(0)); Get_Node(pEdge->asInt(2)).Del_Edge(pEdge->asInt(0)); pEdge->Set_Value(4, 1); n++; } } } } while( n > 0 ); //----------------------------------------------------- for(iEdge=m_Edges.Get_Count()-1; iEdge>=0; iEdge--) { if( m_Edges[iEdge][4] ) { m_Edges.Del_Shape(iEdge); } } //----------------------------------------------------- return( Update() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Line_Intersection::CPolygon_Line_Intersection(void) { //----------------------------------------------------- Set_Name (_TL("Polygon-Line Intersection")); Set_Author (SG_T("O. Conrad (c) 2011")); Set_Description (_TW( "Polygon-line intersection. Splits polygons with lines. " )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "LINES" , _TL("Lines"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Line ); Parameters.Add_Shapes( NULL , "INTERSECT" , _TL("Intersection"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Line_Intersection::On_Execute(void) { CSG_Shapes *pPolygons; //-------------------------------------------------------- pPolygons = Parameters("POLYGONS") ->asShapes(); m_pLines = Parameters("LINES") ->asShapes(); m_pIntersection = Parameters("INTERSECT") ->asShapes(); //-------------------------------------------------------- if( !m_pLines ->is_Valid() || m_pLines ->Get_Count() < 1 || !pPolygons->is_Valid() || pPolygons->Get_Count() < 1 || m_pLines->Get_Extent().Intersects(pPolygons->Get_Extent()) == INTERSECTION_None ) { Error_Set(_TL("no shapes for intersection found")); return( false ); } //-------------------------------------------------------- m_pIntersection->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s: %s]"), pPolygons->Get_Name(), _TL("Intersection"), m_pLines->Get_Name()), pPolygons ); //-------------------------------------------------------- for(int iPolygon=0; iPolygonGet_Count() && Set_Progress(iPolygon, pPolygons->Get_Count()); iPolygon++) { if( !Get_Intersection((CSG_Shape_Polygon *)pPolygons->Get_Shape(iPolygon)) ) { m_pIntersection->Add_Shape(pPolygons->Get_Shape(iPolygon)); } } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool Trace_Polygon(CSG_Shape *pPolygon, CSG_Network &Network, int iEdge) { bool bAscending = true; CSG_Shape *pEdge = Network.Get_Edges().Get_Shape(iEdge); if( pEdge->asInt(3) == SHAPE_TYPE_Polygon ) { if( pEdge->asInt(4) ) { return( false ); } bAscending = true; } else if( (pEdge->asInt(4) & 0x1) == 0 ) { bAscending = true; } else if( (pEdge->asInt(4) & 0x2) == 0 ) { bAscending = false; } else { return( false ); } while( pEdge != NULL ) { pEdge->Set_Value(4, pEdge->asInt(4) | (bAscending ? 0x1 : 0x2)); for(int iPoint=0; iPointGet_Point_Count(0); iPoint++) { pPolygon->Add_Point(pEdge->Get_Point(iPoint, 0, bAscending)); } int End_Node = pEdge->asInt(bAscending ? 2 : 1); iEdge = Network.Get_Node(End_Node).Get_Edge_Next(iEdge, false); pEdge = Network.Get_Edges().Get_Shape(iEdge); if( pEdge ) { bAscending = pEdge->asInt(3) == SHAPE_TYPE_Polygon || End_Node == pEdge->asInt(1); if( (pEdge->asInt(4) & (bAscending ? 0x1 : 0x2)) ) { pEdge = NULL; } } } return( pPolygon->is_Valid() ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Line_Intersection::Get_Intersection(CSG_Shape_Polygon *pPolygon) { CSG_Network Network; for(int iLine=0; iLineGet_Count(); iLine++) { CSG_Shape *pLine = m_pLines->Get_Shape(iLine); if( pLine->Intersects(pPolygon) ) { Network.Add_Shape(pLine); } } if( Network.Get_Edges().Get_Count() == 0 ) { return( false ); } Network.Add_Shape(pPolygon); Network.Update(); Network.Remove_End_Nodes(); //----------------------------------------------------- int iEdge, iPolygon; CSG_Shapes Intersection(SHAPE_TYPE_Polygon); Intersection.Add_Field(SG_T("ID"), SG_DATATYPE_Int); for(iEdge=0; iEdgeasInt(3) == SHAPE_TYPE_Polygon ) { Trace_Polygon(Intersection.Add_Shape(), Network, iEdge); } else if( pPolygon->Contains(pEdge->Get_Point(0)) && pPolygon->Contains(pEdge->Get_Point(pEdge->Get_Point_Count(0) - 1)) ) { Trace_Polygon(Intersection.Add_Shape(), Network, iEdge); Trace_Polygon(Intersection.Add_Shape(), Network, iEdge); } } //----------------------------------------------------- for(iPolygon=0; iPolygonGet_Point_Count() > 0 && ((CSG_Shape_Polygon *)pIntersect)->is_Clockwise(0) == true ) { pIntersect->Set_Value(0, m_pIntersection->Get_Count()); ((CSG_Table_Record *)m_pIntersection->Add_Shape(pIntersect, SHAPE_COPY_GEOM))->Assign(pPolygon); } } for(iPolygon=0; iPolygonGet_Point_Count() > 0 && ((CSG_Shape_Polygon *)pIntersect)->is_Clockwise(0) == false ) { for(int j=0; jContains(pIntersect->Get_Point(0)) ) { CSG_Shape *pShape = m_pIntersection->Get_Shape(Intersection[j].asInt(0)); for(int iPoint=0, iPart=pShape->Get_Part_Count(); iPointGet_Point_Count(0); iPoint++) { pShape->Add_Point(pIntersect->Get_Point(iPoint), iPart); } break; } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// /*/--------------------------------------------------------- { //----------------------------------------------------- CSG_Shapes p(SHAPE_TYPE_Point); p.Add_Field(SG_T("ID") , SG_DATATYPE_Int); p.Add_Field(SG_T("COUNT"), SG_DATATYPE_Int); for(int i=0; iAdd_Point(Network.Get_Node(i).Get_Point()); pNode->Set_Value(0, Network.Get_Node(i).Get_ID()); pNode->Set_Value(1, Network.Get_Node(i).Get_Edge_Count()); } DataObject_Add(SG_Create_Shapes(p)); DataObject_Add(SG_Create_Shapes(Network.Get_Edges())); //----------------------------------------------------- CSG_Shapes l(SHAPE_TYPE_Line); l.Add_Field(SG_T("ID") , SG_DATATYPE_Int); l.Add_Field(SG_T("COUNT"), SG_DATATYPE_Int); l.Add_Field(SG_T("EDGE") , SG_DATATYPE_Int); l.Add_Field(SG_T("DIR") , SG_DATATYPE_Double); l.Add_Field(SG_T("ORDER"), SG_DATATYPE_Int); for(int i=0; iSet_Value(0, Network.Get_Node(i).Get_ID()); pNode->Set_Value(1, Network.Get_Node(i).Get_Edge_Count()); pNode->Set_Value(2, Network.Get_Node(i).Get_Edge(j)); pNode->Set_Value(3, Network.Get_Node(i).Get_Direction(j) * M_RAD_TO_DEG); pNode->Set_Value(4, j); pNode->Add_Point(P); pNode->Add_Point( P.x + 10.0 * sin(Network.Get_Node(i).Get_Direction(j)), P.y + 10.0 * cos(Network.Get_Node(i).Get_Direction(j)) ); } } //----------------------------------------------------- CSG_Shapes p(SHAPE_TYPE_Point); p.Add_Field(SG_T("COUNT"), SG_DATATYPE_Int); for(int i=0; iAdd_Point(Network.Get_Node(i).Get_Point()); pNode->Set_Value(0, Network.Get_Node(i).Get_Edge_Count()); } DataObject_Add(SG_Create_Shapes(p)); }/**/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/polygon_line_intersection.h000066400000000000000000000106251224124640700277460ustar00rootroot00000000000000/********************************************************** * Version $Id: polygon_line_intersection.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // polygon_line_intersection.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__polygon_line_intersection_H #define HEADER_INCLUDED__polygon_line_intersection_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_Line_Intersection : public CSG_Module { public: CPolygon_Line_Intersection(void); protected: virtual bool On_Execute (void); private: CSG_Shapes *m_pLines, *m_pIntersection; bool Get_Intersection (CSG_Shape_Polygon *pPolygon); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__polygon_line_intersection_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/polygon_split_parts.cpp000066400000000000000000000143071224124640700271310ustar00rootroot00000000000000/********************************************************** * Version $Id: polygon_split_parts.cpp 915 2011-02-15 08:43:36Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // polygon_split_parts.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "polygon_split_parts.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Split_Parts::CPolygon_Split_Parts(void) { //----------------------------------------------------- Set_Name (_TL("Polygon Parts to Separate Polygons")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Splits parts of multipart polygons into separate polygons. " "This can be done only for islands (outer rings) or for all " "parts (inner and outer rings) by checking the 'ignore lakes' " "option." )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "PARTS" , _TL("Polygon Parts"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Value( NULL , "LAKES" , _TL("Ignore Lakes"), _TL(""), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Split_Parts::On_Execute(void) { bool bIgnoreLakes; CSG_Shapes *pPolygons, *pParts; pPolygons = Parameters("POLYGONS") ->asShapes(); pParts = Parameters("PARTS") ->asShapes(); bIgnoreLakes = Parameters("LAKES") ->asBool(); pParts->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), pPolygons->Get_Name(), _TL("Parts")), pPolygons); //----------------------------------------------------- for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pPolygons->Get_Count()); iShape++) { CSG_Shape *pPolygon = pPolygons->Get_Shape(iShape); for(int iPart=0; iPartGet_Part_Count() && Process_Get_Okay(); iPart++) { if( bIgnoreLakes || !((CSG_Shape_Polygon *)pPolygon)->is_Lake(iPart) ) { CSG_Shape *pPart = pParts->Add_Shape(pPolygon, SHAPE_COPY_ATTR); for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { pPart->Add_Point(pPolygon->Get_Point(iPoint, iPart)); } if( !bIgnoreLakes ) { for(int jPart=0; jPartGet_Part_Count(); jPart++) { if( ((CSG_Shape_Polygon *)pPolygon)->is_Lake(jPart) && ((CSG_Shape_Polygon *)pPart)->Contains(pPolygon->Get_Point(0, jPart)) ) { for(int jPoint=0, nPart=pPart->Get_Part_Count(); jPointGet_Point_Count(jPart); jPoint++) { pPart->Add_Point(pPolygon->Get_Point(jPoint, jPart), nPart); } } } } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/polygon_split_parts.h000066400000000000000000000104071224124640700265730ustar00rootroot00000000000000/********************************************************** * Version $Id: polygon_split_parts.h 915 2011-02-15 08:43:36Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // polygon_split_parts.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__polygon_split_parts_H #define HEADER_INCLUDED__polygon_split_parts_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_Split_Parts : public CSG_Module { public: CPolygon_Split_Parts(void); protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__polygon_split_parts_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/polygon_to_edges_nodes.cpp000066400000000000000000000222061224124640700275430ustar00rootroot00000000000000/********************************************************** * Version $Id: polygon_to_edges_nodes.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // polygon_to_edges_nodes.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "polygon_to_edges_nodes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_to_Edges_Nodes::CPolygon_to_Edges_Nodes(void) { //----------------------------------------------------- Set_Name (_TL("Polygons to Edges and Nodes")); Set_Author (SG_T("O. Conrad (c) 2011")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "EDGES" , _TL("Edges"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); Parameters.Add_Shapes( NULL , "NODES" , _TL("Nodes"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_to_Edges_Nodes::On_Execute(void) { CSG_Shapes *pPolygons; pPolygons = Parameters("POLYGONS") ->asShapes(); m_pEdges = Parameters("EDGES") ->asShapes(); m_pNodes = Parameters("NODES") ->asShapes(); if( !m_Vertices.Create(pPolygons, -1) ) { Error_Set(_TL("initialisation error")); return( false ); } //----------------------------------------------------- m_pEdges->Create(SHAPE_TYPE_Line , CSG_String::Format(SG_T("%s [%s]"), pPolygons->Get_Name(), _TL("Edges"))); m_pEdges->Add_Field(_TL("ID") , SG_DATATYPE_Int); m_pEdges->Add_Field(_TL("NODE_A"), SG_DATATYPE_Int); m_pEdges->Add_Field(_TL("NODE_B"), SG_DATATYPE_Int); m_pEdges->Add_Field(_TL("FACE_A"), SG_DATATYPE_Int); m_pEdges->Add_Field(_TL("FACE_B"), SG_DATATYPE_Int); m_pNodes->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), pPolygons->Get_Name(), _TL("Nodes"))); m_pNodes->Add_Field(_TL("ID") , SG_DATATYPE_Int); m_pNodes->Add_Field(_TL("COUNT") , SG_DATATYPE_Int); m_pNodes->Add_Field(_TL("EDGES") , SG_DATATYPE_String); m_Nodes.Create(pPolygons->Get_Extent()); //----------------------------------------------------- for(int iPolygon=0; iPolygonGet_Count() && Set_Progress(iPolygon, pPolygons->Get_Count()); iPolygon++) { CSG_Shape *pPolygon = pPolygons->Get_Shape(iPolygon); for(int iPart=0, iPoint; iPartGet_Part_Count(); iPart++) { if( !Find_Node(pPolygon, iPart, iPoint = 0) ) { CSG_Shape *pEdge = m_pEdges->Add_Shape(); for(iPoint=0; iPointGet_Point_Count(); iPoint++) { pEdge->Add_Point(pPolygon->Get_Point(iPoint, iPart)); } } else { do { Trace_Edge(pPolygon, iPart, iPoint); } while( Find_Node(pPolygon, iPart, ++iPoint) ); } } } //----------------------------------------------------- m_Vertices .Destroy(); m_Nodes .Destroy(); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_to_Edges_Nodes::Find_Node(CSG_Shape *pPolygon, int iPart, int &iPoint) { for( ; iPointGet_Point_Count(iPart); iPoint++) { double Distance; CSG_PRQuadTree_Leaf *pLeaf = m_Vertices.Get_Nearest_Leaf(pPolygon->Get_Point(iPoint, iPart), Distance); if( pLeaf->has_Statistics() && ((CSG_PRQuadTree_Leaf_List *)pLeaf)->Get_Count() > 2 ) { return( true ); } } return( false ); } //--------------------------------------------------------- bool CPolygon_to_Edges_Nodes::Trace_Edge(CSG_Shape *pPolygon, int iPart, int aPoint) { CSG_Shape *pEdge = m_pEdges->Add_Shape(); for(int iPoint=aPoint; pEdge->Get_Point_Count(0)Get_Point_Count(iPart); iPoint=iPointGet_Point_Count(iPart)-1 ? iPoint+1 : 0) { double Distance; CSG_PRQuadTree_Leaf *pLeaf = m_Vertices.Get_Nearest_Leaf(pPolygon->Get_Point(iPoint, iPart), Distance); pEdge->Add_Point(pPolygon->Get_Point(iPoint, iPart)); if( iPoint != aPoint && pLeaf->has_Statistics() ) { if( ((CSG_PRQuadTree_Leaf_List *)pLeaf)->Get_Count() > 2 ) // Node { TSG_Point A = pPolygon->Get_Point(aPoint, iPart); TSG_Point B = pPolygon->Get_Point(iPoint, iPart); if( pEdge->Get_Point_Count(0) > 2 || (A.x != B.x || A.y != B.y) ) { int Node_A = Add_Node(A, pEdge->Get_Index()); int Node_B = Add_Node(B, pEdge->Get_Index()); pEdge->Set_Value(0, pEdge->Get_Index()); pEdge->Set_Value(1, Node_A < Node_B ? Node_A : Node_B); pEdge->Set_Value(2, Node_A < Node_B ? Node_B : Node_A); pEdge->Set_Value(3, pPolygon->Get_Index()); return( true ); } m_pEdges->Del_Shape(pEdge); return( false ); } } } m_pEdges->Del_Shape(pEdge); return( false ); } //--------------------------------------------------------- int CPolygon_to_Edges_Nodes::Add_Node(TSG_Point &Point, int Edge_ID) { int Node_ID; double Distance; CSG_Shape *pNode; CSG_PRQuadTree_Leaf *pLeaf = m_Nodes.Get_Nearest_Leaf(Point, Distance); if( !pLeaf || Distance > 0.0 ) { Node_ID = m_pNodes->Get_Count(); pNode = m_pNodes->Add_Shape(); pNode ->Set_Value(0, Node_ID); pNode ->Set_Value(1, 1); pNode ->Set_Value(2, CSG_String::Format(SG_T("%d"), Edge_ID)); pNode ->Set_Value(3, -1); pNode ->Add_Point(Point); m_Nodes.Add_Point(Point.x, Point.y, Node_ID); } else { Node_ID = (int)pLeaf->Get_Z(); pNode = m_pNodes->Get_Shape(Node_ID); pNode ->Add_Value(1, 1); pNode ->Set_Value(2, CSG_String::Format(SG_T("%s|%d"), pNode->asString(2), Edge_ID)); } return( pNode->Get_Index() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/polygon_to_edges_nodes.h000066400000000000000000000110541224124640700272070ustar00rootroot00000000000000/********************************************************** * Version $Id: polygon_to_edges_nodes.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_polygons // // // //-------------------------------------------------------// // // // polygon_to_edges_nodes.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__polygon_to_edges_nodes_H #define HEADER_INCLUDED__polygon_to_edges_nodes_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_to_Edges_Nodes : public CSG_Module { public: CPolygon_to_Edges_Nodes(void); protected: virtual bool On_Execute (void); private: CSG_PRQuadTree m_Vertices, m_Nodes; CSG_Shapes *m_pEdges, *m_pNodes; bool Find_Node (CSG_Shape *pPolygon, int iPart, int &iPoint); bool Trace_Edge (CSG_Shape *pPolygon, int iPart, int iPoint); int Add_Node (TSG_Point &Point, int Edge_ID); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__polygon_to_edges_nodes_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/polygon_to_points.cpp000066400000000000000000000157001224124640700266010ustar00rootroot00000000000000/********************************************************** * Version $Id: polygon_to_points.cpp 988 2011-04-12 15:55:24Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Polygon // // // //-------------------------------------------------------// // // // Polygon_To_Points.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "polygon_to_points.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_To_Points::CPolygon_To_Points(void) { //----------------------------------------------------- Set_Name (_TL("Convert Polygon/Line Vertices to Points")); Set_Author (SG_T("O. Conrad (c) 2008")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_To_Points::On_Execute(void) { CSG_Shapes *pShapes, *pPoints; pShapes = Parameters("SHAPES") ->asShapes(); pPoints = Parameters("POINTS") ->asShapes(); //----------------------------------------------------- if( pShapes->is_Valid() ) { pPoints->Create(SHAPE_TYPE_Point, pShapes->Get_Name()); pPoints->Add_Field(SG_T("ID") , SG_DATATYPE_String); pPoints->Add_Field(SG_T("ID_SHAPE") , SG_DATATYPE_Int); pPoints->Add_Field(SG_T("ID_PART") , SG_DATATYPE_Int); pPoints->Add_Field(SG_T("ID_POINT") , SG_DATATYPE_Int); if( pShapes->Get_Type() == SHAPE_TYPE_Polygon ) { pPoints->Add_Field(SG_T("CLOCKWISE"), SG_DATATYPE_String); pPoints->Add_Field(SG_T("LAKE") , SG_DATATYPE_String); } switch( pShapes->Get_Vertex_Type() ) { case SG_VERTEX_TYPE_XY: break; case SG_VERTEX_TYPE_XYZ: pPoints->Add_Field(SG_T("Z"), SG_DATATYPE_Double); break; case SG_VERTEX_TYPE_XYZM: pPoints->Add_Field(SG_T("Z"), SG_DATATYPE_Double); pPoints->Add_Field(SG_T("M"), SG_DATATYPE_Double); break; } for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { CSG_Shape *pPoint = pPoints->Add_Shape(); pPoint->Add_Point(pShape->Get_Point(iPoint, iPart)); int n = 0; pPoint->Set_Value(n++, CSG_String::Format(SG_T("%d/%d/%d"), iShape, iPart, iPoint)); pPoint->Set_Value(n++, iShape); pPoint->Set_Value(n++, iPart); pPoint->Set_Value(n++, iPoint); if( pShapes->Get_Type() == SHAPE_TYPE_Polygon ) { pPoint->Set_Value(n++, ((CSG_Shape_Polygon *)pShape)->is_Clockwise(iPart) ? SG_T("Y") : SG_T("N")); pPoint->Set_Value(n++, ((CSG_Shape_Polygon *)pShape)->is_Lake (iPart) ? SG_T("Y") : SG_T("N")); } switch( pShapes->Get_Vertex_Type() ) { case SG_VERTEX_TYPE_XY: break; case SG_VERTEX_TYPE_XYZ: pPoint->Set_Value(n++, pShape->Get_Z(iPoint, iPart)); break; case SG_VERTEX_TYPE_XYZM: pPoint->Set_Value(n++, pShape->Get_Z(iPoint, iPart)); pPoint->Set_Value(n++, pShape->Get_M(iPoint, iPart)); break; } } } } return( pPoints->is_Valid() ); } //----------------------------------------------------- return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/polygon_to_points.h000066400000000000000000000103521224124640700262440ustar00rootroot00000000000000/********************************************************** * Version $Id: polygon_to_points.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Polygon // // // //-------------------------------------------------------// // // // Polygon_To_Points.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Polygon_To_Points_H #define HEADER_INCLUDED__Polygon_To_Points_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_To_Points : public CSG_Module { public: CPolygon_To_Points(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Conversion") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Polygon_To_Points_H saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/shape_index.cpp000066400000000000000000000176661224124640700253200ustar00rootroot00000000000000/********************************************************** * Version $Id: shape_index.cpp 1333 2012-02-21 13:27:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Polygon // // // //-------------------------------------------------------// // // // Shape_Index.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "shape_index.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShape_Index::CShape_Index(void) { //----------------------------------------------------- Set_Name (_TL("Polygon Shape Indices")); Set_Author (SG_T("(c) 2008 by O.Conrad")); Set_Description (_TW( "Various indices describing the shape of polygons. " "Based on area, perimeter, maximum distance between the vertices of a polygon.\n" "\n" " - Interior Edge Ratio (Perimeter / Area)\n" " - Shape Index (Perimeter / (2 * SquareRoot(PI * Area))\n" "\n" "References:\n" "Lang, S., Blaschke, T. (2007): Landschaftsanalyse mit GIS.\n" "\n" "Forman, R.T.T., Godron, M. (1986): Landscape Ecology. Cambridge.\n" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "INDEX" , _TL("Shape Index"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon ); } //--------------------------------------------------------- CShape_Index::~CShape_Index(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShape_Index::On_Execute(void) { CSG_Shapes *pShapes, *pIndex; //----------------------------------------------------- pShapes = Parameters("SHAPES") ->asShapes(); pIndex = Parameters("INDEX") ->asShapes(); //----------------------------------------------------- if( pShapes->is_Valid() ) { int iField = pShapes->Get_Field_Count(); if( pIndex == NULL ) { pIndex = pShapes; } if( pIndex != pShapes ) { pIndex->Create(SHAPE_TYPE_Polygon, _TL("Shape Index"), pShapes); } pIndex->Add_Field(_TL("Area") , SG_DATATYPE_Double); pIndex->Add_Field(_TL("Perimeter") , SG_DATATYPE_Double); pIndex->Add_Field(_TL("P/A") , SG_DATATYPE_Double); pIndex->Add_Field(_TL("P/sqrt(A)") , SG_DATATYPE_Double); pIndex->Add_Field(_TL("Max.Distance") , SG_DATATYPE_Double); pIndex->Add_Field(_TL("D/A") , SG_DATATYPE_Double); pIndex->Add_Field(_TL("D/sqrt(A)") , SG_DATATYPE_Double); pIndex->Add_Field(_TL("Shape Index") , SG_DATATYPE_Double); for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape_Polygon *pShape = (CSG_Shape_Polygon *)pShapes->Get_Shape(iShape); double Area = pShape->Get_Area(); double Perimeter = pShape->Get_Perimeter(); double Distance = Get_Distance(pShape); if( Perimeter > 0.0 && Distance > 0.0 ) { if( pIndex != pShapes ) { pShape = (CSG_Shape_Polygon *)pIndex->Add_Shape(pShape, SHAPE_COPY); } pShape->Set_Value(iField + 0, Area); pShape->Set_Value(iField + 1, Perimeter); if (Area > 0.0) { pShape->Set_Value(iField + 2, Perimeter / Area); pShape->Set_Value(iField + 3, Perimeter / sqrt(Area)); } else { pShape->Set_NoData(iField + 2); pShape->Set_NoData(iField + 3); } pShape->Set_Value(iField + 4, Distance); if (Area > 0.0) { pShape->Set_Value(iField + 5, Distance / Area); pShape->Set_Value(iField + 6, Distance / sqrt(Area)); pShape->Set_Value(iField + 7, Perimeter / (2.0 * sqrt(M_PI * Area))); } else { pShape->Set_NoData(iField + 5); pShape->Set_NoData(iField + 6); pShape->Set_NoData(iField + 7); } } } if( pIndex == pShapes ) { DataObject_Update(pShapes); } return( pIndex->is_Valid() ); } //----------------------------------------------------- return( false ); } //--------------------------------------------------------- double CShape_Index::Get_Distance(CSG_Shape *pShape) { double d, dMax = 0.0; for(int iPart=0; iPartGet_Part_Count(); iPart++) { if( pShape->Get_Point_Count(iPart) > 2 ) { TSG_Point A, B; A = pShape->Get_Point(pShape->Get_Point_Count(iPart) - 1, iPart); for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { B = A; A = pShape->Get_Point(iPoint, iPart); d = SG_Get_Distance(A, B); if( dMax < d ) { dMax = d; } } } } return( dMax ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_polygons/shape_index.h000066400000000000000000000102771224124640700247540ustar00rootroot00000000000000/********************************************************** * Version $Id: shape_index.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Polygon // // // //-------------------------------------------------------// // // // Shape_Index.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shape_Index_H #define HEADER_INCLUDED__Shape_Index_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShape_Index : public CSG_Module { public: CShape_Index(void); virtual ~CShape_Index(void); protected: virtual bool On_Execute (void); private: double Get_Distance (CSG_Shape *pShape); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shape_Index_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/000077500000000000000000000000001224124640700215735ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/CreateChartLayer.cpp000066400000000000000000000224041224124640700254630ustar00rootroot00000000000000/********************************************************** * Version $Id: CreateChartLayer.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CCreateChartLayer.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "CreateChartLayer.h" #include #define TYPE_PIE 0 #define TYPE_BARS 0 #define PI2 6.283185 CCreateChartLayer::CCreateChartLayer(void){ CSG_Parameter *pNode; Parameters.Set_Name(_TL("Create Chart Layer (bars/sectors)")); Parameters.Set_Description(_TW( "(c) 2004 by Victor Olaya. ")); pNode = Parameters.Add_Shapes(NULL, "INPUT", _TL("Shapes"), _TL(""), PARAMETER_INPUT); Parameters.Add_Table_Field(pNode, "SIZE", _TL("Size field"), _TL("")); Parameters.Add_Value(NULL, "MAXSIZE", _TL("Maximum size"), _TL(""), PARAMETER_TYPE_Double, 100, 0, true); Parameters.Add_Value(NULL, "MINSIZE", _TL("Minimum size"), _TL(""), PARAMETER_TYPE_Double, 10, 0, true); Parameters.Add_Choice(NULL, "TYPE", _TL("Type"), _TL(""), _TW("Sectors|" "Bars|"), 0); m_pExtraParameters = Add_Parameters("EXTRA", _TL("Fields for diagram"), _TL("")); }//constructor CCreateChartLayer::~CCreateChartLayer(void) {} bool CCreateChartLayer::On_Execute(void){ CSG_Shapes *pInput; int i=0; int iType; int iSizeField; if (GetExtraParameters()){ iSizeField = Parameters("SIZE")->asInt(); m_fMaxSize = (float) Parameters("MAXSIZE")->asDouble(); m_fMinSize = (float) Parameters("MINSIZE")->asDouble(); if (m_fMinSize > m_fMaxSize){ m_fMinSize = m_fMaxSize; }//if iType = Parameters("TYPE")->asInt(); pInput = Parameters("INPUT")->asShapes(); m_fMaxValue = pInput->Get_Maximum(iSizeField); m_fMinValue = pInput->Get_Minimum(iSizeField); if (iType == TYPE_PIE){ m_pOutput = SG_Create_Shapes(SHAPE_TYPE_Polygon, _TL("Chart (sectors):")); }//if else{ m_pOutput = SG_Create_Shapes(SHAPE_TYPE_Polygon, _TL("Chart (bars):")); }//else m_pOutput->Add_Field(_TL("Field (ID)"), SG_DATATYPE_Int); m_pOutput->Add_Field(_TL("Field (Name)"), SG_DATATYPE_String); for (i = 0; i < pInput->Get_Count(); i++){ if (iType == TYPE_PIE){ // AddPieChart(pInput->Get_Shape(i),m_pOutput->Get_Type()); AddPieChart(pInput->Get_Shape(i),pInput->Get_Type()); }//if else{ // AddBarChart(pInput->Get_Shape(i),m_pOutput->Get_Type()); AddBarChart(pInput->Get_Shape(i),pInput->Get_Type()); }//else }//for DataObject_Add(m_pOutput, false); delete [] m_bIncludeParam; return true; }//if delete [] m_bIncludeParam; return false; }//method bool CCreateChartLayer::GetExtraParameters(){ int i; CSG_Shapes *pInput; CSG_Parameter *pParam; CSG_String sName; bool bIsValidSelection = false; pInput = Parameters("INPUT")->asShapes(); m_pExtraParameters->Create(this, _TL("Fields for diagram"), _TL(""), SG_T("EXTRA")); m_bIncludeParam = new bool [pInput->Get_Field_Count() ]; for (i = 0; i < pInput->Get_Field_Count(); i++) { switch( pInput->Get_Field_Type(i) ) { default: break; case SG_DATATYPE_Byte: case SG_DATATYPE_Char: case SG_DATATYPE_Word: case SG_DATATYPE_Short: case SG_DATATYPE_DWord: case SG_DATATYPE_Int: case SG_DATATYPE_ULong: case SG_DATATYPE_Long: case SG_DATATYPE_Float: case SG_DATATYPE_Double: // is numeric field m_pExtraParameters->Add_Value( NULL, SG_Get_String(i,0).c_str(), pInput->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false ); break; } }//for if(Dlg_Parameters("EXTRA")){ for (i = 0; i < pInput->Get_Field_Count(); i++){ sName = SG_Get_String(i,0); if (pParam = Get_Parameters("EXTRA")->Get_Parameter(sName.c_str())){ m_bIncludeParam[i] = pParam->asBool(); bIsValidSelection = true; }//try else{ m_bIncludeParam[i] = false; }//else }//for m_pExtraParameters->Destroy(); return bIsValidSelection; }//if m_pExtraParameters->Destroy(); return false; }//method void CCreateChartLayer::AddPieChart(CSG_Shape* pShape, int iType){ int i,j; int iSteps; int iSizeField; int iField; float fSum = 0; float fPartialSum = 0; float fSize; float fSectorSize; double dX, dY; CSG_Shape *pSector; CSG_Table_Record *pRecord; TSG_Point Point; iSizeField = Parameters("SIZE")->asInt(); pRecord = pShape; for (i = 0; i < pRecord->Get_Table()->Get_Field_Count(); i++){ if (m_bIncludeParam[i]){ fSum += pRecord->asFloat(i); }//if }//for fSize = pRecord->asFloat(iSizeField); fSize = m_fMinSize + (m_fMaxSize - m_fMinSize)/(m_fMaxValue - m_fMinValue) * (fSize - m_fMinValue); switch (iType){ case SHAPE_TYPE_Polygon: Point = ((CSG_Shape_Polygon*) pShape)->Get_Centroid(); break; case SHAPE_TYPE_Line: Point = GetLineMidPoint((CSG_Shape_Line*)pShape); break; case SHAPE_TYPE_Point: Point = pShape->Get_Point(0); break; default: break; }//switch dX = Point.x; dY = Point.y; fPartialSum = 0; iField = 1; for (i = 0; i < pRecord->Get_Table()->Get_Field_Count(); i++){ if (m_bIncludeParam[i]){ fSectorSize = pRecord->asFloat(i) / fSum; pSector = m_pOutput->Add_Shape(); pSector->Add_Point(dX,dY); iSteps = (int) (fSectorSize * 200.); for (j = 0; j < iSteps; j++){ pSector->Add_Point(dX + fSize * sin((fPartialSum + (float)j / 200.) * PI2), dY + fSize * cos((fPartialSum + (float)j / 200.) * PI2)); }//for fPartialSum +=fSectorSize; pSector->Add_Point(dX + fSize * sin(fPartialSum * PI2), dY + fSize * cos(fPartialSum * PI2)); pSector->Set_Value(0,iField); pSector->Set_Value(1,pRecord->Get_Table()->Get_Field_Name(i)); iField++; }//if }//for }//method void CCreateChartLayer::AddBarChart(CSG_Shape* pShape, int iType){ int i; int iSizeField; int iField; int iValidFields = 0; float fMax; float fMin; float fSize; float fBarHeight, fBarWidth; double dX, dY; CSG_Shape *pSector; CSG_Table_Record *pRecord; TSG_Point Point; iSizeField = Parameters("SIZE")->asInt(); pRecord = pShape; pRecord = pShape; for (i = 0; i < pRecord->Get_Table()->Get_Field_Count(); i++){ if (m_bIncludeParam[i]){ if (!iValidFields){ fMin = fMax = pRecord->asFloat(i); } else{ if (pRecord->asFloat(i) > fMax){ fMax = pRecord->asFloat(i); }//if if (pRecord->asFloat(i) < fMin){ fMin = pRecord->asFloat(i); }//if }//else iValidFields++; }//if }//for if (fMax > 0 && fMin > 0){ fMin = 0; }//if if (fMax < 0 && fMin < 0){ fMax = 0; }//if fSize = pRecord->asFloat(iSizeField); fSize = m_fMinSize + (m_fMaxSize - m_fMinSize)/(m_fMaxValue - m_fMinValue) * (fSize - m_fMinValue); switch (iType){ case SHAPE_TYPE_Polygon: Point = ((CSG_Shape_Polygon*) pShape)->Get_Centroid(); break; case SHAPE_TYPE_Line: Point = GetLineMidPoint((CSG_Shape_Line*)pShape); break; case SHAPE_TYPE_Point: Point = pShape->Get_Point(0); break; default: break; }//switch dX = Point.x; dY = Point.y; fBarWidth = fSize / (float)iValidFields; iField = 1; for (i = 0; i < pRecord->Get_Table()->Get_Field_Count(); i++){ if (m_bIncludeParam[i]){ fBarHeight = pRecord->asFloat(i) / (fMax - fMin) * fSize; pSector = m_pOutput->Add_Shape(); pSector->Add_Point(dX - fSize / 2. + fBarWidth * (iField - 1) , dY); pSector->Add_Point(dX - fSize / 2. + fBarWidth * iField, dY); pSector->Add_Point(dX - fSize / 2. + fBarWidth * iField, dY + fBarHeight); pSector->Add_Point(dX - fSize / 2. + fBarWidth * (iField - 1) , dY + fBarHeight); pSector->Set_Value(0,iField); pSector->Set_Value(1,pRecord->Get_Table()->Get_Field_Name(i)); iField++; }//if }//for }//method TSG_Point CCreateChartLayer::GetLineMidPoint(CSG_Shape_Line *pLine){ int i; float fDist, fAccDist = 0; float fLength = pLine->Get_Length(0) / 2.; TSG_Point Point, Point2, ReturnPoint; for (i = 0; i < pLine->Get_Point_Count(0) - 1; i++){ Point = pLine->Get_Point(i); Point2 = pLine->Get_Point(i+1); fDist = sqrt(pow(Point.x - Point2.x,2.) + pow(Point.y - Point2.y,2.)); if (fAccDist <= fLength && fAccDist + fDist > fLength){ ReturnPoint.x = Point.x + (Point2.x - Point.x) * (fLength - fAccDist) / fDist; ReturnPoint.y = Point.y + (Point2.y - Point.y) * (fLength - fAccDist) / fDist; return ReturnPoint; }//if fAccDist += fDist; }//for return pLine->Get_Point(pLine->Get_Point_Count(0) / 2); }//method saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/CreateChartLayer.h000066400000000000000000000033201224124640700251240ustar00rootroot00000000000000/********************************************************** * Version $Id: CreateChartLayer.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CreateChartLayer.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CCreateChartLayer : public CSG_Module { public: CCreateChartLayer(); virtual ~CCreateChartLayer(); virtual bool is_ProjectDependent(void) {return( false );} private: float m_fMaxValue, m_fMinValue; float m_fMaxSize, m_fMinSize; CSG_Parameters *m_pExtraParameters; bool *m_bIncludeParam; CSG_Shapes *m_pOutput; void AddPieChart(CSG_Shape*, int); void AddBarChart(CSG_Shape*, int); bool GetExtraParameters(); TSG_Point GetLineMidPoint(CSG_Shape_Line*); protected: virtual bool On_Execute(void); }; saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/GraticuleBuilder.cpp000066400000000000000000000145711224124640700255350ustar00rootroot00000000000000/********************************************************** * Version $Id: GraticuleBuilder.cpp 1127 2011-07-06 15:53:00Z oconrad $ *********************************************************/ /******************************************************************************* GraticuleBuilder.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GraticuleBuilder.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGraticuleBuilder::CGraticuleBuilder(void) { Set_Name (_TL("Create Graticule")); Set_Author (SG_T("V.Olaya (c) 2004")); Set_Description (_TW( "(c) 2004 by Victor Olaya. " )); Parameters.Add_Shapes( NULL , "GRATICULE" , _TL("Graticule"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Shapes( NULL , "EXTENT" , _TL("Extent"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Range( NULL , "X_EXTENT" , _TL("Width"), _TL(""), -180.0, 180.0 ); Parameters.Add_Range( NULL , "Y_EXTENT" , _TL("Height"), _TL(""), -90.0, 90.0 ); Parameters.Add_Value( NULL , "DISTX" , _TL("Division Width"), _TL(""), PARAMETER_TYPE_Double, 10 ); Parameters.Add_Value( NULL , "DISTY" , _TL("Division Height"), _TL(""), PARAMETER_TYPE_Double, 10 ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Lines"), _TL("Rectangles") ), 0 ); } //--------------------------------------------------------- CGraticuleBuilder::~CGraticuleBuilder(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGraticuleBuilder::On_Execute(void) { //----------------------------------------------------- CSG_Rect Extent; if( Parameters("EXTENT")->asShapes() ) { Extent.Assign(Parameters("EXTENT")->asShapes()->Get_Extent()); } else { Extent.Assign( Parameters("X_EXTENT")->asRange()->Get_LoVal(), Parameters("Y_EXTENT")->asRange()->Get_LoVal(), Parameters("X_EXTENT")->asRange()->Get_HiVal(), Parameters("Y_EXTENT")->asRange()->Get_HiVal() ); } //----------------------------------------------------- int id = 0, row, col; double x, y, dx, dy; CSG_Shapes *pGraticule; pGraticule = Parameters("GRATICULE") ->asShapes(); dx = Parameters("DISTX") ->asDouble(); dy = Parameters("DISTY") ->asDouble(); //----------------------------------------------------- if( dx <= 0.0 || dx > Extent.Get_XRange() || dy <= 0.0 || dy > Extent.Get_YRange() ) { Error_Set(_TL("invalid division size")); return( false ); } switch( Parameters("TYPE")->asInt() ) { //----------------------------------------------------- case 0: // Lines { pGraticule->Create(SHAPE_TYPE_Line, _TL("Graticule")); pGraticule->Add_Field("ID", SG_DATATYPE_Int); for(x=Extent.Get_XMin(); x<=Extent.Get_XMax(); x+=dx) { CSG_Shape *pShape = pGraticule->Add_Shape(); pShape->Set_Value(0, ++id); for(y=Extent.Get_YMin(); y<=Extent.Get_YMax(); y+=dy) { pShape->Add_Point(x,y); pShape->Add_Point(x,y); } }//for for(y=Extent.Get_YMin(); y<=Extent.Get_YMax(); y+=dy) { CSG_Shape *pShape = pGraticule->Add_Shape(); pShape->Set_Value(0, ++id); for(x=Extent.Get_XMin(); x<=Extent.Get_XMax(); x+=dx) { pShape->Add_Point(x,y); pShape->Add_Point(x,y); } }//for } break; //----------------------------------------------------- case 1: // Rectangles { pGraticule->Create(SHAPE_TYPE_Polygon, _TL("Graticule")); pGraticule->Add_Field("ID" , SG_DATATYPE_Int); pGraticule->Add_Field("ROW", SG_DATATYPE_Int); pGraticule->Add_Field("COL", SG_DATATYPE_Int); // pGraticule->Add_Field("LNK", SG_DATATYPE_String); for(x=Extent.Get_XMin(), row=1; xExtent.Get_YMin(); y-=dy, col++) { CSG_Shape *pShape = pGraticule->Add_Shape(); pShape->Set_Value(0, ++id); pShape->Set_Value(1, row); pShape->Set_Value(2, col); // pShape->Set_Value(3, CSG_String::Format(SG_T("ftp://xftp.jrc.it/pub/srtmV4/tiff/srtm_%02d_%02d.zip"), row, col)); pShape->Add_Point(x , y ); pShape->Add_Point(x , y - dy); pShape->Add_Point(x + dx, y - dy); pShape->Add_Point(x + dx, y ); pShape->Add_Point(x , y ); } } } break; //----------------------------------------------------- } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/GraticuleBuilder.h000066400000000000000000000026511224124640700251760ustar00rootroot00000000000000/********************************************************** * Version $Id: GraticuleBuilder.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* GraticuleBuilder.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CGraticuleBuilder : public CSG_Module { public: CGraticuleBuilder(void); virtual ~CGraticuleBuilder(void); virtual bool is_ProjectDependent(void) {return( false );} protected: virtual bool On_Execute(void); }; saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/MLB_Interface.cpp000066400000000000000000000140721224124640700246750ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1369 2012-04-10 21:39:09Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Tools // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Shapes - Tools") ); case MLB_INFO_Author: return( SG_T("O. Conrad, V. Olaya, V. Wichmann (c) 2002-2012") ); case MLB_INFO_Description: return( _TL("Tools for the manipulation of vector data.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Shapes|Tools") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Shapes_Create_Empty.h" #include "Shapes_Merge.h" #include "QueryBuilder.h" #include "SearchInTable.h" #include "SelectByTheme.h" #include "NewLayerFromSelectedShapes.h" #include "SeparateShapes.h" #include "TransformShapes.h" #include "CreateChartLayer.h" #include "GraticuleBuilder.h" #include "shapes_cut.h" #include "shapes_cut_interactive.h" #include "shapes_split.h" #include "shapes_split_randomly.h" #include "shapes_split_by_attribute.h" #include "shapes_buffer.h" #include "shapes_extents.h" #include "quadtree_structure.h" #include "shapes_polar_to_cartes.h" #include "shapes_generate.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CShapes_Create_Empty ); case 2: return( new CShapes_Merge ); case 3: return( new CSelect_Numeric ); case 4: return( new CSelect_String ); case 5: return( new CSelect_Location ); case 6: return( new CSelection_Copy ); case 7: return( new CSelection_Delete ); case 8: return( new CSelection_Invert ); case 9: return( new CSeparateShapes ); case 10: return( new CTransformShapes ); case 11: return( new CCreateChartLayer ); case 12: return( new CGraticuleBuilder ); case 13: return( new CShapes_Cut ); case 14: return( new CShapes_Cut_Interactive ); case 15: return( new CShapes_Split ); case 16: return( new CShapes_Split_Randomly ); case 17: return( new CShapes_Split_by_Attribute ); case 18: return( new CShapes_Buffer ); case 19: return( new CShapes_Extents ); case 20: return( new CQuadTree_Structure ); case 21: return( new CShapes_Polar_to_Cartes ); case 22: return( new CShapes_Generate ); case 30: return( NULL ); } return( MLB_INTERFACE_SKIP_MODULE ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/MLB_Interface.h000066400000000000000000000077231224124640700243470ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Tools // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__shapes_tools_H #define HEADER_INCLUDED__shapes_tools_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef shapes_tools_EXPORTS #define shapes_tools_EXPORT _SAGA_DLL_EXPORT #else #define shapes_tools_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__shapes_tools_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/Makefile.am000066400000000000000000000030021224124640700236220ustar00rootroot00000000000000# # $Id: Makefile.am 1404 2012-05-14 10:04:07Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libshapes_tools.la libshapes_tools_la_SOURCES =\ CreateChartLayer.cpp\ GraticuleBuilder.cpp\ MLB_Interface.cpp\ NewLayerFromSelectedShapes.cpp\ quadtree_structure.cpp\ QueryBuilder.cpp\ SearchInTable.cpp\ SelectByTheme.cpp\ SeparateShapes.cpp\ Shapes_Create_Empty.cpp\ Shapes_Merge.cpp\ TransformShapes.cpp\ shapes_buffer.cpp\ shapes_cut.cpp\ shapes_cut_interactive.cpp\ shapes_extents.cpp\ shapes_generate.cpp\ shapes_polar_to_cartes.cpp\ shapes_split.cpp\ shapes_split_by_attribute.cpp\ shapes_split_randomly.cpp\ CreateChartLayer.h\ GraticuleBuilder.h\ MLB_Interface.h\ NewLayerFromSelectedShapes.h\ quadtree_structure.h\ QueryBuilder.h\ SearchInTable.h\ SelectByTheme.h\ SeparateShapes.h\ Shapes_Create_Empty.h\ Shapes_Merge.h\ TransformShapes.h\ shapes_buffer.h\ shapes_cut.h\ shapes_cut_interactive.h\ shapes_extents.h\ shapes_generate.h\ shapes_polar_to_cartes.h\ shapes_split.h\ shapes_split_by_attribute.h\ shapes_split_randomly.h libshapes_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la #install-exec-hook: # pushd .; cd $(pkglibdir); ln -s libshapes_tools.so shapes_tools.so; popd saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/Makefile.in000066400000000000000000000517141224124640700236500ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/shapes/shapes_tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libshapes_tools_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libshapes_tools_la_OBJECTS = CreateChartLayer.lo \ GraticuleBuilder.lo MLB_Interface.lo \ NewLayerFromSelectedShapes.lo quadtree_structure.lo \ QueryBuilder.lo SearchInTable.lo SelectByTheme.lo \ SeparateShapes.lo Shapes_Create_Empty.lo Shapes_Merge.lo \ TransformShapes.lo shapes_buffer.lo shapes_cut.lo \ shapes_cut_interactive.lo shapes_extents.lo shapes_generate.lo \ shapes_polar_to_cartes.lo shapes_split.lo \ shapes_split_by_attribute.lo shapes_split_randomly.lo libshapes_tools_la_OBJECTS = $(am_libshapes_tools_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libshapes_tools_la_SOURCES) DIST_SOURCES = $(libshapes_tools_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1404 2012-05-14 10:04:07Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libshapes_tools.la libshapes_tools_la_SOURCES = \ CreateChartLayer.cpp\ GraticuleBuilder.cpp\ MLB_Interface.cpp\ NewLayerFromSelectedShapes.cpp\ quadtree_structure.cpp\ QueryBuilder.cpp\ SearchInTable.cpp\ SelectByTheme.cpp\ SeparateShapes.cpp\ Shapes_Create_Empty.cpp\ Shapes_Merge.cpp\ TransformShapes.cpp\ shapes_buffer.cpp\ shapes_cut.cpp\ shapes_cut_interactive.cpp\ shapes_extents.cpp\ shapes_generate.cpp\ shapes_polar_to_cartes.cpp\ shapes_split.cpp\ shapes_split_by_attribute.cpp\ shapes_split_randomly.cpp\ CreateChartLayer.h\ GraticuleBuilder.h\ MLB_Interface.h\ NewLayerFromSelectedShapes.h\ quadtree_structure.h\ QueryBuilder.h\ SearchInTable.h\ SelectByTheme.h\ SeparateShapes.h\ Shapes_Create_Empty.h\ Shapes_Merge.h\ TransformShapes.h\ shapes_buffer.h\ shapes_cut.h\ shapes_cut_interactive.h\ shapes_extents.h\ shapes_generate.h\ shapes_polar_to_cartes.h\ shapes_split.h\ shapes_split_by_attribute.h\ shapes_split_randomly.h libshapes_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/shapes/shapes_tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/shapes/shapes_tools/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libshapes_tools.la: $(libshapes_tools_la_OBJECTS) $(libshapes_tools_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libshapes_tools_la_OBJECTS) $(libshapes_tools_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CreateChartLayer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GraticuleBuilder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NewLayerFromSelectedShapes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QueryBuilder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SearchInTable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SelectByTheme.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SeparateShapes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shapes_Create_Empty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shapes_Merge.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TransformShapes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quadtree_structure.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapes_buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapes_cut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapes_cut_interactive.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapes_extents.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapes_generate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapes_polar_to_cartes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapes_split.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapes_split_by_attribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapes_split_randomly.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES #install-exec-hook: # pushd .; cd $(pkglibdir); ln -s libshapes_tools.so shapes_tools.so; popd # 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: saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.cpp000066400000000000000000000114271224124640700274730ustar00rootroot00000000000000/********************************************************** * Version $Id: NewLayerFromSelectedShapes.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* NewLayerFromSelectedShapes.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "NewLayerFromSelectedShapes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSelection_Copy::CSelection_Copy(void) { Set_Name (_TL("Copy Selection to New Shapes Layer")); Set_Author (SG_T("Victor Olaya (c) 2004")); Set_Description (_TW( "Copies selected shapes to new shapes layer." )); Parameters.Add_Shapes( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT ); } //--------------------------------------------------------- bool CSelection_Copy::On_Execute(void) { CSG_Shapes *pInput, *pOutput; pInput = Parameters("INPUT") ->asShapes(); pOutput = Parameters("OUTPUT")->asShapes(); if( pInput->Get_Selection_Count() <= 0 ) { Error_Set(_TL("no shapes in selection")); return( false ); } if( pOutput->Get_Type() != SHAPE_TYPE_Undefined && pOutput->Get_Type() != pInput->Get_Type() ) { Parameters("OUTPUT")->Set_Value(pOutput = SG_Create_Shapes()); } pOutput->Create(pInput->Get_Type(), CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), _TL("Selection")), pInput); for(int i=0; iGet_Selection_Count() && Set_Progress(i, pInput->Get_Selection_Count()); i++) { pOutput->Add_Shape(pInput->Get_Selection(i)); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSelection_Delete::CSelection_Delete(void) { Set_Name (_TL("Delete Selection from Shapes Layer")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Deletes selected shapes from shapes layer." )); Parameters.Add_Shapes( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); } //--------------------------------------------------------- bool CSelection_Delete::On_Execute(void) { CSG_Shapes *pInput; pInput = Parameters("INPUT") ->asShapes(); if( pInput->Get_Selection_Count() <= 0 ) { Error_Set(_TL("no shapes in selection")); return( false ); } pInput->Del_Selection(); DataObject_Update(pInput); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSelection_Invert::CSelection_Invert(void) { Set_Name (_TL("Invert Selection of Shapes Layer")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Deselects selected and selects unselected shapes of given shapes layer." )); Parameters.Add_Shapes( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); } //--------------------------------------------------------- bool CSelection_Invert::On_Execute(void) { CSG_Shapes *pInput; pInput = Parameters("INPUT") ->asShapes(); pInput->Inv_Selection(); DataObject_Update(pInput); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/NewLayerFromSelectedShapes.h000066400000000000000000000056221224124640700271400ustar00rootroot00000000000000/********************************************************** * Version $Id: NewLayerFromSelectedShapes.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* NewLayerFromSelectedShapes.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSelection_Copy : public CSG_Module { public: CSelection_Copy(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Selection") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSelection_Delete : public CSG_Module { public: CSelection_Delete(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Selection") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSelection_Invert : public CSG_Module { public: CSelection_Invert(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Selection") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/QueryBuilder.cpp000066400000000000000000000122171224124640700247160ustar00rootroot00000000000000/********************************************************** * Version $Id: QueryBuilder.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* QueryBuilder.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "QueryBuilder.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSelect_Numeric::CSelect_Numeric(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Select by Attributes... (Numerical Expression)")); Set_Author (SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011")); Set_Description (_TW( "Selects records for which the expression is true." )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("attribute to be searched; if not set all attributes will be searched"), true ); Parameters.Add_String( NULL , "EXPRESSION" , _TL("Expression"), _TL(""), SG_T("a > 0") ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("new selection"), _TL("add to current selection"), _TL("select from current selection"), _TL("remove from current selection") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSelect_Numeric::On_Execute(void) { int Method, Field; CSG_String Expression; CSG_Shapes *pShapes; CSG_Formula Formula; //----------------------------------------------------- pShapes = Parameters("SHAPES") ->asShapes(); Field = Parameters("FIELD") ->asInt(); Expression = Parameters("EXPRESSION") ->asString(); Method = Parameters("METHOD") ->asInt(); //----------------------------------------------------- if( !Formula.Set_Formula(Expression) ) { CSG_String Message; if( Formula.Get_Error(Message) ) { Error_Set(Message); } return( false ); } //----------------------------------------------------- double *Values = new double[pShapes->Get_Field_Count()]; for(int i=0; iGet_Count() && Set_Progress(i, pShapes->Get_Count()); i++) { CSG_Shape *pShape = pShapes->Get_Shape(i); if( Field >= pShapes->Get_Field_Count() ) { for(int j=0; jGet_Field_Count(); j++) { Values[j] = pShape->asDouble(j); } } else { Values[0] = pShape->asDouble(Field); } switch( Method ) { case 0: // New selection if( ( pShape->is_Selected() && !Formula.Get_Value(Values, pShapes->Get_Field_Count())) || (!pShape->is_Selected() && Formula.Get_Value(Values, pShapes->Get_Field_Count())) ) { pShapes->Select(i, true); } break; case 1: // Add to current selection if( !pShape->is_Selected() && Formula.Get_Value(Values, pShapes->Get_Field_Count()) ) { pShapes->Select(i, true); } break; case 2: // Select from current selection if( pShape->is_Selected() && !Formula.Get_Value(Values, pShapes->Get_Field_Count()) ) { pShapes->Select(i, true); } break; case 3: // Remove from current selection if( pShape->is_Selected() && Formula.Get_Value(Values, pShapes->Get_Field_Count()) ) { pShapes->Select(i, true); } break; } } delete[](Values); //----------------------------------------------------- Message_Add(CSG_String::Format(SG_T("%s: %d"), _TL("selected shapes"), pShapes->Get_Selection_Count())); DataObject_Update(pShapes); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/QueryBuilder.h000066400000000000000000000040701224124640700243610ustar00rootroot00000000000000/********************************************************** * Version $Id: QueryBuilder.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* QueryBuilder.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSelect_Numeric : public CSG_Module { public: CSelect_Numeric(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Selection") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/SearchInTable.cpp000066400000000000000000000141071224124640700247460ustar00rootroot00000000000000/********************************************************** * Version $Id: SearchInTable.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* SearchInTable.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "SearchInTable.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSelect_String::CSelect_String(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Select by Attributes... (String Expression)")); Set_Author (SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011")); Set_Description (_TW( "Searches for an character string expression in the attributes table and selects records where the expression is found." )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("attribute to be searched; if not set all attributes will be searched"), true ); Parameters.Add_String( NULL , "EXPRESSION" , _TL("Expression"), _TL(""), SG_T("") ); Parameters.Add_Value( NULL , "CASE" , _TL("Case Sensitive"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Choice( NULL , "COMPARE" , _TL("Select if..."), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("attribute is identical with search expression"), _TL("attribute contains search expression"), _TL("attribute is contained in search expression") ), 1 ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("new selection"), _TL("add to current selection"), _TL("select from current selection"), _TL("remove from current selection") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSelect_String::On_Execute(void) { int Method; CSG_Shapes *pShapes; //----------------------------------------------------- pShapes = Parameters("SHAPES") ->asShapes(); m_Field = Parameters("FIELD") ->asInt(); m_Expression = Parameters("EXPRESSION") ->asString(); m_Case = Parameters("CASE") ->asBool(); m_Compare = Parameters("COMPARE") ->asInt(); Method = Parameters("METHOD") ->asInt(); //----------------------------------------------------- if( m_Case == false ) { m_Expression.Make_Upper(); } //----------------------------------------------------- for(int i=0; iGet_Count() && Set_Progress(i, pShapes->Get_Count()); i++) { CSG_Shape *pShape = pShapes->Get_Shape(i); switch( Method ) { case 0: // New selection if( ( pShape->is_Selected() && !Do_Select(pShape)) || (!pShape->is_Selected() && Do_Select(pShape)) ) { pShapes->Select(i, true); } break; case 1: // Add to current selection if( !pShape->is_Selected() && Do_Select(pShape) ) { pShapes->Select(i, true); } break; case 2: // Select from current selection if( pShape->is_Selected() && !Do_Select(pShape) ) { pShapes->Select(i, true); } break; case 3: // Remove from current selection if( pShape->is_Selected() && Do_Select(pShape) ) { pShapes->Select(i, true); } break; } } //----------------------------------------------------- Message_Add(CSG_String::Format(SG_T("%s: %d"), _TL("selected shapes"), pShapes->Get_Selection_Count())); DataObject_Update(pShapes); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline bool CSelect_String::Do_Compare(const SG_Char *Value) { CSG_String s(Value); if( m_Case == false ) { s.Make_Upper(); } switch( m_Compare ) { case 0: // identical return( m_Expression.Cmp(s) == 0 ); case 1: // contains return( s.Find(m_Expression) >= 0 ); case 2: // contained return( m_Expression.Find(s) >= 0 ); } return( false ); } //--------------------------------------------------------- inline bool CSelect_String::Do_Select(CSG_Shape *pShape) { if( m_Field >= 0 && m_Field < pShape->Get_Table()->Get_Field_Count() ) { return( Do_Compare(pShape->asString(m_Field)) ); } for(int i=0; iGet_Table()->Get_Field_Count(); i++) { if( Do_Compare(pShape->asString(i)) ) { return( true ); } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/SearchInTable.h000066400000000000000000000043461224124640700244170ustar00rootroot00000000000000/********************************************************** * Version $Id: SearchInTable.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* SearchInTable.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSelect_String : public CSG_Module { public: CSelect_String(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Selection") ); } protected: virtual bool On_Execute (void); private: bool m_Case; int m_Field, m_Compare; CSG_String m_Expression; bool Do_Compare (const SG_Char *Value); bool Do_Select (CSG_Shape *pShape); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/SelectByTheme.cpp000066400000000000000000000154071224124640700250030ustar00rootroot00000000000000/********************************************************** * Version $Id: SelectByTheme.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* SelectByTheme.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "SelectByTheme.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSelect_Location::CSelect_Location(void) { //----------------------------------------------------- Set_Name (_TL("Select by Location...")); Set_Author (SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011")); Set_Description (_TW( "Select by location." )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes to Select From"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "LOCATIONS" , _TL("Locations"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Choice( NULL , "CONDITION" , _TL("Condition"), _TL("Select shapes that fulfil this condition"), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("intersect"), _TL("are completely within"), _TL("completely contain"), _TL("have their centroid in"), _TL("contain the centeroid of") ), 0 ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("new selection"), _TL("add to current selection"), _TL("select from current selection"), _TL("remove from current selection") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSelect_Location::On_Execute(void) { int Method, Condition; m_pShapes = Parameters("SHAPES") ->asShapes(); m_pLocations = Parameters("LOCATIONS") ->asShapes(); Condition = Parameters("CONDITION") ->asInt(); Method = Parameters("METHOD") ->asInt(); //----------------------------------------------------- switch( Condition ) { case 0: // intersect if( ((m_pShapes ->Get_Type() == SHAPE_TYPE_Point || m_pShapes ->Get_Type() == SHAPE_TYPE_Points) && m_pLocations->Get_Type() != SHAPE_TYPE_Polygon) || ((m_pLocations->Get_Type() == SHAPE_TYPE_Point || m_pLocations->Get_Type() == SHAPE_TYPE_Points) && m_pShapes ->Get_Type() != SHAPE_TYPE_Polygon) ) { Error_Set(_TL("points can only intersect with polygons")); return( false ); } break; case 1: // are completely within case 3: // have their centroid in if( m_pLocations->Get_Type() != SHAPE_TYPE_Polygon ) { Error_Set(_TL("this operation requires locations to be of type polygon")); return( false ); } break; case 2: // completely contain case 4: // contain the centroid of if( m_pShapes->Get_Type() != SHAPE_TYPE_Polygon ) { Error_Set(_TL("this operation requires selectable shapes to be of type polygon")); return( false ); } break; } //----------------------------------------------------- for(int i=0; iGet_Count() && Set_Progress(i, m_pShapes->Get_Count()); i++) { CSG_Shape *pShape = m_pShapes->Get_Shape(i); switch( Method ) { case 0: // New selection if( ( pShape->is_Selected() && !Do_Select(pShape, Condition)) || (!pShape->is_Selected() && Do_Select(pShape, Condition)) ) { m_pShapes->Select(i, true); } break; case 1: // Add to current selection if( !pShape->is_Selected() && Do_Select(pShape, Condition) ) { m_pShapes->Select(i, true); } break; case 2: // Select from current selection if( pShape->is_Selected() && !Do_Select(pShape, Condition) ) { m_pShapes->Select(i, true); } break; case 3: // Remove from current selection if( pShape->is_Selected() && Do_Select(pShape, Condition) ) { m_pShapes->Select(i, true); } break; } } //----------------------------------------------------- Message_Add(CSG_String::Format(SG_T("%s: %d"), _TL("selected shapes"), m_pShapes->Get_Selection_Count())); DataObject_Update(m_pShapes); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSelect_Location::Do_Select(CSG_Shape *pShape, int Condition) { for(int i=0; iGet_Count() && Process_Get_Okay(); i++) { CSG_Shape *pLocation = m_pLocations->Get_Shape(i); if( pShape->Intersects(pLocation->Get_Extent()) ) { switch( Condition ) { case 0: // intersect if( pLocation->Intersects(pShape) ) { return( true ); } break; case 1: // are completely within if( pLocation->Intersects(pShape) == INTERSECTION_Contains ) { return( true ); } break; case 2: // completely contain if( pShape->Intersects(pLocation) == INTERSECTION_Contains ) { return( true ); } break; case 3: // have their centroid in if( ((CSG_Shape_Polygon *)pLocation)->Contains(pShape->Get_Centroid()) ) { return( true ); } break; case 4: // contain the centroid of if( ((CSG_Shape_Polygon *)pShape)->Contains(pLocation->Get_Centroid()) ) { return( true ); } break; } } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/SelectByTheme.h000066400000000000000000000042431224124640700244440ustar00rootroot00000000000000/********************************************************** * Version $Id: SelectByTheme.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* SelectByTheme.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSelect_Location : public CSG_Module { public: CSelect_Location(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Selection") ); } protected: virtual bool On_Execute (void); private: CSG_Shapes *m_pShapes, *m_pLocations; bool Do_Select (CSG_Shape *pShape, int Condition); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/SeparateShapes.cpp000066400000000000000000000071621224124640700252150ustar00rootroot00000000000000/********************************************************** * Version $Id: SeparateShapes.cpp 931 2011-02-21 16:03:49Z oconrad $ *********************************************************/ /******************************************************************************* SeparateShapes.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "SeparateShapes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSeparateShapes::CSeparateShapes(void) { CSG_Parameter *pNode; Set_Name (_TL("Split Shapes Layer Completely")); Set_Author (SG_T("Victor Olaya (c) 2005")); Set_Description (_TW( "Copies each shape of given layer to a separate target layer." )); pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("") ); Parameters.Add_Shapes_List( NULL , "LIST" , _TL("Output"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "NAMING" , _TL("Name by..."), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("number of order"), _TL("attribute") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSeparateShapes::On_Execute(void) { int Naming, Field; CSG_Shapes *pShapes; CSG_Parameter_Shapes_List *pList; pShapes = Parameters("SHAPES") ->asShapes(); pList = Parameters("LIST") ->asShapesList(); Naming = Parameters("NAMING") ->asInt(); Field = Parameters("FIELD") ->asInt(); for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_String Name; switch( Naming ) { case 0: default: Name.Printf(SG_T("%s [%04d]"), pShapes->Get_Name(), iShape + 1); break; case 1: Name.Printf(SG_T("%s [%s]") , pShapes->Get_Name(), pShapes->Get_Record(iShape)->asString(Field)); break; } CSG_Shapes *pShape = SG_Create_Shapes(pShapes->Get_Type(), Name, pShapes); pList ->Add_Item(pShape); pShape ->Add_Shape(pShapes->Get_Shape(iShape)); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/SeparateShapes.h000066400000000000000000000040611224124640700246550ustar00rootroot00000000000000/********************************************************** * Version $Id: SeparateShapes.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* SeparateShapes.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSeparateShapes : public CSG_Module { public: CSeparateShapes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Construction") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/Shapes_Create_Empty.cpp000066400000000000000000000237221224124640700261710ustar00rootroot00000000000000/********************************************************** * Version $Id: Shapes_Create_Empty.cpp 1097 2011-06-16 16:04:25Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Tools // // // //-------------------------------------------------------// // // // Shapes_Create_Empty.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Shapes_Create_Empty.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define GET_NODE(i) CSG_String::Format(SG_T("NODE%03d"), i) #define GET_NAME(i) CSG_String::Format(SG_T("NAME%03d"), i) #define GET_TYPE(i) CSG_String::Format(SG_T("TYPE%03d"), i) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Create_Empty::CShapes_Create_Empty(void) { //----------------------------------------------------- Set_Name (_TL("Create New Shapes Layer")); Set_Author (SG_T("O. Conrad (c) 2008")); Set_Description (_TW( "Creates a new empty shapes layer of given type, " "which might be either point, multipoint, line or polygon. " "Possible field types for the attributes table are:\n" " - character string\n" " - 1 byte integer\n" " - 2 byte integer\n" " - 4 byte integer\n" " - 4 byte floating point\n" " - 8 byte floating point\n" " - 32 bit true color (RGB)\n" )); //----------------------------------------------------- Parameters.Add_Shapes_Output( NULL , "SHAPES" , _TL("Shapes"), _TL("") ); Parameters.Add_String( NULL , "NAME" , _TL("Name"), _TL(""), _TL("New Shapes Layer") ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Shape Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("Point"), _TL("Multipoint"), _TL("Lines"), _TL("Polygon") ) ); Parameters.Add_Choice( NULL , "VERTEX" , _TL("Vertex Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("x, y"), _TL("x, y, z"), _TL("x, y, z, m") ) ); Parameters.Add_Value( NULL , "NFIELDS" , _TL("Number of Attributes"), _TL(""), PARAMETER_TYPE_Int , 2, 1, true ); Parameters.Add_Parameters( NULL , "FIELDS" , _TL("Attributes"), _TL("") ); //----------------------------------------------------- CSG_Parameters *pAttributes = Parameters("FIELDS")->asParameters(); _Set_Field_Count(pAttributes, Parameters("NFIELDS")->asInt()); pAttributes->Get_Parameter(GET_NAME(0))->Set_Value(_TL("ID")); pAttributes->Get_Parameter(GET_TYPE(0))->Set_Value(3); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CShapes_Create_Empty::_Set_Field_Count(CSG_Parameters *pAttributes, int nAttributes) { //----------------------------------------------------- CSG_String Types; Types.Printf(SG_T("%s|%s|%s|%s|%s|%s|%s|"), _TL("character string"), _TL("1 byte integer"), _TL("2 byte integer"), _TL("4 byte integer"), _TL("4 byte floating point"), _TL("8 byte floating point"), _TL("color (rgb)") ); //----------------------------------------------------- if( pAttributes && nAttributes > 0 ) { int nCurrent = pAttributes->Get_Count() / 3; if( nCurrent < nAttributes ) { for(int i=nCurrent; iAdd_Node( NULL , GET_NODE(i), CSG_String::Format(SG_T("%i. %s"), i + 1, _TL("Attribute")), _TL("") ); pAttributes->Add_String( pNode , GET_NAME(i), _TL("Name"), _TL(""), _TL("Name") ); pAttributes->Add_Choice( pNode , GET_TYPE(i), _TL("Type"), _TL(""), Types ); } } else if( nCurrent > nAttributes ) { CSG_Parameters Tmp; Tmp.Assign(pAttributes); pAttributes->Destroy(); pAttributes->Set_Name(Tmp.Get_Name()); for(int i=0; iAdd_Node( NULL , GET_NODE(i), CSG_String::Format(SG_T("%i. %s"), i + 1, _TL("Attribute")), _TL("") ); pAttributes->Add_String( pNode , GET_NAME(i), _TL("Name"), _TL(""), Tmp(GET_NAME(i)) ? Tmp(GET_NAME(i))->asString() : _TL("Name") ); pAttributes->Add_Choice( pNode , GET_TYPE(i), _TL("Type"), _TL(""), Types, Tmp(GET_TYPE(i)) ? Tmp(GET_TYPE(i))->asInt() : 0 ); } } } } //--------------------------------------------------------- int CShapes_Create_Empty::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("NFIELDS")) ) { _Set_Field_Count(pParameters->Get_Parameter("FIELDS")->asParameters(), pParameter->asInt()); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Create_Empty::On_Execute(void) { TSG_Vertex_Type Vertex; switch( Parameters("VERTEX")->asInt() ) { default: case 0: Vertex = SG_VERTEX_TYPE_XY; break; case 1: Vertex = SG_VERTEX_TYPE_XYZ; break; case 2: Vertex = SG_VERTEX_TYPE_XYZM; break; } //----------------------------------------------------- CSG_Shapes *pShapes; switch( Parameters("TYPE")->asInt() ) { default: return( false ); case 0: pShapes = SG_Create_Shapes(SHAPE_TYPE_Point , Parameters("NAME")->asString(), NULL, Vertex); break; case 1: pShapes = SG_Create_Shapes(SHAPE_TYPE_Points , Parameters("NAME")->asString(), NULL, Vertex); break; case 2: pShapes = SG_Create_Shapes(SHAPE_TYPE_Line , Parameters("NAME")->asString(), NULL, Vertex); break; case 3: pShapes = SG_Create_Shapes(SHAPE_TYPE_Polygon, Parameters("NAME")->asString(), NULL, Vertex); break; } //----------------------------------------------------- int i, n; TSG_Data_Type Type; CSG_Parameters *pAttributes; pAttributes = Parameters("FIELDS")->asParameters(); n = pAttributes->Get_Count() / 3; for(i=0; iGet_Parameter(GET_TYPE(i))->asInt() ) { default: case 0: Type = SG_DATATYPE_String; break; case 1: Type = SG_DATATYPE_Char ; break; case 2: Type = SG_DATATYPE_Short ; break; case 3: Type = SG_DATATYPE_Int ; break; case 4: Type = SG_DATATYPE_Float ; break; case 5: Type = SG_DATATYPE_Double; break; case 6: Type = SG_DATATYPE_Color ; break; } pShapes->Add_Field(pAttributes->Get_Parameter(GET_NAME(i))->asString(), Type); } Parameters("SHAPES")->Set_Value(pShapes); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/Shapes_Create_Empty.h000066400000000000000000000107241224124640700256340ustar00rootroot00000000000000/********************************************************** * Version $Id: Shapes_Create_Empty.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Tools // // // //-------------------------------------------------------// // // // Shapes_Create_Empty.h // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes_Create_Empty_H #define HEADER_INCLUDED__Shapes_Create_Empty_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Create_Empty : public CSG_Module { public: CShapes_Create_Empty(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Construction") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: void _Set_Field_Count (CSG_Parameters *pAttributes, int nAttributes); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shapes_Create_Empty_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/Shapes_Merge.cpp000066400000000000000000000114161224124640700246440ustar00rootroot00000000000000/********************************************************** * Version $Id: Shapes_Merge.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* Shapes_Merge.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "Shapes_Merge.h" #include #include CShapes_Merge::CShapes_Merge(void){ Set_Name(_TL("Merge Shapes Layers")); Set_Author(_TL("Copyrights (c) 2004 by Victor Olaya")); Set_Description (_TW( "(c) 2004 by Victor Olaya. Merge Shapes Layers")); Parameters.Add_Shapes(NULL, "OUT", _TL("Merged Layer"), _TL(""), PARAMETER_OUTPUT); Parameters.Add_Shapes(NULL, "MAIN", _TL("Main Layer"), _TL("Main Layer. Output layer will have the same field in the attributes table as this layer"), PARAMETER_INPUT); Parameters.Add_Shapes_List(NULL, "LAYERS", _TL("Additional Layers"), _TL("Layers to merge with main layer"), PARAMETER_INPUT_OPTIONAL); }//constructor CShapes_Merge::~CShapes_Merge(void) {} bool CShapes_Merge::On_Execute(void){ CSG_Table *pTable; CSG_Shapes *pShapes, *pOutput; CSG_Shape *pShape, *pShape2; CSG_Parameter_Shapes_List *pShapesList; CSG_Shapes* pMainShapes; int i,j; int iLayer, iField, nFields; int iFieldMain, iFieldAdditional; std::vector FieldsMain, FieldsAdditional; CSG_String sName1,sName2; pOutput = Parameters("OUT")->asShapes(); pMainShapes = Parameters("MAIN")->asShapes(); TSG_Shape_Type MainType = pMainShapes->Get_Type(); pOutput->Create(MainType, _TL("Shapes_Merge")); pTable = pMainShapes; nFields = pTable->Get_Field_Count(); for (i=0; iAdd_Field(pTable->Get_Field_Name(i), pTable->Get_Field_Type(i)); }//for pOutput->Add_Field(SG_T("LAYER_ID") , SG_DATATYPE_Int); pOutput->Add_Field(SG_T("LAYER") , SG_DATATYPE_String); //copy main layer into destination for(i=0; iGet_Count(); i++) { pShape = pMainShapes->Get_Shape(i); pShape2 = pOutput->Add_Shape(pShape); pShape2 ->Set_Value(nFields + 0, 1); pShape2 ->Set_Value(nFields + 1, pMainShapes->Get_Name()); for (iField = 0; iFieldGet_Field_Type(iField) == SG_DATATYPE_String) { pShape2->Set_Value(iField, pShape->asString(iField)); }//if else { pShape2->Set_Value(iField, pShape->asDouble(iField)); }//else }//for }//for //now copy the additional layers if( (pShapesList = Parameters("LAYERS")->asShapesList()) != NULL && pShapesList->Get_Count() > 0 ) { for (iLayer=0; iLayerGet_Count(); iLayer++) { if( (pShapes = pShapesList->asShapes(iLayer)) != NULL ) { if (pShapes->Get_Type() == MainType) { FieldsMain.clear(); FieldsAdditional.clear(); //see which fields are in both attributes tables for (i=0; iGet_Field_Count(); j++) { sName1 = pShapes->Get_Field_Name(j); sName2 = pTable->Get_Field_Name(i); if (!sName1.CmpNoCase(sName2)) { FieldsMain.push_back(i); FieldsAdditional.push_back(j); continue; }//if }//for }//for //copy shapes and attributes for(i=0; iGet_Count(); i++) { pShape = pShapes->Get_Shape(i); pShape2 = pOutput->Add_Shape(pShape); pShape2 ->Set_Value(nFields + 0, 2 + iLayer); pShape2 ->Set_Value(nFields + 1, pShapes->Get_Name()); for (j=0; jGet_Field_Type(iFieldMain) == SG_DATATYPE_String) { pShape2->Set_Value(iFieldMain, pShape->asString(iFieldAdditional)); }//if else { pShape2->Set_Value(iFieldMain, pShape->asDouble(iFieldAdditional)); }//else }//for }//for }//if }//if }//for }//if return true; }//method saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/Shapes_Merge.h000066400000000000000000000032531224124640700243110ustar00rootroot00000000000000/********************************************************** * Version $Id: Shapes_Merge.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Shapes_Merge.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes_Merge_H #define HEADER_INCLUDED__Shapes_Merge_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CShapes_Merge : public CSG_Module { public: CShapes_Merge(void); virtual ~CShapes_Merge(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Construction") ); } protected: virtual bool On_Execute(void); }; #endif // #ifndef HEADER_INCLUDED__Shapes_Merge_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/TransformShapes.cpp000066400000000000000000000117751224124640700254310ustar00rootroot00000000000000/********************************************************** * Version $Id: TransformShapes.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* TransformShapes.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ //--------------------------------------------------------- #include "TransformShapes.h" //--------------------------------------------------------- CTransformShapes::CTransformShapes(void) { Set_Name (_TL("Transform Shapes")); Set_Author (SG_T("(c) 2004 by Victor Olaya")); Set_Description (_TW( "(c) 2004 by Victor Olaya. Use this module to move, rotate and/or scale shapes." )); CSG_Parameter *pNode_0, *pNode_1; //----------------------------------------------------- Parameters.Add_Shapes( NULL , "OUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Shapes( NULL , "IN" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); //----------------------------------------------------- pNode_0 = Parameters.Add_Node( NULL , "MOVE" , _TL("Move"), _TL("") ); pNode_1 = Parameters.Add_Value( pNode_0 , "DX" , _TL("dX"), _TL("dX(GridUnits)"), PARAMETER_TYPE_Double, 0.0 ); pNode_1 = Parameters.Add_Value( pNode_0, "DY" , _TL("dY"), _TL("dY(GridUnits)"), PARAMETER_TYPE_Double, 0.0 ); //----------------------------------------------------- pNode_0 = Parameters.Add_Node( NULL , "ROTATE" , _TL("Rotate"), _TL("")); pNode_1 = Parameters.Add_Value( pNode_0 , "ANGLE" , _TL("Angle"), _TL("Angle in degrees, counting clockwise from north"), PARAMETER_TYPE_Double, 0.0 ); //----------------------------------------------------- pNode_0 = Parameters.Add_Node( NULL , "SCALE" , _TL("Scale"), _TL("") ); pNode_1 = Parameters.Add_Value( pNode_0 , "SCALEX" , _TL("Scale Factor X"), _TL("Scale Factor X"), PARAMETER_TYPE_Double, 1.0 ); pNode_1 = Parameters.Add_Value( pNode_0 , "SCALEY" , _TL("Scale Factor Y"), _TL("Scale Factor Y"), PARAMETER_TYPE_Double, 1.0 ); //----------------------------------------------------- pNode_0 = Parameters.Add_Node( NULL , "ANCHOR" , _TL("Anchor Point"), _TL("") ); pNode_1 = Parameters.Add_Value( pNode_0 , "ANCHORX" , _TL("X"), _TL("X"), PARAMETER_TYPE_Double, 0.0 ); pNode_1 = Parameters.Add_Value( pNode_0 , "ANCHORY" , _TL("Y"), _TL("Y"), PARAMETER_TYPE_Double, 0.0 ); }//constructor //--------------------------------------------------------- CTransformShapes::~CTransformShapes(void) {} //--------------------------------------------------------- bool CTransformShapes::On_Execute(void) { bool bCopy; double Angle; TSG_Point P, Q, Move, Scale, Anchor; CSG_Shapes *pIn, *pOut; //----------------------------------------------------- pIn = Parameters("IN") ->asShapes(); pOut = Parameters("OUT") ->asShapes(); Scale.x = Parameters("SCALEX") ->asDouble(); Scale.y = Parameters("SCALEY") ->asDouble(); Move.x = Parameters("DX") ->asDouble(); Move.y = Parameters("DY") ->asDouble(); Anchor.x = Parameters("ANCHORX") ->asDouble(); Anchor.y = Parameters("ANCHORY") ->asDouble(); Angle = Parameters("ANGLE") ->asDouble() * -M_DEG_TO_RAD; if( pIn == pOut ) { bCopy = true; pOut = SG_Create_Shapes(); }//if else { bCopy = false; }//else pOut->Create(pIn->Get_Type(), CSG_String::Format(SG_T("%s [%s]"), pIn->Get_Name(), _TL("Transformed")), pIn); //----------------------------------------------------- for(int iShape=0; iShapeGet_Count(); iShape++) { CSG_Shape *pShape = pOut->Add_Shape(pIn->Get_Shape(iShape)); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { // move first, then rotate and scale... P = pShape->Get_Point(iPoint, iPart); P.x += Move.x - Anchor.x; P.y += Move.y - Anchor.y; Q.x = Anchor.x + Scale.x * (P.x * cos(Angle) - P.y * sin(Angle)); Q.y = Anchor.y + Scale.y * (P.x * sin(Angle) + P.y * cos(Angle)); pShape->Set_Point(Q, iPoint, iPart); }//for }//for }//for //----------------------------------------------------- if( bCopy ) { pIn->Assign(pOut); delete(pOut); }//if return true; }//method saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/TransformShapes.h000066400000000000000000000025551224124640700250720ustar00rootroot00000000000000/********************************************************** * Version $Id: TransformShapes.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* TransformShapes.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CTransformShapes : public CSG_Module{ public: CTransformShapes(void); virtual ~CTransformShapes(void); protected: virtual bool On_Execute(void); private: }; saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/quadtree_structure.cpp000066400000000000000000000217271224124640700262420ustar00rootroot00000000000000/********************************************************** * Version $Id: quadtree_structure.cpp 953 2011-03-18 16:21:40Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Tools // // // //-------------------------------------------------------// // // // quadtree_structure.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. // // // // This library is free software; you can redistribute // // it and/or modify it under the terms of the GNU Lesser // // General Public License as published by the Free // // Software Foundation, version 2.1 of the License. // // // // This library 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 Lesser General Public // // License for more details. // // // // You should have received a copy of the GNU Lesser // // General Public License along with this program; if // // not, write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "quadtree_structure.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CQuadTree_Structure::CQuadTree_Structure(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("QuadTree Structure to Shapes")); Set_Author (SG_T("O. Conrad (c) 2009")); Set_Description (_TW( "" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "ATTRIBUTE" , _TL("Attribute"), _TL(""), true ); Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "LINES" , _TL("Lines"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); Parameters.Add_Shapes( NULL , "POINTS" , _TL("Duplicated Points"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); } //--------------------------------------------------------- bool CQuadTree_Structure::On_Execute(void) { CSG_PRQuadTree QT(Parameters("SHAPES")->asShapes(), Parameters("ATTRIBUTE")->asInt()); Get_Shapes(Parameters("POLYGONS")->asShapes(), (CSG_PRQuadTree_Item *)&QT.Get_Root()); Get_Shapes(Parameters("LINES") ->asShapes(), (CSG_PRQuadTree_Item *)&QT.Get_Root()); Get_Shapes(Parameters("POINTS") ->asShapes(), (CSG_PRQuadTree_Item *)&QT.Get_Root()); return( true ); } //--------------------------------------------------------- bool CQuadTree_Structure::Get_Shapes(CSG_Shapes *pShapes, CSG_PRQuadTree_Item *pItem) { CSG_Shape *pShape; if( pShapes && pItem ) { switch( pShapes->Get_Type() ) { default: return( false ); case SHAPE_TYPE_Point: pShapes->Create(SHAPE_TYPE_Point , CSG_String::Format(SG_T("%s [%s, %s]"), Parameters("SHAPES")->asShapes()->Get_Name(), _TL("QuadTree"), _TL("Duplicates"))); pShapes->Add_Field("COUNT", SG_DATATYPE_Int); pShapes->Add_Field("VALUE", SG_DATATYPE_String); break; case SHAPE_TYPE_Line: pShapes->Create(SHAPE_TYPE_Line , CSG_String::Format(SG_T("%s [%s, %s]"), Parameters("SHAPES")->asShapes()->Get_Name(), _TL("QuadTree"), _TL("Squares"))); pShapes->Add_Field("LEVEL", SG_DATATYPE_Int); pShape = pShapes->Add_Shape(); pShape->Set_Value(0, 0.0); pShape->Add_Point(pItem->Get_xMin(), pItem->Get_yMin()); pShape->Add_Point(pItem->Get_xMin(), pItem->Get_yMax()); pShape->Add_Point(pItem->Get_xMax(), pItem->Get_yMax()); pShape->Add_Point(pItem->Get_xMax(), pItem->Get_yMin()); pShape->Add_Point(pItem->Get_xMin(), pItem->Get_yMin()); break; case SHAPE_TYPE_Polygon: pShapes->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s, %s]"), Parameters("SHAPES")->asShapes()->Get_Name(), _TL("QuadTree"), _TL("Leafs"))); pShapes->Add_Field("LEVEL", SG_DATATYPE_Int); pShapes->Add_Field("VALUE", SG_DATATYPE_Double); pShapes->Add_Field("COUNT", SG_DATATYPE_Int); break; } Get_Shapes(pShapes, pItem, 1); return( true ); } return( false ); } //--------------------------------------------------------- void CQuadTree_Structure::Get_Shapes(CSG_Shapes *pShapes, CSG_PRQuadTree_Item *pItem, int Level) { if( pItem ) { switch( pShapes->Get_Type() ) { //------------------------------------------------- case SHAPE_TYPE_Point: { if( pItem->is_Leaf() ) { CSG_Shape *pShape = pShapes->Add_Shape(); pShape->Add_Point(pItem->asLeaf()->Get_Point()); if( pItem->has_Statistics() ) { CSG_PRQuadTree_Leaf_List *pList = (CSG_PRQuadTree_Leaf_List *)pItem; pShape->Set_Value(0, pList->Get_Count()); pShape->Set_Value(1, SG_Get_String(pList->Get_Value(0), -2).c_str()); for(int i=1; iGet_Count(); i++) { pShape->Set_Value(1, CSG_String::Format(SG_T("%s|%s"), pShape->asString(1), SG_Get_String(pList->Get_Value(i), -2).c_str() )); } } else { pShape->Set_Value(0, 1); pShape->Set_Value(1, SG_Get_String(pItem->asLeaf()->Get_Z(), -2).c_str()); } } } break; //------------------------------------------------- case SHAPE_TYPE_Line: { if( pItem->is_Node() ) { CSG_Shape *pShape = pShapes->Add_Shape(); pShape->Set_Value(0, Level); pShape->Add_Point(pItem->Get_xMin(), pItem->Get_yCenter(), 0); pShape->Add_Point(pItem->Get_xMax(), pItem->Get_yCenter(), 0); pShape->Add_Point(pItem->Get_xCenter(), pItem->Get_yMin(), 1); pShape->Add_Point(pItem->Get_xCenter(), pItem->Get_yMax(), 1); } } break; //------------------------------------------------- case SHAPE_TYPE_Polygon: { if( pItem->is_Leaf() ) { CSG_Shape *pShape = pShapes->Add_Shape(); pShape->Set_Value(0, Level + 1); pShape->Set_Value(1, pItem->asLeaf()->Get_Z()); pShape->Set_Value(2, pItem->has_Statistics() ? ((CSG_PRQuadTree_Leaf_List *)pItem)->Get_Count() : 1); pShape->Add_Point(pItem->Get_xMin(), pItem->Get_yMin()); pShape->Add_Point(pItem->Get_xMin(), pItem->Get_yMax()); pShape->Add_Point(pItem->Get_xMax(), pItem->Get_yMax()); pShape->Add_Point(pItem->Get_xMax(), pItem->Get_yMin()); } } break; } //------------------------------------------------- if( pItem->is_Node() ) { for(int i=0; i<4; i++) { Get_Shapes(pShapes, pItem->asNode()->Get_Child(i), Level + 1); } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/quadtree_structure.h000066400000000000000000000110241224124640700256740ustar00rootroot00000000000000/********************************************************** * Version $Id: quadtree_structure.h 953 2011-03-18 16:21:40Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Tools // // // //-------------------------------------------------------// // // // quadtree_structure.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. // // // // This library is free software; you can redistribute // // it and/or modify it under the terms of the GNU Lesser // // General Public License as published by the Free // // Software Foundation, version 2.1 of the License. // // // // This library 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 Lesser General Public // // License for more details. // // // // You should have received a copy of the GNU Lesser // // General Public License along with this program; if // // not, write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__quadtree_structure_H #define HEADER_INCLUDED__quadtree_structure_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CQuadTree_Structure : public CSG_Module { public: CQuadTree_Structure(void); protected: virtual bool On_Execute (void); private: bool Get_Shapes (CSG_Shapes *pShapes, CSG_PRQuadTree_Item *pItem); void Get_Shapes (CSG_Shapes *pShapes, CSG_PRQuadTree_Item *pItem, int Level); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__quadtree_structure_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_buffer.cpp000066400000000000000000000351471224124640700251250ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_buffer.cpp 1721 2013-06-06 09:55:02Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Shapes_Buffer.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "shapes_buffer.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Buffer::CShapes_Buffer(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Shapes Buffer")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "A vector based buffer construction partly based on the method supposed by Dong et al. 2003. " "\n\n" "References:\n" "Dong, P, Yang, C., Rui, X., Zhang, L., Cheng, Q. (2003): " "'An effective buffer generation method in GIS'. " "Geoscience and Remote Sensing Symposium, 2003. " "IGARSS '03. Proceedings. 2003 IEEE International, Vol.6, p.3706-3708.\n" "online version\n" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "BUFFER" , _TL("Buffer"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); pNode = Parameters.Add_Table_Field_or_Const( pNode , "DIST_FIELD" , _TL("Buffer Distance"), _TL(""), 100.0, 0.0, true ); Parameters.Add_Value( pNode , "DIST_SCALE" , _TL("Scaling Factor for Attribute Value"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); Parameters.Add_Value( NULL , "DISSOLVE" , _TL("Dissolve Buffers"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( NULL , "NZONES" , _TL("Number of Buffer Zones"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); Parameters.Add_Value( NULL , "POLY_INNER" , _TL("Inner Buffer"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "DARC" , _TL("Arc Vertex Distance [Degree]"), _TL(""), PARAMETER_TYPE_Double, 5.0, 0.01, true, 45.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CShapes_Buffer::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SHAPES")) ) { pParameters->Get_Parameter("POLY_INNER")->Set_Enabled(pParameter->asShapes() && pParameter->asShapes()->Get_Type() == SHAPE_TYPE_Polygon); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("NZONES")) ) { pParameters->Get_Parameter("DISSOLVE" )->Set_Enabled(pParameter->asInt() == 1); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("DIST_FIELD")) ) { pParameters->Get_Parameter("DIST_SCALE")->Set_Enabled(pParameter->asInt() >= 0); } //----------------------------------------------------- return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Buffer::On_Execute(void) { int Field, nZones; CSG_Shapes *pShapes, *pBuffers; //----------------------------------------------------- pShapes = Parameters("SHAPES" )->asShapes(); pBuffers = Parameters("BUFFER" )->asShapes(); nZones = Parameters("NZONES" )->asInt(); Field = Parameters("DIST_FIELD")->asInt(); m_dArc = Parameters("DARC" )->asDouble() * M_DEG_TO_RAD; m_bPolyInner = Parameters("POLY_INNER")->asBool() && pShapes->Get_Type() == SHAPE_TYPE_Polygon; //----------------------------------------------------- if( !pShapes->is_Valid() ) { Message_Add(_TL("Invalid Shapes")); return( false ); } if( Field < 0 && Parameters("DIST_FIELD")->asDouble() <= 0.0 ) { Message_Add(_TL("Invalid Buffer Distance")); return( false ); } //----------------------------------------------------- if( nZones == 1 ) { Get_Buffers(pShapes, Field, pBuffers, 1.0, Parameters("DISSOLVE")->asBool()); } //----------------------------------------------------- else if( nZones > 1 ) { CSG_Shape *pBuffer; CSG_Shapes Buffers; pBuffers->Create(SHAPE_TYPE_Polygon); pBuffers->Add_Field(_TL("ID") , SG_DATATYPE_Int); pBuffers->Add_Field(_TL("ZONE") , SG_DATATYPE_Double); double dZone = 1.0 / nZones; for(int iZone=0; iZone 0 ) { SG_Polygon_Difference(pBuffer, Buffers.Get_Shape(0)); } pBuffer = pBuffers->Add_Shape(Buffers.Get_Shape(0)); pBuffer ->Set_Value(0, (nZones - iZone) + 1); pBuffer ->Set_Value(1, (nZones - iZone) * dZone * 100.0); } } //----------------------------------------------------- pBuffers->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("Buffer"))); return( pBuffers->is_Valid() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Buffer::Get_Buffers(CSG_Shapes *pShapes, int Field, CSG_Shapes *pBuffers, double Scale, bool bDissolve) { //----------------------------------------------------- double Distance; CSG_Shapes Part(SHAPE_TYPE_Polygon); CSG_Shape *pPart = Part.Add_Shape(), *pBuffer; Distance = Parameters("DIST_FIELD")->asDouble() * Scale; Scale = Parameters("DIST_SCALE")->asDouble() * Scale; if( !bDissolve ) { pBuffers->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("Buffer")), pShapes); } else { pBuffers->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("Buffer"))); pBuffers->Add_Field(_TL("ID"), SG_DATATYPE_Int); pBuffer = pBuffers->Add_Shape(); } //----------------------------------------------------- for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); if( Field < 0 || (Distance = Scale * pShape->asDouble(Field)) > 0.0 ) { if( !bDissolve ) { pBuffer = pBuffers->Add_Shape(pShape, SHAPE_COPY_ATTR); } if( pBuffer->Get_Part_Count() == 0 ) { Get_Buffer(pShape, pBuffer, Distance); } else { Get_Buffer(pShape, pPart , Distance); SG_Polygon_Union(pBuffer, pPart); pPart->Del_Parts(); } } } //----------------------------------------------------- return( pBuffers->is_Valid() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Buffer::Get_Buffer(CSG_Shape *pShape, CSG_Shape *pBuffer, double Distance) { switch( pShape->Get_Type() ) { case SHAPE_TYPE_Point: return( Get_Buffer_Point (pShape, pBuffer, Distance) ); case SHAPE_TYPE_Points: return( Get_Buffer_Points (pShape, pBuffer, Distance) ); case SHAPE_TYPE_Line: return( Get_Buffer_Line (pShape, pBuffer, Distance) ); case SHAPE_TYPE_Polygon: return( Get_Buffer_Polygon (pShape, pBuffer, Distance) ); default: return( false ); } } //--------------------------------------------------------- bool CShapes_Buffer::Get_Buffer_Point(CSG_Shape *pPoint, CSG_Shape *pBuffer, double Distance) { Add_Arc(pBuffer, pPoint->Get_Point(0), Distance, 0.0, M_PI_360); return( true ); } //--------------------------------------------------------- bool CShapes_Buffer::Get_Buffer_Points(CSG_Shape *pPoints, CSG_Shape *pBuffer, double Distance) { CSG_Shapes Part(SHAPE_TYPE_Polygon); CSG_Shape *pPart = Part.Add_Shape(); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { if( pBuffer->Get_Part_Count() == 0 ) { Add_Arc(pBuffer, pPoints->Get_Point(iPoint), Distance, 0.0, M_PI_360); } else { Add_Arc(pPart , pPoints->Get_Point(iPoint), Distance, 0.0, M_PI_360); SG_Polygon_Union(pBuffer, pPart); pPart->Del_Parts(); } } } return( true ); } //--------------------------------------------------------- bool CShapes_Buffer::Get_Buffer_Line(CSG_Shape *pLine, CSG_Shape *pBuffer, double Distance) { return( SG_Polygon_Offset(pLine, Distance, m_dArc, pBuffer) ); } //--------------------------------------------------------- bool CShapes_Buffer::Get_Buffer_Polygon(CSG_Shape *pPolygon, CSG_Shape *pBuffer, double Distance) { if( m_bPolyInner ) { if( SG_Polygon_Offset(pPolygon, -Distance, m_dArc, pBuffer) ) SG_Polygon_Difference(pPolygon, pBuffer, pBuffer); else pBuffer->Assign(pPolygon, false); return( true ); } return( SG_Polygon_Offset(pPolygon, Distance, m_dArc, pBuffer) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline double CShapes_Buffer::Get_Direction(const TSG_Point &From, const TSG_Point &To) { double dx = To.x - From.x; double dy = To.y - From.y; return( dx != 0.0 ? M_PI_180 + atan2(dy, dx) : ( dy > 0.0 ? M_PI_270 : ( dy < 0.0 ? M_PI_090 : 0.0 ) ) ); } //--------------------------------------------------------- inline bool CShapes_Buffer::Get_Parallel(const TSG_Point &A, const TSG_Point &B, TSG_Point AB[2], double Distance) { double d; TSG_Point C; if( (d = SG_Get_Distance(A, B)) > 0.0 ) { d = Distance / d; C.x = d * (A.y - B.y); C.y = d * (B.x - A.x); AB[0].x = A.x + C.x; AB[0].y = A.y + C.y; AB[1].x = B.x + C.x; AB[1].y = B.y + C.y; return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void CShapes_Buffer::Add_Vertex(CSG_Shape *pBuffer, const TSG_Point &Center, double Distance, double theta) { pBuffer->Add_Point( Center.x + Distance * cos(theta), Center.y + Distance * sin(theta) ); } //--------------------------------------------------------- inline void CShapes_Buffer::Add_Arc(CSG_Shape *pBuffer, const TSG_Point &Center, double Distance, double alpha, double beta) { double theta; if( alpha < beta ) { for(theta=alpha; thetabeta; theta-=m_dArc) { Add_Vertex(pBuffer, Center, Distance, theta); } } Add_Vertex(pBuffer, Center, Distance, beta); } //--------------------------------------------------------- inline void CShapes_Buffer::Add_Arc(CSG_Shape *pBuffer, const TSG_Point &Center, double Distance, const TSG_Point &A, const TSG_Point &B) { double alpha, beta; alpha = Get_Direction(A, Center); beta = Get_Direction(B, Center); if( alpha - beta >= M_PI_180 ) { beta += M_PI_360; } Add_Arc(pBuffer, Center, Distance, alpha, beta); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_buffer.h000066400000000000000000000124131224124640700245610ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_buffer.h 1721 2013-06-06 09:55:02Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Shapes_Buffer.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes_Buffer_H #define HEADER_INCLUDED__Shapes_Buffer_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Buffer : public CSG_Module { public: CShapes_Buffer(void); protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: bool m_bPolyInner; double m_dArc; bool Get_Buffers (CSG_Shapes *pShapes, int Field, CSG_Shapes *pBuffers, double Scale, bool bDissolve); bool Get_Buffer (CSG_Shape *pShape , CSG_Shape *pBuffer, double Distance); bool Get_Buffer_Point (CSG_Shape *pPoint , CSG_Shape *pBuffer, double Distance); bool Get_Buffer_Points (CSG_Shape *pPoints , CSG_Shape *pBuffer, double Distance); bool Get_Buffer_Line (CSG_Shape *pLine , CSG_Shape *pBuffer, double Distance); bool Get_Buffer_Polygon (CSG_Shape *pPolygon, CSG_Shape *pBuffer, double Distance); double Get_Direction (const TSG_Point &From, const TSG_Point &To); bool Get_Parallel (const TSG_Point &A, const TSG_Point &B, TSG_Point AB[2], double Distance); void Add_Vertex (CSG_Shape *pBuffer, const TSG_Point &Center, double Distance, double theta); void Add_Arc (CSG_Shape *pBuffer, const TSG_Point &Center, double Distance, double alpha, double beta); void Add_Arc (CSG_Shape *pBuffer, const TSG_Point &Center, double Distance, const TSG_Point &A, const TSG_Point &B); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shapes_Buffer_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_cut.cpp000066400000000000000000000365011224124640700244420ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_cut.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Shapes_Cut.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "shapes_cut.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool Cut_Shapes(CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes, CSG_Shapes *pCut) { if( pCut && pShapes && pShapes->is_Valid() && pPolygons && pPolygons->is_Valid() && pPolygons->Get_Extent().Intersects(pShapes->Get_Extent()) ) { pCut->Create( pShapes->Get_Type(), CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("Cut")), pShapes ); for(int iShape=0; iShapeGet_Count() && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++) { bool bAdd; CSG_Shape *pShape = pShapes->Get_Shape(iShape); if( Method == 2 ) // center { bAdd = false; TSG_Point Center; if( pShapes->Get_Type() == SHAPE_TYPE_Polygon ) Center = ((CSG_Shape_Polygon *)pShape)->Get_Centroid(); else Center = pShape->Get_Extent().Get_Center(); if( pPolygons->Select(Center) ) { bAdd = true; } } else if( Method == 1 ) // intersects { bAdd = false; for(int iPart=0; iPartGet_Part_Count() && !bAdd; iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart) && !bAdd; iPoint++) { if( pPolygons->Select(pShape->Get_Point(iPoint, iPart)) ) { bAdd = true; } } } } else // completely contained { bAdd = true; for(int iPart=0; iPartGet_Part_Count() && bAdd; iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart) && bAdd; iPoint++) { if( pPolygons->Select(pShape->Get_Point(iPoint, iPart)) == false ) { bAdd = false; } } } } if( bAdd ) { pCut->Add_Shape(pShape); } } return( pCut->Get_Count() > 0 ); } return( false ); } //--------------------------------------------------------- bool Cut_Shapes(CSG_Rect Extent, int Method, CSG_Shapes *pShapes, CSG_Shapes *pCut) { if( pCut && pShapes && pShapes->is_Valid() && Extent.Intersects(pShapes->Get_Extent()) ) { pCut->Create( pShapes->Get_Type(), CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("Cut")), pShapes ); for(int iShape=0; iShapeGet_Count() && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++) { bool bAdd; CSG_Shape *pShape = pShapes->Get_Shape(iShape); if( Method == 2 ) // center { bAdd = pShapes->Get_Type() == SHAPE_TYPE_Polygon ? Extent.Contains(((CSG_Shape_Polygon *)pShape)->Get_Centroid()) : Extent.Contains(pShape->Get_Extent().Get_Center()); } else // completely contained, intersects { switch( pShape->Intersects(Extent) ) { case INTERSECTION_Identical: case INTERSECTION_Contained: bAdd = true; break; case INTERSECTION_Overlaps: case INTERSECTION_Contains: bAdd = Method == 1; break; default: bAdd = false; break; } } if( bAdd ) { pCut->Add_Shape(pShape); } } return( pCut->Get_Count() > 0 ); } return( false ); } //--------------------------------------------------------- CSG_Shapes * Cut_Shapes(CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes) { CSG_Shapes *pCut = SG_Create_Shapes(); if( Cut_Shapes(pPolygons, Method, pShapes, pCut) ) { return( pCut ); } delete(pCut); return( NULL ); } CSG_Shapes * Cut_Shapes(CSG_Rect Extent, int Method, CSG_Shapes *pShapes) { CSG_Shapes *pCut = SG_Create_Shapes(); if( Cut_Shapes(Extent, Method, pShapes, pCut) ) { return( pCut ); } delete(pCut); return( NULL ); } //--------------------------------------------------------- CSG_String Cut_Methods_Str(void) { return( CSG_String::Format(SG_T("%s|%s|%s|"), _TL("completely contained"), _TL("intersects"), _TL("center")) ); } //--------------------------------------------------------- bool Cut_Set_Extent(CSG_Rect Extent, CSG_Shapes *pExtent, bool bClear) { if( pExtent ) { if( bClear ) { pExtent->Create(SHAPE_TYPE_Polygon, _TL("Extent [Cut]")); pExtent->Add_Field("ID", SG_DATATYPE_Int); } if( pExtent->Get_Type() == SHAPE_TYPE_Polygon ) { CSG_Shape *pShape = pExtent->Add_Shape(); pShape->Set_Value(SG_T("ID"), pExtent->Get_Count()); pShape->Add_Point(Extent.Get_XMin(), Extent.Get_YMin()); pShape->Add_Point(Extent.Get_XMin(), Extent.Get_YMax()); pShape->Add_Point(Extent.Get_XMax(), Extent.Get_YMax()); pShape->Add_Point(Extent.Get_XMax(), Extent.Get_YMin()); pShape->Add_Point(Extent.Get_XMin(), Extent.Get_YMin()); return( true ); } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Cut::CShapes_Cut(void) { Set_Name (_TL("Cut Shapes Layer")); Set_Author (SG_T("O. Conrad (c) 2006")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Shapes_List( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes_List( NULL , "CUT" , _TL("Cut"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Shapes( NULL , "EXTENT" , _TL("Extent"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), Cut_Methods_Str(), 0 ); Parameters.Add_Choice( NULL , "TARGET" , _TL("Extent"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("user defined"), _TL("grid project"), _TL("shapes layer extent"), _TL("polygons") ), 0 ); //----------------------------------------------------- CSG_Parameters *pParameters; pParameters = Add_Parameters("CUT", _TL("Extent"), _TL("")); pParameters->Add_Value( NULL, "AX" , _TL("Left") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "BX" , _TL("Right") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "AY" , _TL("Bottom") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "BY" , _TL("Top") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "DX" , _TL("Horizontal Range") , _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); pParameters->Add_Value( NULL, "DY" , _TL("Vertical Range") , _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); pParameters = Add_Parameters("GRID", _TL("Extent"), _TL("")); pParameters->Add_Grid_System( NULL, "GRID", _TL("Grid Project") , _TL("") ); pParameters = Add_Parameters("SHAPES", _TL("Extent"), _TL("")); pParameters->Add_Shapes( NULL, "SHAPES", _TL("Shapes") , _TL(""), PARAMETER_INPUT ); pParameters = Add_Parameters("POLYGONS", _TL("Polygons"), _TL("")); pParameters->Add_Shapes( NULL, "POLYGONS", _TL("Polygons") , _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Cut::On_Execute(void) { int Method; CSG_Shapes *pExtent, *pCut; CSG_Parameter_Shapes_List *pShapes, *pCuts; //----------------------------------------------------- pShapes = Parameters("SHAPES") ->asShapesList(); pCuts = Parameters("CUT") ->asShapesList(); pExtent = Parameters("EXTENT") ->asShapes(); Method = Parameters("METHOD") ->asInt(); //----------------------------------------------------- if( pShapes->Get_Count() > 0 ) { int iLayer; CSG_Rect r(pShapes->asShapes(0)->Get_Extent()); for(iLayer=1; iLayerGet_Count(); iLayer++) { r.Union(pShapes->asShapes(iLayer)->Get_Extent()); } if( Get_Extent(r) ) { pCuts->Del_Items(); Cut_Set_Extent(r, pExtent, true); for(iLayer=0; iLayerGet_Count(); iLayer++) { if( m_pPolygons ) { if( Cut_Shapes(m_pPolygons, Method, pShapes->asShapes(iLayer), pCut = SG_Create_Shapes()) ) pCuts->Add_Item(pCut); else delete(pCut); } else { if( Cut_Shapes(r, Method, pShapes->asShapes(iLayer), pCut = SG_Create_Shapes()) ) pCuts->Add_Item(pCut); else delete(pCut); } } return( pCuts->Get_Count() > 0 ); } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Cut::Get_Extent(CSG_Rect &r) { m_pPolygons = NULL; switch( Parameters("TARGET")->asInt() ) { //----------------------------------------------------- case 0: // user defined Get_Parameters("CUT")->Get_Parameter("AX")->Set_Value(r.Get_XMin()); Get_Parameters("CUT")->Get_Parameter("AY")->Set_Value(r.Get_YMin()); Get_Parameters("CUT")->Get_Parameter("BX")->Set_Value(r.Get_XMax()); Get_Parameters("CUT")->Get_Parameter("BY")->Set_Value(r.Get_YMax()); Get_Parameters("CUT")->Get_Parameter("DX")->Set_Value(r.Get_XRange()); Get_Parameters("CUT")->Get_Parameter("DY")->Set_Value(r.Get_YRange()); if( Dlg_Parameters("CUT") ) { r.Assign( Get_Parameters("CUT")->Get_Parameter("AX")->asDouble(), Get_Parameters("CUT")->Get_Parameter("AY")->asDouble(), Get_Parameters("CUT")->Get_Parameter("BX")->asDouble(), Get_Parameters("CUT")->Get_Parameter("BY")->asDouble() ); return( true ); } break; //----------------------------------------------------- case 1: // grid project if( Dlg_Parameters("GRID") ) { r.Assign(Get_Parameters("GRID")->Get_Parameter("GRID")->asGrid_System()->Get_Extent()); return( true ); } break; //----------------------------------------------------- case 2: // shapes extent if( Dlg_Parameters("SHAPES") ) { r.Assign(Get_Parameters("SHAPES")->Get_Parameter("SHAPES")->asShapes()->Get_Extent()); return( true ); } break; //----------------------------------------------------- case 3: // polygons if( Dlg_Parameters("POLYGONS") ) { r.Assign(Get_Parameters("POLYGONS")->Get_Parameter("POLYGONS")->asShapes()->Get_Extent()); m_pPolygons = Get_Parameters("POLYGONS")->Get_Parameter("POLYGONS")->asShapes(); return( true ); } break; } return( false ); } //--------------------------------------------------------- int CShapes_Cut::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameters->Get_Identifier(), SG_T("CUT")) ) { double ax, ay, bx, by, dx, dy, d; ax = pParameters->Get_Parameter("AX")->asDouble(); ay = pParameters->Get_Parameter("AY")->asDouble(); bx = pParameters->Get_Parameter("BX")->asDouble(); by = pParameters->Get_Parameter("BY")->asDouble(); dx = pParameters->Get_Parameter("DX")->asDouble(); dy = pParameters->Get_Parameter("DY")->asDouble(); if( ax > bx ) { d = ax; ax = bx; bx = d; } if( ay > by ) { d = ay; ay = by; by = d; } if ( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("DX")) ) { bx = ax + dx; } else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AX")) || !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("BX")) ) { dx = bx - ax; } else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("DY")) ) { by = ay + dy; } else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AY")) || !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("BY")) ) { dy = by - ay; } pParameters->Get_Parameter("AX")->Set_Value(ax); pParameters->Get_Parameter("AY")->Set_Value(ay); pParameters->Get_Parameter("BX")->Set_Value(bx); pParameters->Get_Parameter("BY")->Set_Value(by); pParameters->Get_Parameter("DX")->Set_Value(dx); pParameters->Get_Parameter("DY")->Set_Value(dy); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_cut.h000066400000000000000000000117711224124640700241110ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_cut.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Shapes_Cut.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes_Cut_H #define HEADER_INCLUDED__Shapes_Cut_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Shapes * Cut_Shapes (CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes); CSG_Shapes * Cut_Shapes (CSG_Rect Extent , int Method, CSG_Shapes *pShapes); bool Cut_Shapes (CSG_Shapes *pPolygons, int Method, CSG_Shapes *pShapes, CSG_Shapes *pCut); bool Cut_Shapes (CSG_Rect Extent , int Method, CSG_Shapes *pShapes, CSG_Shapes *pCut); CSG_String Cut_Methods_Str (void); bool Cut_Set_Extent (CSG_Rect Extent, CSG_Shapes *pExtent, bool bClear); /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Cut : public CSG_Module { public: CShapes_Cut(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Construction") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: CSG_Shapes *m_pPolygons; bool Get_Extent (CSG_Rect &r); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shapes_Cut_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_cut_interactive.cpp000066400000000000000000000222451224124640700270370ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_cut_interactive.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Shapes_Cut_Interactive.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "shapes_cut_interactive.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Cut_Interactive::CShapes_Cut_Interactive(void) { Set_Name (_TL("Cut Shapes Layer")); Set_Author (SG_T("(c) 2006 by O.Conrad")); Set_Description (_TW( "" )); Set_Drag_Mode (MODULE_INTERACTIVE_DRAG_BOX); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "CUT" , _TL("Cut"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Shapes( NULL , "EXTENT" , _TL("Extent"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), Cut_Methods_Str(), 0 ); //----------------------------------------------------- CSG_Parameters *pParameters = Add_Parameters("CUT", _TL("Extent"), _TL("")); pParameters->Add_Value( NULL, "AX" , _TL("Left") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "BX" , _TL("Right") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "AY" , _TL("Bottom") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "BY" , _TL("Top") , _TL(""), PARAMETER_TYPE_Double ); pParameters->Add_Value( NULL, "DX" , _TL("Horizontal Range") , _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); pParameters->Add_Value( NULL, "DY" , _TL("Vertical Range") , _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); } //--------------------------------------------------------- CShapes_Cut_Interactive::~CShapes_Cut_Interactive(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Cut_Interactive::On_Execute(void) { m_bDown = false; m_pShapes = Parameters("SHAPES") ->asShapes(); m_pCut = Parameters("CUT") ->asShapes(); m_pExtent = Parameters("EXTENT") ->asShapes(); m_Method = Parameters("METHOD") ->asInt(); m_pCut->Create(m_pShapes->Get_Type()); return( true ); } //--------------------------------------------------------- bool CShapes_Cut_Interactive::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode) { switch( Mode ) { //----------------------------------------------------- case MODULE_INTERACTIVE_LDOWN: if( m_bDown == false ) { m_bDown = true; m_pDown = ptWorld; } return( true ); //----------------------------------------------------- case MODULE_INTERACTIVE_LUP: if( m_bDown == true ) { m_bDown = false; CSG_Rect r(m_pDown, ptWorld); if( Get_Extent(r) ) { if( Cut_Set_Extent(r, m_pExtent, true) ) { DataObject_Update(m_pExtent); } if( Cut_Shapes(r, m_Method, m_pShapes, m_pCut) ) { DataObject_Update(m_pCut); } else { Message_Add(_TL("No shapes in selection")); } } } return( true ); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CShapes_Cut_Interactive::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameters->Get_Identifier(), SG_T("CUT")) ) { double ax, ay, bx, by, dx, dy, d; ax = pParameters->Get_Parameter("AX")->asDouble(); ay = pParameters->Get_Parameter("AY")->asDouble(); bx = pParameters->Get_Parameter("BX")->asDouble(); by = pParameters->Get_Parameter("BY")->asDouble(); dx = pParameters->Get_Parameter("DX")->asDouble(); dy = pParameters->Get_Parameter("DY")->asDouble(); if( ax > bx ) { d = ax; ax = bx; bx = d; } if( ay > by ) { d = ay; ay = by; by = d; } if ( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("DX")) ) { bx = ax + dx; } else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AX")) || !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("BX")) ) { dx = bx - ax; } else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("DY")) ) { by = ay + dy; } else if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AY")) || !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("BY")) ) { dy = by - ay; } pParameters->Get_Parameter("AX")->Set_Value(ax); pParameters->Get_Parameter("AY")->Set_Value(ay); pParameters->Get_Parameter("BX")->Set_Value(bx); pParameters->Get_Parameter("BY")->Set_Value(by); pParameters->Get_Parameter("DX")->Set_Value(dx); pParameters->Get_Parameter("DY")->Set_Value(dy); return( true ); } return( false ); } //--------------------------------------------------------- bool CShapes_Cut_Interactive::Get_Extent(CSG_Rect &r) { CSG_Parameters *pParameters = Get_Parameters("CUT"); pParameters->Get_Parameter("AX")->Set_Value(r.Get_XMin()); pParameters->Get_Parameter("AY")->Set_Value(r.Get_YMin()); pParameters->Get_Parameter("BX")->Set_Value(r.Get_XMax()); pParameters->Get_Parameter("BY")->Set_Value(r.Get_YMax()); pParameters->Get_Parameter("DX")->Set_Value(r.Get_XRange()); pParameters->Get_Parameter("DY")->Set_Value(r.Get_YRange()); if( Dlg_Parameters("CUT") ) { r.Assign( pParameters->Get_Parameter("AX")->asDouble(), pParameters->Get_Parameter("AY")->asDouble(), pParameters->Get_Parameter("BX")->asDouble(), pParameters->Get_Parameter("BY")->asDouble() ); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_cut_interactive.h000066400000000000000000000111371224124640700265020ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_cut_interactive.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Shapes_Cut_Interactive.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes_Cut_Interactive_H #define HEADER_INCLUDED__Shapes_Cut_Interactive_H //--------------------------------------------------------- #include "shapes_cut.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Cut_Interactive : public CSG_Module_Interactive { public: CShapes_Cut_Interactive(void); virtual ~CShapes_Cut_Interactive(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Construction") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); virtual bool On_Execute_Position (CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode); private: bool m_bDown; int m_Method; CSG_Point m_pDown; CSG_Shapes *m_pShapes, *m_pCut, *m_pExtent; bool Get_Extent (CSG_Rect &r); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shapes_Cut_Interactive_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_extents.cpp000066400000000000000000000157421224124640700253450ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_extents.cpp 1385 2012-04-27 12:43:24Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Tools // // // //-------------------------------------------------------// // // // Shapes_Extents.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "shapes_extents.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Extents::CShapes_Extents(void) { //----------------------------------------------------- Set_Name (_TL("Get Shapes Extents")); Set_Author (SG_T("O. Conrad (c) 2008")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "EXTENTS" , _TL("Extents"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Choice( NULL , "OUTPUT" , _TL("Get Extent for ..."), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("all shapes"), _TL("each shape"), _TL("each shape's part") ), 1 ); } //--------------------------------------------------------- CShapes_Extents::~CShapes_Extents(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Extents::On_Execute(void) { CSG_Shapes *pShapes = Parameters("SHAPES" )->asShapes(); CSG_Shapes *pExtents = Parameters("EXTENTS")->asShapes(); //----------------------------------------------------- if( !pShapes->is_Valid() ) { Message_Add(_TL("invalid input")); return( false ); } //----------------------------------------------------- int iOutput = Parameters("OUTPUT")->asInt(); if( iOutput == 0 ) // all shapes { pExtents->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), pShapes->Get_Name(), _TL("Extent"))); pExtents->Add_Field(SG_T("OID"), SG_DATATYPE_Int); TSG_Rect r = pShapes->Get_Extent(); CSG_Shape *pExtent = pExtents->Add_Shape(); pExtent->Set_Value(0, 1); pExtent->Add_Point(r.xMin, r.yMin); pExtent->Add_Point(r.xMin, r.yMax); pExtent->Add_Point(r.xMax, r.yMax); pExtent->Add_Point(r.xMax, r.yMin); return( true ); } //----------------------------------------------------- if( pShapes->Get_Type() == SHAPE_TYPE_Point ) { Message_Add(_TL("no 'get extents' support for single point layers")); return( false ); } //----------------------------------------------------- pExtents->Create(SHAPE_TYPE_Polygon, pShapes->Get_Name(), pShapes); for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); if( iOutput == 1 ) // each shape { TSG_Rect r = pShape->Get_Extent(); CSG_Shape *pExtent = pExtents->Add_Shape(pShape, SHAPE_COPY_ATTR); pExtent->Add_Point(r.xMin, r.yMin); pExtent->Add_Point(r.xMin, r.yMax); pExtent->Add_Point(r.xMax, r.yMax); pExtent->Add_Point(r.xMax, r.yMin); } else // if( iOutput == 2 ) // each shape's part { for(int iPart=0; iPartGet_Part_Count(); iPart++) { TSG_Rect r = pShape->Get_Extent(iPart); CSG_Shape *pExtent = pExtents->Add_Shape(pShape, SHAPE_COPY_ATTR); pExtent->Add_Point(r.xMin, r.yMin); pExtent->Add_Point(r.xMin, r.yMax); pExtent->Add_Point(r.xMax, r.yMax); pExtent->Add_Point(r.xMax, r.yMin); } } } //----------------------------------------------------- return( pExtents->is_Valid() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_extents.h000066400000000000000000000102431224124640700250010ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_extents.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Tools // // // //-------------------------------------------------------// // // // Shapes_Extents.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes_Extents_H #define HEADER_INCLUDED__Shapes_Extents_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Extents : public CSG_Module { public: CShapes_Extents(void); virtual ~CShapes_Extents(void); protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shapes_Extents_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_generate.cpp000066400000000000000000000252531224124640700254430ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_generate.cpp 1371 2012-04-11 17:50:34Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // shapes_generate.cpp // // // // Copyright (C) 2012 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "shapes_generate.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Generate::CShapes_Generate(void) { Set_Name(_TL("Generate Shapes")); Set_Author(_TL("Volker Wichmann (c) 2012, LASERDATA GmbH")); Set_Description (_TW( "The module allows to generate point, line or polygon shapes from " "a table with x and y coordinates and an identifier. The table must " "be sorted in vertex order.\n\n" "The identifier has different meanings:\n\n" "* Point Shapes: The identifier is arbitrary\n\n" "* Line Shapes: The identifier is unique for each line\n\n" "* Polygon Shapes: The identifier is unique for each polygon; " "the first polygon vertex may but must not be duplicated in " "order to close the polygon\n\n") ); //----------------------------------------------------- Parameters.Add_Table( NULL , "INPUT" ,_TL("Input"), _TL("Table with coordinates."), PARAMETER_INPUT ); Parameters.Add_Table_Field( Parameters("INPUT"), "FIELD_ID", _TL("ID"), _TL("Field with identifier.") ); Parameters.Add_Table_Field( Parameters("INPUT"), "FIELD_X", _TL("X"), _TL("Field with x-coordinate.") ); Parameters.Add_Table_Field( Parameters("INPUT"), "FIELD_Y", _TL("Y"), _TL("Field with y-coordinate.") ); /*Parameters.Add_Table_Field( Parameters("INPUT"), "FIELD_Z", _TL("Z"), _TL("Field with z-coordinate."), true );*/ Parameters.Add_Choice( NULL , "SHAPE_TYPE" , _TL("Shape Type"), _TL("Shape type to generate."), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Point(s)"), _TL("Line(s)"), _TL("Polygon(s)") ), 0 ); Parameters.Add_Shapes( NULL , "OUTPUT" , _TL("Output"), _TL("Generated Shapefile."), PARAMETER_OUTPUT ); } //--------------------------------------------------------- CShapes_Generate::~CShapes_Generate(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Generate::On_Execute(void) { CSG_Table *pInput; CSG_Shapes *pOutput; int iFieldId, iFieldX, iFieldY; // iFieldZ int iShapeType; CSG_String sName; pInput = Parameters("INPUT")->asTable(); iFieldId = Parameters("FIELD_ID")->asInt(); iFieldX = Parameters("FIELD_X")->asInt(); iFieldY = Parameters("FIELD_Y")->asInt(); //iFieldZ = Parameters("FIELD_Z")->asInt(); iShapeType = Parameters("SHAPE_TYPE")->asInt(); pOutput = Parameters("OUTPUT")->asShapes(); if (pInput->Get_Count() < 1) { SG_UI_Msg_Add_Error(_TL("Input table is empty!")); return (false); } //----------------------------------------------------- // Initialize ... sName = CSG_String::Format(SG_T("Shapes_%s"), pInput->Get_Name()); pOutput->Destroy(); switch (iShapeType) { default: case 0: // point pOutput->Create(SHAPE_TYPE_Point, sName, (CSG_Table*)0, SG_VERTEX_TYPE_XY); break; case 1: // line pOutput->Create(SHAPE_TYPE_Line, sName, (CSG_Table*)0, SG_VERTEX_TYPE_XY); break; case 2: // polygon pOutput->Create(SHAPE_TYPE_Polygon, sName, (CSG_Table*)0, SG_VERTEX_TYPE_XY); break; } pOutput->Add_Field(SG_T("ID"), SG_DATATYPE_Int); //----------------------------------------------------- // Generate ... switch (iShapeType) { default: case 0: // point if (!Generate_Point_Shapes(pInput, pOutput, iFieldId, iFieldX, iFieldY)) return (false); break; case 1: // line if (!Generate_Line_Shapes(pInput, pOutput, iFieldId, iFieldX, iFieldY)) return (false); break; case 2: // polygon if (!Generate_Polygon_Shapes(pInput, pOutput, iFieldId, iFieldX, iFieldY)) return (false); break; } //----------------------------------------------------- return (true); } //--------------------------------------------------------- bool CShapes_Generate::Generate_Point_Shapes(CSG_Table *pInput, CSG_Shapes *pOutput, int iFieldId, int iFieldX, int iFieldY) { for (int i=0; iGet_Count() && Set_Progress(i, pInput->Get_Count()); i++) { CSG_Table_Record *pRecord = pInput->Get_Record(i); CSG_Shape *pShape = pOutput->Add_Shape(); pShape->Add_Point(pRecord->asDouble(iFieldX), pRecord->asDouble(iFieldY)); pShape->Set_Value(0, pRecord->asInt(iFieldId)); } return (true); } //--------------------------------------------------------- bool CShapes_Generate::Generate_Line_Shapes(CSG_Table *pInput, CSG_Shapes *pOutput, int iFieldId, int iFieldX, int iFieldY) { int iVertices = 0; int iID = pInput->Get_Record(0)->asInt(iFieldId); CSG_Shape *pShape = pOutput->Add_Shape(); pShape->Set_Value(0, iID); for (int i=0; iGet_Count() && Set_Progress(i, pInput->Get_Count()); i++) { CSG_Table_Record *pRecord = pInput->Get_Record(i); if (pRecord->asInt(iFieldId) != iID) { if (iVertices < 2) { pOutput->Del_Record(pOutput->Get_Record_Count() - 1); SG_UI_Msg_Add_Error(_TL("Line with less than 2 vertices encountered!")); return (false); } pShape = pOutput->Add_Shape(); iID = pRecord->asInt(iFieldId); pShape->Set_Value(0, iID); iVertices = 0; } pShape->Add_Point(pRecord->asDouble(iFieldX), pRecord->asDouble(iFieldY)); iVertices += 1; iID = pRecord->asInt(iFieldId); } if (iVertices < 2) { pOutput->Del_Record(pOutput->Get_Record_Count() - 1); SG_UI_Msg_Add_Error(_TL("Line with less than 2 vertices encountered!")); return (false); } return (true); } //--------------------------------------------------------- bool CShapes_Generate::Generate_Polygon_Shapes(CSG_Table *pInput, CSG_Shapes *pOutput, int iFieldId, int iFieldX, int iFieldY) { int iVertices = 0; int iID = pInput->Get_Record(0)->asInt(iFieldId); CSG_Shape *pShape = pOutput->Add_Shape(); pShape->Set_Value(0, iID); TSG_Point pointA; pointA.x = pInput->Get_Record(0)->asDouble(iFieldX); pointA.y = pInput->Get_Record(0)->asDouble(iFieldY); for (int i=0; iGet_Count() && Set_Progress(i, pInput->Get_Count()); i++) { CSG_Table_Record *pRecord = pInput->Get_Record(i); if (pRecord->asInt(iFieldId) != iID) { if (iVertices < 3) { pOutput->Del_Record(pOutput->Get_Record_Count() - 1); SG_UI_Msg_Add_Error(_TL("Polygon with less than 3 vertices encountered!")); return (false); } TSG_Point pointB; pointB.x = pInput->Get_Record(i-1)->asDouble(iFieldX); pointB.y = pInput->Get_Record(i-1)->asDouble(iFieldY); if (pointA.x != pointB.x || pointA.y != pointB.y) pShape->Add_Point(pointA); pShape = pOutput->Add_Shape(); iID = pRecord->asInt(iFieldId); pShape->Set_Value(0, iID); pointA.x = pInput->Get_Record(i)->asDouble(iFieldX); pointA.y = pInput->Get_Record(i)->asDouble(iFieldY); iVertices = 0; } pShape->Add_Point(pRecord->asDouble(iFieldX), pRecord->asDouble(iFieldY)); iVertices += 1; iID = pRecord->asInt(iFieldId); } if (iVertices < 3) { pOutput->Del_Record(pOutput->Get_Record_Count() - 1); SG_UI_Msg_Add_Error(_TL("Polygon with less than 3 vertices encountered!")); return (false); } return (true); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_generate.h000066400000000000000000000113171224124640700251040ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_generate.h 1369 2012-04-10 21:39:09Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // shapes_generate.h // // // // Copyright (C) 2012 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: wichmann@laserdata // // // // contact: Volker Wichmann // // LASERDATA GmbH // // Management and analysis of // // laserscanning data // // Innsbruck, Austria // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes_Generate_H #define HEADER_INCLUDED__Shapes_Generate_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Generate : public CSG_Module { public: CShapes_Generate(void); virtual ~CShapes_Generate(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Construction") ); } protected: virtual bool On_Execute (void); private: bool Generate_Point_Shapes (CSG_Table *pInput, CSG_Shapes *pOutput, int iFieldId, int iFieldX, int iFieldY); bool Generate_Line_Shapes (CSG_Table *pInput, CSG_Shapes *pOutput, int iFieldId, int iFieldX, int iFieldY); bool Generate_Polygon_Shapes (CSG_Table *pInput, CSG_Shapes *pOutput, int iFieldId, int iFieldX, int iFieldY); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shapes_Generate_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_polar_to_cartes.cpp000066400000000000000000000161311224124640700270240ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_polar_to_cartes.cpp 911 2011-11-11 11:11:11Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // shapes_polar_to_cartes.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "shapes_polar_to_cartes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Polar_to_Cartes::CShapes_Polar_to_Cartes(void) { CSG_Parameter *pNode; //----------------------------------------------------- // 1. Info... Set_Name (_TL("Polar to Cartesian Coordinates")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "" )); //----------------------------------------------------- // 2. Parameters... pNode = Parameters.Add_Shapes( NULL , "POLAR" , _TL("Polar Coordinates"), _TL(""), PARAMETER_INPUT ); pNode = Parameters.Add_Table_Field( pNode , "F_EXAGG" , _TL("Exaggeration"), _TL(""), true ); Parameters.Add_Value( pNode , "D_EXAGG" , _TL("Exaggeration Factor"), _TL(""), PARAMETER_TYPE_Double, 1.0 ); Parameters.Add_Shapes( NULL , "CARTES" , _TL("Cartesion Coordinates"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "RADIUS" , _TL("Radius"), _TL(""), PARAMETER_TYPE_Double, 6371000.0, 0.0, true ); Parameters.Add_Value( NULL , "DEGREE" , _TL("Degree"), _TL("polar coordinates given in degree"), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Polar_to_Cartes::On_Execute(void) { bool bDegree; int fExagg; double Radius, dExagg, Exagg = 0.0; CSG_Shapes *pPolar, *pCartes; //----------------------------------------------------- pPolar = Parameters("POLAR") ->asShapes(); pCartes = Parameters("CARTES") ->asShapes(); Radius = Parameters("RADIUS") ->asDouble(); bDegree = Parameters("DEGREE") ->asBool(); fExagg = Parameters("F_EXAGG") ->asInt(); dExagg = Parameters("D_EXAGG") ->asDouble(); //----------------------------------------------------- if( !pPolar->is_Valid() ) { Error_Set(_TL("invalid input")); return( false ); } //----------------------------------------------------- pCartes->Create(pPolar->Get_Type(), CSG_String::Format(SG_T("%s [%s]"), pPolar->Get_Name(), _TL("cartesian")), pPolar, SG_VERTEX_TYPE_XYZ); //----------------------------------------------------- for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pPolar->Get_Count()); iShape++) { CSG_Shape *pShape = pPolar->Get_Shape(iShape); CSG_Shape *pTarget = pCartes->Add_Shape(pShape, SHAPE_COPY_ATTR); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { TSG_Point_Z Point = Get_Cartes(pShape->Get_Point(iPoint, iPart), fExagg < 0 ? Radius : Radius + dExagg * pShape->asDouble(fExagg), bDegree); pTarget->Add_Point(Point.x, Point.y, iPart); pTarget->Set_Z (Point.z, iPoint , iPart); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline TSG_Point_Z CShapes_Polar_to_Cartes::Get_Cartes(TSG_Point Point, double Radius, bool bDegree) { if( bDegree ) { Point.x *= M_DEG_TO_RAD; Point.y *= M_DEG_TO_RAD; } TSG_Point_Z p; p.z = Radius * sin(Point.y); Radius = Radius * cos(Point.y); p.x = Radius * cos(Point.x); p.y = Radius * sin(Point.x); return( p ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_polar_to_cartes.h000066400000000000000000000107421224124640700264730ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_polar_to_cartes.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // shapes_polar_to_cartes.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__shapes_polar_to_cartes__H #define HEADER_INCLUDED__shapes_polar_to_cartes__H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Polar_to_Cartes : public CSG_Module { public: CShapes_Polar_to_Cartes(void); protected: virtual bool On_Execute (void); private: TSG_Point_Z Get_Cartes (TSG_Point Point, double Radius, bool bDegree); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__shapes_polar_to_cartes__H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_split.cpp000066400000000000000000000143531224124640700250030ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_split.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Shapes_Split.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "shapes_split.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Split::CShapes_Split(void) { Set_Name (_TL("Split Shapes Layer")); Set_Author (SG_T("(c) 2006 by O.Conrad")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes_List( NULL , "CUTS" , _TL("Tiles"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Shapes( NULL , "EXTENT" , _TL("Extent"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Polygon ); Parameters.Add_Value( NULL , "NX" , _TL("Number of horizontal tiles"), _TL(""), PARAMETER_TYPE_Int, 2, 1, true ); Parameters.Add_Value( NULL , "NY" , _TL("Number of vertical tiles"), _TL(""), PARAMETER_TYPE_Int, 2, 1, true ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), Cut_Methods_Str(), 0 ); } //--------------------------------------------------------- CShapes_Split::~CShapes_Split(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Split::On_Execute(void) { int x, y, nx, ny, Method; CSG_Shapes *pShapes, *pCut, *pExtent; //----------------------------------------------------- pShapes = Parameters("SHAPES") ->asShapes(); pExtent = Parameters("EXTENT") ->asShapes(); nx = Parameters("NX") ->asInt(); ny = Parameters("NY") ->asInt(); Method = Parameters("METHOD") ->asInt(); Parameters("CUTS")->asShapesList()->Del_Items(); //----------------------------------------------------- if( pShapes->is_Valid() ) { double dx, dy; TSG_Rect r; dx = pShapes->Get_Extent().Get_XRange() / nx; dy = pShapes->Get_Extent().Get_YRange() / ny; for(y=0; yGet_Extent().Get_YMin() + y * dy; r.yMax = r.yMin + dy; for(x=0; xGet_Extent().Get_XMin() + x * dx; r.xMax = r.xMin + dx; Cut_Set_Extent(r, pExtent, y == 0 && x == 0); Process_Set_Text(CSG_String::Format(SG_T("%d/%d"), y * nx + (x + 1), nx * ny)); if( (pCut = Cut_Shapes(r, Method, pShapes)) != NULL ) { pCut->Set_Name(CSG_String::Format(SG_T("%s [%d][%d]"), pShapes->Get_Name(), 1 + x, 1 + y)); Parameters("CUTS")->asShapesList()->Add_Item(pCut); } } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_split.h000066400000000000000000000102441224124640700244430ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_split.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Shapes_Split.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes_Split_H #define HEADER_INCLUDED__Shapes_Split_H //--------------------------------------------------------- #include "shapes_cut.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Split : public CSG_Module { public: CShapes_Split(void); virtual ~CShapes_Split(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Construction") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shapes_Split_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_split_by_attribute.cpp000066400000000000000000000135121224124640700275540ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_split_by_attribute.cpp 1068 2011-05-25 14:21:19Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // shapes_split_by_attribute.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "shapes_split_by_attribute.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Split_by_Attribute::CShapes_Split_by_Attribute(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Split Table/Shapes by Attribute")); Set_Author (SG_T("O. Conrad (c) 2008")); Set_Description (_TW( "" )); //----------------------------------------------------- pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Table / Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL(""), false ); Parameters.Add_Table_List( NULL , "CUTS" , _TL("Cuts"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Split_by_Attribute::On_Execute(void) { int iField; CSG_Table *pTable; //----------------------------------------------------- pTable = Parameters("TABLE") ->asTable(); iField = Parameters("FIELD") ->asInt(); Parameters("CUTS")->asTableList()->Del_Items(); //----------------------------------------------------- if( pTable->is_Valid() && pTable->Set_Index(iField, TABLE_INDEX_Ascending) ) { CSG_String sValue; CSG_Table *pCut = NULL; for(int iRecord=0; iRecordGet_Count() && Set_Progress(iRecord, pTable->Get_Count()); iRecord++) { CSG_Table_Record *pRecord = pTable->Get_Record_byIndex(iRecord); if( !pCut || sValue.Cmp(pRecord->asString(iField)) ) { pCut = pTable->Get_ObjectType() == DATAOBJECT_TYPE_Shapes ? SG_Create_Shapes(((CSG_Shapes *)pTable)->Get_Type(), SG_T(""), pTable) : SG_Create_Table(pTable); pCut->Set_Name(CSG_String::Format(SG_T("%s [%s = %s]"), pTable->Get_Name(), pTable->Get_Field_Name(iField), pRecord->asString(iField) )); Parameters("CUTS")->asTableList()->Add_Item(pCut); sValue = pRecord->asString(iField); } pCut->Add_Record(pRecord); } return( pCut != NULL ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_split_by_attribute.h000066400000000000000000000103231224124640700272160ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_split_by_attribute.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // shapes_split_by_attribute.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__shapes_split_by_attribute_H #define HEADER_INCLUDED__shapes_split_by_attribute_H //--------------------------------------------------------- #include "shapes_cut.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Split_by_Attribute : public CSG_Module { public: CShapes_Split_by_Attribute(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Construction") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__shapes_split_by_attribute_H saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_split_randomly.cpp000066400000000000000000000137121224124640700267060ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_split_randomly.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Shapes_Split_Randomly.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "shapes_split_randomly.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Split_Randomly::CShapes_Split_Randomly(void) { Set_Name (_TL("Split Shapes Layer Randomly")); Set_Author (SG_T("(c) 2008 by O.Conrad")); Set_Description (_TW( "Randomly splits one shapes layer into to new shapes layers. " "Useful to create a control group for model testing. " )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "A" , _TL("Group A"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Shapes( NULL , "B" , _TL("Group B"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "PERCENT" , _TL("Relation B / A"), _TL(""), PARAMETER_TYPE_Double, 25.0, 0.0, true, 100.0, true ); } //--------------------------------------------------------- CShapes_Split_Randomly::~CShapes_Split_Randomly(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Split_Randomly::On_Execute(void) { double Percent; CSG_Shapes *pShapes, *pA, *pB; //----------------------------------------------------- pShapes = Parameters("SHAPES") ->asShapes(); pA = Parameters("A") ->asShapes(); pB = Parameters("B") ->asShapes(); Percent = Parameters("PERCENT") ->asDouble(); //----------------------------------------------------- pA->Create(pShapes->Get_Type(), CSG_String::Format(SG_T("%s [%d%%]"), pShapes->Get_Name(), (int)(100.5 - Percent)), pShapes); pB->Create(pShapes->Get_Type(), CSG_String::Format(SG_T("%s [%d%%]"), pShapes->Get_Name(), (int)( 0.5 + Percent)), pShapes); Percent *= RAND_MAX / 100.0; //----------------------------------------------------- if( pShapes->is_Valid() ) { srand((unsigned)time(NULL)); for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { if( Percent < rand() ) { pA->Add_Shape(pShapes->Get_Shape(iShape)); } else { pB->Add_Shape(pShapes->Get_Shape(iShape)); } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/shapes/shapes_tools/shapes_split_randomly.h000066400000000000000000000103461224124640700263530ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes_split_randomly.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // shapes_tools // // // //-------------------------------------------------------// // // // Shapes_Split_Randomly.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes_Split_Randomly_H #define HEADER_INCLUDED__Shapes_Split_Randomly_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Split_Randomly : public CSG_Module { public: CShapes_Split_Randomly(void); virtual ~CShapes_Split_Randomly(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Construction") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shapes_Split_Randomly_H saga-2.1.0+dfsg/src/modules/shapes/shapes_transect/000077500000000000000000000000001224124640700222565ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/shapes/shapes_transect/MLB_Interface.cpp000066400000000000000000000115361224124640700253620ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Transect // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2009 by // // Johan Van de Wauw // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Shapes - Transects" )); case MLB_INFO_Author: return( _TL("Johan Van de Wauw (c) 2009" )); case MLB_INFO_Description: return( _TL("A SAGA module to create transects through polygon files." )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Shapes|Lines|Transects" )); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Polygon_Transect.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { // Don't forget to continuously enumerate the case switches // when adding new modules! Also bear in mind that the // enumeration always has to start with [case 0:] and // that [default:] must return NULL!... CSG_Module *pModule; switch( i ) { case 0: pModule = new CPolygon_Transect; break; default: pModule = NULL; break; } return( pModule ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/shapes/shapes_transect/MLB_Interface.h000066400000000000000000000076731224124640700250360ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes Transect // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2009 by // // Johan Van de Wauw // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__transect_H #define HEADER_INCLUDED__transect_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef transect_EXPORTS #define transect_EXPORT _SAGA_DLL_EXPORT #else #define transect_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__transect_H saga-2.1.0+dfsg/src/modules/shapes/shapes_transect/Makefile.am000066400000000000000000000011701224124640700243110ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version -avoid-version pkglib_LTLIBRARIES = libtransect.la libtransect_la_SOURCES =\ Polygon_Transect.h\ MLB_Interface.h\ Polygon_Transect.cpp\ MLB_Interface.cpp libtransect_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/shapes/shapes_transect/Makefile.in000066400000000000000000000441671224124640700243370ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/shapes/shapes_transect DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libtransect_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libtransect_la_OBJECTS = Polygon_Transect.lo MLB_Interface.lo libtransect_la_OBJECTS = $(am_libtransect_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libtransect_la_SOURCES) DIST_SOURCES = $(libtransect_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version -avoid-version pkglib_LTLIBRARIES = libtransect.la libtransect_la_SOURCES = \ Polygon_Transect.h\ MLB_Interface.h\ Polygon_Transect.cpp\ MLB_Interface.cpp libtransect_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/shapes/shapes_transect/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/shapes/shapes_transect/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libtransect.la: $(libtransect_la_OBJECTS) $(libtransect_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libtransect_la_OBJECTS) $(libtransect_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Polygon_Transect.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/shapes/shapes_transect/Polygon_Transect.cpp000066400000000000000000000306631224124640700262640ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Transect.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Transect // // // //-------------------------------------------------------// // // // Polygon_Transect.cpp // // // // Copyright (C) 2009 by // // Johan Van de Wauw // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Polygon_Transect.h" #include #include using std::map; using std::list; using std::pair; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Transect::CPolygon_Transect(void) { //----------------------------------------------------- // Give some information about your module... Set_Name (_TL("Transect through polygon shapefile")); Set_Author (_TL("Copyrights (c) 2009 Johan Van de Wauw")); Set_Description (_TW( "Transect for lines and polygon shapefiles\n" "\n" "The goal of this module is to create a transect along a line through a polygon map.\n" "Eg\n" "\n" "|____ST1_____!_ST2_!__ST1__!_______ST#_____|\n" "\n" "(Soil type 1 etc...)\n" "\n" "This is done by creating a table with the ID of each line, the distance \n" "to the starting point and the different transects:\n" "\n" "
|  line_id  |  start  |  end  |  code/field  |\n"
                    "|    0      |    0    |  124  |     ST1      |\n"
                    "|    0      |   124   |  300  |     ST2      |\n"
                    "|    0      |   300   | 1223  |     ST1      |\n"
                    "|    0      |  1223   | 2504  |     ST3      |\n"
                    "|    1      |    0    |  200  |     ST4      |\n"
                    "|   ...     |   ...   |  ...  |     ...      |
\n" "\n" "\n" "The module requires an input shape with all the line transects [Transect_Line] \n" "and a polygon theme [Theme]. You also have to select which field you want to have in \n" "the resulting table [Transect_Result]. This can be an ID of the polygon theme if you \n" "want to link the tables later on, or any other field [Theme_Field].\n") ); //----------------------------------------------------- // Define your parameters list... CSG_Parameter *pTheme; Parameters.Add_Shapes( NULL, "TRANSECT", _TL("Line Transect(s)"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Line ); pTheme = Parameters.Add_Shapes( NULL, "THEME", _TL("Theme"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Table_Field( pTheme , "THEME_FIELD" , _TL("Theme Field"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL, "TRANSECT_RESULT", _TL("Result table"), _TL(""), PARAMETER_OUTPUT ); } //--------------------------------------------------------- CPolygon_Transect::~CPolygon_Transect(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Transect::On_Execute(void) { CSG_Table *pTransect_Result; CSG_Shapes *pTheme, *pTransect; CSG_Shape_Line *pLine; CSG_Shape_Polygon *pTheme_Shape; int Theme_Field; pTransect = Parameters("TRANSECT")->asShapes(); pTheme = Parameters("THEME")->asShapes(); pTransect_Result = Parameters("TRANSECT_RESULT")->asTable(); Theme_Field = Parameters("THEME_FIELD")->asInt(); //----------------------------------------------------- // Check for valid parameter settings... //----------------------------------------------------- if (pTheme->Get_Type() != SHAPE_TYPE_Polygon){ Error_Set(CSG_String("[THEME] is not a polygon file")); return(false); } if (pTransect->Get_Type() != SHAPE_TYPE_Line){ Error_Set(CSG_String("[TRANSECT] is not a line shapefile")); return(false); } if (pTheme->Get_Count() ==0 || pTransect->Get_Count()==0) { Error_Set(CSG_String("[TRANSECT] or [THEME] is empty")); return(false); } if (!(pTheme->Get_Extent().Intersects(pTransect->Get_Extent()))) { Error_Set(CSG_String("[TRANSECT] and [THEME] do not intersect")); return(false); } const int LINE_ID = pTransect_Result->Get_Field_Count(); pTransect_Result->Add_Field(SG_T("line_id"), SG_DATATYPE_Int); const int START = pTransect_Result->Get_Field_Count(); pTransect_Result->Add_Field(SG_T("start"), SG_DATATYPE_Double); const int END = pTransect_Result->Get_Field_Count(); pTransect_Result->Add_Field(SG_T("end"), SG_DATATYPE_Double); const int POLY_ID = pTransect_Result->Get_Field_Count(); pTransect_Result->Add_Field(SG_T("poly_id"), SG_DATATYPE_Int); const int FIELD = pTransect_Result->Get_Field_Count(); pTransect_Result->Add_Field(SG_T("field"), pTheme->Get_Field_Type(Theme_Field)); // Short description of the algorithm: // For every line it is checked whether it crosses a polygon. If it does, // the points where it crosses are recorded in the map LineBorders, with // the polygon_id as key. for (int iLine=0; iLineGet_Count() && Set_Progress(iLine, pTransect->Get_Count()); iLine++) { pLine =(CSG_Shape_Line *) pTransect->Get_Shape(iLine); for (int iLinePart=0;iLinePartGet_Part_Count();iLinePart++) { CSG_Shape_Part *pLinePart =pLine->Get_Part(iLinePart); CSG_Rect LinePartExtent = pLinePart->Get_Extent(); map > LineBorders; for (int iShape=0; iShapeGet_Count();iShape++) { pTheme_Shape = (CSG_Shape_Polygon *) pTheme->Get_Shape(iShape); if (pLinePart->Get_Extent().Intersects(pTheme_Shape->Get_Extent())>0) { for (int iPart=0; iPartGet_Part_Count(); iPart++) { CSG_Shape_Polygon_Part *pPart = (CSG_Shape_Polygon_Part *) pTheme_Shape->Get_Part(iPart); if (pPart->Contains(pLinePart->Get_Point(0))) LineBorders[iShape].push_back(0); if (pPart->Contains(pLinePart->Get_Point(pLinePart->Get_Count()))) LineBorders[iShape].push_back(pLine->Get_Length(iLinePart)); for (int iPoint=0; iPointGet_Count();iPoint++) { int iPoint2 = (iPoint!=pPart->Get_Count()-1)?iPoint+1:0; TSG_Point Crossing; double Length=0; for (int iLinePartPoint=0; iLinePartPointGet_Count(); iLinePartPoint++) { if (SG_Get_Crossing(Crossing,pPart->Get_Point(iPoint),pPart->Get_Point(iPoint2), pLinePart->Get_Point(iLinePartPoint), pLinePart->Get_Point(iLinePartPoint+1))) { LineBorders[iShape].push_back(Length+SG_Get_Distance(Crossing, pLinePart->Get_Point(iLinePartPoint))); } Length+=SG_Get_Distance(pLinePart->Get_Point(iLinePartPoint), pLinePart->Get_Point(iLinePartPoint+1)); } } } } } // convert LineBorders to the result table // the table contains the lineids and the distance to the origin of the line, // and it is sorted by lineid, polygonid CSG_Table_Record *pRecord; for (map >::iterator shapeit=LineBorders.begin();shapeit!=LineBorders.end();++shapeit) { //shapeit->second.sort(); bool start=1; for (list::iterator i=shapeit->second.begin(); i!=shapeit->second.end();++i) { if (start){ pRecord =pTransect_Result->Add_Record(); pRecord->Set_Value(LINE_ID, iLine); pRecord->Set_Value(START, *i); pRecord->Set_Value(POLY_ID, shapeit->first); CSG_Table_Record *pTheme_Record =pTheme->Get_Shape(shapeit->first) ; if(pTheme->Get_Field_Type(Theme_Field)== SG_DATATYPE_String ) pRecord->Set_Value(FIELD, pTheme_Record->asString(Theme_Field)); else pRecord->Set_Value(FIELD, pTheme_Record->asDouble(Theme_Field)); start = 0; } else { pRecord->Set_Value(END, *i); start=1; } } } } } return( true ); } saga-2.1.0+dfsg/src/modules/shapes/shapes_transect/Polygon_Transect.h000066400000000000000000000102711224124640700257220ustar00rootroot00000000000000/********************************************************** * Version $Id: Polygon_Transect.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Transect // // // //-------------------------------------------------------// // // // Polygon_Transect.h // // // // Copyright (C) 2009 by // // Johan Van de Wauw // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Polygon_Transect_H #define HEADER_INCLUDED__Polygon_Transect_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CPolygon_Transect : public CSG_Module { public: ////// public members and functions: ////////////// CPolygon_Transect(void); // constructor virtual ~CPolygon_Transect(void); // destructor protected: /// protected members and functions: /////////// virtual bool On_Execute(void); // always override this function private: ///// private members and functions: ///////////// }; //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Polygon_Transect_H saga-2.1.0+dfsg/src/modules/table/000077500000000000000000000000001224124640700166745ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/table/Makefile.am000066400000000000000000000000461224124640700207300ustar00rootroot00000000000000SUBDIRS = table_tools table_calculus saga-2.1.0+dfsg/src/modules/table/Makefile.in000066400000000000000000000424501224124640700207460ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/table DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = table_tools table_calculus all: all-recursive .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) --gnu src/modules/table/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/table/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules/table/table_calculus/000077500000000000000000000000001224124640700216565ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/table/table_calculus/Fit.cpp000066400000000000000000000225061224124640700231110ustar00rootroot00000000000000/********************************************************** * Version $Id: Fit.cpp 1398 2012-05-10 11:36:50Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // Fit.cpp // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "LMFit.h" #include #include #include #include "Fit.h" #define EPS 0.001 CSG_Formula Formel; char vars[26]; double NUG(double x) { if (x > 0) return 1.0; else return 0.0; } double SPH(double x, double a) { if (x < 0) return 0.0; if (x > a) return 1.0; double val = x/a; return (1.5 - 0.5*val*val)*val; } double EXP(double x, double a) { if (x < 0) return 0.0; return 1.0 - exp(-x/a); } double LIN(double x, double a) { if (a == 0.0) return x; if (x < a) return x/a; return x; } CFit::CFit(void) { Set_Name(_TL("Function Fit")); Set_Description(_TL("CFit\n(created by SAGA Wizard).")); CSG_Parameter *pNode; pNode = Parameters.Add_Table(NULL , "SOURCE" , _TL("Source") , _TL(""), PARAMETER_INPUT); Parameters.Add_Table_Field(pNode , "YFIELD" , _TL("y - Values") , _TL("")); Parameters.Add_Choice(pNode, "USE_X", _TL("Use x -Values"), _TL(""), _TL("No|Yes|")); Parameters.Add_Table_Field(pNode , "XFIELD" , _TL("x - Values") , _TL("")); Parameters.Add_String(NULL, "FORMEL", _TL("Formula"), _TW( "The following operators are available for the formula definition:\n" "+ Addition\n" "- Subtraction\n" "* Multiplication\n" "/ Division\n" "^ power\n" "sin(x)\n" "cos(x)\n" "tan(x)\n" "asin(x)\n" "acos(x)\n" "atan(x)\n" "abs(x)\n" "sqrt(x)\n\n" "For Variogram - Fitting you can use the folowing Variogram - Models:\n" "NUG(x)\n" "SPH(x,a)\n" "EXP(x,a)\n" "LIN(x,a)\n" "The Fitting variables are single characters like a,b,m .. " "alphabetical order with the grid list order ('a'= first var, 'b' = second grid, ...)\n" "Example: m*x+a \n"), SG_T("m*x+c")); Parameters.Add_Value(NULL, "ITER", _TL("Iterationen"), _TL(""), PARAMETER_TYPE_Int, 1000, 1, true); Parameters.Add_Value(NULL, "LAMDA", _TL("Max Lamda"), _TL(""), PARAMETER_TYPE_Double, 10000, 1, true); } int CFit::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if (!SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FORMEL")) ) { CSG_String Msg; Formel.Set_Formula(pParameters->Get_Parameter("FORMEL")->asString()); if( Formel.Get_Error(Msg) ) { Error_Set (Msg); Message_Dlg(Msg); return( -1 ); } } return( 0 ); } CFit::~CFit(void) {} void FitFunc(double x, vector < double> ca, double &y, vector < double> &dyda, int na) { int i; for(i = 0; i < na; i++) { Formel.Set_Variable(vars[i], ca[i]); } y= Formel.Get_Value(x); for (i = 0; i < na; i++) { Formel.Set_Variable(vars[i], ca[i] + EPS); dyda[i] = Formel.Get_Value(x); dyda[i] -= y; dyda[i] /= EPS; Formel.Set_Variable(vars[i], ca[i] - EPS); } } // MinGW Error !!! // Fit.cpp:199: error: name lookup of `i' changed for new ISO `for' scoping // Fit.cpp:192: error: using obsolete binding at `i' bool CFit::On_Execute(void) { int i, j, NrVars; vector < double> x, y, StartValue, Result; CSG_String msg; CSG_Parameters StartParameters; const SG_Char *formel = Parameters("FORMEL")->asString(); Formel.Add_Function(SG_T("NUG"), (TSG_PFNC_Formula_1) NUG, 1, 0); Formel.Add_Function(SG_T("SPH"), (TSG_PFNC_Formula_1) SPH, 2, 0); Formel.Add_Function(SG_T("EXP"), (TSG_PFNC_Formula_1) EXP, 2, 0); Formel.Add_Function(SG_T("LIN"), (TSG_PFNC_Formula_1) LIN, 2, 0); Formel.Set_Formula(formel); if (Formel.Get_Error(msg)) { Message_Add(msg); return false; } const SG_Char *uservars = NULL; uservars = Formel.Get_Used_Variables(); NrVars = 0; for (i = 0; i < SG_STR_LEN(uservars); i++) { if (uservars[i] >='a' && uservars[i] <= 'z') { if (uservars[i] != 'x') vars[NrVars++] = uservars[i]; } } vars[NrVars] =(char) 0; StartParameters.Add_Info_String(NULL, _TL(""), _TL("Formula"), _TL("Formula"), formel); for (i = 0; i < strlen(vars); i++) { CSG_String c(vars[i]); StartParameters.Add_Value(NULL, c, c, _TL("Start Value"), PARAMETER_TYPE_Double, 1.0); } Dlg_Parameters(&StartParameters, _TL("Start Values")); for (i = 0; i < strlen(vars); i++) { char c[3]; sprintf(c, "%c", vars[i]); StartValue.push_back(StartParameters(c)->asDouble()); } CSG_Table *pTable = Parameters("SOURCE")->asTable(); int Record_Count = pTable->Get_Record_Count(); int yField = Parameters("YFIELD")->asInt(); int xField = Parameters("XFIELD")->asInt(); bool Use_X = Parameters("USE_X")->asBool(); pTable->Add_Field(_TL("Fit") , SG_DATATYPE_Double); for (i = 0; i < Record_Count; i++) { CSG_Table_Record * Record = pTable->Get_Record(i); if (Use_X) { x.push_back(Record->asDouble(xField)); } else { x.push_back(i); } y.push_back(Record->asDouble(yField)); } TLMFit *Fit; Fit = new TLMFit(x, y, StartValue, FitFunc); int max_iter = Parameters("ITER")->asInt(); double Max_lamda = Parameters("LAMDA")->asInt(); int iter = 0; try { Fit->Fit(); while ((Fit->Alamda() < Max_lamda) &&(iter < max_iter) &&Process_Get_Okay(true)) { Fit->Fit(); iter++; } } catch (ESingularMatrix &E) { if (E.Type == 1 || E.Type == 2) { msg.Printf(_TL("Matrix signular\n")); Message_Add(msg); return false; } } Result = Fit->Param(); for (i = 0; i < NrVars; i++) { Formel.Set_Variable(vars[i], (double) Result[i]); } msg.Printf(_TL("Model Parameters:")); Message_Add(msg); for (i = 0; i < NrVars; i++) { msg.Printf(SG_T("%c = %f\n"), vars[i], Result[i]); Message_Add(msg); } msg.Printf(_TL("\nRMS of Residuals (stdfit):\t%f\n"), sqrt(Fit->Chisq()/x.size())); Message_Add(msg); msg.Printf(_TL("Correlation Matrix of the Fit Parameters:\n")); Message_Add(msg); vector< vector < double> > covar = Fit->Covar(); msg.Printf(_TL("")); for (j = 0; j < NrVars; j++) msg.Printf(SG_T("%s\t%c"), msg.c_str(), vars[j]); msg.Printf(SG_T("%s\n"), msg.c_str()); Message_Add(msg); for (i = 0; i < NrVars; i++) { msg.Printf(SG_T("%c"), vars[i]); for (j = 0; j <= i; j++) { msg.Printf(SG_T("%s\t%f"), msg.c_str(), covar[i][j]/covar[i][i]); } msg.Printf(SG_T("%s\n"), msg.c_str()); Message_Add(msg); } int Field_Count = pTable->Get_Field_Count(); for (i = 0; i < Record_Count; i++) { CSG_Table_Record * Record = pTable->Get_Record(i); Record->Set_Value(Field_Count - 1, Formel.Get_Value(x[i])); } // API_FREE (uservars); return (true); } saga-2.1.0+dfsg/src/modules/table/table_calculus/Fit.h000066400000000000000000000101431224124640700225500ustar00rootroot00000000000000/********************************************************** * Version $Id: Fit.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // Fit.h // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__CFit_H #define HEADER_INCLUDED__CFit_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFit : public CSG_Module { public: CFit(void); virtual ~CFit(void); protected: virtual bool On_Execute(void); virtual int On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Initialize_Parameters(void) { return( true ); } virtual void On_Finalize_Parameters(void) { } private: }; #endif // #ifndef HEADER_INCLUDED__CFit_H saga-2.1.0+dfsg/src/modules/table/table_calculus/LMFit.cpp000066400000000000000000000207231224124640700233410ustar00rootroot00000000000000/********************************************************** * Version $Id: LMFit.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // LMFit.cpp // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "LMFit.h" TLMFit::TLMFit(vector Xdata, vector Ydata, vector Param, void(*CfuncP)(double x, vector ca, double &y, vector < double> &dyda, int na)) { int i, mfit = 0; chisq = 0; alamda = -1; ndata = Xdata.size(); nparam = Param.size(); x.resize(ndata); y.resize(ndata); for (i = 0; i < ndata; i++) { x[i] = Xdata[i]; y[i] = Ydata[i]; } a.resize(nparam); ia.resize(nparam); for (i = 0; i < nparam; i++) { a[i] = Param[i]; ia[i] = 1; if (ia[i]) mfit++; } alpha.resize(mfit); covar.resize(mfit); for (i = 0; i < mfit; i++) { covar[i].resize(mfit); alpha[i].resize(mfit); } funcP = CfuncP; } //---------------------------------------------------------------------------- void TLMFit::Fit(void) { mrqmin(); } void TLMFit::gaussj(vector< vector > &aa, int n, vector< vector < double> > &b, int m) { vector < int> indxc, indxr, ipiv; int i, icol, irow, j, k, l, ll; double big, dum, pivinv, temp, test; indxc.resize(n); indxr.resize(n); ipiv.resize(n); for (j = 0; j < n; j++) ipiv[j] = 0; for (i = 0; i < n; i++) { big = 0.0; for (j = 0; j < n; j++) if (ipiv[j] != 1) for (k = 0; k < n; k++) { if (ipiv[k] == 0) { if (fabs(aa[j][k]) >= big) { big = fabs(aa[j][k]); irow = j; icol = k; } } else if (ipiv[k] > 1) { throw ESingularMatrix(1); } } ++(ipiv[icol]); if (irow != icol) { for (l = 0; l < n; l++) SWAP(aa[irow][l], aa[icol][l]); for (l = 0; l < m; l++) SWAP(b[irow][l], b[icol][l]); } indxr[i] = irow; indxc[i] = icol; if (fabs(aa[icol][icol]) < 1E-300) { throw ESingularMatrix(2); } // else test = aa[icol][icol]; pivinv = 1.0/test; aa[icol][icol] = 1.0; for (l = 0; l < n; l++) aa[icol][l] *= pivinv; for (l = 0; l < m; l++) b[icol][l] *= pivinv; for (ll = 0; ll < n; ll++) if (ll != icol) { dum = aa[ll][icol]; aa[ll][icol] = 0.0; for (l = 0; l < n; l++) aa[ll][l] -= aa[icol][l]*dum; for (l = 0; l < m; l++) b[ll][l] -= b[icol][l]*dum; } } for (l =(n - 1); l > -1; l--) { if (indxr[l] != indxc[l]) for (k = 0; k < n; k++) SWAP(aa[k][indxr[l]], aa[k][indxc[l]]); } } //----------------------------------------------------------------------- void TLMFit::covsrt(int mfit) { int i, j, k; double temp; for (i = mfit; i < nparam; i++) for (j = 0; j < i; j++) covar[i][j] = 0.0; k = mfit; for (j = (nparam - 1); j>-1; j--) { if (ia[j]) { for (i = 0; i < nparam; i++) SWAP(covar[i][k], covar[i][j]); for (i = 0; i < nparam; i++) SWAP(covar[k][i], covar[j][i]); k--; } } } //----------------------------------------------------------------------- void TLMFit::mrqcof(vector &ba, vector< vector > &balpha, vector < double> &bbeta) { vector < double> dyda(nparam, 0); int i, j, k, l, m, mfit = 0; double ymod, wt, dy; for (j = 0; j < nparam; j++) if (ia[j] > 0) mfit++; for (j = 0; j < mfit; j++) { for (k = 0; k <=j; k++) balpha[j][k] = 0.0; bbeta[j] = 0.0; } chisq = 0.0; for (i = 0; i < ndata; i++) { (*funcP)(x[i], ba, ymod, dyda, nparam); dy = y[i] - ymod; for (j=-1, l = 0; l < nparam; l++) { if (ia[l]) { wt = dyda[l]; for (j++, k=-1, m = 0; m <= l; m++) { if (ia[m]) balpha[j][++k] += wt*dyda[m]; } bbeta[j] += dy*wt; } } chisq += dy*dy; } for (j = 1; j < mfit; j++) for (k = 0; k < j; k++) balpha[k][j] = balpha[j][k]; } //----------------------------------------------------------------------- void TLMFit::mrqmin() { static vector < double> atry, beta, da; int j, k, l; static int mfit; static double ochisq; static vector< vector < double> > oneda; if (alamda < 0.0) { atry.resize(nparam); beta.resize(nparam); da.resize(nparam); for (mfit = 0, j = 0; j < nparam; j++) if (ia[j]) mfit++; oneda.resize(mfit); for (unsigned int i = 0; i < oneda.size(); i++) oneda[i].resize(1); alamda = 0.001; mrqcof(a, alpha, beta); ochisq = (chisq); for (j = 0; j < nparam; j++) atry[j] =(a[j]); } for (j = 0; j < mfit; j++) { for (k = 0; k < mfit; k++) covar[j][k] = alpha[j][k]; covar[j][j] = alpha[j][j]*(1.0 + (alamda)); oneda[j][0] = beta[j]; } try {gaussj(covar, mfit, oneda, 1);} catch (ESingularMatrix &E) { throw; } for (j = 0; j < mfit; j++) { da[j] = oneda[j][0]; } if (alamda == 0.0) { covsrt(mfit); return; } for (j = 0, l = 0; l < nparam; l++) if (ia[l]) atry[l] = a[l] + da[j++]; mrqcof(atry, covar, da); if (chisq < ochisq) { alamda *= 0.1; ochisq = (chisq); for (j = 0; j < mfit; j++) { for (k = 0; k < mfit; k++) alpha[j][k] = covar[j][k]; beta[j] = da[j]; } for (j = 0; j < nparam; j++) // Achtung!! in aelteren Versionen war hier ein Fehler a[j] = atry[j]; } else { alamda *= 10.0; chisq = ochisq; } } //---------------------------------------------------------------------------- // Implementation ESinglularMatrix (error handling for singular matrix) //---------------------------------------------------------------------------- ESingularMatrix::ESingularMatrix(int i) { Type = i; } //---------------------------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_calculus/LMFit.h000066400000000000000000000111031224124640700227760ustar00rootroot00000000000000/********************************************************** * Version $Id: LMFit.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // LMFit.h // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef LMFitH #define LMFitH #include #include #define SWAP(a,b) {temp=(a);(a)=(b);(b)=temp;} using namespace std; class TLMFit{ public: TLMFit (vector Xdata, vector Ydata, vector Param, void (*CfuncP)(double x, vector ca, double &y, vector &dyda, int na)); ~TLMFit (){}; void Fit(); // Accessors: vector< vector > Alpha() const {return alpha;}; vector< vector > Covar() const {return covar;}; double Chisq() const {return chisq;}; vector Param() const {return a;}; int Ndata() const {return ndata;}; int Nparam() const {return nparam;}; double Alamda() const {return alamda;}; private: void gaussj(vector< vector > &a, int m, vector< vector > &b, int n); void covsrt(int mfit); void mrqcof(vector &a, vector< vector > &alpha, vector &beta); void mrqmin(void); double chisq, alamda; vector x, y, a; //x-, y-Values, Fit-Parameters a, Sigmas vector ia; //Use Fit-Parameter for fit (1) or not (0) vector< vector > covar, alpha; //Covarianz-Matrix int ndata, nparam; //Number of Points, Number of Parameters void (*funcP)(double x, vector ca, double &y, vector &dyda, int na); }; class ESingularMatrix {// Error Handling public : int Type; ESingularMatrix (int i); }; #endif saga-2.1.0+dfsg/src/modules/table/table_calculus/MLB_Interface.cpp000066400000000000000000000121431224124640700247550ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1601 2013-01-31 13:14:20Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Table - Calculus") ); case MLB_INFO_Author: return( _TL("SAGA User Group Associaton (c) 2002") ); case MLB_INFO_Description: return( _TL("") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Table|Calculus") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Fit.h" #include "Table_Calculator.h" #include "table_running_average.h" #include "table_cluster_analysis.h" #include "table_pca.h" #include "table_fill_record_gaps.h" #include "table_field_analyzer.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CFit ); case 1: return( new CTable_Calculator ); case 2: return( new CTable_Calculator_Shapes ); case 5: return( new CTable_Running_Average ); case 6: return( new CTable_Cluster_Analysis ); case 7: return( new CTable_PCA ); case 8: return( new CTable_Fill_Record_Gaps ); case 11: return( new CTable_Field_Extreme ); //----------------------------------------------------- case 19: return( NULL ); default: return( MLB_INTERFACE_SKIP_MODULE ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/table/table_calculus/MLB_Interface.h000066400000000000000000000077371224124640700244370ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: Andre Ringeler // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__table_calculus_H #define HEADER_INCLUDED__table_calculus_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef table_calculus_EXPORTS #define table_calculus_EXPORT _SAGA_DLL_EXPORT #else #define table_calculus_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__table_calculus_H saga-2.1.0+dfsg/src/modules/table/table_calculus/Makefile.am000066400000000000000000000016141224124640700237140ustar00rootroot00000000000000# # $Id: Makefile.am 1601 2013-01-31 13:14:20Z oconrad $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libtable_calculus.la libtable_calculus_la_SOURCES =\ Fit.cpp\ LMFit.cpp\ MLB_Interface.cpp\ Table_Calculator.cpp\ table_cluster_analysis.cpp\ table_field_analyzer.cpp\ table_fill_record_gaps.cpp\ table_pca.cpp\ table_running_average.cpp\ Fit.h\ LMFit.h\ MLB_Interface.h\ Table_Calculator.h\ table_cluster_analysis.h\ table_field_analyzer.h\ table_fill_record_gaps.h\ table_pca.h\ table_running_average.h libtable_calculus_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/table/table_calculus/Makefile.in000066400000000000000000000461771224124640700237420ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/table/table_calculus DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libtable_calculus_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libtable_calculus_la_OBJECTS = Fit.lo LMFit.lo MLB_Interface.lo \ Table_Calculator.lo table_cluster_analysis.lo \ table_field_analyzer.lo table_fill_record_gaps.lo table_pca.lo \ table_running_average.lo libtable_calculus_la_OBJECTS = $(am_libtable_calculus_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libtable_calculus_la_SOURCES) DIST_SOURCES = $(libtable_calculus_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1601 2013-01-31 13:14:20Z oconrad $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libtable_calculus.la libtable_calculus_la_SOURCES = \ Fit.cpp\ LMFit.cpp\ MLB_Interface.cpp\ Table_Calculator.cpp\ table_cluster_analysis.cpp\ table_field_analyzer.cpp\ table_fill_record_gaps.cpp\ table_pca.cpp\ table_running_average.cpp\ Fit.h\ LMFit.h\ MLB_Interface.h\ Table_Calculator.h\ table_cluster_analysis.h\ table_field_analyzer.h\ table_fill_record_gaps.h\ table_pca.h\ table_running_average.h libtable_calculus_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/table/table_calculus/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/table/table_calculus/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libtable_calculus.la: $(libtable_calculus_la_OBJECTS) $(libtable_calculus_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libtable_calculus_la_OBJECTS) $(libtable_calculus_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Fit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LMFit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Table_Calculator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table_cluster_analysis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table_field_analyzer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table_fill_record_gaps.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table_pca.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table_running_average.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/table/table_calculus/Table_Calculator.cpp000066400000000000000000000162721224124640700255720ustar00rootroot00000000000000/********************************************************** * Version $Id: Table_Calculator.cpp 1195 2011-10-14 11:29:50Z oconrad $ *********************************************************/ /******************************************************************************* TableCalculator.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Table_Calculator.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Calculator_Base::CTable_Calculator_Base(void) { Set_Author (SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011")); CSG_String s(_TW( "The table calculator calculates a new attribute from existing attributes based on a mathematical formula. " "Attributes are addressed by the character 'f' (for 'field') followed by the field number (i.e.: f1, f2, ..., fn) " "or by the field name in square brackets (e.g.: [Field Name]).\n" "Examples:\n" "sin(f1) * f2 + f3\n" "[Population] / [Area]\n" "\nThe following operators are available for the formula definition:\n" )); s += CSG_Formula::Get_Help_Operators(); Set_Description(s); Parameters.Add_String (NULL, "FORMULA", _TL("Formula") , _TL(""), SG_T("f1 + f2")); Parameters.Add_String (NULL, "NAME" , _TL("Field Name") , _TL(""), SG_T("Calculation")); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Calculator_Base::On_Execute(void) { //----------------------------------------------------- CSG_Table *pTable = Parameters("TABLE")->asTable(); if( !pTable->is_Valid() || pTable->Get_Field_Count() <= 0 || pTable->Get_Record_Count() <= 0 ) { Error_Set(_TL("invalid table")); return( false ); } //----------------------------------------------------- CSG_Formula Formula; int nFields = pTable->Get_Field_Count(); int *Fields = new int[nFields]; if( !Formula.Set_Formula(Get_Formula(Parameters("FORMULA")->asString(), pTable, Fields, nFields)) ) { CSG_String Message; Formula.Get_Error(Message); Error_Set(Message); delete[](Fields); return( false ); } //----------------------------------------------------- if( Parameters("RESULT")->asTable() && Parameters("RESULT")->asTable() != pTable ) { pTable = Parameters("RESULT")->asTable(); pTable->Create(*Parameters("TABLE")->asTable()); } int fResult = Parameters("FIELD")->asInt(); // pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("TABLE")->asTable()->Get_Name(), Parameters("NAME")->asString())); pTable->Set_Name(Parameters("TABLE")->asTable()->Get_Name()); if( fResult < 0 || fResult >= pTable->Get_Field_Count() ) { fResult = pTable->Get_Field_Count(); pTable->Add_Field(Parameters("NAME")->asString(), SG_DATATYPE_Double); } //----------------------------------------------------- CSG_Vector Values(nFields); for(int iRecord=0; iRecordGet_Count() && Set_Progress(iRecord, pTable->Get_Count()); iRecord++) { CSG_Table_Record *pRecord = pTable->Get_Record(iRecord); bool bOkay = true; for(int iField=0; iFieldis_NoData(iField) ) { Values[iField] = pRecord->asDouble(Fields[iField]); } else { bOkay = false; } } if( bOkay ) { pRecord->Set_Value(fResult, Formula.Get_Value(Values.Get_Data(), nFields)); } else { pRecord->Set_NoData(fResult); } } //----------------------------------------------------- delete[](Fields); if( pTable == Parameters("TABLE")->asTable() ) { DataObject_Update(pTable); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_String CTable_Calculator_Base::Get_Formula(CSG_String sFormula, CSG_Table *pTable, int *Fields, int &nFields) { const SG_Char vars[27] = SG_T("abcdefghijklmnopqrstuvwxyz"); int iField; for(iField=pTable->Get_Field_Count()-1, nFields=0; iField>=0 && nFields<26; iField--) { bool bUse = false; CSG_String sField; sField.Printf(SG_T("f%d"), iField + 1); if( sFormula.Find(sField) >= 0 ) { sFormula.Replace(sField, CSG_String(vars[nFields])); bUse = true; } sField.Printf(SG_T("[%s]"), pTable->Get_Field_Name(iField)); if( sFormula.Find(sField) >= 0 ) { sFormula.Replace(sField, CSG_String(vars[nFields])); bUse = true; } if( bUse ) { Fields[nFields++] = iField; } } return( sFormula ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Calculator::CTable_Calculator(void) : CTable_Calculator_Base() { Set_Name (_TL("Table Calculator")); Parameters.Add_Table (NULL, "TABLE" , _TL("Table") , _TL(""), PARAMETER_INPUT); Parameters.Add_Table (NULL, "RESULT" , _TL("Result") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Table_Field(Parameters("TABLE"), "FIELD", _TL("Field"), _TL(""), true); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Calculator_Shapes::CTable_Calculator_Shapes(void) : CTable_Calculator_Base() { Set_Name (_TL("Table Calculator (Shapes)")); Parameters.Add_Shapes (NULL, "TABLE" , _TL("Shapes") , _TL(""), PARAMETER_INPUT); Parameters.Add_Shapes (NULL, "RESULT" , _TL("Result") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Table_Field(Parameters("TABLE"), "FIELD", _TL("Field"), _TL(""), true); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_calculus/Table_Calculator.h000066400000000000000000000047541224124640700252410ustar00rootroot00000000000000/********************************************************** * Version $Id: Table_Calculator.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* TableCalculator.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Calculator_Base : public CSG_Module { public: CTable_Calculator_Base(void); protected: virtual bool On_Execute (void); CSG_String Get_Formula (CSG_String sFormula, CSG_Table *pTable, int *Fields, int &nFields); }; //--------------------------------------------------------- class CTable_Calculator : public CTable_Calculator_Base { public: CTable_Calculator(void); }; //--------------------------------------------------------- class CTable_Calculator_Shapes : public CTable_Calculator_Base { public: CTable_Calculator_Shapes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Table") ); } }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_calculus/table_cluster_analysis.cpp000066400000000000000000000250241224124640700271200ustar00rootroot00000000000000/********************************************************** * Version $Id: table_cluster_analysis.cpp 1592 2013-01-23 16:58:32Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // table_cluster_analysis.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "table_cluster_analysis.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Cluster_Analysis::CTable_Cluster_Analysis(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Cluster Analysis")); Set_Author (SG_T("O. Conrad (c) 2010")); Set_Description (_TW( "Cluster Analysis for grids.\n\nReferences:\n\n" "Iterative Minimum Distance:\n" "- Forgy, E. (1965):\n" " 'Cluster Analysis of multivariate data: efficiency vs. interpretability of classifications',\n" " Biometrics 21:768\n\n" "Hill-Climbing:" "- Rubin, J. (1967):\n" " 'Optimal Classification into Groups: An Approach for Solving the Taxonomy Problem',\n" " J. Theoretical Biology, 15:103-144\n\n" )); //----------------------------------------------------- pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Fields( pNode , "FIELDS" , _TL("Attributes"), _TL("") ); Parameters.Add_Table_Field( pNode , "CLUSTER" , _TL("Cluster"), _TL(""), true ); Parameters.Add_Table( NULL , "RESULT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Table( NULL , "STATISTICS" , _TL("Statistics"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Iterative Minimum Distance (Forgy 1965)"), _TL("Hill-Climbing (Rubin 1967)"), _TL("Combined Minimum Distance / Hillclimbing") ), 1 ); Parameters.Add_Value( NULL , "NCLUSTER" , _TL("Clusters"), _TL("Number of clusters"), PARAMETER_TYPE_Int, 10, 2, true ); Parameters.Add_Value( NULL , "NORMALISE" , _TL("Normalise"), _TL("Automatically normalise grids by standard deviation before clustering."), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Cluster_Analysis::On_Execute(void) { bool bNormalize; int iFeature, nFeatures, *Features, iElement, nElements, Cluster; CSG_Cluster_Analysis Analysis; CSG_Table *pTable; //----------------------------------------------------- pTable = Parameters("RESULT" )->asTable(); bNormalize = Parameters("NORMALISE")->asBool(); Cluster = Parameters("CLUSTER" )->asInt(); Features = (int *)Parameters("FIELDS")->asPointer(); nFeatures = Parameters("FIELDS")->asInt (); if( !Features || nFeatures <= 0 ) { Error_Set(_TL("no features in selection")); return( false ); } if( !Analysis.Create(nFeatures) ) { Error_Set(_TL("could not initialize cluster engine")); return( false ); } if( pTable && pTable != Parameters("TABLE")->asTable() ) { pTable->Create(*Parameters("TABLE")->asTable()); } else { pTable = Parameters("TABLE")->asTable(); } if( Cluster < 0 ) { Cluster = pTable->Get_Field_Count(); pTable->Add_Field(_TL("CLUSTER"), SG_DATATYPE_Int); } //----------------------------------------------------- for(iElement=0, nElements=0; iElementGet_Count() && Set_Progress(iElement, pTable->Get_Count()); iElement++) { CSG_Table_Record *pRecord = pTable->Get_Record(iElement); bool bNoData = false; for(iFeature=0; iFeatureis_NoData(Features[iFeature]) ) { bNoData = true; } } if( bNoData || !Analysis.Add_Element() ) { pRecord->Set_NoData(Cluster); } else { pRecord->Set_Value(Cluster, 0.0); for(iFeature=0; iFeatureasDouble(Features[iFeature]); if( bNormalize ) { d = (d - pTable->Get_Mean(Features[iFeature])) / pTable->Get_StdDev(Features[iFeature]); } Analysis.Set_Feature(nElements, iFeature, d); } nElements++; } } if( nElements <= 1 ) { return( false ); } //----------------------------------------------------- bool bResult = Analysis.Execute(Parameters("METHOD")->asInt(), Parameters("NCLUSTER")->asInt()); for(iElement=0, nElements=0; iElementGet_Count(); iElement++) { Set_Progress(iElement, pTable->Get_Count()); CSG_Table_Record *pRecord = pTable->Get_Record(iElement); if( !pRecord->is_NoData(Cluster) ) { pRecord->Set_Value(Cluster, Analysis.Get_Cluster(nElements++)); } } Save_Statistics(pTable, Features, bNormalize, Analysis); // Save_LUT(pCluster, Analysis.Get_nClusters()); DataObject_Update(pTable); return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CTable_Cluster_Analysis::Save_Statistics(CSG_Table *pTable, int *Features, bool bNormalize, const CSG_Cluster_Analysis &Analysis) { int iCluster, iFeature; CSG_String s; CSG_Table *pStatistics; pStatistics = Parameters("STATISTICS")->asTable(); pStatistics->Destroy(); pStatistics->Set_Name(_TL("Cluster Analysis")); pStatistics->Add_Field(_TL("ClusterID") , SG_DATATYPE_Int); pStatistics->Add_Field(_TL("Elements") , SG_DATATYPE_Int); pStatistics->Add_Field(_TL("Std.Dev.") , SG_DATATYPE_Double); s.Printf(SG_T("\n%s:\t%ld \n%s:\t%d \n%s:\t%d \n%s:\t%f\n\n%s\t%s\t%s"), _TL("Number of Elements") , Analysis.Get_nElements(), _TL("Number of Variables") , Analysis.Get_nFeatures(), _TL("Number of Clusters") , Analysis.Get_nClusters(), _TL("Value of Target Function") , Analysis.Get_SP(), _TL("Cluster"), _TL("Elements"), _TL("Std.Dev.") ); for(iFeature=0; iFeatureGet_Field_Name(Features[iFeature])); pStatistics->Add_Field(pTable->Get_Field_Name(Features[iFeature]), SG_DATATYPE_Double); } Message_Add(s); for(iCluster=0; iClusterAdd_Record(); pRecord->Set_Value(0, iCluster); pRecord->Set_Value(1, Analysis.Get_nMembers(iCluster)); pRecord->Set_Value(2, sqrt(Analysis.Get_Variance(iCluster))); for(iFeature=0; iFeatureGet_Mean(Features[iFeature]) + Centroid * pTable->Get_StdDev(Features[iFeature]); } s += CSG_String::Format(SG_T("\t%f"), Centroid); pRecord->Set_Value(iFeature + 3, Centroid); } Message_Add(s, false); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_calculus/table_cluster_analysis.h000066400000000000000000000102631224124640700265640ustar00rootroot00000000000000/********************************************************** * Version $Id: table_cluster_analysis.h 1592 2013-01-23 16:58:32Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // table_cluster_analysis.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__table_cluster_analysis_H #define HEADER_INCLUDED__table_cluster_analysis_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Cluster_Analysis : public CSG_Module { public: CTable_Cluster_Analysis(void); protected: virtual bool On_Execute (void); private: void Save_Statistics (CSG_Table *pTable, int *Features, bool bNormalize, const CSG_Cluster_Analysis &Analysis); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__table_cluster_analysis_H saga-2.1.0+dfsg/src/modules/table/table_calculus/table_field_analyzer.cpp000066400000000000000000000166771224124640700265420ustar00rootroot00000000000000/********************************************************** * Version $Id: table_field_analyzer.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // table_field_analyzer.cpp // // // // Copyright (C) 2013 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "table_field_analyzer.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Field_Extreme::CTable_Field_Extreme(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Find Field of Extreme Value")); Set_Author (SG_T("O.Conrad (c) 2013")); Set_Description (_TW( "Identifies from the selected attributes that one, " "which has the maximum or respectively the minimum value. " )); //----------------------------------------------------- pNode = Parameters.Add_Table( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Fields( pNode , "FIELDS" , _TL("Attributes"), _TL("") ); Parameters.Add_Table_Field( pNode , "EXTREME_ID" , _TL("Attribute"), _TL(""), true ); Parameters.Add_Table_Field( pNode , "EXTREME_VALUE" , _TL("Value"), _TL(""), true ); Parameters.Add_Table( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "TYPE" , _TL("TYPE"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("minimum"), _TL("maximum") ), 1 ); Parameters.Add_Choice( NULL , "IDENTIFY" , _TL("Attribute Identification"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("name"), _TL("index") ), 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Field_Extreme::On_Execute(void) { //----------------------------------------------------- int *Fields = (int *)Parameters("FIELDS")->asPointer(); int nFields = Parameters("FIELDS")->asInt (); if( nFields <= 1 ) { Error_Set(_TL("needs at least two attributes in selection")); return( false ); } //----------------------------------------------------- CSG_Table *pTable = Parameters("INPUT")->asTable(); if( !pTable->is_Valid() ) { Error_Set(_TL("invalid table")); return( false ); } if( Parameters("OUTPUT")->asTable() && Parameters("OUTPUT")->asTable() != pTable ) { pTable = Parameters("OUTPUT")->asTable(); pTable ->Create( *Parameters("INPUT")->asTable()); pTable ->Set_Name(Parameters("INPUT")->asTable()->Get_Name()); } //----------------------------------------------------- int fID, fValue; bool bMaximum = Parameters("TYPE" )->asInt() == 1; bool bName = Parameters("IDENTIFY")->asInt() == 0; if( (fID = Parameters("EXTREME_ID")->asInt()) < 0 ) { fID = pTable->Get_Field_Count(); pTable->Add_Field(bMaximum ? "MAX_FIELD" : "MIN_FIELD", SG_DATATYPE_String); } else if( bName == true && pTable->Get_Field_Type(fID) != SG_DATATYPE_String ) { pTable->Set_Field_Type(fID, SG_DATATYPE_String); } else if( bName == false && pTable->Get_Field_Type(fID) != SG_DATATYPE_Int ) { pTable->Set_Field_Type(fID, SG_DATATYPE_Int); } if( (fValue = Parameters("EXTREME_VALUE")->asInt()) < 0 ) { fValue = pTable->Get_Field_Count(); pTable->Add_Field(bMaximum ? "MAX_VALUE" : "MIN_VALUE", SG_DATATYPE_Double); } //----------------------------------------------------- for(int iRecord=0; iRecordGet_Count() && Set_Progress(iRecord, pTable->Get_Count()); iRecord++) { CSG_Table_Record *pRecord = pTable->Get_Record(iRecord); int xField = Fields[0]; double xValue = pRecord->asDouble(xField); for(int iField=1; iFieldasDouble(Fields[iField])) || (!bMaximum && xValue > pRecord->asDouble(Fields[iField])) ) { xField = Fields[iField]; xValue = pRecord->asDouble(xField); } } if( bName ) pRecord->Set_Value(fID, pTable->Get_Field_Name(xField)); else pRecord->Set_Value(fID, xField); pRecord->Set_Value(fValue, xValue); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_calculus/table_field_analyzer.h000066400000000000000000000100411224124640700261620ustar00rootroot00000000000000/********************************************************** * Version $Id: table_field_analyzer.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // table_field_analyzer.h // // // // Copyright (C) 2013 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__table_field_analyzer_H #define HEADER_INCLUDED__table_field_analyzer_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Field_Extreme : public CSG_Module { public: CTable_Field_Extreme(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__table_field_analyzer_H saga-2.1.0+dfsg/src/modules/table/table_calculus/table_fill_record_gaps.cpp000066400000000000000000000211411224124640700270260ustar00rootroot00000000000000/********************************************************** * Version $Id: table_fill_record_gaps.cpp 911 2011-11-11 11:11:11Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // table_calculus // // // //-------------------------------------------------------// // // // table_fill_record_gaps.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "table_fill_record_gaps.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Fill_Record_Gaps::CTable_Fill_Record_Gaps(void) { CSG_Parameter *pNode; //----------------------------------------------------- // 1. Info... Set_Name (_TL("Fill Gaps in Records")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "" )); //----------------------------------------------------- // 2. Parameters... pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "ORDER" , _TL("Order"), _TL("") ); pNode = Parameters.Add_Table( NULL , "NOGAPS" , _TL("Table without Gaps"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Interpolation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Nearest Neighbour"), _TL("Linear"), _TL("Spline") ), 1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Fill_Record_Gaps::On_Execute(void) { int Method; CSG_Table *pTable; //----------------------------------------------------- pTable = Parameters("TABLE") ->asTable(); m_pNoGaps = Parameters("NOGAPS") ->asTable(); m_fOrder = Parameters("ORDER") ->asInt(); Method = Parameters("METHOD") ->asInt(); if( pTable->Get_Count() == 0 || !pTable->Set_Index(m_fOrder, TABLE_INDEX_Ascending) ) { return( false ); } //----------------------------------------------------- CSG_Table_Record *pA, *pB; m_pNoGaps->Create(pTable); m_pNoGaps->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pTable->Get_Name(), _TL("no gaps"))); m_pNoGaps->Add_Record(pB = pTable->Get_Record(0)); //----------------------------------------------------- for(int iRecord=1; iRecordGet_Count() && Set_Progress(iRecord, pTable->Get_Count()-1); iRecord++) { pA = pB; pB = pTable->Get_Record(iRecord); int iA = pA->asInt(m_fOrder); int iB = pB->asInt(m_fOrder); if( iB - iA > 1 ) { int iStart = m_pNoGaps->Get_Count(); for(int i=iA+1; iAdd_Record()->Set_Value(m_fOrder, i); } for(int iField=0; iFieldGet_Field_Count(); iField++) { if( iField != m_fOrder && ::SG_Data_Type_is_Numeric(pTable->Get_Field_Type(iField)) ) { switch( Method ) { case 0: Set_Nearest (iStart, iField, pA, pB); break; case 1: Set_Linear (iStart, iField, pA, pB); break; case 2: Set_Spline (iStart, iField, pTable->Get_Record(iRecord - 2), pA, pB, pTable->Get_Record(iRecord + 1)); break; } } } } m_pNoGaps->Add_Record(pB); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Fill_Record_Gaps::Set_Nearest(int iOffset, int iField, CSG_Table_Record *p1, CSG_Table_Record *p2) { double z1 = p1->asDouble(iField); double z2 = p2->asDouble(iField); int n = iOffset + (m_pNoGaps->Get_Count() - iOffset) / 2; for(int iRecord=iOffset; iRecordGet_Count(); iRecord++) { m_pNoGaps->Get_Record(iRecord)->Set_Value(iField, iOffset < n ? z1 : z2); } return( true ); } //--------------------------------------------------------- bool CTable_Fill_Record_Gaps::Set_Linear(int iOffset, int iField, CSG_Table_Record *p1, CSG_Table_Record *p2) { double z1 = p1->asDouble(iField); double dz = (p2->asDouble(iField) - z1) / abs(p2->asInt(m_fOrder) - p1->asInt(m_fOrder)); for(int iRecord=iOffset, iX=1; iRecordGet_Count(); iRecord++, iX++) { m_pNoGaps->Get_Record(iRecord)->Set_Value(iField, z1 + iX * dz); } return( true ); } //--------------------------------------------------------- bool CTable_Fill_Record_Gaps::Set_Spline(int iOffset, int iField, CSG_Table_Record *p0, CSG_Table_Record *p1, CSG_Table_Record *p2, CSG_Table_Record *p3) { CSG_Spline Spline; int i0 = p0 ? p0->asInt(m_fOrder) : p1->asInt(m_fOrder) - 1; int i1 = p1->asInt(m_fOrder); int i2 = p2->asInt(m_fOrder); int i3 = p3 ? p3->asInt(m_fOrder) : p2->asInt(m_fOrder) + 1; Spline.Add(i0 - i1, p0 ? p0->asDouble(iField) : p1->asDouble(iField)); Spline.Add(0 , p1->asDouble(iField)); Spline.Add(i2 - i1, p2->asDouble(iField)); Spline.Add(i3 - i1, p3 ? p3->asDouble(iField) : p2->asDouble(iField)); if( !Spline.Create() ) { return( Set_Linear(iOffset, iField, p1, p2) ); } for(int iRecord=iOffset, i=1; iRecordGet_Count(); iRecord++, i++) { m_pNoGaps->Get_Record(iRecord)->Set_Value(iField, Spline.Get_Value(i)); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_calculus/table_fill_record_gaps.h000066400000000000000000000115231224124640700264760ustar00rootroot00000000000000/********************************************************** * Version $Id: table_fill_record_gaps.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // table_calculus // // // //-------------------------------------------------------// // // // table_fill_record_gaps.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__table_fill_record_gaps_H #define HEADER_INCLUDED__table_fill_record_gaps_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Fill_Record_Gaps : public CSG_Module { public: CTable_Fill_Record_Gaps(void); // virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); private: int m_fOrder; CSG_Table *m_pNoGaps; bool Set_Nearest (int iOffset, int iField, CSG_Table_Record *pA, CSG_Table_Record *pB); bool Set_Linear (int iOffset, int iField, CSG_Table_Record *pA, CSG_Table_Record *pB); bool Set_Spline (int iOffset, int iField, CSG_Table_Record *pAA, CSG_Table_Record *pA, CSG_Table_Record *pB, CSG_Table_Record *pBB); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__table_fill_record_gaps_H saga-2.1.0+dfsg/src/modules/table/table_calculus/table_pca.cpp000066400000000000000000000317461224124640700243070ustar00rootroot00000000000000/********************************************************** * Version $Id: table_pca.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // table_pca.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "table_pca.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_PCA::CTable_PCA(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Principle Components Analysis")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Principle Components Analysis (PCA) for tables. " "Implementation based on F. Murtagh's " "code " "as provided by the " "StatLib web site.\n" "\n" "References:\n" "Bahrenberg, G., Giese, E., Nipper, J. (1992): Statistische Methoden in der Geographie 2 - Multivariate Statistik. pp.198-277.\n" )); //----------------------------------------------------- pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Parameters( pNode , "FIELDS" , _TL("Attributes"), _TL("") ); Parameters.Add_Table( NULL , "PCA" , _TL("Principle Components"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("correlation matrix"), _TL("variance-covariance matrix"), _TL("sums-of-squares-and-cross-products matrix") ), 1 ); Parameters.Add_Value( NULL , "NFIRST" , _TL("Number of Components"), _TL("maximum number of calculated first components; set to zero to get all"), PARAMETER_TYPE_Int, 3, 0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CTable_PCA::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TABLE")) ) { CSG_Table *pTable = pParameter->asTable(); CSG_Parameters *pFields = pParameters->Get_Parameter("FIELDS")->asParameters(); pFields->Del_Parameters(); for(int i=0; iGet_Field_Count(); i++) { if( SG_Data_Type_is_Numeric(pTable->Get_Field_Type(i)) ) { pFields->Add_Value(NULL, CSG_String::Format(SG_T("%d"), i), pTable->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false); } } } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_PCA::On_Execute(void) { CSG_Vector Eigen_Values; CSG_Matrix Eigen_Vectors, Matrix; //----------------------------------------------------- m_pTable = Parameters("TABLE") ->asTable(); m_Method = Parameters("METHOD") ->asInt(); //----------------------------------------------------- if( !Get_Fields() ) { Error_Set(_TL("invalid field selection")); SG_FREE_SAFE(m_Features); return( false ); } if( !Get_Matrix(Matrix) ) { Error_Set(_TL("matrix initialisation failed")); SG_FREE_SAFE(m_Features); return( false ); } if( !SG_Matrix_Eigen_Reduction(Matrix, Eigen_Vectors, Eigen_Values) ) { Error_Set(_TL("Eigen reduction failed")); SG_FREE_SAFE(m_Features); return( false ); } //----------------------------------------------------- Get_Components(Eigen_Vectors, Eigen_Values); //----------------------------------------------------- SG_FREE_SAFE(m_Features); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_PCA::Get_Fields(void) { CSG_Parameters *pFields = Parameters("FIELDS")->asParameters(); m_Features = (int *)SG_Calloc(pFields->Get_Count(), sizeof(int)); m_nFeatures = 0; for(int iFeature=0; iFeatureGet_Count(); iFeature++) { if( pFields->Get_Parameter(iFeature)->asBool() ) { CSG_String s(pFields->Get_Parameter(iFeature)->Get_Identifier()); m_Features[m_nFeatures++] = s.asInt(); } } return( m_nFeatures > 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline bool CTable_PCA::is_NoData(int iElement) { CSG_Table_Record *pElement = m_pTable->Get_Record(iElement); for(int iFeature=0; iFeatureis_NoData(m_Features[iFeature]) ) { return( true ); } } return( false ); } //--------------------------------------------------------- inline double CTable_PCA::Get_Value(int iFeature, int iElement) { CSG_Table_Record *pElement = m_pTable->Get_Record(iElement); switch( m_Method ) { default: case 0: // Correlation matrix: Center and reduce the column vectors. return( (pElement->asDouble(iFeature) - m_pTable->Get_Mean(iFeature)) / (sqrt(m_pTable->Get_Count() * m_pTable->Get_Variance(iFeature))) ); case 1: // Variance-covariance matrix: Center the column vectors. return( (pElement->asDouble(iFeature) - m_pTable->Get_Mean(iFeature)) ); case 2: // Sums-of-squares-and-cross-products matrix return( (pElement->asDouble(iFeature)) ); } } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_PCA::Get_Matrix(CSG_Matrix &Matrix) { int i, j1, j2; Matrix.Create(m_nFeatures, m_nFeatures); Matrix.Set_Zero(); switch( m_Method ) { //----------------------------------------------------- default: case 0: // Correlation matrix: Center and reduce the column vectors. for(j1=0; j1Get_Count() && Set_Progress(i, m_pTable->Get_Count()); i++) { if( !is_NoData(i) ) { for(j1=0; j1Get_Count() && Set_Progress(i, m_pTable->Get_Count()); i++) { if( !is_NoData(i) ) { for(j1=0; j1 0.0 ? 100.0 / Sum : 0.0; Message_Add(CSG_String::Format(SG_T("\n%s, %s, %s\n"), _TL("explained variance"), _TL("explained cumulative variance"), _TL("Eigenvalue")), false); for(j=m_nFeatures-1, Cum=0.0; j>=0; j--) { Cum += Eigen_Values[j] * Sum; Message_Add(CSG_String::Format(SG_T("%6.2f\t%6.2f\t%18.5f\n"), Eigen_Values[j] * Sum, Cum, Eigen_Values[j]), false); } Message_Add(CSG_String::Format(SG_T("\n%s:\n"), _TL("Eigenvectors")), false); for(j=0; jasInt(); if( n <= 0 || n > m_nFeatures ) { n = m_nFeatures; } //----------------------------------------------------- CSG_Table *pPCA = Parameters("PCA")->asTable(); if( pPCA == NULL ) { pPCA = m_pTable; } if( pPCA != m_pTable ) { pPCA->Destroy(); pPCA->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pTable->Get_Name(), _TL("Principal Components"))); } //----------------------------------------------------- field0 = pPCA->Get_Field_Count(); for(i=0; iAdd_Field(CSG_String::Format(SG_T("%s %d"), _TL("Component"), i + 1), SG_DATATYPE_Double); } //----------------------------------------------------- for(int iElement=0; iElementGet_Count() && Set_Progress(iElement, m_pTable->Get_Count()); iElement++) { if( !is_NoData(iElement) ) { CSG_Table_Record *pElement = pPCA == m_pTable ? pPCA->Get_Record(iElement) : pPCA->Add_Record(); for(i=0, j=m_nFeatures-1; iSet_Value(field0 + i, d); } } } //----------------------------------------------------- if( pPCA == m_pTable ) { DataObject_Update(m_pTable); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_calculus/table_pca.h000066400000000000000000000106301224124640700237410ustar00rootroot00000000000000/********************************************************** * Version $Id: table_pca.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // table_pca.h // // // // Copyright (C) 2010 by // // Jan Papmeier // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__table_pca_H #define HEADER_INCLUDED__table_pca_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_PCA : public CSG_Module { public: CTable_PCA(void); protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: int m_Method, m_nFeatures, *m_Features; CSG_Table *m_pTable; bool Get_Fields (void); bool is_NoData (int iElement); double Get_Value (int iFeature, int iElement); bool Get_Matrix (CSG_Matrix &Matrix); bool Get_Components (CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__table_pca_H saga-2.1.0+dfsg/src/modules/table/table_calculus/table_running_average.cpp000066400000000000000000000143661224124640700267150ustar00rootroot00000000000000/********************************************************** * Version $Id: table_running_average.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // table_running_average.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "table_running_average.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Running_Average::CTable_Running_Average(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Running Average")); Set_Author (SG_T("O. Conrad (c) 2009")); Set_Description (_TW( "\n" )); //----------------------------------------------------- pNode = Parameters.Add_Table( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("") ); Parameters.Add_Table( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Value( NULL , "COUNT" , _TL("Number of Records"), _TL(""), PARAMETER_TYPE_Int, 10, 2, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Running_Average::On_Execute(void) { int iValue, nValues; CSG_Table *pTable; //----------------------------------------------------- pTable = Parameters("INPUT") ->asTable(); iValue = Parameters("FIELD") ->asInt(); nValues = Parameters("COUNT") ->asInt(); if( Parameters("OUTPUT")->asTable() && Parameters("OUTPUT")->asTable() != pTable ) { pTable = Parameters("OUTPUT") ->asTable(); pTable->Create(*Parameters("INPUT")->asTable()); } //----------------------------------------------------- if( pTable->is_Valid() ) { int i, iLo, iHi, nRange, iAverage; double sValues; iAverage = pTable->Get_Field_Count(); pTable->Add_Field(CSG_String::Format(SG_T("%s [%s]"), pTable->Get_Field_Name(iValue), _TL("Average")), SG_DATATYPE_Double); nRange = nValues / 2; sValues = 0.0; for(iLo=-nValues, i=-nRange, iHi=0; iGet_Count() && Set_Progress(i, pTable->Get_Count() + nRange); iLo++, i++, iHi++) { sValues += pTable->Get_Record(iHi < pTable->Get_Count() ? iHi : pTable->Get_Count() - 1)->asDouble(iValue); if( i < 0 ) { sValues += pTable->Get_Record( 0 )->asDouble(iValue); } else { if( iLo < 0 ) { sValues -= pTable->Get_Record( 0 )->asDouble(iValue); } else if( iLo >= 0 ) { sValues -= pTable->Get_Record(iLo)->asDouble(iValue); } pTable->Get_Record(i)->Set_Value(iAverage, sValues / (double)nValues); } } return( true ); } //----------------------------------------------------- return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_calculus/table_running_average.h000066400000000000000000000102421224124640700263470ustar00rootroot00000000000000/********************************************************** * Version $Id: table_running_average.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Calculus // // // //-------------------------------------------------------// // // // table_running_average.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__table_running_average_H #define HEADER_INCLUDED__table_running_average_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Running_Average : public CSG_Module { public: CTable_Running_Average(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__table_running_average_H saga-2.1.0+dfsg/src/modules/table/table_tools/000077500000000000000000000000001224124640700212035ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/table/table_tools/Join_Tables.cpp000066400000000000000000000323611224124640700241050ustar00rootroot00000000000000/********************************************************** * Version $Id: Join_Tables.cpp 1010 2011-04-26 11:52:02Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Tools // // // //-------------------------------------------------------// // // // Join_Tables.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad & Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Join_Tables.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CJoin_Tables_Base::Initialise(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Author (SG_T("V.Olaya (c) 2005, O.Conrad (c) 2011")); Set_Description (_TW( "Joins two tables using key attributes." )); //----------------------------------------------------- pNode = Parameters("TABLE_A"); Parameters.Add_Table_Field( pNode , "ID_A" , _TL("Identifier"), _TL("") ); pNode = Parameters("TABLE_B"); Parameters.Add_Table_Field( pNode , "ID_B" , _TL("Identifier"), _TL("") ); Parameters.Add_Value( pNode , "FIELDS_ALL" , _TL("Add All Fields"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Table_Fields( pNode , "FIELDS" , _TL("Fields"), _TL("") ); Parameters.Add_Value( NULL , "KEEP_ALL" , _TL("Keep All"), _TL(""), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CJoin_Tables_Base::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FIELDS_ALL")) ) { pParameters->Get_Parameter("FIELDS")->Set_Enabled(pParameter->asBool() == false); } return( 1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CJoin_Tables_Base::On_Execute(void) { //----------------------------------------------------- int id_A, id_B; CSG_Table *pT_A, *pT_B; pT_A = Parameters("TABLE_A")->asTable(); id_A = Parameters("ID_A" )->asInt(); pT_B = Parameters("TABLE_B")->asTable(); id_B = Parameters("ID_B" )->asInt(); if( id_A < 0 || id_A >= pT_A->Get_Field_Count() || pT_A->Get_Count() <= 0 || id_B < 0 || id_B >= pT_B->Get_Field_Count() || pT_B->Get_Count() <= 0 ) { return( false ); } //----------------------------------------------------- if( Parameters("RESULT")->asTable() && Parameters("RESULT")->asTable() != pT_A ) { pT_A = Parameters("RESULT")->asTable(); if( Parameters("RESULT")->asTable()->Get_ObjectType() == DATAOBJECT_TYPE_Shapes ) { ((CSG_Shapes *)pT_A)->Create(*Parameters("TABLE_A")->asShapes()); } else { pT_A->Create(*Parameters("TABLE_A")->asTable()); } } //----------------------------------------------------- int nJoins, *Join, Offset = pT_A->Get_Field_Count(); if( Parameters("FIELDS_ALL")->asBool() ) { if( (nJoins = pT_B->Get_Field_Count() - 1) <= 0 ) { Error_Set(_TL("no fields to add")); return( false ); } Join = new int[nJoins]; for(int i=0, j=0; iGet_Field_Count(); i++) { if( i != id_B ) { pT_A->Add_Field(pT_B->Get_Field_Name(i), pT_B->Get_Field_Type(i)); Join[j++] = i; } } } else { CSG_Parameter_Table_Fields *pFields = Parameters("FIELDS")->asTableFields(); if( (nJoins = pFields->Get_Count()) <= 0 ) { Error_Set(_TL("no fields to add")); return( false ); } Join = new int[nJoins]; for(int j=0; jGet_Count(); j++) { int i = pFields->Get_Index(j); pT_A->Add_Field(pT_B->Get_Field_Name(i), pT_B->Get_Field_Type(i)); Join[j] = i; } } pT_A->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pT_A->Get_Name(), pT_B->Get_Name())); //----------------------------------------------------- bool bCmpNumeric = SG_Data_Type_is_Numeric(pT_A->Get_Field_Type(id_A)) || SG_Data_Type_is_Numeric(pT_B->Get_Field_Type(id_B)); CSG_Table Delete; if( !Parameters("KEEP_ALL")->asBool() ) Delete.Add_Field("ID", SG_DATATYPE_Int); pT_A->Set_Index(id_A, TABLE_INDEX_Ascending); pT_B->Set_Index(id_B, TABLE_INDEX_Ascending); CSG_Table_Record *pRecord_B = pT_B->Get_Record_byIndex(0); for(int a=0, b=0, Cmp; pRecord_B && aGet_Count() && Set_Progress(a, pT_A->Get_Count()); a++) { CSG_Table_Record *pRecord_A = pT_A->Get_Record_byIndex(a); while( pRecord_B && (Cmp = Cmp_Keys(pRecord_A->Get_Value(id_A), pRecord_B->Get_Value(id_B), bCmpNumeric)) < 0 ) { pRecord_B = pT_B->Get_Record_byIndex(++b); } if( pRecord_B && Cmp == 0 ) { for(int i=0; iGet_Value(Offset + i) = *pRecord_B->Get_Value(Join[i]); } } else if( Delete.Get_Field_Count() == 0 ) { for(int i=0; iSet_NoData(Offset + i); } } else { Delete.Add_Record()->Set_Value(0, pRecord_A->Get_Index()); } } //----------------------------------------------------- delete[](Join); pT_A->Set_Index(id_A, TABLE_INDEX_None); pT_B->Set_Index(id_B, TABLE_INDEX_None); if( Delete.Get_Count() > 0 ) { Delete.Set_Index(0, TABLE_INDEX_Descending); for(int i=0; iDel_Shape(Delete[i].asInt(0)); pT_A->Del_Record(Delete[i].asInt(0)); } Message_Add(CSG_String::Format(SG_T("%d %s"), pT_A->Get_Selection_Count(), _TL("unjoined records have been removed"))); } if( pT_A == Parameters("TABLE_A")->asTable() ) { DataObject_Update(pT_A); } return( pT_A->Get_Count() > 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline int CJoin_Tables_Base::Cmp_Keys(CSG_Table_Value *pA, CSG_Table_Value *pB, bool bCmpNumeric) { if( pB == NULL ) { return( 1 ); } if( bCmpNumeric ) { double d = pB->asDouble() - pA->asDouble(); return( d < 0.0 ? -1 : d > 0.0 ? 1 : 0 ); } CSG_String Key(pB->asString()); return( Key.CmpNoCase(pA->asString()) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CJoin_Tables::CJoin_Tables(void) { Set_Name (_TL("Join Attributes from a Table")); Parameters.Add_Table( NULL , "TABLE_A" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL , "TABLE_B" , _TL("Join Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL , "RESULT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Initialise(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CJoin_Tables_Shapes::CJoin_Tables_Shapes(void) { Set_Name (_TL("Join Attributes from a Table (Shapes)")); Parameters.Add_Shapes( NULL , "TABLE_A" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL , "TABLE_B" , _TL("Join Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "RESULT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Initialise(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Append_Rows::CTable_Append_Rows(void) { Set_Name (_TL("Append Rows from Table")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description(_TW( "" )); Parameters.Add_Table( NULL , "INPUT" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL , "APPEND" , _TL("Append Rows from ..."), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL , "OUTPUT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Append_Rows::On_Execute(void) { CSG_Table *pTable, *pOutput, *pAppend; //----------------------------------------------------- pTable = Parameters("INPUT" )->asTable(); pOutput = Parameters("OUTPUT")->asTable(); pAppend = Parameters("APPEND")->asTable(); //----------------------------------------------------- if( pTable->Get_Record_Count() <= 0 ) { Error_Set(_TL("no records in data set")); return( false ); } if( pAppend->Get_Record_Count() <= 0 ) { Error_Set(_TL("no records to append")); return( false ); } //----------------------------------------------------- if( pOutput && pOutput != pTable ) { pOutput->Create (*pTable); pOutput->Set_Name ( pTable->Get_Name()); pTable = pOutput; } //----------------------------------------------------- int iField, jField, aField, nRecords; nRecords = pTable->Get_Count() < pAppend->Get_Count() ? pTable->Get_Count() : pAppend->Get_Count(); aField = pTable->Get_Field_Count(); for(iField=0; iFieldGet_Field_Count(); iField++) { pTable->Add_Field(pAppend->Get_Field_Name(iField), pAppend->Get_Field_Type(iField)); } //----------------------------------------------------- for(int iRecord=0; iRecordGet_Record(iRecord); CSG_Table_Record *pAdd = pAppend->Get_Record(iRecord); for(iField=0, jField=aField; iFieldGet_Field_Count(); iField++) { *pRec->Get_Value(jField++) = *pAdd->Get_Value(iField); } } //----------------------------------------------------- if( pTable == Parameters("INPUT")->asTable() ) { DataObject_Update(pTable); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_tools/Join_Tables.h000066400000000000000000000120631224124640700235470ustar00rootroot00000000000000/********************************************************** * Version $Id: Join_Tables.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Tools // // // //-------------------------------------------------------// // // // Join_Tables.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Join_Tables_H #define HEADER_INCLUDED__Join_Tables_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CJoin_Tables_Base : public CSG_Module { protected: void Initialise (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: int Cmp_Keys (CSG_Table_Value *pA, CSG_Table_Value *pB, bool bCmpNumeric); }; //--------------------------------------------------------- class CJoin_Tables : public CJoin_Tables_Base { public: CJoin_Tables(void); }; //--------------------------------------------------------- class CJoin_Tables_Shapes : public CJoin_Tables_Base { public: CJoin_Tables_Shapes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Shapes|Table") ); } }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Append_Rows : public CSG_Module { public: CTable_Append_Rows(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Join_Tables_H saga-2.1.0+dfsg/src/modules/table/table_tools/MLB_Interface.cpp000066400000000000000000000120071224124640700243010ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1401 2012-05-11 14:27:10Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Tools // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Table - Tools") ); case MLB_INFO_Author: return( _TL("SAGA User Group Associaton (c) 2002") ); case MLB_INFO_Description: return( _TL("") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Table|Tools") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Table_Create_Empty.h" #include "Table_Rotate.h" #include "Table_Enumerate.h" #include "Join_Tables.h" #include "table_change_date_format.h" #include "table_change_field_type.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CTable_Create_Empty ); case 1: return( new CTable_Rotate ); case 2: return( new CTable_Enumerate ); case 3: return( new CJoin_Tables ); case 4: return( new CJoin_Tables_Shapes ); case 5: return( new CTable_Change_Date_Format ); case 6: return( new CTable_Change_Time_Format ); case 7: return( new CTable_Change_Field_Type ); case 8: return( new CTable_Append_Rows ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/table/table_tools/MLB_Interface.h000066400000000000000000000077151224124640700237600ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Tools // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@gwdg.de // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__table_tools_H #define HEADER_INCLUDED__table_tools_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef table_tools_EXPORTS #define table_tools_EXPORT _SAGA_DLL_EXPORT #else #define table_tools_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__table_tools_H saga-2.1.0+dfsg/src/modules/table/table_tools/Makefile.am000066400000000000000000000015211224124640700232360ustar00rootroot00000000000000# # $Id: Makefile.am 1358 2012-03-28 17:17:15Z oconrad $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libtable_tools.la libtable_tools_la_SOURCES =\ Join_Tables.cpp\ MLB_Interface.cpp\ table_change_date_format.cpp\ table_change_field_type.cpp\ Table_Create_Empty.cpp\ Table_Enumerate.cpp\ Table_Rotate.cpp\ Join_Tables.h\ MLB_Interface.h\ table_change_date_format.h\ table_change_field_type.h\ Table_Create_Empty.h\ Table_Enumerate.h\ Table_Rotate.h libtable_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/table/table_tools/Makefile.in000066400000000000000000000455571224124640700232700ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/table/table_tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libtable_tools_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libtable_tools_la_OBJECTS = Join_Tables.lo MLB_Interface.lo \ table_change_date_format.lo table_change_field_type.lo \ Table_Create_Empty.lo Table_Enumerate.lo Table_Rotate.lo libtable_tools_la_OBJECTS = $(am_libtable_tools_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libtable_tools_la_SOURCES) DIST_SOURCES = $(libtable_tools_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1358 2012-03-28 17:17:15Z oconrad $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libtable_tools.la libtable_tools_la_SOURCES = \ Join_Tables.cpp\ MLB_Interface.cpp\ table_change_date_format.cpp\ table_change_field_type.cpp\ Table_Create_Empty.cpp\ Table_Enumerate.cpp\ Table_Rotate.cpp\ Join_Tables.h\ MLB_Interface.h\ table_change_date_format.h\ table_change_field_type.h\ Table_Create_Empty.h\ Table_Enumerate.h\ Table_Rotate.h libtable_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/table/table_tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/table/table_tools/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libtable_tools.la: $(libtable_tools_la_OBJECTS) $(libtable_tools_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libtable_tools_la_OBJECTS) $(libtable_tools_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Join_Tables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Table_Create_Empty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Table_Enumerate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Table_Rotate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table_change_date_format.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table_change_field_type.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/table/table_tools/Table_Create_Empty.cpp000066400000000000000000000213651224124640700254060ustar00rootroot00000000000000/********************************************************** * Version $Id: Table_Create_Empty.cpp 1098 2011-06-16 16:06:32Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Tools // // // //-------------------------------------------------------// // // // Table_Create_Empty.cpp // // // // Copyright (C) 2005 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@gwdg.de // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Table_Create_Empty.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define GET_NODE(i) CSG_String::Format(SG_T("NODE%03d"), i) #define GET_NAME(i) CSG_String::Format(SG_T("NAME%03d"), i) #define GET_TYPE(i) CSG_String::Format(SG_T("TYPE%03d"), i) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Create_Empty::CTable_Create_Empty(void) { //----------------------------------------------------- Set_Name (_TL("Create New Table")); Set_Author (SG_T("O. Conrad (c) 2005")); Set_Description (_TW( "Creates a new empty table. " "Possible field types are:\n" " - character string\n" " - 1 byte integer\n" " - 2 byte integer\n" " - 4 byte integer\n" " - 4 byte floating point\n" " - 8 byte floating point\n" " - 32 bit true color (RGB)\n" )); //----------------------------------------------------- Parameters.Add_Table_Output( NULL , "TABLE" , _TL("Table"), _TL("") ); Parameters.Add_String( NULL , "NAME" , _TL("Name"), _TL(""), _TL("New Table") ); Parameters.Add_Value( NULL , "NFIELDS" , _TL("Number of Attributes"), _TL(""), PARAMETER_TYPE_Int , 2, 1, true ); Parameters.Add_Parameters( NULL , "FIELDS" , _TL("Attributes"), _TL("") ); //----------------------------------------------------- CSG_Parameters *pAttributes = Parameters("FIELDS")->asParameters(); _Set_Field_Count(pAttributes, Parameters("NFIELDS")->asInt()); pAttributes->Get_Parameter(GET_NAME(0))->Set_Value(_TL("ID")); pAttributes->Get_Parameter(GET_TYPE(0))->Set_Value(3); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CTable_Create_Empty::_Set_Field_Count(CSG_Parameters *pAttributes, int nAttributes) { //----------------------------------------------------- CSG_String Types; Types.Printf(SG_T("%s|%s|%s|%s|%s|%s|%s|"), _TL("character string"), _TL("1 byte integer"), _TL("2 byte integer"), _TL("4 byte integer"), _TL("4 byte floating point"), _TL("8 byte floating point"), _TL("color (rgb)") ); //----------------------------------------------------- if( pAttributes && nAttributes > 0 ) { int nCurrent = pAttributes->Get_Count() / 3; if( nCurrent < nAttributes ) { for(int i=nCurrent; iAdd_Node( NULL , GET_NODE(i), CSG_String::Format(SG_T("%i. %s"), i + 1, _TL("Attribute")), _TL("") ); pAttributes->Add_String( pNode , GET_NAME(i), _TL("Name"), _TL(""), _TL("Name") ); pAttributes->Add_Choice( pNode , GET_TYPE(i), _TL("Type"), _TL(""), Types ); } } else if( nCurrent > nAttributes ) { CSG_Parameters Tmp; Tmp.Assign(pAttributes); pAttributes->Destroy(); pAttributes->Set_Name(Tmp.Get_Name()); for(int i=0; iAdd_Node( NULL , GET_NODE(i), CSG_String::Format(SG_T("%i. %s"), i + 1, _TL("Attribute")), _TL("") ); pAttributes->Add_String( pNode , GET_NAME(i), _TL("Name"), _TL(""), Tmp(GET_NAME(i)) ? Tmp(GET_NAME(i))->asString() : _TL("Name") ); pAttributes->Add_Choice( pNode , GET_TYPE(i), _TL("Type"), _TL(""), Types, Tmp(GET_TYPE(i)) ? Tmp(GET_TYPE(i))->asInt() : 0 ); } } } } //--------------------------------------------------------- int CTable_Create_Empty::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("NFIELDS")) ) { _Set_Field_Count(pParameters->Get_Parameter("FIELDS")->asParameters(), pParameter->asInt()); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Create_Empty::On_Execute(void) { CSG_Table *pTable = SG_Create_Table(); pTable->Set_Name(Parameters("NAME")->asString()); //----------------------------------------------------- int i, n; TSG_Data_Type Type; CSG_Parameters *pAttributes; pAttributes = Parameters("FIELDS")->asParameters(); n = pAttributes->Get_Count() / 3; for(i=0; iGet_Parameter(GET_TYPE(i))->asInt() ) { default: case 0: Type = SG_DATATYPE_String; break; case 1: Type = SG_DATATYPE_Char ; break; case 2: Type = SG_DATATYPE_Short ; break; case 3: Type = SG_DATATYPE_Int ; break; case 4: Type = SG_DATATYPE_Float ; break; case 5: Type = SG_DATATYPE_Double; break; case 6: Type = SG_DATATYPE_Color ; break; } pTable->Add_Field(pAttributes->Get_Parameter(GET_NAME(i))->asString(), Type); } Parameters("TABLE")->Set_Value(pTable); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_tools/Table_Create_Empty.h000066400000000000000000000113711224124640700250470ustar00rootroot00000000000000/********************************************************** * Version $Id: Table_Create_Empty.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Tools // // // //-------------------------------------------------------// // // // Table_Create_Empty.h // // // // Copyright (C) 2003 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@gwdg.de // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Table_Create_Empty_H #define HEADER_INCLUDED__Table_Create_Empty_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Create_Empty : public CSG_Module { public: CTable_Create_Empty(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Table|Construction") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: void _Set_Field_Count (CSG_Parameters *pAttributes, int nAttributes); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Table_Create_Empty_H saga-2.1.0+dfsg/src/modules/table/table_tools/Table_Enumerate.cpp000066400000000000000000000150231224124640700247440ustar00rootroot00000000000000/********************************************************** * Version $Id: Table_Enumerate.cpp 1098 2011-06-16 16:06:32Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Tools // // // //-------------------------------------------------------// // // // Table_Enumerate.cpp // // // // Copyright (C) 2005 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@gwdg.de // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Table_Enumerate.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Enumerate::CTable_Enumerate(void) { CSG_Parameter *pNode; Set_Name(_TL("Enumerate Table Field")); Set_Description(_TW( "Enumerate attribute of a table, i.e. assign to identical values of choosen attribute field unique identifiers." )); pNode = Parameters.Add_Table( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL(""), true ); Parameters.Add_Table( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); } //--------------------------------------------------------- CTable_Enumerate::~CTable_Enumerate(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Enumerate::On_Execute(void) { int iField, iField_ID; CSG_Table *pTable, *pOutput; //----------------------------------------------------- pTable = Parameters("INPUT") ->asTable(); pOutput = Parameters("OUTPUT") ->asTable(); iField = Parameters("FIELD") ->asInt(); //----------------------------------------------------- if( pTable->Get_Record_Count() <= 0 ) { Error_Set(_TL("no records in data set")); return( false ); } //----------------------------------------------------- if( pOutput != NULL && pOutput != pTable ) { pOutput->Create (*pTable); pOutput->Set_Name ( pTable->Get_Name()); pTable = pOutput; } pTable->Add_Field(_TL("ENUM_ID"), SG_DATATYPE_Int); iField_ID = pTable->Get_Field_Count() - 1; //----------------------------------------------------- if( iField >= 0 && iField < pTable->Get_Field_Count() ) { TSG_Table_Index_Order old_Order = pTable->Get_Index_Order(0); int old_Field = pTable->Get_Index_Field(0); pTable->Set_Index(iField, TABLE_INDEX_Descending); CSG_String Value = pTable->Get_Record_byIndex(0)->asString(iField); for(int iRecord=0, iID=1; iRecordGet_Count() && Set_Progress(iRecord, pTable->Get_Count()); iRecord++) { CSG_Table_Record *pRecord = pTable->Get_Record_byIndex(iRecord); if( Value.Cmp(pRecord->asString(iField)) ) { Value = pRecord->asString(iField); iID++; } pRecord->Set_Value(iField_ID, iID); } pTable->Set_Index(old_Field, old_Order); } else { for(int iRecord=0; iRecordGet_Count() && Set_Progress(iRecord, pTable->Get_Count()); iRecord++) { CSG_Table_Record *pRecord = pTable->Get_Record(iRecord); pRecord->Set_Value(iField_ID, iRecord + 1); } } //----------------------------------------------------- if( pTable == Parameters("INPUT")->asTable() ) { DataObject_Update(pTable); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_tools/Table_Enumerate.h000066400000000000000000000074351224124640700244210ustar00rootroot00000000000000/********************************************************** * Version $Id: Table_Enumerate.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Tools // // // //-------------------------------------------------------// // // // Table_Enumerate.h // // // // Copyright (C) 2003 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@gwdg.de // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Table_Enumerate_H #define HEADER_INCLUDED__Table_Enumerate_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CTable_Enumerate : public CSG_Module { public: CTable_Enumerate(void); virtual ~CTable_Enumerate(void); protected: virtual bool On_Execute(void); }; #endif // #ifndef HEADER_INCLUDED__Table_Enumerate_H saga-2.1.0+dfsg/src/modules/table/table_tools/Table_Rotate.cpp000066400000000000000000000137631224124640700242660ustar00rootroot00000000000000/********************************************************** * Version $Id: Table_Rotate.cpp 1098 2011-06-16 16:06:32Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Tools // // // //-------------------------------------------------------// // // // Table_Rotate.cpp // // // // Copyright (C) 2003 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@gwdg.de // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Table_Rotate.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Rotate::CTable_Rotate(void) { Set_Name (_TL("Transpose Table")); Set_Description (_TW( "Transposes a table, i.e. to swap rows and columns." )); Parameters.Add_Table( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT ); } //--------------------------------------------------------- CTable_Rotate::~CTable_Rotate(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Rotate::On_Execute(void) { bool bCopy; int x, y; TSG_Data_Type FieldType; CSG_Table *pInput, *pOutput; CSG_Table_Record *pRec_In, *pRec_Out; //----------------------------------------------------- pInput = Parameters("INPUT") ->asTable(); pOutput = Parameters("OUTPUT") ->asTable(); //----------------------------------------------------- if( pInput->Get_Field_Count() > 0 && pInput->Get_Record_Count() > 0 ) { if( pInput != pOutput ) { bCopy = true; } else { bCopy = false; pOutput = SG_Create_Table(); } pOutput->Destroy(); pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), _TL("rotated"))); FieldType = SG_DATATYPE_String; //------------------------------------------------- pOutput->Add_Field(pInput->Get_Field_Name(0), SG_DATATYPE_String); for(y=0; yGet_Record_Count(); y++) { pOutput->Add_Field(pInput->Get_Record(y)->asString(0), FieldType); } for(y=1; yGet_Field_Count(); y++) { pRec_Out = pOutput->Add_Record(); pRec_Out->Set_Value(0, pInput->Get_Field_Name(y)); for(x=0; xGet_Record_Count(); x++) { pRec_In = pInput->Get_Record(x); if( FieldType == SG_DATATYPE_String ) { pRec_Out->Set_Value(x + 1, pRec_In->asString(y)); } else { pRec_Out->Set_Value(x + 1, pRec_In->asDouble(y)); } } } //------------------------------------------------- if( !bCopy ) { pInput->Assign(pOutput); delete(pOutput); } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_tools/Table_Rotate.h000066400000000000000000000074101224124640700237230ustar00rootroot00000000000000/********************************************************** * Version $Id: Table_Rotate.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Table_Tools // // // //-------------------------------------------------------// // // // Table_Rotate.h // // // // Copyright (C) 2003 by // // SAGA User Group Associaton // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@gwdg.de // // // // contact: SAGA User Group Associaton // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Table_Rotate_H #define HEADER_INCLUDED__Table_Rotate_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CTable_Rotate : public CSG_Module { public: CTable_Rotate(void); virtual ~CTable_Rotate(void); protected: virtual bool On_Execute(void); }; #endif // #ifndef HEADER_INCLUDED__Table_Rotate_H saga-2.1.0+dfsg/src/modules/table/table_tools/table_change_date_format.cpp000066400000000000000000000340641224124640700266570ustar00rootroot00000000000000/********************************************************** * Version $Id: table_change_date_format.cpp 911 2011-11-11 11:11:11Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // table_tools // // // //-------------------------------------------------------// // // // table_change_date_format.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "table_change_date_format.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Change_Date_Format::CTable_Change_Date_Format(void) { CSG_Parameter *pNode; //----------------------------------------------------- // 1. Info... Set_Name (_TL("Change Date Format")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "" )); //----------------------------------------------------- // 2. Parameters... pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Date Field"), _TL("") ); Parameters.Add_Table( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "FMT_IN" , _TL("Input Format"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|"), _TL("dd.mm.yy"), _TL("yy.mm.dd"), _TL("dd:mm:yy"), _TL("yy:mm:dd"), _TL("ddmmyyyy, fix size"), _TL("yyyymmdd, fix size"), _TL("ddmmyy, fix size"), _TL("yymmdd, fix size"), _TL("Julian Day") ), 0 ); Parameters.Add_Choice( NULL , "FMT_OUT" , _TL("Output Format"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|"), _TL("dd.mm.yy"), _TL("yy.mm.dd"), _TL("dd:mm:yy"), _TL("yy:mm:dd"), _TL("ddmmyyyy, fix size"), _TL("yyyymmdd, fix size"), _TL("ddmmyy, fix size"), _TL("yymmdd, fix size"), _TL("Julian Day") ), 7 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Change_Date_Format::On_Execute(void) { //----------------------------------------------------- int fmt_In = Parameters("FMT_IN" )->asInt(); int fmt_Out = Parameters("FMT_OUT")->asInt(); if( fmt_In == fmt_Out ) { Error_Set(_TL("nothing to do: input format is same as output format")); return( false ); } //----------------------------------------------------- CSG_Table *pTable = Parameters("OUTPUT")->asTable(); if( pTable && pTable != Parameters("TABLE")->asTable() ) { pTable->Assign (Parameters("TABLE")->asTable()); pTable->Set_Name(Parameters("TABLE")->asTable()->Get_Name()); } else { pTable = Parameters("TABLE")->asTable(); } //----------------------------------------------------- int fDate = Parameters("FIELD" )->asInt(); switch( fmt_Out ) { case 0: case 1: case 2: case 3: pTable->Set_Field_Type(fDate, SG_DATATYPE_String); break; default: pTable->Set_Field_Type(fDate, SG_DATATYPE_Int); break; } //----------------------------------------------------- SG_Char sep_In = fmt_In == 0 || fmt_In == 1 ? SG_T('.') : SG_T(':'); //----------------------------------------------------- for(int iRecord=0; iRecordGet_Count() && Set_Progress(iRecord, pTable->Get_Count()); iRecord++) { CSG_Table_Record *pRecord = pTable->Get_Record(iRecord); CSG_String sDate = pRecord->asString(fDate); int y, m, d; switch( fmt_In ) { case 0: // dd.mm.yy case 2: // dd:mm:yy d = sDate.BeforeFirst(sep_In).asInt(); m = sDate.AfterFirst (sep_In).asInt(); y = sDate.AfterLast (sep_In).asInt(); break; case 1: // yy.mm.dd case 3: // yy:mm:dd y = sDate.BeforeFirst(sep_In).asInt(); m = sDate.AfterFirst (sep_In).asInt(); d = sDate.AfterLast (sep_In).asInt(); break; case 4: // ddmmyyyy d = sDate.Left (2) .asInt(); m = sDate.Mid (2, 2).asInt(); y = sDate.Right(4) .asInt(); break; case 5: // yyyymmdd y = sDate.Left (4) .asInt(); m = sDate.Mid (4, 2).asInt(); d = sDate.Right(2) .asInt(); break; case 6: // ddmmyy d = sDate.Left (2) .asInt(); m = sDate.Mid (2, 2).asInt(); y = sDate.Right(2) .asInt(); break; case 7: // yymmdd y = sDate.Left (2) .asInt(); m = sDate.Mid (2, 2).asInt(); d = sDate.Right(2) .asInt(); break; case 8: // Julian Day { d = sDate.asInt(); if( d >= 2299161 ) // Gregorian, else Julian { y = (int)((d - 1867216.25) / 36524.25); d = d + 1 + y - (int)(y / 4.0); } int B = d + 1524; y = (int)((B - 122.1) / 365.25); d = (int)(365.25 * y); m = (int)((B - d) / 30.6001); d = B - d - (int)(30.6001 * m); // day, without day fraction df m = m < 14 ? m - 1 : m - 13; // month y = m > 2 ? y - 4716 : y - 4715; // year } break; } switch( fmt_Out ) { case 0: sDate.Printf(SG_T("%02d.%02d.%02d"), d, m, y); break; // dd:mm:yy case 1: sDate.Printf(SG_T("%02d.%02d.%02d"), y, m, d); break; // yy:mm:dd case 2: sDate.Printf(SG_T("%02d:%02d:%02d"), d, m, y); break; // dd:mm:yy case 3: sDate.Printf(SG_T("%02d:%02d:%02d"), y, m, d); break; // yy:mm:dd case 4: sDate.Printf(SG_T("%02d%02d%04d") , d, m, y); break; // ddmmyyyy case 5: sDate.Printf(SG_T("%04d%02d%02d") , y, m, d); break; // yyyymmdd case 6: sDate.Printf(SG_T("%02d%02d%02d") , d, m, y - 100 * (int)(y / 100.0)); break; // ddmmyy case 7: sDate.Printf(SG_T("%02d%02d%02d") , y - 100 * (int)(y / 100.0), m, d); break; // yymmdd case 8: // Julian Day { double Y = y + (m - 2.85) / 12.0; d = (int)((int)((int)(367.0 * Y) - 1.75 * (int)(Y) + d) - 0.75 * (int)(Y / 100.0)) + 1721115; sDate.Printf(SG_T("%d"), d); } break; } pRecord->Set_Value(fDate, sDate); } //----------------------------------------------------- if( pTable == Parameters("TABLE")->asTable() ) { DataObject_Update(pTable); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Change_Time_Format::CTable_Change_Time_Format(void) { CSG_Parameter *pNode; //----------------------------------------------------- // 1. Info... Set_Name (_TL("Change Time Format")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "" )); //----------------------------------------------------- // 2. Parameters... pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Time Field"), _TL("") ); Parameters.Add_Table( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "FMT_IN" , _TL("Input Format"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"), _TL("hh.mm.ss"), _TL("hh:mm:ss"), _TL("hhmmss, fix size"), _TL("hours"), _TL("minutes"), _TL("seconds") ), 1 ); Parameters.Add_Choice( NULL , "FMT_OUT" , _TL("Output Format"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"), _TL("hh.mm.ss"), _TL("hh:mm:ss"), _TL("hhmmss, fix size"), _TL("hours"), _TL("minutes"), _TL("seconds") ), 5 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Change_Time_Format::On_Execute(void) { //----------------------------------------------------- int fmt_In = Parameters("FMT_IN" )->asInt(); int fmt_Out = Parameters("FMT_OUT")->asInt(); if( fmt_In == fmt_Out ) { Error_Set(_TL("nothing to do: input format is same as output format")); return( false ); } //----------------------------------------------------- CSG_Table *pTable = Parameters("OUTPUT")->asTable(); if( pTable && pTable != Parameters("TABLE")->asTable() ) { pTable->Assign (Parameters("TABLE")->asTable()); pTable->Set_Name(Parameters("TABLE")->asTable()->Get_Name()); } else { pTable = Parameters("TABLE")->asTable(); } //----------------------------------------------------- int fTime = Parameters("FIELD" )->asInt(); pTable->Set_Field_Type(fTime, SG_DATATYPE_String); //----------------------------------------------------- SG_Char sep_In = fmt_In == 0 ? SG_T('.') : SG_T(':'); //----------------------------------------------------- for(int iRecord=0; iRecordGet_Count() && Set_Progress(iRecord, pTable->Get_Count()); iRecord++) { CSG_Table_Record *pRecord = pTable->Get_Record(iRecord); CSG_String sTime = pRecord->asString(fTime); double s; switch( fmt_In ) { case 0: // hh.mm.ss case 1: // hh:mm:ss s = sTime.BeforeFirst(sep_In).asInt() * 3600; s += sTime.AfterFirst (sep_In).asInt() * 60; s += sTime.AfterLast (sep_In).asDouble(); break; case 2: // hhmmss s = sTime.Left (2) .asInt() * 3600; s += sTime.Mid (2, 2).asInt() * 60; s += sTime.Right(2) .asDouble(); break; case 3: // hours s = sTime.asDouble() * 3600; break; case 4: // minutes s = sTime.asDouble() * 60; break; case 5: // seconds s = sTime.asDouble(); break; } switch( fmt_Out ) { case 0: case 1: case 2: { int h = (int)(s / 3600); s = s - h * 3600; int m = (int)(s / 60); s = s - m * 60; switch( fmt_Out ) { // case 0: sTime.Printf(SG_T("%02d.%02d.%02.*f"), h, m, SG_Get_Significant_Decimals(s), s); break; // hh:mm:ss.s // case 1: sTime.Printf(SG_T("%02d:%02d:%02.*f"), h, m, SG_Get_Significant_Decimals(s), s); break; // hh:mm:ss.s case 0: sTime.Printf(SG_T("%02d.%02d.%02d" ), h, m, (int)(s + 0.5)); break; // hh:mm:ss case 1: sTime.Printf(SG_T("%02d:%02d:%02d" ), h, m, (int)(s + 0.5)); break; // hh:mm:ss case 2: sTime.Printf(SG_T("%02d%02d%02d" ), h, m, (int)(s + 0.5)); break; // hhmmss } } break; case 3: case 4: case 5: { switch( fmt_Out ) { case 3: s = s / 3600; break; // hours case 4: s = s / 60; break; // minutes // case 5: s = s ; break; // seconds } sTime.Printf(SG_T("%.*f"), SG_Get_Significant_Decimals(s), s); } break; } pRecord->Set_Value(fTime, sTime); } //----------------------------------------------------- if( pTable == Parameters("TABLE")->asTable() ) { DataObject_Update(pTable); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_tools/table_change_date_format.h000066400000000000000000000116171224124640700263230ustar00rootroot00000000000000/********************************************************** * Version $Id: table_change_date_format.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // table_tools // // // //-------------------------------------------------------// // // // table_change_date_format.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__table_change_date_format_H #define HEADER_INCLUDED__table_change_date_format_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Change_Date_Format : public CSG_Module { public: CTable_Change_Date_Format(void); // virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Change_Time_Format : public CSG_Module { public: CTable_Change_Time_Format(void); // virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__table_change_date_format_H saga-2.1.0+dfsg/src/modules/table/table_tools/table_change_field_type.cpp000066400000000000000000000210351224124640700265100ustar00rootroot00000000000000/********************************************************** * Version $Id: table_change_field_type.cpp 911 2011-11-11 11:11:11Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // table_tools // // // //-------------------------------------------------------// // // // table_change_field_type.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "table_change_field_type.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Change_Field_Type::CTable_Change_Field_Type(void) { CSG_Parameter *pNode; //----------------------------------------------------- // 1. Info... Set_Name (_TL("Change Field Type")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "" )); //----------------------------------------------------- // 2. Parameters... pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Field"), _TL("") ); Parameters.Add_Table( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Data Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"), SG_Data_Type_Get_Name(SG_DATATYPE_String).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Date ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Color ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Byte ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Char ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Word ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Short ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_DWord ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Int ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_ULong ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Long ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Float ).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Double).c_str(), SG_Data_Type_Get_Name(SG_DATATYPE_Binary).c_str() ), 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CTable_Change_Field_Type::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TABLE")) || !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FIELD")) ) { CSG_Table *pTable = pParameters->Get_Parameter("TABLE")->asTable(); if( pTable ) { int Type; switch( pTable->Get_Field_Type(pParameters->Get_Parameter("FIELD")->asInt()) ) { default: case SG_DATATYPE_String: Type = 0; break; case SG_DATATYPE_Date: Type = 1; break; case SG_DATATYPE_Color: Type = 2; break; case SG_DATATYPE_Byte: Type = 3; break; case SG_DATATYPE_Char: Type = 4; break; case SG_DATATYPE_Word: Type = 5; break; case SG_DATATYPE_Short: Type = 6; break; case SG_DATATYPE_DWord: Type = 7; break; case SG_DATATYPE_Int: Type = 8; break; case SG_DATATYPE_ULong: Type = 9; break; case SG_DATATYPE_Long: Type = 10; break; case SG_DATATYPE_Float: Type = 11; break; case SG_DATATYPE_Double: Type = 12; break; case SG_DATATYPE_Binary: Type = 13; break; } pParameters->Get_Parameter("TYPE")->Set_Value(Type); } } return( 1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Change_Field_Type::On_Execute(void) { //----------------------------------------------------- TSG_Data_Type Type; switch( Parameters("TYPE")->asInt() ) { default: case 0: Type = SG_DATATYPE_String; break; case 1: Type = SG_DATATYPE_Date; break; case 2: Type = SG_DATATYPE_Color; break; case 3: Type = SG_DATATYPE_Byte; break; case 4: Type = SG_DATATYPE_Char; break; case 5: Type = SG_DATATYPE_Word; break; case 6: Type = SG_DATATYPE_Short; break; case 7: Type = SG_DATATYPE_DWord; break; case 8: Type = SG_DATATYPE_Int; break; case 9: Type = SG_DATATYPE_ULong; break; case 10: Type = SG_DATATYPE_Long; break; case 11: Type = SG_DATATYPE_Float; break; case 12: Type = SG_DATATYPE_Double; break; case 13: Type = SG_DATATYPE_Binary; break; } //----------------------------------------------------- CSG_Table *pTable = Parameters("OUTPUT")->asTable(); if( pTable && pTable != Parameters("TABLE")->asTable() ) { pTable->Assign (Parameters("TABLE")->asTable()); pTable->Set_Name(Parameters("TABLE")->asTable()->Get_Name()); } else { pTable = Parameters("TABLE")->asTable(); } //----------------------------------------------------- int Field = Parameters("FIELD" )->asInt(); if( Type == pTable->Get_Field_Type(Field) ) { Error_Set(_TL("nothing to do: original and desired field types are identical")); return( false ); } //----------------------------------------------------- pTable->Set_Field_Type(Field, Type); //----------------------------------------------------- if( pTable == Parameters("TABLE")->asTable() ) { DataObject_Update(pTable); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/table/table_tools/table_change_field_type.h000066400000000000000000000107551224124640700261640ustar00rootroot00000000000000/********************************************************** * Version $Id: table_change_field_type.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // table_tools // // // //-------------------------------------------------------// // // // table_change_field_type.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__table_change_field_type_H #define HEADER_INCLUDED__table_change_field_type_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Change_Field_Type : public CSG_Module { public: CTable_Change_Field_Type(void); protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__table_change_field_type_H saga-2.1.0+dfsg/src/modules/tin/000077500000000000000000000000001224124640700163775ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/tin/Makefile.am000066400000000000000000000001171224124640700204320ustar00rootroot00000000000000if WITH_GUI SUBDIRS = tin_tools tin_viewer else SUBDIRS = tin_tools endif saga-2.1.0+dfsg/src/modules/tin/Makefile.in000066400000000000000000000425311224124640700204510ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/tin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = tin_tools tin_viewer DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @WITH_GUI_FALSE@SUBDIRS = tin_tools @WITH_GUI_TRUE@SUBDIRS = tin_tools tin_viewer all: all-recursive .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) --gnu src/modules/tin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/tin/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules/tin/tin_tools/000077500000000000000000000000001224124640700204115ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/tin/tin_tools/MLB_Interface.cpp000066400000000000000000000116251224124640700235140ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("TIN - Tools") ); case MLB_INFO_Author: return( SG_T("O. Conrad (c) 2004") ); case MLB_INFO_Description: return( _TL("Tools for Triangulated Irregular Network (TIN) processing.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("TIN") ); } } //--------------------------------------------------------- #include "TIN_From_Grid.h" #include "TIN_From_Grid_Specific_Points.h" #include "TIN_From_Shapes.h" #include "TIN_To_Shapes.h" #include "TIN_Gradient.h" #include "TIN_Flow_Trace.h" #include "TIN_Flow_Parallel.h" //--------------------------------------------------------- CSG_Module * Create_Module(int i) { CSG_Module *pModule; switch( i ) { case 0: pModule = new CTIN_From_Grid; break; case 1: pModule = new CTIN_From_Grid_Specific_Points; break; case 2: pModule = new CTIN_From_Shapes; break; case 3: pModule = new CTIN_To_Shapes; break; case 4: pModule = new CTIN_Gradient; break; case 5: pModule = new CTIN_Flow_Trace; break; case 6: pModule = new CTIN_Flow_Parallel; break; default: pModule = NULL; break; } return( pModule ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/tin/tin_tools/MLB_Interface.h000066400000000000000000000077011224124640700231610ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Terrain_Analysis // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__tin_tools_H #define HEADER_INCLUDED__tin_tools_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef tin_tools_EXPORTS #define tin_tools_EXPORT _SAGA_DLL_EXPORT #else #define tin_tools_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__tin_tools_H saga-2.1.0+dfsg/src/modules/tin/tin_tools/Makefile.am000066400000000000000000000015531224124640700224510ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libtin_tools.la libtin_tools_la_SOURCES =\ MLB_Interface.cpp\ TIN_Flow_Parallel.cpp\ TIN_Flow_Trace.cpp\ TIN_From_Grid.cpp\ TIN_From_Grid_Specific_Points.cpp\ TIN_From_Shapes.cpp\ TIN_Gradient.cpp\ TIN_To_Shapes.cpp\ MLB_Interface.h\ TIN_Flow_Parallel.h\ TIN_Flow_Trace.h\ TIN_From_Grid.h\ TIN_From_Grid_Specific_Points.h\ TIN_From_Shapes.h\ TIN_Gradient.h\ TIN_To_Shapes.h libtin_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules/tin/tin_tools/Makefile.in000066400000000000000000000457031224124640700224670ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/tin/tin_tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libtin_tools_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libtin_tools_la_OBJECTS = MLB_Interface.lo TIN_Flow_Parallel.lo \ TIN_Flow_Trace.lo TIN_From_Grid.lo \ TIN_From_Grid_Specific_Points.lo TIN_From_Shapes.lo \ TIN_Gradient.lo TIN_To_Shapes.lo libtin_tools_la_OBJECTS = $(am_libtin_tools_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libtin_tools_la_SOURCES) DIST_SOURCES = $(libtin_tools_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libtin_tools.la libtin_tools_la_SOURCES = \ MLB_Interface.cpp\ TIN_Flow_Parallel.cpp\ TIN_Flow_Trace.cpp\ TIN_From_Grid.cpp\ TIN_From_Grid_Specific_Points.cpp\ TIN_From_Shapes.cpp\ TIN_Gradient.cpp\ TIN_To_Shapes.cpp\ MLB_Interface.h\ TIN_Flow_Parallel.h\ TIN_Flow_Trace.h\ TIN_From_Grid.h\ TIN_From_Grid_Specific_Points.h\ TIN_From_Shapes.h\ TIN_Gradient.h\ TIN_To_Shapes.h libtin_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/tin/tin_tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/tin/tin_tools/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libtin_tools.la: $(libtin_tools_la_OBJECTS) $(libtin_tools_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libtin_tools_la_OBJECTS) $(libtin_tools_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TIN_Flow_Parallel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TIN_Flow_Trace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TIN_From_Grid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TIN_From_Grid_Specific_Points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TIN_From_Shapes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TIN_Gradient.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TIN_To_Shapes.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_Flow_Parallel.cpp000066400000000000000000000176541224124640700243670ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_Flow_Parallel.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_Flow_Parallel.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "TIN_Flow_Parallel.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTIN_Flow_Parallel::CTIN_Flow_Parallel(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Flow Accumulation (Parallel)")); Set_Author (SG_T("(c) 2004 by O.Conrad")); Set_Description (_TW( "Calculates the catchment area based on the selected elevation values.\n\n" )); //----------------------------------------------------- pNode = Parameters.Add_TIN( NULL , "DEM" , _TL("TIN"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "ZFIELD" , _TL("Z Values"), _TL("") ); Parameters.Add_TIN( NULL , "FLOW" , _TL("Flow Accumulation"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Single Flow Direction"), _TL("Multiple Flow Direction") ) ); } //--------------------------------------------------------- CTIN_Flow_Parallel::~CTIN_Flow_Parallel(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_Flow_Parallel::On_Execute(void) { int iPoint; CSG_TIN *pDEM; //----------------------------------------------------- pDEM = Parameters("DEM") ->asTIN(); m_iHeight = Parameters("ZFIELD") ->asInt(); m_pFlow = Parameters("FLOW") ->asTIN(); m_pFlow->Create(*pDEM); m_iArea = m_pFlow->Get_Field_Count(); m_pFlow->Add_Field(_TL("AREA") , SG_DATATYPE_Double); m_iFlow = m_pFlow->Get_Field_Count(); m_pFlow->Add_Field(_TL("FLOW") , SG_DATATYPE_Double); m_iSpecific = m_pFlow->Get_Field_Count(); m_pFlow->Add_Field(_TL("SPECIFIC") , SG_DATATYPE_Double); //----------------------------------------------------- m_pFlow->Set_Index(m_iHeight, TABLE_INDEX_Descending); for(iPoint=0; iPointGet_Node_Count() && Set_Progress(iPoint, m_pFlow->Get_Node_Count()); iPoint++) { switch( Parameters("METHOD")->asInt() ) { case 0: default: Let_it_flow_single (m_pFlow->Get_Node(m_pFlow->Get_Record_byIndex(iPoint)->Get_Index())); break; case 1: Let_it_flow_multiple (m_pFlow->Get_Node(m_pFlow->Get_Record_byIndex(iPoint)->Get_Index())); break; } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CTIN_Flow_Parallel::Let_it_flow_single(CSG_TIN_Node *pPoint) { int i, iMin; double dz, dzMin, Area; Area = pPoint->Get_Polygon_Area(); pPoint->Set_Value(m_iArea, Area); pPoint->Add_Value(m_iFlow, Area); for(i=0, iMin=-1, dzMin=0.0; iGet_Neighbor_Count(); i++) { if( (dz = pPoint->Get_Gradient(i, m_iHeight)) > dzMin ) { dzMin = dz; iMin = i; } } if( iMin >= 0 ) { pPoint->Get_Neighbor(iMin)->Add_Value(m_iFlow, pPoint->asDouble(m_iFlow)); } pPoint->Set_Value(m_iSpecific, Area > 0.0 ? 1.0 / Area : -1.0); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CTIN_Flow_Parallel::Let_it_flow_multiple(CSG_TIN_Node *pPoint) { int i; double d, dzSum, *dz, Area; Area = pPoint->Get_Polygon_Area(); pPoint->Set_Value(m_iArea, Area); pPoint->Add_Value(m_iFlow, Area); if( pPoint->Get_Neighbor_Count() > 0 ) { dz = (double *)SG_Malloc(pPoint->Get_Neighbor_Count() * sizeof(double)); for(i=0, dzSum=0.0; iGet_Neighbor_Count(); i++) { if( (d = pPoint->Get_Gradient(i, m_iHeight)) > 0.0 ) { dzSum += (dz[i] = d); } else { dz[i] = 0.0; } } if( dzSum > 0.0 ) { d = pPoint->asDouble(m_iFlow); for(i=0; iGet_Neighbor_Count(); i++) { if( dz[i] > 0.0 ) { pPoint->Get_Neighbor(i)->Add_Value( m_iFlow, d * dz[i] / dzSum); } } } SG_Free(dz); } pPoint->Set_Value(m_iSpecific, Area > 0.0 ? 1.0 / Area : -1.0); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_Flow_Parallel.h000066400000000000000000000103321224124640700240160ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_Flow_Parallel.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_Flow_Parallel.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__TIN_Flow_Parallel_H #define HEADER_INCLUDED__TIN_Flow_Parallel_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTIN_Flow_Parallel : public CSG_Module { public: CTIN_Flow_Parallel(void); virtual ~CTIN_Flow_Parallel(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Terrain Analysis") ); } protected: virtual bool On_Execute (void); private: int m_iHeight, m_iArea, m_iFlow, m_iSpecific; CSG_TIN *m_pFlow; void Let_it_flow_single (CSG_TIN_Node *pPoint); void Let_it_flow_multiple (CSG_TIN_Node *pPoint); }; #endif // #ifndef HEADER_INCLUDED__TIN_Flow_Parallel_H saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_Flow_Trace.cpp000066400000000000000000000165621224124640700236660ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_Flow_Trace.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_Flow_Trace.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "TIN_Flow_Trace.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTIN_Flow_Trace::CTIN_Flow_Trace(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Flow Accumulation (Trace)")); Set_Author (SG_T("(c) 2004 by O.Conrad")); Set_Description (_TW( "Calculates the catchment area based on the selected elevation values.\n\n" )); //----------------------------------------------------- pNode = Parameters.Add_TIN( NULL , "DEM" , _TL("TIN"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "ZFIELD" , _TL("Z Values"), _TL("") ); pNode = Parameters.Add_TIN( NULL , "FLOW" , _TL("Flow Accumulation"), _TL(""), PARAMETER_OUTPUT ); } //--------------------------------------------------------- CTIN_Flow_Trace::~CTIN_Flow_Trace(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_Flow_Trace::On_Execute(void) { int iPoint; CSG_TIN_Node *pPoint; CSG_TIN *pDEM; //----------------------------------------------------- pDEM = Parameters("DEM") ->asTIN(); m_iHeight = Parameters("ZFIELD") ->asInt(); m_pFlow = Parameters("FLOW") ->asTIN(); m_pFlow->Create(*pDEM); m_iDir = m_pFlow->Get_Field_Count(); m_pFlow->Add_Field("DIRECTION" , SG_DATATYPE_Double); m_iArea = m_pFlow->Get_Field_Count(); m_pFlow->Add_Field("AREA" , SG_DATATYPE_Double); m_iFlow = m_pFlow->Get_Field_Count(); m_pFlow->Add_Field("FLOW" , SG_DATATYPE_Double); m_iSpecific = m_pFlow->Get_Field_Count(); m_pFlow->Add_Field("Specific" , SG_DATATYPE_Double); //----------------------------------------------------- for(iPoint=0; iPointGet_Node_Count(); iPoint++) { pPoint = m_pFlow->Get_Node(iPoint); pPoint->Set_Value(m_iDir , Get_Lowest_Neighbor(pPoint)); pPoint->Set_Value(m_iArea , pPoint->Get_Polygon_Area()); } //----------------------------------------------------- for(iPoint=0; iPointGet_Node_Count() && Set_Progress(iPoint, m_pFlow->Get_Node_Count()); iPoint++) { pPoint = m_pFlow->Get_Node(iPoint); if( pPoint->asDouble(m_iArea) > 0.0 ) { Trace(pPoint, pPoint->asDouble(m_iArea)); } } //----------------------------------------------------- for(iPoint=0; iPointGet_Node_Count() && Set_Progress(iPoint, m_pFlow->Get_Node_Count()); iPoint++) { pPoint = m_pFlow->Get_Node(iPoint); pPoint->Set_Value(m_iSpecific, pPoint->asDouble(m_iArea) > 0.0 ? 1.0 / pPoint->asDouble(m_iArea) : -1.0 ); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CTIN_Flow_Trace::Get_Lowest_Neighbor(CSG_TIN_Node *pPoint) { int i, iMin; double dz, dzMin; for(i=0, iMin=-1, dzMin=0.0; iGet_Neighbor_Count(); i++) { if( (dz = pPoint->Get_Gradient(i, m_iHeight)) > dzMin ) { dzMin = dz; iMin = i; } } return( iMin ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CTIN_Flow_Trace::Trace(CSG_TIN_Node *pPoint, double Area) { CSG_TIN_Node *pNeighbor; if( (pNeighbor = pPoint->Get_Neighbor(pPoint->asInt(m_iDir))) != NULL ) { pNeighbor->Add_Value(m_iFlow, Area); Trace(pNeighbor, Area); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_Flow_Trace.h000066400000000000000000000103121224124640700233160ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_Flow_Trace.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_Flow_Trace.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__TIN_Flow_Trace_H #define HEADER_INCLUDED__TIN_Flow_Trace_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTIN_Flow_Trace : public CSG_Module { public: CTIN_Flow_Trace(void); virtual ~CTIN_Flow_Trace(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Terrain Analysis") ); } protected: virtual bool On_Execute (void); private: int m_iHeight, m_iDir, m_iArea, m_iFlow, m_iSpecific; CSG_TIN *m_pFlow; int Get_Lowest_Neighbor(CSG_TIN_Node *pPoint); void Trace(CSG_TIN_Node *pPoint, double Area); }; #endif // #ifndef HEADER_INCLUDED__TIN_Flow_Trace_H saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_From_Grid.cpp000066400000000000000000000140361224124640700235030ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_From_Grid.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_From_Grid.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "TIN_From_Grid.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTIN_From_Grid::CTIN_From_Grid(void) { //----------------------------------------------------- Set_Name (_TL("Grid to TIN")); Set_Author (SG_T("(c) 2004 by O.Conrad")); Set_Description (_TW( "Creates a TIN from grid points. No data values will be ignored.\n\n" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "VALUES" , _TL("Values"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_TIN( NULL , "TIN" , _TL("TIN"), _TL(""), PARAMETER_OUTPUT ); } //--------------------------------------------------------- CTIN_From_Grid::~CTIN_From_Grid(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_From_Grid::On_Execute(void) { int x, y, i; CSG_TIN *pTIN; CSG_Grid *pGrid; CSG_Parameter_Grid_List *pValues; CSG_Shape *pPoint; CSG_Shapes Points; //----------------------------------------------------- pGrid = Parameters("GRID") ->asGrid(); pValues = Parameters("VALUES") ->asGridList(); Points.Create(SHAPE_TYPE_Point); Points.Add_Field("VALUE", SG_DATATYPE_Double); for(i=0; iGet_Count(); i++) { Points.Add_Field(pValues->asGrid(i)->Get_Name(), SG_DATATYPE_Double); } //----------------------------------------------------- for(y=0; yGet_NY() && Set_Progress(y, pGrid->Get_NY()); y++) { for(x=0; xGet_NX(); x++) { if( !pGrid->is_NoData(x, y) ) { pPoint = Points.Add_Shape(); pPoint->Add_Point( pGrid->Get_XMin() + pGrid->Get_Cellsize() * x, pGrid->Get_YMin() + pGrid->Get_Cellsize() * y ); pPoint->Set_Value(0, pGrid->asDouble(x, y)); for(i=0; iGet_Count(); i++) { pPoint->Set_Value(1 + i, pValues->asGrid(i)->asDouble(x, y)); } } } } //----------------------------------------------------- if( Points.Get_Count() >= 3 ) { pTIN = Parameters("TIN")->asTIN(); pTIN->Create(&Points); pTIN->Set_Name(pGrid->Get_Name()); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_From_Grid.h000066400000000000000000000077601224124640700231560ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_From_Grid.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_From_Grid.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__TIN_From_Grid_H #define HEADER_INCLUDED__TIN_From_Grid //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTIN_From_Grid : public CSG_Module_Grid { public: CTIN_From_Grid(void); virtual ~CTIN_From_Grid(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Conversion") ); } protected: virtual bool On_Execute (void); }; #endif // #ifndef HEADER_INCLUDED__TIN_From_Grid_H saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.cpp000066400000000000000000000352011224124640700266410ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_From_Grid_Specific_Points.cpp 1081 2011-06-08 08:05:26Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_From_Grid_Specific_Points.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "TIN_From_Grid_Specific_Points.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTIN_From_Grid_Specific_Points::CTIN_From_Grid_Specific_Points(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Grid to TIN (Surface Specific Points)")); Set_Author (SG_T("(c) 2004 by O.Conrad")); Set_Description (_TW( "Creates a TIN by identifying (surface) specific points of a grid." )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "VALUES" , _TL("Values"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_TIN( NULL , "TIN" , _TL("TIN"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL("The method used to identify surface specific points."), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Mark Highest Neighbour"), _TL("Opposite Neighbours"), _TL("Flow Direction"), _TL("Flow Direction (up and down)"), _TL("Peucker & Douglas") ), 1 ); pNode = Parameters.Add_Node(NULL, "THRESHOLDS", _TL("Thresholds"), _TL("")); Parameters.Add_Value( pNode , "HIGH" , _TL("Mark Highest Neighbour"), _TL(""), PARAMETER_TYPE_Int , 4, 1, true, 4, true ); Parameters.Add_Range( pNode , "FLOW" , _TL("Flow Direction"), _TL(""), 0, 3, 0, true, 8, true ); Parameters.Add_Value( pNode , "PEUCKER" , _TL("Peucker & Douglas"), _TL(""), PARAMETER_TYPE_Double , 2 ); } //--------------------------------------------------------- CTIN_From_Grid_Specific_Points::~CTIN_From_Grid_Specific_Points(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_From_Grid_Specific_Points::On_Execute(void) { bool bResult; int x, y, i; CSG_TIN *pTIN; CSG_Grid *pGrid, Grid; CSG_Parameter_Grid_List *pValues; CSG_Shape *pPoint; CSG_Shapes Points; //----------------------------------------------------- pGrid = Parameters("GRID")->asGrid(); Grid.Create(pGrid, SG_DATATYPE_Byte); //----------------------------------------------------- switch( Parameters("METHOD")->asInt() ) { default: bResult = false; break; case 0: bResult = Get_MarkHighestNB (&Grid, pGrid); break; case 1: bResult = Get_OppositeNB (&Grid, pGrid, Parameters("HIGH")->asInt()); break; case 2: bResult = Get_FlowDirection (&Grid, pGrid, (int)Parameters("FLOW")->asRange()->Get_LoVal(), (int)Parameters("FLOW")->asRange()->Get_HiVal() ); break; case 3: bResult = Get_FlowDirection2(&Grid, pGrid, (int)Parameters("FLOW")->asRange()->Get_HiVal() ); break; case 4: bResult = Get_Peucker (&Grid, pGrid, Parameters("PEUCKER")->asDouble()); break; } //----------------------------------------------------- if( bResult ) { pValues = Parameters("VALUES")->asGridList(); Points.Create(SHAPE_TYPE_Point); Points.Add_Field(_TL("VALUE"), SG_DATATYPE_Double); for(i=0; iGet_Count(); i++) { Points.Add_Field(pValues->asGrid(i)->Get_Name(), SG_DATATYPE_Double); } for(y=0; yAdd_Point( Get_XMin() + Get_Cellsize() * x, Get_YMin() + Get_Cellsize() * y ); pPoint->Set_Value(0, pGrid->asDouble(x, y)); for(i=0; iGet_Count(); i++) { pPoint->Set_Value(1 + i, pValues->asGrid(i)->asDouble(x, y)); } } } } //------------------------------------------------- if( Points.Get_Count() >= 3 ) { pTIN = Parameters("TIN")->asTIN(); pTIN->Create(&Points); pTIN->Set_Name(pGrid->Get_Name()); } } return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_From_Grid_Specific_Points::Get_MarkHighestNB(CSG_Grid *pResult, CSG_Grid *pGrid) // Band & Lammers... { int i, x, y, ix, iy, xlo, ylo, xhi, yhi; double lo, hi, z; CSG_Grid *clo, *chi; clo = SG_Create_Grid(pGrid, SG_DATATYPE_Char); chi = SG_Create_Grid(pGrid, SG_DATATYPE_Char); // Pass 1: Auszaehlen... for(y=0; yasDouble(x,y); xhi = xlo = x; yhi = ylo = y; for(i=0; i<4; i++) { ix = Get_xTo(i,x); iy = Get_yTo(i,y); if( is_InGrid(ix,iy) ) { z = pGrid->asDouble(ix,iy); if( z > hi ) { hi = z; xhi = ix; yhi = iy; } else if( z < lo ) { lo = z; xlo = ix; ylo = iy; } } } clo->Add_Value(xlo,ylo,1); chi->Add_Value(xhi,yhi,1); } } // Pass 2: Setzen... for(y=0; yasChar(x,y) ) { if( !clo->asChar(x,y) ) pResult->Set_Value(x,y, 2); // Sattel else pResult->Set_Value(x,y, 1); // Tiefenlinie } else if( !clo->asChar(x,y) ) pResult->Set_Value(x,y, -1); // Wasserscheide else pResult->Set_Value(x,y, 0); // Nichts... } } delete(clo); delete(chi); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_From_Grid_Specific_Points::Get_OppositeNB(CSG_Grid *pResult, CSG_Grid *pGrid, int Threshold) { int i, x, y, ix, iy, jx, jy; double z, iz, jz; CSG_Grid *clo, *chi; clo = SG_Create_Grid(pGrid, SG_DATATYPE_Char); chi = SG_Create_Grid(pGrid, SG_DATATYPE_Char); // Pass 1: Auszaehlen... for(y=0; yasDouble(x,y); for(i=0; i<4; i++) { ix = Get_xTo(i,x); iy = Get_yTo(i,y); if( is_InGrid(ix,iy) ) { jx = Get_xFrom(i,x); jy = Get_yFrom(i,y); if( is_InGrid(jx,jy) ) { iz = pGrid->asDouble(ix,iy); jz = pGrid->asDouble(jx,jy); if( iz>z && jz>z ) chi->Add_Value(x,y,1); else if( izAdd_Value(x,y,1); } } } } } // Pass 2: Setzen... for(y=0; yasChar(x,y) ) { if( clo->asChar(x,y) ) pResult->Set_Value(x,y, 5); // Sattel else pResult->Set_Value(x,y, chi->asChar(x,y) ); // Tiefenlinie } else if( clo->asChar(x,y) ) pResult->Set_Value(x,y, - clo->asChar(x,y) ); // Wasserscheide else pResult->Set_Value(x,y, 0); // Nichts... pResult->Set_Value(x, y, abs(pResult->asInt(x, y)) >= Threshold ? 1 : 0); } } delete(clo); delete(chi); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_From_Grid_Specific_Points::Get_FlowDirection(CSG_Grid *pResult, CSG_Grid *pGrid, int Min, int Max) { bool bLower; int x, y, i, ix, iy, xLow, yLow; double z, iz, zLow; pResult->Assign(); for(y=0; yasDouble(x,y); bLower = false; for(i=0; i<8; i++) { ix = Get_xTo(i,x); iy = Get_yTo(i,y); if( is_InGrid(ix,iy) ) { iz = pGrid->asDouble(ix,iy); if(izAdd_Value(xLow, yLow, 1); } } } for(y=0; yasInt(x, y); if( i <= Min ) { pResult->Set_Value(x, y, -1); } else if( i >= Max ) { pResult->Set_Value(x, y, 1); } else { pResult->Set_Value(x, y, 0); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_From_Grid_Specific_Points::Get_FlowDirection2(CSG_Grid *pResult, CSG_Grid *pGrid, int Threshold) { CSG_Grid Grid(*pGrid), Result(*pResult); Get_FlowDirection(pResult, &Grid, -1, Threshold); Grid.Invert(); Get_FlowDirection(&Result, &Grid, -1, Threshold); for(long n=0; n 0 ) { pResult->Set_Value(n, 1); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_From_Grid_Specific_Points::Get_Peucker(CSG_Grid *pResult, CSG_Grid *pGrid, double Threshold) { bool wasPlus; int x, y, i, ix, iy, nSgn; double d, dPlus, dMinus, z, alt[8]; for(y=0; yGet_NY() && Set_Progress(y, pGrid->Get_NY()); y++) { for(x=0; xGet_NX(); x++) { z = pGrid->asDouble(x,y); for(i=0; i<8; i++) { ix = pGrid->Get_System().Get_xTo(i,x); iy = pGrid->Get_System().Get_yTo(i,y); if( pGrid->is_InGrid(ix,iy) ) alt[i] = pGrid->asDouble(ix,iy); else alt[i] = z; } dPlus = dMinus = 0; nSgn = 0; wasPlus = (alt[7] - z > 0) ? true : false; for(i=0; i<8; i++) { d = alt[i] - z; if(d>0) { dPlus += d; if(!wasPlus) { nSgn++; wasPlus = true; } } else if(d<0) { dMinus -= d; if(wasPlus) { nSgn++; wasPlus = false; } } } i = 0; if(!dPlus) // Peak... i = 9; else if(!dMinus) // Pit i = -9; else if(nSgn==4) // Pass i = 1; else if(nSgn==2) { i = nSgn = 0; if(alt[7]>z) { while(alt[i++]>z); do nSgn++; while(alt[i++]z); } i = 0; if(nSgn==4) { if(dMinus-dPlus > Threshold) // convex break... i = 2; else if(dPlus-dMinus > Threshold) // concave break... i = -2; } else // lines: { if(dMinus-dPlus>0) // Ridge i = 7; else // Channel i = -7; } } pResult->Set_Value(x, y, i == 0 ? 0 : 1); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_From_Grid_Specific_Points.h000066400000000000000000000107721224124640700263140ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_From_Grid_Specific_Points.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_From_Grid_Specific_Points.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__TIN_From_Grid_Specific_Points_H #define HEADER_INCLUDED__TIN_From_Grid_Specific_Points_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTIN_From_Grid_Specific_Points : public CSG_Module_Grid { public: CTIN_From_Grid_Specific_Points(void); virtual ~CTIN_From_Grid_Specific_Points(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Conversion") ); } protected: virtual bool On_Execute (void); private: bool Get_MarkHighestNB (CSG_Grid *pResult, CSG_Grid *pGrid); bool Get_OppositeNB (CSG_Grid *pResult, CSG_Grid *pGrid, int Threshold); bool Get_FlowDirection (CSG_Grid *pResult, CSG_Grid *pGrid, int Min, int Max); bool Get_FlowDirection2 (CSG_Grid *pResult, CSG_Grid *pGrid, int Threshold); bool Get_Peucker (CSG_Grid *pResult, CSG_Grid *pGrid, double Threshold); }; #endif // #ifndef HEADER_INCLUDED__TIN_From_Grid_Specific_Points_H saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_From_Shapes.cpp000066400000000000000000000115441224124640700240420ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_From_Shapes.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_From_Shapes.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "TIN_From_Shapes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTIN_From_Shapes::CTIN_From_Shapes(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name(_TL("Shapes to TIN")); Set_Author (SG_T("(c) 2004 by O.Conrad")); Set_Description( _TL("Convert a shapes layer to a TIN\n\n") ); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); pNode = Parameters.Add_TIN( NULL , "TIN" , _TL("TIN"), _TL(""), PARAMETER_OUTPUT ); } //--------------------------------------------------------- CTIN_From_Shapes::~CTIN_From_Shapes(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_From_Shapes::On_Execute(void) { CSG_TIN *pTIN; CSG_Shapes *pShapes; pShapes = Parameters("SHAPES") ->asShapes(); pTIN = Parameters("TIN") ->asTIN(); return( pTIN->Create(pShapes) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_From_Shapes.h000066400000000000000000000077731224124640700235200ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_From_Shapes.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_From_Shapes.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__TIN_From_Shapes_H #define HEADER_INCLUDED__TIN_From_Shapes_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTIN_From_Shapes : public CSG_Module { public: CTIN_From_Shapes(void); virtual ~CTIN_From_Shapes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Conversion") ); } protected: virtual bool On_Execute (void); }; #endif // #ifndef HEADER_INCLUDED__TIN_From_Shapes_H saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_Gradient.cpp000066400000000000000000000150121224124640700233630ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_Gradient.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_Gradient.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "TIN_Gradient.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTIN_Gradient::CTIN_Gradient(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name(_TL("Gradient")); Set_Author (SG_T("(c) 2004 by O.Conrad")); Set_Description( _TL("Calculates the gradient based on the values of each triangle's points.\n\n") ); //----------------------------------------------------- pNode = Parameters.Add_TIN( NULL , "TIN" , _TL("TIN"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "ZFIELD" , _TL("Z Values"), _TL("") ); Parameters.Add_Shapes( NULL , "GRADIENT" , _TL("TIN_Gradient"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Choice( NULL , "DEGREE" , _TL("Output Unit"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Radians"), _TL("Degree") ), 1 ); } //--------------------------------------------------------- CTIN_Gradient::~CTIN_Gradient(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_Gradient::On_Execute(void) { bool bDegree; int iTriangle, zField; double a, b; CSG_TIN_Triangle *pTriangle; CSG_TIN *pTIN; CSG_Shape *pShape; CSG_Shapes *pShapes; //----------------------------------------------------- pTIN = Parameters("TIN") ->asTIN(); zField = Parameters("ZFIELD") ->asInt(); pShapes = Parameters("GRADIENT") ->asShapes(); bDegree = Parameters("DEGREE") ->asInt() == 1; //----------------------------------------------------- pShapes->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s], %s [%s]"), _TL("TIN_Gradient"), pTIN->Get_Field_Name(zField), _TL("TIN"), pTIN->Get_Name())); pShapes->Add_Field(_TL("ID") , SG_DATATYPE_Int); pShapes->Add_Field(_TL("AREA") , SG_DATATYPE_Double); pShapes->Add_Field(_TL("DECLINE"), SG_DATATYPE_Double); pShapes->Add_Field(_TL("AZIMUTH"), SG_DATATYPE_Double); //----------------------------------------------------- for(iTriangle=0; iTriangleGet_Triangle_Count() && Set_Progress(iTriangle, pTIN->Get_Triangle_Count()); iTriangle++) { pTriangle = pTIN->Get_Triangle(iTriangle); if( pTriangle->Get_Gradient(zField, a, b) ) { if( bDegree ) { a *= M_RAD_TO_DEG; b *= M_RAD_TO_DEG; } pShape = pShapes->Add_Shape(); pShape->Add_Point(pTriangle->Get_Node(0)->Get_Point()); pShape->Add_Point(pTriangle->Get_Node(1)->Get_Point()); pShape->Add_Point(pTriangle->Get_Node(2)->Get_Point()); pShape->Set_Value(0, iTriangle + 1); pShape->Set_Value(1, pTriangle->Get_Area()); pShape->Set_Value(2, a); pShape->Set_Value(3, b); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_Gradient.h000066400000000000000000000077541224124640700230460ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_Gradient.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_Gradient.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__TIN_Gradient_H #define HEADER_INCLUDED__TIN_Gradient_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTIN_Gradient : public CSG_Module { public: CTIN_Gradient(void); virtual ~CTIN_Gradient(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Terrain Analysis") ); } protected: virtual bool On_Execute (void); }; #endif // #ifndef HEADER_INCLUDED__TIN_Gradient_H saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_To_Shapes.cpp000066400000000000000000000231401224124640700235140ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_To_Shapes.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_To_Shapes.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "TIN_To_Shapes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTIN_To_Shapes::CTIN_To_Shapes(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name(_TL("TIN to Shapes")); Set_Author (SG_T("(c) 2004 by O.Conrad")); Set_Description( _TL("Converts a TIN data set to shapes layers.\n\n") ); //----------------------------------------------------- pNode = Parameters.Add_TIN( NULL , "TIN" , _TL("TIN"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL , "CENTER" , _TL("Center of Triangles"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL , "EDGES" , _TL("Edges"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); Parameters.Add_Shapes( NULL , "TRIANGLES" , _TL("Triangles"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); } //--------------------------------------------------------- CTIN_To_Shapes::~CTIN_To_Shapes(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_To_Shapes::On_Execute(void) { int i, j; CSG_TIN_Node *pPoint; CSG_TIN_Edge *pEdge; CSG_TIN_Triangle *pTriangle; CSG_TIN *pTIN; CSG_Shape *pShape; CSG_Shapes *pShapes; //----------------------------------------------------- pTIN = Parameters("TIN") ->asTIN(); //----------------------------------------------------- pShapes = Parameters("POINTS") ->asShapes(); pShapes->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), _TL("TIN"), pTIN->Get_Name())); pShapes->Add_Field("POINT_ID", SG_DATATYPE_Int); for(j=0; jGet_Field_Count(); j++) { pShapes->Add_Field(pTIN->Get_Field_Name(j), pTIN->Get_Field_Type(j)); } for(i=0; iGet_Node_Count() && Set_Progress(i, pTIN->Get_Node_Count()); i++) { pPoint = pTIN->Get_Node(i); pShape = pShapes->Add_Shape(); pShape->Add_Point(pPoint->Get_Point()); pShape->Set_Value(0, 1 + i); for(j=0; jGet_Field_Count(); j++) { pShape->Set_Value(j + 1, pPoint->asString(j)); } } //----------------------------------------------------- pShapes = Parameters("EDGES") ->asShapes(); pShapes->Create(SHAPE_TYPE_Line, CSG_String::Format(SG_T("%s [%s]"), _TL("TIN Edges"), pTIN->Get_Name())); pShapes->Add_Field("ID" , SG_DATATYPE_Int); pShapes->Add_Field("POINT_ID_A" , SG_DATATYPE_Int); pShapes->Add_Field("POINT_ID_B" , SG_DATATYPE_Int); for(i=0; iGet_Edge_Count() && Set_Progress(i, pTIN->Get_Edge_Count()); i++) { pEdge = pTIN->Get_Edge(i); pShape = pShapes->Add_Shape(); pShape->Add_Point(pEdge->Get_Node(0)->Get_Point()); pShape->Add_Point(pEdge->Get_Node(1)->Get_Point()); pShape->Set_Value(0, 1 + i); pShape->Set_Value(1, 1 + pEdge->Get_Node(0)->Get_ID()); pShape->Set_Value(2, 1 + pEdge->Get_Node(1)->Get_ID()); } //----------------------------------------------------- pShapes = Parameters("TRIANGLES") ->asShapes(); pShapes->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), _TL("TIN Triangles"), pTIN->Get_Name())); pShapes->Add_Field("ID" , SG_DATATYPE_Int); pShapes->Add_Field("POINT_ID_A" , SG_DATATYPE_Int); pShapes->Add_Field("POINT_ID_B" , SG_DATATYPE_Int); pShapes->Add_Field("POINT_ID_C" , SG_DATATYPE_Int); for(i=0; iGet_Triangle_Count() && Set_Progress(i, pTIN->Get_Triangle_Count()); i++) { pTriangle = pTIN->Get_Triangle(i); pShape = pShapes->Add_Shape(); pShape->Add_Point(pTriangle->Get_Node(0)->Get_Point()); pShape->Add_Point(pTriangle->Get_Node(1)->Get_Point()); pShape->Add_Point(pTriangle->Get_Node(2)->Get_Point()); pShape->Set_Value(0, 1 + i); pShape->Set_Value(1, 1 + pTriangle->Get_Node(0)->Get_ID()); pShape->Set_Value(2, 1 + pTriangle->Get_Node(1)->Get_ID()); pShape->Set_Value(3, 1 + pTriangle->Get_Node(2)->Get_ID()); } //----------------------------------------------------- pShapes = Parameters("CENTER") ->asShapes(); pShapes->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), _TL("TIN Centroids"), pTIN->Get_Name())); pShapes->Add_Field("ID" , SG_DATATYPE_Int); pShapes->Add_Field("POINT_ID_A" , SG_DATATYPE_Int); pShapes->Add_Field("POINT_ID_B" , SG_DATATYPE_Int); pShapes->Add_Field("POINT_ID_C" , SG_DATATYPE_Int); for(i=0; iGet_Triangle_Count() && Set_Progress(i, pTIN->Get_Triangle_Count()); i++) { pTriangle = pTIN->Get_Triangle(i); pShape = pShapes->Add_Shape(); pShape->Add_Point(pTriangle->Get_CircumCircle_Point()); pShape->Set_Value(0, 1 + i); pShape->Set_Value(1, 1 + pTriangle->Get_Node(0)->Get_Index()); pShape->Set_Value(2, 1 + pTriangle->Get_Node(1)->Get_Index()); pShape->Set_Value(3, 1 + pTriangle->Get_Node(2)->Get_Index()); } //----------------------------------------------------- CSG_Points Points; pShapes = Parameters("POLYGONS") ->asShapes(); pShapes->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), _TL("TIN Voronoi"), pTIN->Get_Name())); pShapes->Add_Field("POINT_ID", SG_DATATYPE_Int); for(j=0; jGet_Field_Count(); j++) { pShapes->Add_Field(pTIN->Get_Field_Name(j), pTIN->Get_Field_Type(j)); } for(i=0; iGet_Node_Count() && Set_Progress(i, pTIN->Get_Node_Count()); i++) { pPoint = pTIN->Get_Node(i); if( pPoint->Get_Polygon(Points) ) { pShape = pShapes->Add_Shape(); for(j=0; jAdd_Point(Points[j]); } pShape->Set_Value(0, 1 + i); for(j=0; jGet_Field_Count(); j++) { pShape->Set_Value(j + 1, pPoint->asString(j)); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_tools/TIN_To_Shapes.h000066400000000000000000000077551224124640700231770ustar00rootroot00000000000000/********************************************************** * Version $Id: TIN_To_Shapes.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // TIN_Tools // // // //-------------------------------------------------------// // // // TIN_To_Shapes.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__TIN_To_Shapes_H #define HEADER_INCLUDED__TIN_To_Shapes_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTIN_To_Shapes : public CSG_Module { public: CTIN_To_Shapes(void); virtual ~CTIN_To_Shapes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Conversion") ); } protected: virtual bool On_Execute (void); }; #endif // #ifndef HEADER_INCLUDED__TIN_To_Shapes_H saga-2.1.0+dfsg/src/modules/tin/tin_viewer/000077500000000000000000000000001224124640700205525ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules/tin/tin_viewer/MLB_Interface.cpp000066400000000000000000000106461224124640700236570ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // tin_viewer // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute for Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("TIN - Visualisation") ); case MLB_INFO_Author: return( SG_T("O.Conrad (c) 2011") ); case MLB_INFO_Description: return( _TL("TIN viewer." )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("TIN|Visualisation" )); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "tin_view_module.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CTIN_View_Module ); default: return( NULL ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules/tin/tin_viewer/MLB_Interface.h000066400000000000000000000076051224124640700233250ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_viewer // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute for Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__pointcloud_viewer_mlb_H #define HEADER_INCLUDED__pointcloud_viewer_mlb_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef pointcloud_viewer_EXPORTS #define pointcloud_viewer_EXPORT _SAGA_DLL_EXPORT #else #define pointcloud_viewer_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__pointcloud_viewer_mlb_H saga-2.1.0+dfsg/src/modules/tin/tin_viewer/Makefile.am000066400000000000000000000017341224124640700226130ustar00rootroot00000000000000if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` else DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libtin_viewer.la libtin_viewer_la_SOURCES =\ MLB_Interface.cpp\ tin_view_control.cpp\ tin_view_dialog.cpp\ tin_view_module.cpp\ MLB_Interface.h\ tin_view_control.h\ tin_view_dialog.h\ tin_view_module.h libtin_viewer_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS) saga-2.1.0+dfsg/src/modules/tin/tin_viewer/Makefile.in000066400000000000000000000454171224124640700226320ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules/tin/tin_viewer DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libtin_viewer_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la \ $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la am_libtin_viewer_la_OBJECTS = MLB_Interface.lo tin_view_control.lo \ tin_view_dialog.lo tin_view_module.lo libtin_viewer_la_OBJECTS = $(am_libtin_viewer_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libtin_viewer_la_SOURCES) DIST_SOURCES = $(libtin_viewer_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_FALSE@DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) @SAGA_UNICODE_TRUE@DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) @SAGA_UNICODE_FALSE@DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` @SAGA_UNICODE_TRUE@DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libtin_viewer.la libtin_viewer_la_SOURCES = \ MLB_Interface.cpp\ tin_view_control.cpp\ tin_view_dialog.cpp\ tin_view_module.cpp\ MLB_Interface.h\ tin_view_control.h\ tin_view_dialog.h\ tin_view_module.h libtin_viewer_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules/tin/tin_viewer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/tin/tin_viewer/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libtin_viewer.la: $(libtin_viewer_la_OBJECTS) $(libtin_viewer_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libtin_viewer_la_OBJECTS) $(libtin_viewer_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tin_view_control.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tin_view_dialog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tin_view_module.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules/tin/tin_viewer/tin_view_control.cpp000066400000000000000000000726661224124640700246630ustar00rootroot00000000000000/********************************************************** * Version $Id: tin_view_control.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // tin_viewer // // // //-------------------------------------------------------// // // // tin_view_control.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include #include #include #include //--------------------------------------------------------- #include "tin_view_control.h" #include "tin_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define m_Settings (*m_pSettings) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- BEGIN_EVENT_TABLE(CTIN_View_Control, wxPanel) EVT_SIZE (CTIN_View_Control::On_Size) EVT_PAINT (CTIN_View_Control::On_Paint) EVT_KEY_DOWN (CTIN_View_Control::On_Key_Down) EVT_LEFT_DOWN (CTIN_View_Control::On_Mouse_LDown) EVT_LEFT_UP (CTIN_View_Control::On_Mouse_LUp) EVT_RIGHT_DOWN (CTIN_View_Control::On_Mouse_RDown) EVT_RIGHT_UP (CTIN_View_Control::On_Mouse_RUp) EVT_MIDDLE_DOWN (CTIN_View_Control::On_Mouse_MDown) EVT_MIDDLE_UP (CTIN_View_Control::On_Mouse_MUp) EVT_MOTION (CTIN_View_Control::On_Mouse_Motion) EVT_MOUSEWHEEL (CTIN_View_Control::On_Mouse_Wheel) END_EVENT_TABLE() /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTIN_View_Control::CTIN_View_Control(wxWindow *pParent, CSG_TIN *pTIN, int Field_Z, int Field_Color, CSG_Parameters &Settings, CSG_Grid *pRGB) : wxPanel(pParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxSUNKEN_BORDER|wxNO_FULL_REPAINT_ON_RESIZE) { m_pTIN = pTIN; m_pRGB = pRGB; m_bRGB = pRGB != NULL; m_pSettings = &Settings; m_zField = Field_Z; m_cField = Field_Color; m_Shading = 1; m_Style = 1; m_cWire = SG_GET_RGB(150, 150, 150); m_xRotate = 0.0; m_yRotate = 0.0; m_zRotate = 0.0; m_xShift = 0.0; m_yShift = 0.0; m_zShift = 1000.0; m_bCentral = true; m_bStereo = false; m_bFrame = true; m_Light_Hgt = 45.0 * M_DEG_TO_RAD; m_Light_Dir = 90.0 * M_DEG_TO_RAD; m_dCentral = 500.0; //----------------------------------------------------- CSG_Parameter *pNode = m_pSettings->Add_Node(NULL, "NODE_CONTROL", _TL("3D View"), _TL("")); m_pSettings->Add_Colors( pNode , "COLORS" , _TL("Colors"), _TL("") ); m_pSettings->Add_Value( pNode , "BGCOLOR" , _TL("Background Color"), _TL(""), PARAMETER_TYPE_Color, 0 ); m_pSettings->Add_Range( pNode , "C_RANGE" , _TL("Colors Value Range"), _TL("") ); m_pSettings->Add_Value( pNode , "COLOR_WIRE" , _TL("Wire Frame Color"), _TL(""), PARAMETER_TYPE_Color, m_cWire ); m_pSettings->Add_Value( pNode , "SIZE_DEF" , _TL("Point Size: Default"), _TL(""), PARAMETER_TYPE_Int, 0, 0, true ); m_pSettings->Add_Value( pNode , "SIZE_SCALE" , _TL("Point Size: Scaling"), _TL(""), PARAMETER_TYPE_Double, 250.0, 1.0, true ); m_pSettings->Add_Value( pNode , "EXAGGERATION" , _TL("Exaggeration"), _TL(""), PARAMETER_TYPE_Double, 1.0 ); m_pSettings->Add_Value( pNode , "STEREO_DIST" , _TL("Stereo Eye Distance [Degree]"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); if( m_pRGB ) { m_pSettings->Add_Choice( pNode , "RGB_INTERPOL", _TL("Map Draping Interpolation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("[VAL] None"), _TL("[VAL] Bilinear"), _TL("[VAL] Inverse Distance"), _TL("[VAL] Bicubic Spline"), _TL("[VAL] B-Spline") ), 0 ); } //----------------------------------------------------- Update_Extent(); } //--------------------------------------------------------- CTIN_View_Control::~CTIN_View_Control(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CTIN_View_Control::On_Size(wxSizeEvent &event) { _Set_Size(); event.Skip(); } //--------------------------------------------------------- void CTIN_View_Control::On_Paint(wxPaintEvent &WXUNUSED(event)) { if( m_Image.IsOk() && m_Image.GetWidth() > 0 && m_Image.GetHeight() > 0 ) { wxPaintDC dc(this); dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false); } } //--------------------------------------------------------- void CTIN_View_Control::Update_View(void) { if( _Draw_Image() ) { wxClientDC dc(this); dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false); } } //--------------------------------------------------------- void CTIN_View_Control::Update_Extent(void) { m_Extent.Assign(m_pTIN->Get_Extent()); m_zStats.Invalidate(); m_cStats.Invalidate(); for(int i=0; iGet_Node_Count(); i++) { CSG_TIN_Node *pNode = m_pTIN->Get_Node(i); m_zStats.Add_Value(pNode->asDouble(m_zField)); m_cStats.Add_Value(pNode->asDouble(m_cField)); } m_Settings("C_RANGE")->asRange()->Set_Range( m_cStats.Get_Mean() - 1.5 * m_cStats.Get_StdDev(), m_cStats.Get_Mean() + 1.5 * m_cStats.Get_StdDev() ); Update_View(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CTIN_View_Control::On_Key_Down(wxKeyEvent &event) { switch( event.GetKeyCode() ) { default: event.Skip(); return; case WXK_NUMPAD_ADD: case WXK_ADD: m_xRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_SUBTRACT: case WXK_SUBTRACT: m_xRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_F3: m_yRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_F4: m_yRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_MULTIPLY: case WXK_MULTIPLY: m_zRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_DIVIDE: case WXK_DIVIDE: m_zRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_INSERT: m_xShift -= 10.0; break; case WXK_DELETE: m_xShift += 10.0; break; case WXK_HOME: m_yShift -= 10.0; break; case WXK_END: m_yShift += 10.0; break; case WXK_PAGEUP: m_zShift -= 10.0; break; case WXK_PAGEDOWN: m_zShift += 10.0; break; case 'A': m_bStereo = !m_bStereo; break; case WXK_F1: m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() + 0.5); break; case WXK_F2: m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() - 0.5); break; case WXK_F5: m_Settings("SIZE_DEF") ->Set_Value(m_Settings("SIZE_DEF") ->asDouble() - 1.0); break; case WXK_F6: m_Settings("SIZE_DEF") ->Set_Value(m_Settings("SIZE_DEF") ->asDouble() + 1.0); break; case WXK_F7: m_Settings("SIZE_SCALE") ->Set_Value(m_Settings("SIZE_SCALE") ->asDouble() - 10.0); break; case WXK_F8: m_Settings("SIZE_SCALE") ->Set_Value(m_Settings("SIZE_SCALE") ->asDouble() + 10.0); break; } Update_View(); ((CTIN_View_Dialog *)GetParent())->Update_Rotation(); } //--------------------------------------------------------- #define GET_MOUSE_X_RELDIFF ((double)(m_Mouse_Down.x - event.GetX()) / (double)GetClientSize().x) #define GET_MOUSE_Y_RELDIFF ((double)(m_Mouse_Down.y - event.GetY()) / (double)GetClientSize().y) //--------------------------------------------------------- void CTIN_View_Control::On_Mouse_LDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_zRotate; m_yDown = m_xRotate; CaptureMouse(); } void CTIN_View_Control::On_Mouse_LUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_zRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_xRotate = m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180; Update_View(); ((CTIN_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void CTIN_View_Control::On_Mouse_RDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_xShift; m_yDown = m_yShift; CaptureMouse(); } void CTIN_View_Control::On_Mouse_RUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_xShift = m_xDown - GET_MOUSE_X_RELDIFF * 1000.0; m_yShift = m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0; Update_View(); ((CTIN_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void CTIN_View_Control::On_Mouse_MDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_yRotate; m_yDown = m_zShift; CaptureMouse(); } void CTIN_View_Control::On_Mouse_MUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_yRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_zShift = m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0; Update_View(); ((CTIN_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void CTIN_View_Control::On_Mouse_Motion(wxMouseEvent &event) { if( HasCapture() && event.Dragging() ) { if( event.LeftIsDown() ) { m_zRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_xRotate = m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180; } else if( event.RightIsDown() ) { m_xShift = m_xDown - GET_MOUSE_X_RELDIFF * 1000.0; m_yShift = m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0; } else if( event.MiddleIsDown() ) { m_yRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_zShift = m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0; } else { return; } Update_View(); ((CTIN_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void CTIN_View_Control::On_Mouse_Wheel(wxMouseEvent &event) { if( event.GetWheelRotation() ) { m_zShift += 0.5 * event.GetWheelRotation(); Update_View(); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CTIN_View_Control::_Set_Size(void) { Update_View(); } //--------------------------------------------------------- bool CTIN_View_Control::_Draw_Image(void) { wxSize dcSize = GetClientSize(); if( m_pTIN->Get_Count() <= 0 || dcSize.x <= 0 || dcSize.y <= 0 || m_Extent.Get_XRange() <= 0.0 || m_Extent.Get_YRange() <= 0.0 || m_zField < 0 || m_zField >= m_pTIN->Get_Field_Count() || m_cField < 0 || m_cField >= m_pTIN->Get_Field_Count() || m_zStats.Get_Range() <= 0.0 ) { return( false ); } //------------------------------------------------- if( !m_Image.IsOk() || dcSize.x != m_Image.GetWidth() || dcSize.y != m_Image.GetHeight() ) { m_Image .Create(dcSize.x, dcSize.y); m_Image_zMax.Create(dcSize.x, dcSize.y); } //------------------------------------------------- if( m_Settings("C_RANGE")->asRange()->Get_LoVal() >= m_Settings("C_RANGE")->asRange()->Get_HiVal() ) { m_Settings("C_RANGE")->asRange()->Set_Range( m_cStats.Get_Mean() - 1.5 * m_pTIN->Get_StdDev(m_cField), m_cStats.Get_Mean() + 1.5 * m_pTIN->Get_StdDev(m_cField) ); } m_pColors = m_Settings("COLORS")->asColors(); m_cMin = m_Settings("C_RANGE")->asRange()->Get_LoVal(); m_cScale = m_pColors->Get_Count() / (m_Settings("C_RANGE")->asRange()->Get_HiVal() - m_cMin); m_cWire = m_Settings("COLOR_WIRE")->asColor(); if( m_bRGB ) { m_Interpolation = m_Settings("RGB_INTERPOL")->asInt(); } //------------------------------------------------- r_Scale = (m_Image.GetWidth() / (double)m_Image.GetHeight()) > (m_Extent.Get_XRange() / m_Extent.Get_YRange()) ? m_Image.GetWidth () / m_Extent.Get_XRange() : m_Image.GetHeight() / m_Extent.Get_YRange(); r_sin_x = sin(m_xRotate - M_PI_180); r_cos_x = cos(m_xRotate - M_PI_180); r_sin_y = sin(m_yRotate); r_cos_y = cos(m_yRotate); r_sin_z = sin(m_zRotate); r_cos_z = cos(m_zRotate); r_xc = m_Extent.Get_XCenter(); r_yc = m_Extent.Get_YCenter(); r_zc = m_zStats.Get_Minimum() + 0.5 * m_zStats.Get_Range(); r_Scale_z = r_Scale * m_Settings("EXAGGERATION")->asDouble(); //------------------------------------------------- m_Size_Def = m_Settings("SIZE_DEF")->asInt(); m_Size_Scale = 1.0 / m_Settings("SIZE_SCALE")->asDouble(); _Draw_Background(); //------------------------------------------------- if( m_bStereo == false ) { m_Image_zMax.Assign(999999.0); m_Color_Mode = COLOR_MODE_RGB; for(int i=0; iGet_Triangle_Count(); i++) { _Draw_Triangle(m_pTIN->Get_Triangle(i)); } _Draw_Frame(); } //------------------------------------------------- else { int i; double d = m_Settings("STEREO_DIST")->asDouble() / 2.0; m_Image_zMax.Assign(999999.0); r_sin_y = sin(m_yRotate - d * M_DEG_TO_RAD); r_cos_y = cos(m_yRotate - d * M_DEG_TO_RAD); m_Color_Mode = COLOR_MODE_RED; for(i=0; iGet_Triangle_Count(); i++) { _Draw_Triangle(m_pTIN->Get_Triangle(i)); } _Draw_Frame(); m_Image_zMax.Assign(999999.0); r_sin_y = sin(m_yRotate + d * M_DEG_TO_RAD); r_cos_y = cos(m_yRotate + d * M_DEG_TO_RAD); m_Color_Mode = COLOR_MODE_BLUE; for(i=0; iGet_Triangle_Count(); i++) { _Draw_Triangle(m_pTIN->Get_Triangle(i)); } _Draw_Frame(); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void CTIN_View_Control::_Draw_Point(int iPoint) { TNode p; CSG_TIN_Node *pNode = m_pTIN->Get_Node(iPoint); p.x = pNode->Get_Point().x; p.y = pNode->Get_Point().y; p.z = pNode->asDouble(m_zField); p.c = pNode->asDouble(m_cField); _Get_Projection(p); bool m_bScale = true; _Draw_Point((int)p.x, (int)p.y, p.z, p.c, m_Size_Def + (!m_bScale ? 0 : (int)(20.0 * exp(-m_Size_Scale * p.z)))); } //--------------------------------------------------------- inline void CTIN_View_Control::_Draw_Point(int x, int y, double z, int color, int size) { if( z > 0.0 ) { _Draw_Pixel(x, y, z, color); if( size > 0 && size < 50 ) { for(int iy=1; iy<=size; iy++) { for(int ix=0; ix<=size; ix++) { if( ix*ix + iy*iy <= size*size ) { _Draw_Pixel(x + ix, y + iy, z, color); _Draw_Pixel(x + iy, y - ix, z, color); _Draw_Pixel(x - ix, y - iy, z, color); _Draw_Pixel(x - iy, y + ix, z, color); } } } } } } //--------------------------------------------------------- inline void CTIN_View_Control::_Draw_Line(TNode a, TNode b, int Color) { if( (a.x < 0 && b.x < 0) || (a.x >= m_Image.GetWidth () && b.x >= m_Image.GetWidth ()) || (a.y < 0 && b.y < 0) || (a.y >= m_Image.GetHeight() && b.y >= m_Image.GetHeight()) ) { return; } double i, n, dx, dy, dz; dx = b.x - a.x; dy = b.y - a.y; dz = b.z - a.z; if( b.z < 0.0 || a.z < 0.0 ) return; if( fabs(dx) > fabs(dy) && fabs(dx) > 0.0 ) { n = fabs(dx); dx = dx < 0 ? -1 : 1; dy /= n; dz /= n; } else if( fabs(dy) > 0.0 ) { n = fabs(dy); dx /= n; dy = dy < 0 ? -1 : 1; dz /= n; } else { _Draw_Pixel((int)a.x, (int)a.y, a.z, Color); return; } //----------------------------------------------------- for(i=0; i<=n; i++, a.x+=dx, a.y+=dy, a.z+=dz) { _Draw_Pixel((int)a.x, (int)a.y, a.z, Color); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void CTIN_View_Control::_Draw_Triangle(CSG_TIN_Triangle *pTriangle) { TNode t[3]; for(int iNode=0; iNode<3; iNode++) { CSG_TIN_Node *pNode = pTriangle->Get_Node(iNode); t[iNode].x = pNode->Get_Point().x; t[iNode].y = pNode->Get_Point().y; t[iNode].z = pNode->asDouble(m_zField); if( m_bRGB ) { t[iNode].c = pNode->Get_Point().x; t[iNode].d = pNode->Get_Point().y; } else { t[iNode].c = pNode->asDouble(m_cField); } _Get_Projection(t[iNode]); } //----------------------------------------------------- double dim; switch( m_Shading ) { case 0: default: dim = -1.0; break; case 1: { double s, a, A, B, C; A = t[0].z * (t[1].x - t[2].x) + t[1].z * (t[2].x - t[0].x) + t[2].z * (t[0].x - t[1].x); B = t[0].y * (t[1].z - t[2].z) + t[1].y * (t[2].z - t[0].z) + t[2].y * (t[0].z - t[1].z); C = t[0].x * (t[1].y - t[2].y) + t[1].x * (t[2].y - t[0].y) + t[2].x * (t[0].y - t[1].y); if( C != 0.0 ) { A = - A / C; B = - B / C; s = atan(sqrt(A*A + B*B)); if( A != 0.0 ) a = M_PI_180 + atan2(B, A); else a = B > 0.0 ? M_PI_270 : (B < 0.0 ? M_PI_090 : -1.0); } s = M_PI_090 - s; dim = (acos(sin(s) * sin(m_Light_Hgt) + cos(s) * cos(m_Light_Hgt) * cos(a - m_Light_Dir))) / M_PI_090; } break; case 2: { double s, a; pTriangle->Get_Gradient(m_zField, s, a); s = M_PI_090 - s; dim = (acos(sin(s) * sin(m_Light_Hgt) + cos(s) * cos(m_Light_Hgt) * cos(a - m_Light_Dir))) / M_PI_090; } break; } //----------------------------------------------------- if( m_Style == 0 || m_Style == 1 ) { _Draw_Triangle(t, dim); } if( m_Style == 0 || m_Style == 2 ) { _Draw_Line(t[0], t[1], m_cWire); _Draw_Line(t[1], t[2], m_cWire); _Draw_Line(t[2], t[0], m_cWire); } if( 0 ) { _Draw_Point(t[0].x, t[0].y, t[0].z, SG_GET_RGB(111, 111, 111), 5); _Draw_Point(t[1].x, t[1].y, t[1].z, SG_GET_RGB(111, 111, 111), 5); _Draw_Point(t[2].x, t[2].y, t[2].z, SG_GET_RGB(111, 111, 111), 5); } } //--------------------------------------------------------- inline void CTIN_View_Control::_Draw_Triangle(TNode p[3], double dim) { if( p[0].z < 0.0 || p[1].z < 0.0 || p[2].z < 0.0 ) return; //----------------------------------------------------- if( p[1].y < p[0].y ) { TNode pp = p[1]; p[1] = p[0]; p[0] = pp; } if( p[2].y < p[0].y ) { TNode pp = p[2]; p[2] = p[0]; p[0] = pp; } if( p[2].y < p[1].y ) { TNode pp = p[2]; p[2] = p[1]; p[1] = pp; } //----------------------------------------------------- TSG_Rect r; r.yMin = p[0].y; r.yMax = p[2].y; r.xMin = p[0].x < p[1].x ? (p[0].x < p[2].x ? p[0].x : p[2].x) : (p[1].x < p[2].x ? p[1].x : p[2].x); r.xMax = p[0].x > p[1].x ? (p[0].x > p[2].x ? p[0].x : p[2].x) : (p[1].x > p[2].x ? p[1].x : p[2].x); if( r.yMin >= r.yMax || r.xMin >= r.xMax ) { return; // no area } if( (r.yMin < 0.0 && r.yMax < 0.0) || (r.yMin >= m_Image.GetHeight() && r.yMax >= m_Image.GetHeight()) || (r.xMin < 0.0 && r.xMax < 0.0) || (r.xMin >= m_Image.GetWidth () && r.xMax >= m_Image.GetWidth ()) ) { return; // completely outside grid } //----------------------------------------------------- TNode d[3]; if( (d[0].y = p[2].y - p[0].y) > 0.0 ) { d[0].x = (p[2].x - p[0].x) / d[0].y; d[0].z = (p[2].z - p[0].z) / d[0].y; d[0].c = (p[2].c - p[0].c) / d[0].y; d[0].d = (p[2].d - p[0].d) / d[0].y; } if( (d[1].y = p[1].y - p[0].y) > 0.0 ) { d[1].x = (p[1].x - p[0].x) / d[1].y; d[1].z = (p[1].z - p[0].z) / d[1].y; d[1].c = (p[1].c - p[0].c) / d[1].y; d[1].d = (p[1].d - p[0].d) / d[1].y; } if( (d[2].y = p[2].y - p[1].y) > 0.0 ) { d[2].x = (p[2].x - p[1].x) / d[2].y; d[2].z = (p[2].z - p[1].z) / d[2].y; d[2].c = (p[2].c - p[1].c) / d[2].y; d[2].d = (p[2].d - p[1].d) / d[2].y; } //----------------------------------------------------- int ay = (int)r.yMin; if( ay < 0 ) ay = 0; if( ay < r.yMin ) ay++; int by = (int)r.yMax; if( by >= m_Image.GetHeight() ) by = m_Image.GetHeight() - 1; for(int y=ay; y<=by; y++) { if( y <= p[1].y && d[1].y > 0.0 ) { _Draw_Triangle_Line(y, p[0].x + (y - p[0].y) * d[0].x, p[0].x + (y - p[0].y) * d[1].x, p[0].z + (y - p[0].y) * d[0].z, p[0].z + (y - p[0].y) * d[1].z, p[0].c + (y - p[0].y) * d[0].c, p[0].c + (y - p[0].y) * d[1].c, p[0].d + (y - p[0].y) * d[0].d, p[0].d + (y - p[0].y) * d[1].d, dim ); } else if( d[2].y > 0.0 ) { _Draw_Triangle_Line(y, p[0].x + (y - p[0].y) * d[0].x, p[1].x + (y - p[1].y) * d[2].x, p[0].z + (y - p[0].y) * d[0].z, p[1].z + (y - p[1].y) * d[2].z, p[0].c + (y - p[0].y) * d[0].c, p[1].c + (y - p[1].y) * d[2].c, p[0].d + (y - p[0].y) * d[0].d, p[1].d + (y - p[1].y) * d[2].d, dim ); } } } //--------------------------------------------------------- inline void CTIN_View_Control::_Draw_Triangle_Line(int y, double xa, double xb, double za, double zb, double ca, double cb, double da, double db, double dim) { if( xb < xa ) { double d; d = xa; xa = xb; xb = d; d = za; za = zb; zb = d; d = ca; ca = cb; cb = d; d = da; da = db; db = d; } if( xb > xa ) { double dz = (zb - za) / (xb - xa); double dc = (cb - ca) / (xb - xa); double dd = (db - da) / (xb - xa); int ax = (int)xa; if( ax < 0 ) ax = 0; if( ax < xa ) ax++; int bx = (int)xb; if( bx >= m_Image.GetWidth() ) bx = m_Image.GetWidth() - 1; for(int x=ax; x<=bx; x++) { double z = za + dz * (x - xa); double c = ca + dc * (x - xa); double d = da + dd * (x - xa); if( m_bRGB ) { if( m_pRGB->Get_Value(c, d, c, m_Interpolation, false, true) ) { _Draw_Pixel(x, y, z, _Dim_Color(c, dim)); } } else { _Draw_Pixel(x, y, z, _Get_Color(c, dim)); } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CTIN_View_Control::_Draw_Background(void) { BYTE r, g, b, *pRGB; int i, n, color; color = m_Settings("BGCOLOR")->asColor(); if( m_bStereo ) { color = (int)((SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3.0); color = SG_GET_RGB(color, color, color); } r = SG_GET_R(color); g = SG_GET_G(color); b = SG_GET_B(color); n = m_Image.GetWidth() * m_Image.GetHeight(); for(i=0, pRGB=m_Image.GetData(); iasColor(); color = SG_GET_RGB(SG_GET_R(color) + 128, SG_GET_G(color) + 128, SG_GET_B(color) + 128); for(int i=0; i<2; i++) { p[i][0].x = r.Get_XMin(); p[i][0].y = r.Get_YMin(); p[i][1].x = r.Get_XMax(); p[i][1].y = r.Get_YMin(); p[i][2].x = r.Get_XMax(); p[i][2].y = r.Get_YMax(); p[i][3].x = r.Get_XMin(); p[i][3].y = r.Get_YMax(); p[i][0].z = p[i][1].z = p[i][2].z = p[i][3].z = i == 0 ? m_zStats.Get_Minimum() - buffer * m_zStats.Get_Range() / 100.0 : m_zStats.Get_Maximum() + buffer * m_zStats.Get_Range() / 100.0; for(int j=0; j<4; j++) { _Get_Projection(p[i][j]); } _Draw_Line(p[i][0], p[i][1], color); _Draw_Line(p[i][1], p[i][2], color); _Draw_Line(p[i][2], p[i][3], color); _Draw_Line(p[i][3], p[i][0], color); } _Draw_Line(p[0][0], p[1][0], color); _Draw_Line(p[0][1], p[1][1], color); _Draw_Line(p[0][2], p[1][2], color); _Draw_Line(p[0][3], p[1][3], color); } //--------------------------------------------------------- inline void CTIN_View_Control::_Draw_Pixel(int x, int y, double z, int color) { if( x >= 0 && x < m_Image.GetWidth() && y >= 0 && y < m_Image.GetHeight() && z < m_Image_zMax[y][x] ) { BYTE *RGB = m_Image.GetData() + 3 * (y * m_Image.GetWidth() + x); switch( m_Color_Mode ) { case COLOR_MODE_RGB: RGB[0] = SG_GET_R(color); RGB[1] = SG_GET_G(color); RGB[2] = SG_GET_B(color); break; case COLOR_MODE_RED: RGB[0] = (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3; break; case COLOR_MODE_BLUE: RGB[1] = RGB[2] = (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3; break; } m_Image_zMax[y][x] = z; } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline int CTIN_View_Control::_Dim_Color(int Color, double dim) { if( dim >= 0.0 ) { int r = (int)(dim * SG_GET_R(Color)); if( r < 0 ) r = 0; else if( r > 255 ) r = 255; int g = (int)(dim * SG_GET_G(Color)); if( g < 0 ) g = 0; else if( g > 255 ) g = 255; int b = (int)(dim * SG_GET_B(Color)); if( b < 0 ) b = 0; else if( b > 255 ) b = 255; Color = SG_GET_RGB(r, g, b); } return( Color ); } //--------------------------------------------------------- inline int CTIN_View_Control::_Get_Color(double value, double dim) { int Color = (int)(m_cScale * (value - m_cMin)); Color = m_pColors->Get_Color(Color < 0 ? 0 : (Color >= m_pColors->Get_Count() ? m_pColors->Get_Count() - 1 : Color)); return( _Dim_Color(Color, dim) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void CTIN_View_Control::_Get_Projection(TNode &p) { TSG_Point_Z q; p.x = (p.x - r_xc) * r_Scale; p.y = (p.y - r_yc) * r_Scale; p.z = (p.z - r_zc) * r_Scale_z; double a = (r_cos_y * p.z + r_sin_y * (r_sin_z * p.y + r_cos_z * p.x)); double b = (r_cos_z * p.y - r_sin_z * p.x); q.x = r_cos_y * (r_sin_z * p.y + r_cos_z * p.x) - r_sin_y * p.z; q.y = r_sin_x * a + r_cos_x * b; q.z = r_cos_x * a - r_sin_x * b; q.x += m_xShift; q.y += m_yShift; q.z += m_zShift; if( m_bCentral ) { q.x *= m_dCentral / q.z; q.y *= m_dCentral / q.z; } else { double z = m_dCentral / m_zShift; q.x *= z; q.y *= z; // q.z = -q.z; } p.x = q.x + 0.5 * m_Image.GetWidth (); p.y = q.y + 0.5 * m_Image.GetHeight(); p.z = q.z; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_viewer/tin_view_control.h000066400000000000000000000162211224124640700243110ustar00rootroot00000000000000/********************************************************** * Version $Id: tin_view_control.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // tin_viewer // // // //-------------------------------------------------------// // // // tin_view_control.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__tin_view_control_H #define HEADER_INCLUDED__tin_view_control_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { COLOR_MODE_RGB, COLOR_MODE_RED, COLOR_MODE_BLUE }; //--------------------------------------------------------- typedef struct SNode { double x, y, z, c, d; } TNode; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTIN_View_Control : public wxPanel { public: CTIN_View_Control(wxWindow *pParent, CSG_TIN *pTIN, int Field_Z, int Field_Color, CSG_Parameters &Settings, CSG_Grid *pRGB); virtual ~CTIN_View_Control(void); bool m_bCentral, m_bStereo, m_bFrame, m_bRGB; int m_zField, m_cField, m_Style, m_Shading; double m_xRotate, m_yRotate, m_zRotate, m_xShift, m_yShift, m_zShift, m_dCentral, m_Light_Hgt, m_Light_Dir; void Update_View (void); void Update_Extent (void); void On_Size (wxSizeEvent &event); void On_Paint (wxPaintEvent &event); void On_Key_Down (wxKeyEvent &event); void On_Mouse_LDown (wxMouseEvent &event); void On_Mouse_LUp (wxMouseEvent &event); void On_Mouse_RDown (wxMouseEvent &event); void On_Mouse_RUp (wxMouseEvent &event); void On_Mouse_MDown (wxMouseEvent &event); void On_Mouse_MUp (wxMouseEvent &event); void On_Mouse_Motion (wxMouseEvent &event); void On_Mouse_Wheel (wxMouseEvent &event); private: int m_Color_Mode, m_Size_Def, m_cWire, m_Interpolation; double m_xDown, m_yDown, m_cMin, m_cScale, m_Size_Scale; double r_sin_x, r_sin_y, r_sin_z, r_cos_x, r_cos_y, r_cos_z, r_xc, r_yc, r_zc, r_Scale, r_Scale_z; CSG_Rect m_Extent; CSG_Matrix m_Image_zMax; CSG_Simple_Statistics m_zStats, m_cStats; CSG_Parameters *m_pSettings; CSG_Colors *m_pColors; CSG_Grid *m_pRGB; CSG_TIN *m_pTIN; wxPoint m_Mouse_Down; wxImage m_Image; void _Set_Size (void); bool _Draw_Image (void); void _Draw_Point (int iPoint); void _Draw_Point (int x, int y, double z, int color, int Size); void _Draw_Line (TNode a, TNode b, int Color); void _Draw_Triangle (CSG_TIN_Triangle *pTriangle); void _Draw_Triangle (TNode p[3], double dim); void _Draw_Triangle_Line (int y, double xa, double xb, double za, double zb, double ca, double cb, double da, double db, double dim); void _Draw_Background (void); void _Draw_Frame (void); void _Draw_Pixel (int x, int y, double z, int color); int _Dim_Color (int Color, double dim); int _Get_Color (double value, double dim = -1.0); void _Get_Projection (TNode &p); DECLARE_EVENT_TABLE() }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__tin_view_control_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_viewer/tin_view_dialog.cpp000066400000000000000000000240421224124640700244230ustar00rootroot00000000000000/********************************************************** * Version $Id: tin_view_dialog.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // tin_viewer // // // //-------------------------------------------------------// // // // tin_view_dialog.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "tin_view_control.h" #include "tin_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- BEGIN_EVENT_TABLE(CTIN_View_Dialog, CSGDI_Dialog) EVT_MOUSEWHEEL (CTIN_View_Dialog::On_Mouse_Wheel) EVT_BUTTON (wxID_ANY , CTIN_View_Dialog::On_Button) EVT_CHECKBOX (wxID_ANY , CTIN_View_Dialog::On_Update_Control) EVT_TEXT_ENTER (wxID_ANY , CTIN_View_Dialog::On_Update_Control) EVT_SLIDER (wxID_ANY , CTIN_View_Dialog::On_Update_Control) EVT_CHOICE (wxID_ANY , CTIN_View_Dialog::On_Update_Choices) END_EVENT_TABLE() //--------------------------------------------------------- CTIN_View_Dialog::CTIN_View_Dialog(CSG_TIN *pTIN, int Field_Z, int Field_Color, CSG_Grid *pRGB) : CSGDI_Dialog(_TL("TIN Viewer"), SGDI_DLG_STYLE_START_MAXIMISED) { SetWindowStyle(wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE); //----------------------------------------------------- m_Settings.Create(NULL, _TL("TIN Viewer Settings"), _TL("")); m_pView = new CTIN_View_Control (this, pTIN, Field_Z, Field_Color, m_Settings, pRGB); //----------------------------------------------------- wxArrayString Attributes, Styles, Shadings; for(int i=0; iGet_Field_Count(); i++) { Attributes.Add(pTIN->Get_Field_Name(i)); } Styles .Add(_TL("faces and wire")); Styles .Add(_TL("faces")); Styles .Add(_TL("wire")); Shadings.Add(_TL("none")); Shadings.Add(_TL("shading")); Shadings.Add(_TL("shading (fixed light source)")); //----------------------------------------------------- Add_Button(_TL("Close"), wxID_OK); m_pBtn_Prop = Add_Button (_TL("Advanced Settings") , wxID_ANY); Add_Spacer(); m_pField_Z = Add_Choice (_TL("Z Attribute") , Attributes, m_pView->m_zField); m_pField_Color = Add_Choice (_TL("Color Attribute") , Attributes, m_pView->m_cField); m_pStyle = Add_Choice (_TL("Draw Style") , Styles , m_pView->m_Style); m_pShading = Add_Choice (_TL("Shading") , Shadings , m_pView->m_Shading); Add_Spacer(); m_pCheck_Central = Add_CheckBox (_TL("Central Projection") , m_pView->m_bCentral); m_pCheck_Stereo = Add_CheckBox (_TL("Anaglyph") , m_pView->m_bStereo); m_pCheck_Frame = Add_CheckBox (_TL("Bounding Box") , m_pView->m_bFrame); m_pCheck_RGB = pRGB == NULL ? NULL : Add_CheckBox (_TL("Drape Map") , m_pView->m_bRGB); Add_Spacer(); m_pSlide_xRotate = Add_Slider (_TL("X-Rotation") , m_pView->m_xRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_yRotate = Add_Slider (_TL("Y-Rotation") , m_pView->m_yRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_zRotate = Add_Slider (_TL("Z-Rotation") , m_pView->m_zRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_Central = Add_Slider (_TL("Eye Distance") , m_pView->m_dCentral, 1.0, 2000.0); m_pSlide_Light_Hgt = Add_Slider (_TL("Light Source A") , m_pView->m_Light_Hgt, -M_PI_090, M_PI_090); m_pSlide_Light_Dir = Add_Slider (_TL("Light Source B") , m_pView->m_Light_Dir, -M_PI_360, M_PI_360); // Add_Spacer(); // m_pParameters = Add_TextCtrl (_TL("Function Parameters"), wxTE_MULTILINE|wxTE_READONLY); Add_Output(m_pView); } //--------------------------------------------------------- void CTIN_View_Dialog::On_Mouse_Wheel(wxMouseEvent &event) { m_pView->On_Mouse_Wheel(event); } //--------------------------------------------------------- void CTIN_View_Dialog::On_Update_Control(wxCommandEvent &event) { if( event.GetEventObject() == m_pCheck_Central ) { m_pView->m_bCentral = m_pCheck_Central ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pCheck_Stereo ) { m_pView->m_bStereo = m_pCheck_Stereo ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pCheck_Frame ) { m_pView->m_bFrame = m_pCheck_Frame ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pCheck_RGB ) { m_pView->m_bRGB = m_pCheck_RGB ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pSlide_xRotate ) { m_pView->m_xRotate = m_pSlide_xRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_yRotate ) { m_pView->m_yRotate = m_pSlide_yRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_zRotate ) { m_pView->m_zRotate = m_pSlide_zRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_Central ) { m_pView->m_dCentral = m_pSlide_Central ->Get_Value(); } else if( event.GetEventObject() == m_pSlide_Light_Dir ) { m_pView->m_Light_Dir = m_pSlide_Light_Dir->Get_Value(); } else if( event.GetEventObject() == m_pSlide_Light_Hgt ) { m_pView->m_Light_Hgt = m_pSlide_Light_Hgt->Get_Value(); } else { return; } m_pView->Update_View(); } //--------------------------------------------------------- void CTIN_View_Dialog::On_Update_Choices(wxCommandEvent &event) { if( event.GetEventObject() == m_pField_Z ) { m_pView ->m_zField = m_pField_Z ->GetSelection(); m_pView ->Update_View(); } else if( event.GetEventObject() == m_pField_Color ) { m_Settings("C_RANGE")->asRange()->Set_Range(0.0, 0.0); m_pView ->m_cField = m_pField_Color->GetSelection(); m_pView ->Update_Extent(); } else if( event.GetEventObject() == m_pStyle ) { m_pView ->m_Style = m_pStyle->GetSelection(); m_pView ->Update_View(); } else if( event.GetEventObject() == m_pShading ) { m_pView ->m_Shading = m_pShading->GetSelection(); m_pView ->Update_View(); } else { return; } } //--------------------------------------------------------- void CTIN_View_Dialog::On_Button(wxCommandEvent &event) { if( event.GetEventObject() == m_pBtn_Prop ) { if( SG_UI_Dlg_Parameters(&m_Settings, m_Settings.Get_Name()) ) { m_pView ->Update_View(); } } else { event.Skip(); } } //--------------------------------------------------------- void CTIN_View_Dialog::Update_Rotation(void) { double d; d = fmod(M_RAD_TO_DEG * m_pView->m_xRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_xRotate->Set_Value(d); d = fmod(M_RAD_TO_DEG * m_pView->m_yRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_yRotate->Set_Value(d); d = fmod(M_RAD_TO_DEG * m_pView->m_zRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_zRotate->Set_Value(d); m_pCheck_Stereo ->SetValue(m_pView->m_bStereo); m_pCheck_Frame ->SetValue(m_pView->m_bFrame); if( m_pCheck_RGB ) { m_pCheck_RGB->SetValue(m_pView->m_bRGB); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_viewer/tin_view_dialog.h000066400000000000000000000124031224124640700240660ustar00rootroot00000000000000/********************************************************** * Version $Id: tin_view_dialog.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // tin_viewer // // // //-------------------------------------------------------// // // // tin_view_dialog.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__tin_view_dialog_H #define HEADER_INCLUDED__tin_view_dialog_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTIN_View_Dialog : public CSGDI_Dialog { public: CTIN_View_Dialog(CSG_TIN *pTIN, int Field_Z, int Field_Color, CSG_Grid *pRGB); void Update_Rotation (void); private: wxButton *m_pBtn_Prop; wxCheckBox *m_pCheck_Central, *m_pCheck_Stereo, *m_pCheck_Frame, *m_pCheck_RGB; wxChoice *m_pField_Color, *m_pField_Z, *m_pStyle, *m_pShading; wxTextCtrl *m_pFormula, *m_pParameters; CSGDI_Slider *m_pSlide_xRotate, *m_pSlide_yRotate, *m_pSlide_zRotate, *m_pSlide_Central, *m_pSlide_Light_Hgt, *m_pSlide_Light_Dir; class CTIN_View_Control *m_pView; CSG_Parameters m_Settings; void On_Update_Control (wxCommandEvent &event); void On_Update_Choices (wxCommandEvent &event); void On_Button (wxCommandEvent &event); void On_Mouse_Wheel (wxMouseEvent &event); DECLARE_EVENT_TABLE() }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__tin_view_dialog_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_viewer/tin_view_module.cpp000066400000000000000000000126711224124640700244560ustar00rootroot00000000000000/********************************************************** * Version $Id: points_view_module.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // tin_view_module // // // //-------------------------------------------------------// // // // tin_view_module.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute for Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "tin_view_module.h" #include "tin_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTIN_View_Module::CTIN_View_Module(void) { //----------------------------------------------------- Set_Name (_TL("TIN Viewer")); Set_Author (SG_T("O. Conrad (c) 2011")); Set_Description (_TW( "This module is a 3D viewer for SAGA TINs. Amongst others, " "the viewer supports attribute based coloring, a map view to control " "the area-of-interest, point size scaling based on distance, level " "of detail control and an anaglyph modus (to use with red/blue or " "red/green glasses).\n\n" )); //----------------------------------------------------- CSG_Parameter *pNode = Parameters.Add_TIN( NULL , "TIN" , _TL("TIN"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "HEIGHT" , _TL("Elevation"), _TL("") ); Parameters.Add_Table_Field( pNode , "COLOR" , _TL("Color"), _TL("") ); Parameters.Add_Grid( NULL , "RGB" , _TL("Map"), _TL("rgb coded raster map to be draped"), PARAMETER_INPUT_OPTIONAL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTIN_View_Module::On_Execute(void) { if( !SG_UI_Get_Window_Main() ) { Message_Add(_TL("point cloud viewer can only be run from graphical user interface")); return( false ); } CSG_TIN *pTIN = Parameters("TIN")->asTIN(); if( pTIN->Get_Count() <= 0 ) { Message_Add(_TL("point cloud viewer will not be started, because point cloud has no points")); return( false ); } CTIN_View_Dialog dlg(pTIN, Parameters("HEIGHT")->asInt(), Parameters("COLOR")->asInt(), Parameters("RGB")->asGrid()); dlg.ShowModal(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules/tin/tin_viewer/tin_view_module.h000066400000000000000000000100671224124640700241200ustar00rootroot00000000000000/********************************************************** * Version $Id: points_view_module.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // tin_viewer // // // //-------------------------------------------------------// // // // tin_view_module.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__tin_view_module_H #define HEADER_INCLUDED__tin_view_module_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTIN_View_Module : public CSG_Module { public: CTIN_View_Module(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__points_view_module_H saga-2.1.0+dfsg/src/modules_contrib/000077500000000000000000000000001224124640700173255ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_contrib/Makefile.am000066400000000000000000000000651224124640700213620ustar00rootroot00000000000000SUBDIRS = contrib_a_perego contrib_s_liersch garden saga-2.1.0+dfsg/src/modules_contrib/Makefile.in000066400000000000000000000424751224124640700214060ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_contrib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = contrib_a_perego contrib_s_liersch garden all: all-recursive .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) --gnu src/modules_contrib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_contrib/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/000077500000000000000000000000001224124640700226265ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/Makefile.am000066400000000000000000000000341224124640700246570ustar00rootroot00000000000000SUBDIRS = contrib_a_perego saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/Makefile.in000066400000000000000000000425271224124640700247050ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_contrib/contrib_a_perego DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = contrib_a_perego all: all-recursive .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) --gnu src/modules_contrib/contrib_a_perego/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_contrib/contrib_a_perego/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/000077500000000000000000000000001224124640700261275ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/A1WiTh.cpp000066400000000000000000000101511224124640700276660ustar00rootroot00000000000000/********************************************************** * Version $Id: A1WiTh.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // A1WiTh // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // A1WiTh.cpp // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "A1WiTh.h" //--------------------------------------------------------- CA1WiTh::CA1WiTh(void) { // 1. Info... Set_Name(_TL("Average With Thereshold 1")); Set_Author(_TL("Alessandro Perego")); Set_Description(_TL("Average With Thereshold for Grids calculates average in X and Y distances unsing only the values that differ form central pixel less than a specified threshold. It's useful to remove noise whit a known maximum reducing the loss of informations")); // 2. Parameters... Parameters.Add_Grid(NULL, "INPUT", _TL("Input"), _TL("This must be your input data of type grid."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RESULT", _TL("AWT Grid"), _TL("New grid filtered with the A1WiTh module"), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "RX", _TL("Radius X"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true); Parameters.Add_Value(NULL, "RY", _TL("Radius Y"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true); Parameters.Add_Value(NULL, "THRESH", _TL("Threshold"), _TL("The values in the specified radius is used in the average calculation only if its difference with the central value is lesser or equal to this threshold."), PARAMETER_TYPE_Double, 2.0); } //--------------------------------------------------------- CA1WiTh::~CA1WiTh(void) {} //--------------------------------------------------------- bool CA1WiTh::On_Execute(void) { int x, y, Rx, Ry, ax, ay, bx, by, ix, iy, n; double Thresh, Diff, Sum, c, d; CSG_Grid *pInput, *pResult; pInput = Parameters("INPUT")->asGrid(); pResult = Parameters("RESULT")->asGrid(); Rx = Parameters("RX")->asInt(); Ry = Parameters("RY")->asInt(); Thresh = Parameters("THRESH")->asDouble(); //----------------------------------------------------- for(y=0; y= Get_NX() ){ bx = Get_NX() - 1; } if( ay < 0 ) { ay = 0; } if( by >= Get_NY() ){ by = Get_NY() - 1; } //----------------------------------------------------- for(iy=ay; iy<=by; iy++) { for(ix=ax; ix<=bx; ix++) { c = pInput->asDouble(ix, iy); d = pInput->asDouble(x, y); Diff = c - d; if( Diff < 0) { Diff = 0 - Diff; } if( Diff <= Thresh ) { Sum += pInput->asDouble(ix, iy); n++; } } } //------------------------------------------------------ if( n > 0 ) { pResult->Set_Value(x, y, Sum / n); } } } return( true ); } saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/A1WiTh.h000066400000000000000000000044441224124640700273430ustar00rootroot00000000000000/********************************************************** * Version $Id: A1WiTh.h 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // A1WiTh // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // A1WiTh.h // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__A1WiTh_H #define HEADER_INCLUDED__A1WiTh_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CA1WiTh : public CSG_Module_Grid { public: ////// public members and functions: ////////////// CA1WiTh(void); // constructor virtual ~CA1WiTh(void); // destructor virtual CSG_String Get_MenuPath (void) { return( _TL("Averages") ); } protected: /// protected members and functions: /////////// virtual bool On_Execute(void); // always override this function private: ///// private members and functions: ///////////// }; //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__A1WiTh_H saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/A2WiTh.cpp000066400000000000000000000105241224124640700276730ustar00rootroot00000000000000/********************************************************** * Version $Id: A2WiTh.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // A2WiTh // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // A2WiTh.cpp // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "A2WiTh.h" //--------------------------------------------------------- CA2WiTh::CA2WiTh(void) { // 1. Info... Set_Name(_TL("Average With Thereshold 2")); Set_Author(_TL("Alessandro Perego")); Set_Description(_TL("Average 2 With Thereshold for Grids calculates average in X and Y distances unsing only the values that differ form central pixel less than a specified threshold. Each value has a weight which is inversely proportional to the distance (method 1).")); // 2. Parameters... Parameters.Add_Grid(NULL, "INPUT", _TL("Input"), _TL("This must be your input data of type grid."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RESULT", _TL("AWT Grid"), _TL("New grid filtered with the A2WiTh module"), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "RX", _TL("Radius X"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true); Parameters.Add_Value(NULL, "RY", _TL("Radius Y"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true); Parameters.Add_Value(NULL, "THRESH", _TL("Threshold"), _TL("The values in the specified radius is used in the average calculation only if its difference with the central value is lesser or equal to this threshold."), PARAMETER_TYPE_Double, 2.0); } //--------------------------------------------------------- CA2WiTh::~CA2WiTh(void) {} //--------------------------------------------------------- bool CA2WiTh::On_Execute(void) { int x, y, Rx, Ry, ax, ay, bx, by, ix, iy, iv, iw, irv, irw, n; double Thresh, Diff, Sum, c, d, i; CSG_Grid *pInput, *pResult; pInput = Parameters("INPUT")->asGrid(); pResult = Parameters("RESULT")->asGrid(); Rx = Parameters("RX")->asInt(); Ry = Parameters("RY")->asInt(); Thresh = Parameters("THRESH")->asDouble(); //----------------------------------------------------- for(y=0; y= Get_NX() ) { bx = Get_NX() - 1; } if( (ay = y - Ry) < 0 ) { ay = 0; } if( (by = y + Ry) >= Get_NY() ) { by = Get_NY() - 1; } //----------------------------------------------------- for(iy=ay; iy<=by; iy++) { for(ix=ax; ix<=bx; ix++) { iv = x -ix; if( iv >= 0) { irv = Rx - iv + 1; } else { irv = Rx + iv + 1; } iw = y -iy; if( iw >= 0) { irw = Ry - iw + 1; } else { irw = Ry + iw + 1; } c = pInput->asDouble(ix, iy); d = pInput->asDouble(x, y); Diff = c - d; if( Diff < 0) { Diff = 0 - Diff; } if( Diff <= Thresh ) { i = pInput->asDouble(ix, iy); Sum += ( i *( irv + irw )); n += ( irv + irw ); } } } //------------------------------------------------------ if( n > 0 ) { pResult->Set_Value(x, y, Sum / n); } } } return( true ); } saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/A2WiTh.h000066400000000000000000000044441224124640700273440ustar00rootroot00000000000000/********************************************************** * Version $Id: A2WiTh.h 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // A2WiTh // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // A2WiTh.h // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__A2WiTh_H #define HEADER_INCLUDED__A2WiTh_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CA2WiTh : public CSG_Module_Grid { public: ////// public members and functions: ////////////// CA2WiTh(void); // constructor virtual ~CA2WiTh(void); // destructor virtual CSG_String Get_MenuPath (void) { return( _TL("Averages") ); } protected: /// protected members and functions: /////////// virtual bool On_Execute(void); // always override this function private: ///// private members and functions: ///////////// }; //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__A2WiTh_H saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/A3WiTh.cpp000066400000000000000000000105241224124640700276740ustar00rootroot00000000000000/********************************************************** * Version $Id: A3WiTh.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // A3WiTh // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // A3WiTh.cpp // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "A3WiTh.h" //--------------------------------------------------------- CA3WiTh::CA3WiTh(void) { // 1. Info... Set_Name(_TL("Average With Thereshold 3")); Set_Author(_TL("Alessandro Perego")); Set_Description(_TL("Average 3 With Thereshold for Grids calculates average in X and Y distances unsing only the values that differ form central pixel less than a specified threshold. Each value has a weight which is inversely proportional to the distance (method 2).")); // 2. Parameters... Parameters.Add_Grid(NULL, "INPUT", _TL("Input"), _TL("This must be your input data of type grid."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RESULT", _TL("AWT Grid"), _TL("New grid filtered with the A3WiTh module"), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "RX", _TL("Radius X"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true); Parameters.Add_Value(NULL, "RY", _TL("Radius Y"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true); Parameters.Add_Value(NULL, "THRESH", _TL("Threshold"), _TL("The values in the specified radius is used in the average calculation only if its difference with the central value is lesser or equal to this threshold."), PARAMETER_TYPE_Double, 2.0); } //--------------------------------------------------------- CA3WiTh::~CA3WiTh(void) {} //--------------------------------------------------------- bool CA3WiTh::On_Execute(void) { int x, y, Rx, Ry, ax, ay, bx, by, ix, iy, iv, iw, irv, irw, n; double Thresh, Diff, Sum, c, d, i; CSG_Grid *pInput, *pResult; pInput = Parameters("INPUT")->asGrid(); pResult = Parameters("RESULT")->asGrid(); Rx = Parameters("RX")->asInt(); Ry = Parameters("RY")->asInt(); Thresh = Parameters("THRESH")->asDouble(); //----------------------------------------------------- for(y=0; y= Get_NX() ) { bx = Get_NX() - 1; } if( (ay = y - Ry) < 0 ) { ay = 0; } if( (by = y + Ry) >= Get_NY() ) { by = Get_NY() - 1; } //----------------------------------------------------- for(iy=ay; iy<=by; iy++) { for(ix=ax; ix<=bx; ix++) { iv = x - ix; if( iv >= 0) { irv = Rx - iv + 1; } else { irv = Rx + iv + 1; } iw = y - iy; if( iw >= 0) { irw = Ry - iw + 1; } else { irw = Ry + iw + 1; } c = pInput->asDouble(ix, iy); d = pInput->asDouble(x, y); Diff = c - d; if( Diff < 0) { Diff = 0 - Diff; } if( Diff <= Thresh ) { i = pInput->asDouble(ix, iy); Sum += ( i * irv * irw ); n += ( irv * irw ); } } } //------------------------------------------------------ if( n > 0 ) { pResult->Set_Value(x, y, Sum / n); } } } return( true ); } saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/A3WiTh.h000066400000000000000000000044441224124640700273450ustar00rootroot00000000000000/********************************************************** * Version $Id: A3WiTh.h 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // A3WiTh // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // A3WiTh.h // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__A3WiTh_H #define HEADER_INCLUDED__A3WiTh_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CA3WiTh : public CSG_Module_Grid { public: ////// public members and functions: ////////////// CA3WiTh(void); // constructor virtual ~CA3WiTh(void); // destructor virtual CSG_String Get_MenuPath (void) { return( _TL("Averages") ); } protected: /// protected members and functions: /////////// virtual bool On_Execute(void); // always override this function private: ///// private members and functions: ///////////// }; //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__A3WiTh_H saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa1.cpp000066400000000000000000000076611224124640700300520ustar00rootroot00000000000000/********************************************************** * Version $Id: AvWiMa1.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // AvWiMa // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // AvWiMa1.cpp // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "AvWiMa1.h" //--------------------------------------------------------- CAvWiMa1::CAvWiMa1(void) { // 1. Info... Set_Name(_TL("Average With Mask 1")); Set_Author(_TL("Alessandro Perego")); Set_Description(_TL("Average With Mask 1 calculates average for cells specified by a mask grid. Cell excluded by the mask grid are NOT used in the average calculation.")); // 2. Parameters... Parameters.Add_Grid(NULL, "INPUT", _TL("Input"), _TL("This must be your input data of type grid."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "MASK", _TL("Mask Grid"), _TL("This grid indicates the cells you want calculate the average."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RESULT", _TL("AWM1 Grid"), _TL("New grid filtered with the AvWiMa1 module"), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "V", _TL("Mask value"), _TL("Value of right cells in the Mask Grid"), PARAMETER_TYPE_Double, 1.0); Parameters.Add_Value(NULL, "RX", _TL("Radius X"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true); Parameters.Add_Value(NULL, "RY", _TL("Radius Y"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true); } //--------------------------------------------------------- CAvWiMa1::~CAvWiMa1(void) {} //--------------------------------------------------------- bool CAvWiMa1::On_Execute(void) { int x, y, Rx, Ry, ax, ay, bx, by, ix, iy, n; double Sum, m, im, v; CSG_Grid *pInput, *pMask, *pResult; pInput = Parameters("INPUT")->asGrid(); pMask = Parameters("MASK")->asGrid(); pResult = Parameters("RESULT")->asGrid(); v = Parameters("V")->asDouble(); Rx = Parameters("RX")->asInt(); Ry = Parameters("RY")->asInt(); //----------------------------------------------------- for(y=0; yasDouble(x, y); if( m == v) { Sum = 0.0; n = 0; ax = x - Rx; bx = x + Ry; ay = y - Ry; by = y + Ry; if( ax < 0 ) { ax = 0; } if( bx >= Get_NX() ){ bx = Get_NX() - 1; } if( ay < 0 ) { ay = 0; } if( by >= Get_NY() ){ by = Get_NY() - 1; } for(iy=ay; iy<=by; iy++) { for(ix=ax; ix<=bx; ix++) { im = pMask->asDouble(ix, iy); if( im == v ) { Sum += pInput->asDouble(ix, iy); n++; } } } if( n > 0 ) { pResult->Set_Value(x, y, Sum/n); } } else { pResult->Set_Value(x, y, pInput->asDouble(x, y)); } } } return( true ); } saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa1.h000066400000000000000000000044531224124640700275130ustar00rootroot00000000000000/********************************************************** * Version $Id: AvWiMa1.h 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // AvWiMa // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // AvWiMa1.h // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__AvWiMa1_H #define HEADER_INCLUDED__AvWiMa1_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CAvWiMa1 : public CSG_Module_Grid { public: ////// public members and functions: ////////////// CAvWiMa1(void); // constructor virtual ~CAvWiMa1(void); // destructor virtual CSG_String Get_MenuPath (void) { return( _TL("Averages") ); } protected: /// protected members and functions: /////////// virtual bool On_Execute(void); // always override this function private: ///// private members and functions: ///////////// }; //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__AvWiMa1_H saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa2.cpp000066400000000000000000000075701224124640700300520ustar00rootroot00000000000000/********************************************************** * Version $Id: AvWiMa2.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // AvWiMa // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // AvWiMa2.cpp // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "AvWiMa2.h" //--------------------------------------------------------- CAvWiMa2::CAvWiMa2(void) { // 1. Info... Set_Name(_TL("Average With Mask 2")); Set_Author(_TL("Alessandro Perego")); Set_Description(_TL("Average With Mask 2 calculates average for cells specified by a mask grid. However cell excluded by the mask grid are used in the average calculation for right pixels.")); // 2. Parameters... Parameters.Add_Grid(NULL, "INPUT", _TL("Input"), _TL("This must be your input data of type grid."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "MASK", _TL("Mask Grid"), _TL("This grid indicates the cells you want calculate the average."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RESULT", _TL("AWM2 Grid"), _TL("New grid filtered with the AvWiMa2 module"), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "V", _TL("Mask value"), _TL("Value of right cells in the Mask Grid"), PARAMETER_TYPE_Double, 1.0); Parameters.Add_Value(NULL, "RX", _TL("Radius X"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true); Parameters.Add_Value(NULL, "RY", _TL("Radius Y"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true); } //--------------------------------------------------------- CAvWiMa2::~CAvWiMa2(void) {} //--------------------------------------------------------- bool CAvWiMa2::On_Execute(void) { int x, y, Rx, Ry, ax, ay, bx, by, ix, iy, n; double Sum, m, v; CSG_Grid *pInput, *pMask, *pResult; pInput = Parameters("INPUT")->asGrid(); pMask = Parameters("MASK")->asGrid(); pResult = Parameters("RESULT")->asGrid(); v = Parameters("V")->asDouble(); Rx = Parameters("RX")->asInt(); Ry = Parameters("RY")->asInt(); //----------------------------------------------------- for(y=0; yasDouble(x, y); if( m == v) { Sum = 0.0; n = 0; ax = x - Rx; bx = x + Ry; ay = y - Ry; by = y + Ry; if( ax < 0 ) { ax = 0; } if( bx >= Get_NX() ){ bx = Get_NX() - 1; } if( ay < 0 ) { ay = 0; } if( by >= Get_NY() ){ by = Get_NY() - 1; } for(iy=ay; iy<=by; iy++) { for(ix=ax; ix<=bx; ix++) { Sum += pInput->asDouble(ix, iy); n++; } } if( n > 0 ) { pResult->Set_Value(x, y, Sum/n); } } else { pResult->Set_Value(x, y, pInput->asDouble(x, y)); } } } return( true ); } saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/AvWiMa2.h000066400000000000000000000044531224124640700275140ustar00rootroot00000000000000/********************************************************** * Version $Id: AvWiMa2.h 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // AvWiMa // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // AvWiMa2.h // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__AvWiMa2_H #define HEADER_INCLUDED__AvWiMa2_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CAvWiMa2 : public CSG_Module_Grid { public: ////// public members and functions: ////////////// CAvWiMa2(void); // constructor virtual ~CAvWiMa2(void); // destructor virtual CSG_String Get_MenuPath (void) { return( _TL("Averages") ); } protected: /// protected members and functions: /////////// virtual bool On_Execute(void); // always override this function private: ///// private members and functions: ///////////// }; //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__AvWiMa2_H saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.cpp000066400000000000000000000071611224124640700312320ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // contrib_a_perego // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Grid - Filter (Perego 2009)") ); case MLB_INFO_Author: return( _TL("Alessandro Perego") ); case MLB_INFO_Description: return( _TW( "Contributions from Alessandro Perego. Go to " "" "www.webalice.it/alper78/saga_mod for further information." )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Grid|Filter") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "A1WiTh.h" #include "A2WiTh.h" #include "A3WiTh.h" #include "AvWiMa1.h" #include "AvWiMa2.h" #include "destriping1.h" #include "destriping2.h" #include "directional1.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CA1WiTh ); case 1: return( new CA2WiTh ); case 2: return( new CA3WiTh ); case 3: return( new CAvWiMa1 ); case 4: return( new CAvWiMa2 ); case 5: return( new Cdestriping1 ); case 6: return( new Cdestriping2 ); case 7: return( new Cdirectional1 ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/MLB_Interface.h000066400000000000000000000021541224124640700306740ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__contrib_a_perego_H #define HEADER_INCLUDED__contrib_a_perego_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef contrib_a_perego_EXPORTS #define contrib_a_perego_EXPORT _SAGA_DLL_EXPORT #else #define contrib_a_perego_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__contrib_a_perego_H saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile.am000066400000000000000000000014531224124640700301660ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libcontrib_a_perego.la libcontrib_a_perego_la_SOURCES =\ A1WiTh.cpp\ A2WiTh.cpp\ A3WiTh.cpp\ AvWiMa1.cpp\ AvWiMa2.cpp\ destriping1.cpp\ destriping2.cpp\ directional1.cpp\ MLB_Interface.cpp\ A1WiTh.h\ A2WiTh.h\ A3WiTh.h\ AvWiMa1.h\ AvWiMa2.h\ destriping1.h\ destriping2.h\ directional1.h\ MLB_Interface.h libcontrib_a_perego_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile.in000066400000000000000000000460101224124640700301750ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_contrib/contrib_a_perego/contrib_a_perego DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libcontrib_a_perego_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libcontrib_a_perego_la_OBJECTS = A1WiTh.lo A2WiTh.lo A3WiTh.lo \ AvWiMa1.lo AvWiMa2.lo destriping1.lo destriping2.lo \ directional1.lo MLB_Interface.lo libcontrib_a_perego_la_OBJECTS = $(am_libcontrib_a_perego_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcontrib_a_perego_la_SOURCES) DIST_SOURCES = $(libcontrib_a_perego_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libcontrib_a_perego.la libcontrib_a_perego_la_SOURCES = \ A1WiTh.cpp\ A2WiTh.cpp\ A3WiTh.cpp\ AvWiMa1.cpp\ AvWiMa2.cpp\ destriping1.cpp\ destriping2.cpp\ directional1.cpp\ MLB_Interface.cpp\ A1WiTh.h\ A2WiTh.h\ A3WiTh.h\ AvWiMa1.h\ AvWiMa2.h\ destriping1.h\ destriping2.h\ directional1.h\ MLB_Interface.h libcontrib_a_perego_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_contrib/contrib_a_perego/contrib_a_perego/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcontrib_a_perego.la: $(libcontrib_a_perego_la_OBJECTS) $(libcontrib_a_perego_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libcontrib_a_perego_la_OBJECTS) $(libcontrib_a_perego_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/A1WiTh.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/A2WiTh.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/A3WiTh.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AvWiMa1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AvWiMa2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/destriping1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/destriping2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directional1.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping1.cpp000066400000000000000000000160021224124640700310630ustar00rootroot00000000000000/********************************************************** * Version $Id: destriping1.cpp 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // destriping // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // destriping1.cpp // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "destriping1.h" //--------------------------------------------------------- Cdestriping1::Cdestriping1(void) { // 1. Info... Set_Name(_TL("Destriping")); Set_Author(_TL("Alessandro Perego")); Set_Description(_TW( "Destriping filter removes straight parallel stripes in raster data. " "It uses two low-pass filters elongated in the stripes direction; " "the first one is 1 pixel unit wide while the second one is wide as the striping wavelength. " "Their difference is the striping error which is removed from the original data to obtain the destriped DEM. " "This method is equivalent to that proposed by Oimoen (2000). " "\n" "\nReferences:\n" "- Oimoen, M.J. (2000): An Effective Filter For Removal Of Production Artifacts. " "In U.S. Geological Survey 7.5-Minute Digital Elevation Models. " "Proceedings of the Fourteenth International Conference on Applied Geologic Remote Sensing, " "6-8 November, Las Vegas, NV.\n" "\n" "- Peregro, A. (2009): SRTM DEM destriping with SAGA GIS: consequences on drainage network extraction. " "online.\n" )); // 2. Parameters... Parameters.Add_Grid(NULL, "INPUT", _TL("Input"), _TL("This must be your input data of type grid."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RESULT3", _TL("Destriped Grid"), _TL("New grid filtered with the destriping1 module"), PARAMETER_OUTPUT); Parameters.Add_Grid(NULL, "RESULT1", _TL("Low-pass 1"), _TL("Step 1: low-pass of stripe"), PARAMETER_OUTPUT); Parameters.Add_Grid(NULL, "RESULT2", _TL("Low-pass 2"), _TL("Step 2: low-pass between stripe and its surruondings"), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "ANG", _TL("Angle (in degrees)"), _TL("0 is horizontal, 90 is vertical."), PARAMETER_TYPE_Double, 0.0); Parameters.Add_Value(NULL, "R", _TL("Radius"), _TL(""), PARAMETER_TYPE_Double, 10); Parameters.Add_Value(NULL, "D", _TL("Stripes distance"), _TL(""), PARAMETER_TYPE_Double, 2); } //--------------------------------------------------------- Cdestriping1::~Cdestriping1(void) {} //--------------------------------------------------------- bool Cdestriping1::On_Execute(void) { int x, y, r, dxmax, dymax, ix, ax, ay, bx, by, iy, iv, iw, n1, n2; double d, ang, a, si, si2, co, co2, Sum1, Sum2; CSG_Grid *pInput, *pRes1, *pRes2, *pRes3; pInput = Parameters("INPUT")->asGrid(); pRes1 = Parameters("RESULT1")->asGrid(); pRes2 = Parameters("RESULT2")->asGrid(); pRes3 = Parameters("RESULT3")->asGrid(); ang = Parameters("ANG")->asDouble(); r = Parameters("R")->asInt(); d = Parameters("D")->asDouble(); //----------------------------------------------------- a = ang * 6.283185307179586 / 360; si = sin(a); co = cos(a); si2 = si * si; co2 = co * co; dxmax = (int)((r*sqrt(co2))+(d/2*sqrt(si2))); dymax = (int)((r*sqrt(si2))+(d/2*sqrt(co2))); if(si2 >= co2) { double cosi, si05, dsi, iwcosi, ivmin1, ivmax1, ivmin2, ivmax2; cosi = co / si; si05 = sqrt( (0.5/si)*(0.5/si) ); dsi = sqrt( (d/2/si)*(d/2/si) ); for(y=0; y= Get_NX() ) { bx = Get_NX() - 1; } if( (ay = y - dymax) < 0 ) { ay = 0; } if( (by = y + dymax) >= Get_NY() ) { by = Get_NY() - 1; } //----------------------------------------------------- for(iy=ay; iy<=by; iy++) { iw = y - iy; iwcosi = iw * cosi; ivmin1 = iwcosi - si05; ivmax1 = iwcosi + si05; ivmin2 = iwcosi - dsi; ivmax2 = iwcosi + dsi; for(ix=ax; ix<=bx; ix++) { iv = x - ix; if( iv >= ivmin1 && iv <= ivmax1) { Sum1 += pInput->asDouble(ix, iy); n1++; } if( iv >= ivmin2 && iv <= ivmax2) { Sum2 += pInput->asDouble(ix, iy); n2++; } } } if( n1 > 0 && n2 > 0 ) { pRes1->Set_Value(x, y, Sum1/n1); pRes2->Set_Value(x, y, Sum2/n2); pRes3->Set_Value(x, y, (Sum1/n1)-(Sum2/n2)+pInput->asDouble(x, y)); } } } } if(si2 < co2) { double sico, co05, dco, ivsico, iwmin1, iwmax1, iwmin2, iwmax2; sico = si / co; co05 = sqrt( (0.5/co)*(0.5/co) ); dco = sqrt( (d/2/co)*(d/2/co) ); for(y=0; y= Get_NX() ) { bx = Get_NX() - 1; } if( (ay = y - dymax) < 0 ) { ay = 0; } if( (by = y + dymax) >= Get_NY() ) { by = Get_NY() - 1; } //----------------------------------------------------- for(ix=ax; ix<=bx; ix++) { iv = x - ix; ivsico = iv * sico; iwmin1 = ivsico - co05; iwmax1 = ivsico + co05; iwmin2 = ivsico - dco; iwmax2 = ivsico + dco; for(iy=ay; iy<=by; iy++) { iw = y - iy; if( iw >= iwmin1 && iw <= iwmax1) { Sum1 += pInput->asDouble(ix, iy); n1++; } if( iw >= iwmin2 && iw <= iwmax2) { Sum2 += pInput->asDouble(ix, iy); n2++; } } } if( n1 > 0 && n2 > 0 ) { pRes1->Set_Value(x, y, Sum1/n1); pRes2->Set_Value(x, y, Sum2/n2); pRes3->Set_Value(x, y, (Sum2/n2)-(Sum1/n1)+pInput->asDouble(x, y)); } } } } return( true ); } saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping1.h000066400000000000000000000043721224124640700305370ustar00rootroot00000000000000/********************************************************** * Version $Id: destriping1.h 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // destriping // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // destriping1.h // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__destriping1_H #define HEADER_INCLUDED__destriping1_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class Cdestriping1 : public CSG_Module_Grid { public: ////// public members and functions: ////////////// Cdestriping1(void); // constructor virtual ~Cdestriping1(void); // destructor protected: /// protected members and functions: /////////// virtual bool On_Execute(void); // always override this function private: ///// private members and functions: ///////////// }; //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__destriping1_H saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping2.cpp000066400000000000000000000212061224124640700310660ustar00rootroot00000000000000/********************************************************** * Version $Id: destriping2.cpp 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // destriping // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // destriping2.cpp // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "destriping2.h" //--------------------------------------------------------- Cdestriping2::Cdestriping2(void) { // 1. Info... Set_Name(_TL("Destriping with Mask")); Set_Author(_TL("Alessandro Perego")); Set_Description(_TW( "Destriping filter removes straight parallel stripes in raster data. " "It uses two low-pass filters elongated in the stripes direction; " "the first one is 1 pixel unit wide while the second one is wide as the striping wavelength. " "Their difference is the striping error which is removed from the original data to obtain the destriped DEM. " "This method is equivalent to that proposed by Oimoen (2000). " "With destriping 2 you can choose a range of value (min-max) from the input grid " "and a range of value (Mask min - Mask max) from a mask grid to select the target cells. " "\n" "\nReferences:\n" "- Oimoen, M.J. (2000): An Effective Filter For Removal Of Production Artifacts. " "In U.S. Geological Survey 7.5-Minute Digital Elevation Models. " "Proceedings of the Fourteenth International Conference on Applied Geologic Remote Sensing, " "6-8 November, Las Vegas, NV.\n" "\n" "- Peregro, A. (2009): SRTM DEM destriping with SAGA GIS: consequences on drainage network extraction. " "online.\n" )); // 2. Parameters... Parameters.Add_Grid(NULL, "INPUT", _TL("Input"), _TL("This must be your input data of type grid."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "MASK", _TL("Mask Grid"), _TL("This grid is used to select cells."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RESULT3", _TL("Destriped Grid"), _TL("New grid filtered with the destriping2 module"), PARAMETER_OUTPUT); Parameters.Add_Grid(NULL, "RESULT1", _TL("Low-pass 1"), _TL("Step 1: low-pass of stripe"), PARAMETER_OUTPUT); Parameters.Add_Grid(NULL, "RESULT2", _TL("Low-pass 2"), _TL("Step 2: low-pass between stripe and its surruondings"), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "ANG", _TL("Angle (in degrees)"), _TL("0 is horizontal, 90 is vertical."), PARAMETER_TYPE_Double, 0.0); Parameters.Add_Value(NULL, "R", _TL("Radius"), _TL(""), PARAMETER_TYPE_Double, 20); Parameters.Add_Value(NULL, "D", _TL("Stripes distance"), _TL(""), PARAMETER_TYPE_Double, 2); Parameters.Add_Value(NULL, "MIN", _TL("Min"), _TL(""), PARAMETER_TYPE_Double, -10); Parameters.Add_Value(NULL, "MAX", _TL("Max"), _TL(""), PARAMETER_TYPE_Double, 10); Parameters.Add_Value(NULL, "MMIN", _TL("Mask Min"), _TL(""), PARAMETER_TYPE_Double, -10000); Parameters.Add_Value(NULL, "MMAX", _TL("Mask Max"), _TL(""), PARAMETER_TYPE_Double, 10000); } //--------------------------------------------------------- Cdestriping2::~Cdestriping2(void) {} //--------------------------------------------------------- bool Cdestriping2::On_Execute(void) { int x, y, r, dxmax, dymax, ix, ax, ay, bx, by, iy, iv, iw, n1, n2; double z, mz, iz, imz, d, ang, a, si, si2, co, co2, Sum1, Sum2, min, max, mmin, mmax; CSG_Grid *pInput, *pMask, *pRes1, *pRes2, *pRes3; pInput = Parameters("INPUT")->asGrid(); pMask = Parameters("MASK")->asGrid(); pRes1 = Parameters("RESULT1")->asGrid(); pRes2 = Parameters("RESULT2")->asGrid(); pRes3 = Parameters("RESULT3")->asGrid(); ang = Parameters("ANG")->asDouble(); r = Parameters("R")->asInt(); d = Parameters("D")->asDouble(); min = Parameters("MIN")->asDouble(); max = Parameters("MAX")->asDouble(); mmin = Parameters("MMIN")->asDouble(); mmax = Parameters("MMAX")->asDouble(); //----------------------------------------------------- a = ang * 6.283185307179586 / 360; si = sin(a); co = cos(a); si2 = si * si; co2 = co * co; dxmax = (int)((r*sqrt(co2))+(d/2*sqrt(si2))); dymax = (int)((r*sqrt(si2))+(d/2*sqrt(co2))); if(si2 >= co2) { double cosi, si05, dsi, iwcosi, ivmin1, ivmax1, ivmin2, ivmax2; cosi = co / si; si05 = sqrt( (0.5/si)*(0.5/si) ); dsi = sqrt( (d/2/si)*(d/2/si) ); for(y=0; yasDouble(x, y); mz=pMask->asDouble(x, y); if( z>=min && z<=max && mz>=mmin && mz<=mmax) { Sum1 = 0.0; n1 = 0; Sum2 = 0.0; n2 = 0; //---------------------------------------------------- if( (ax = x - dxmax) < 0 ) { ax = 0; } if( (bx = x + dxmax) >= Get_NX() ) { bx = Get_NX() - 1; } if( (ay = y - dymax) < 0 ) { ay = 0; } if( (by = y + dymax) >= Get_NY() ) { by = Get_NY() - 1; } //----------------------------------------------------- for(iy=ay; iy<=by; iy++) { iw = y - iy; iwcosi = iw * cosi; ivmin1 = iwcosi - si05; ivmax1 = iwcosi + si05; ivmin2 = iwcosi - dsi; ivmax2 = iwcosi + dsi; for(ix=ax; ix<=bx; ix++) { iz = pInput->asDouble(ix, iy); imz=pMask->asDouble(ix, iy); if( iz>=min && iz<=max && imz>=mmin && imz<=mmax) { iv = x - ix; if( iv >= ivmin1 && iv <= ivmax1) { Sum1 += iz; n1++; } if( iv >= ivmin2 && iv <= ivmax2) { Sum2 += iz; n2++; } } } } if( n1 > 0 && n2 > 0 ) { pRes1->Set_Value(x, y, Sum1/n1); pRes2->Set_Value(x, y, Sum2/n2); pRes3->Set_Value(x, y, (Sum1/n1)-(Sum2/n2)+z); } } else { pRes1->Set_Value(x, y, z); pRes2->Set_Value(x, y, z); pRes3->Set_Value(x, y, z); } } } } if(si2 < co2) { double sico, co05, dco, ivsico, iwmin1, iwmax1, iwmin2, iwmax2; sico = si / co; co05 = sqrt( (0.5/co)*(0.5/co) ); dco = sqrt( (d/2/co)*(d/2/co) ); for(y=0; yasDouble(x, y); mz=pMask->asDouble(x, y); if( z>=min && z<=max && mz>=mmin && mz<=mmax) { Sum1 = 0.0; n1 = 0; Sum2 = 0.0; n2 = 0; //---------------------------------------------------- if( (ax = x - dxmax) < 0 ) { ax = 0; } if( (bx = x + dxmax) >= Get_NX() ) { bx = Get_NX() - 1; } if( (ay = y - dymax) < 0 ) { ay = 0; } if( (by = y + dymax) >= Get_NY() ) { by = Get_NY() - 1; } //----------------------------------------------------- for(ix=ax; ix<=bx; ix++) { iv = x - ix; ivsico = iv * sico; iwmin1 = ivsico - co05; iwmax1 = ivsico + co05; iwmin2 = ivsico - dco; iwmax2 = ivsico + dco; for(iy=ay; iy<=by; iy++) { iz = pInput->asDouble(ix, iy); imz=pMask->asDouble(ix, iy); if( iz>=min && iz<=max && imz>=mmin && imz<=mmax) { iw = y - iy; if( iw >= iwmin1 && iw <= iwmax1) { Sum1 += iz; n1++; } if( iw >= iwmin2 && iw <= iwmax2) { Sum2 += iz; n2++; } } } } if( n1 > 0 && n2 > 0 ) { pRes1->Set_Value(x, y, Sum1/n1); pRes2->Set_Value(x, y, Sum2/n2); pRes3->Set_Value(x, y, (Sum2/n2)-(Sum1/n1)+pInput->asDouble(x, y)); } } else { pRes1->Set_Value(x, y, z); pRes2->Set_Value(x, y, z); pRes3->Set_Value(x, y, z); } } } } return( true ); } saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/destriping2.h000066400000000000000000000043721224124640700305400ustar00rootroot00000000000000/********************************************************** * Version $Id: destriping2.h 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // destriping // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // destriping2.h // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__destriping2_H #define HEADER_INCLUDED__destriping2_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class Cdestriping2 : public CSG_Module_Grid { public: ////// public members and functions: ////////////// Cdestriping2(void); // constructor virtual ~Cdestriping2(void); // destructor protected: /// protected members and functions: /////////// virtual bool On_Execute(void); // always override this function private: ///// private members and functions: ///////////// }; //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__destriping2_H saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/directional1.cpp000066400000000000000000000115201224124640700312100ustar00rootroot00000000000000/********************************************************** * Version $Id: directional1.cpp 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // directional1 // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // directional1.cpp // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "directional1.h" //--------------------------------------------------------- Cdirectional1::Cdirectional1(void) { // 1. Info... Set_Name(_TL("Directional Average")); Set_Author(_TL("Alessandro Perego")); Set_Description(_TL("directional1 average for Grids")); // 2. Parameters... Parameters.Add_Grid(NULL, "INPUT", _TL("Input"), _TL("This must be your input data of type grid."), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "RESULT", _TL("Output Grid"), _TL("New grid filtered with the directional1 module"), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "ANG", _TL("Angle (in degrees)"), _TL("0 is horizontal, 90 is vertical."), PARAMETER_TYPE_Double, 0.0); Parameters.Add_Value(NULL, "R1", _TL("Main Radius"), _TL(""), PARAMETER_TYPE_Double, 1); Parameters.Add_Value(NULL, "R2", _TL("Transversal radius"), _TL(""), PARAMETER_TYPE_Double, 0.5); } //--------------------------------------------------------- Cdirectional1::~Cdirectional1(void) {} //--------------------------------------------------------- bool Cdirectional1::On_Execute(void) { int x, y, r1, dxmax, dymax, ix, ax, ay, bx, by, iy, iv, iw, n; double r2, ang, a, si, si2, co, co2, cosi, sico, r2co, r2si, Sum; CSG_Grid *pInput, *pResult; pInput = Parameters("INPUT")->asGrid(); pResult = Parameters("RESULT")->asGrid(); ang = Parameters("ANG")->asDouble(); r1 = Parameters("R1")->asInt(); r2 = Parameters("R2")->asDouble(); //----------------------------------------------------- a = ang * 6.283185307179586 / 360; si = sin(a); co = cos(a); si2 = si * si; co2 = co * co; dxmax = (int)((r1*sqrt(co2))+(r2*sqrt(si2))); dymax = (int)((r1*sqrt(si2))+(r2*sqrt(co2))); if(si2 >= co2) { cosi = co / si; r2si = r2 / sqrt(si2); for(y=0; y= Get_NX() ) { bx = Get_NX() - 1; } if( (ay = y - dymax) < 0 ) { ay = 0; } if( (by = y + dymax) >= Get_NY() ) { by = Get_NY() - 1; } //----------------------------------------------------- for(ix=ax; ix<=bx; ix++) { iv = x - ix; for(iy=ay; iy<=by; iy++) { iw = y - iy; if( iv >= (iw*cosi - r2si) && iv <= (iw*cosi + r2si)) { Sum += pInput->asDouble(ix, iy); n++; } } } if( n > 0 ) { pResult->Set_Value(x, y, Sum/n); } } } } if(si2 < co2) { sico = si / co; r2co = r2 / sqrt(co2); for(y=0; y= Get_NX() ) { bx = Get_NX() - 1; } if( (ay = y - dymax) < 0 ) { ay = 0; } if( (by = y + dymax) >= Get_NY() ) { by = Get_NY() - 1; } //----------------------------------------------------- for(iy=ay; iy<=by; iy++) { iw = y - iy; for(ix=ax; ix<=bx; ix++) { iv = x - ix; if( iw >= (iv*sico - r2co) && iw <= (iv*sico + r2co)) { Sum += pInput->asDouble(ix, iy); n++; } } } if( n > 0 ) { pResult->Set_Value(x, y, Sum/n); } } } } return( true ); } saga-2.1.0+dfsg/src/modules_contrib/contrib_a_perego/contrib_a_perego/directional1.h000066400000000000000000000045161224124640700306640ustar00rootroot00000000000000/********************************************************** * Version $Id: directional1.h 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // Module: // // directional1 // // // // for SAGA // // System for Automated Geoscientific Analyses // // // //-------------------------------------------------------// // // // directional1.h // // // // // //-------------------------------------------------------// // // // // // by Alessandro Perego (Italy) // // // // e-mail: alper78@alice.it // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__directional1_H #define HEADER_INCLUDED__directional1_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class Cdirectional1 : public CSG_Module_Grid { public: ////// public members and functions: ////////////// Cdirectional1(void); // constructor virtual ~Cdirectional1(void); // destructor virtual CSG_String Get_MenuPath (void) { return( _TL("Averages") ); } protected: /// protected members and functions: /////////// virtual bool On_Execute(void); // always override this function private: ///// private members and functions: ///////////// }; //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__directional1_H saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/000077500000000000000000000000001224124640700230205ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/Makefile.am000066400000000000000000000000231224124640700250470ustar00rootroot00000000000000SUBDIRS = ihacres saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/Makefile.in000066400000000000000000000425211224124640700250710ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_contrib/contrib_s_liersch DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = ihacres all: all-recursive .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) --gnu src/modules_contrib/contrib_s_liersch/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_contrib/contrib_s_liersch/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/000077500000000000000000000000001224124640700244365ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.cpp000066400000000000000000000220151224124640700275340ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // ihacres // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Author // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: author@email.de // // // // contact: Author // // Sesame Street. 7 // // 12345 Metropolis // // Nirvana // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Simulation - Hydrology: IHACRES") ); case MLB_INFO_Author: return( SG_T("Stefan Liersch (c) 2008") ); case MLB_INFO_Description: return( _TW( "The metric conceptual rainfall-runoff model IHACRES " "(Identification of unit Hydrographs and Component flows " "from Rainfall, Evaporation and Streamflow data) has been " "implemented as a module library. The IHACRES model was " "developed by: Jakeman, A.J. and G.M. Hornberger (1993); Jakeman et al. (1990).\n" "\n" "Purpose\n" "The module can be used to simulate streamflow (catchment runoff) " "on the basis of daily rainfall and temperature data. No spatial " "data, such as elevation models, soil or land use maps are required.\n" "\n" "IHACRES has been applied to catchments with a wide range of climatologies " "and sizes (Croke et al., 2004). It has been used to predict streamflow in " "ungauged catchments (Kokkonen et al., 2003; Post and Jakeman, 1999; " "Post et al., 1998), to study land cover effects on hydrologic processes " "(Croke et al., 2004; Kokkonen and Jakeman, 2002), and to investigate dynamic " "response characteristics and physical catchment descriptors (Kokkonen et al., " "2003; Sefton and Howarth, 1998).\n" "\n" "More recently, the model has been used to develop a " "rainfall-runoff database " "for flood risk assessment and forecasting by Liersch, S. and M. Volk (2008) " "(pdf).\n" "\n" "References\n
    " "
  • Croke, B.F.W., Merritt, W.S., Jakeman, A.J., 2004. A dynamic model for predicting hydrologic response to land cover changes in gauged and ungauged catchments. Journal Of Hydrology 291 (1), 115-31.
  • \n" "
  • Jakeman, A.J., Littlewood, I.G., Whitehead, P.G., 1990. Computation of the instantaneous unit hydrograph and identifiable component flows with application to two small upland catchments. Journal of Hydrology 117 (1-4), 275-300.
  • \n" "
  • Jakeman, A.J. and Hornberger, G.M., 1993. How Much Complexity Is Warranted in a Rainfall-Runoff Model?. Water Resources Research 29 (8), 2637-49.
  • \n" "
  • Kokkonen, T.S., Jakeman, A.J., Young, P.C., Koivusalo, H.J., 2003. Predicting daily flows in ungauged catchments: model regionalization from catchment descriptors at the Coweeta Hydrologic Laboratory. North Carolina Hydrological Processes 17 (11), 2219-38.
  • \n" "
  • Kokkonen, T.S. and Jakeman, A.J., 2002. Structural Effects of Landscape and Land Use on Streamflow Response. In: Environmental Foresight and Models: A Manifesto, 303-321.
  • \n" "
  • Liersch, S. and M. Volk, 2008. A rainfall-runoff database to support flood risk assessment. iEMSs 2008: International Congress on Environmental Modelling and Software. In: M. Snchez-Marr, J. Bjar, J. Comas, A. Rizzoli and G. Guariso (Eds.): Proceedings of the iEMSs Fourth Biennial Meeting: International Congress on Environmental Modelling and Software (iEMSs 2008). International Environmental Modelling and Software Society, Barcelona, Catalonia, July 2008. Vol. 1: 494-502. ISBN: 978-84-7653-074-0. (PEER reviewed).
  • \n" "
  • Post, D.A. and Jakeman, A.J., 1999. Predicting the daily streamflow of ungauged catchments in S.E. Australia by regionalising the parameters of a lumped conceptual rainfall-runoff model. Ecological Modelling 123 (2-3), 91-104.
  • \n" "
  • Post, D.A., Jones, J.A. and Grant, G.E., 1998. An improved methodology for predicting the daily hydrologic response of ungauged catchments. Environmental Modelling & Software 13 (3-4), 395-403.
  • \n" "
  • Sefton, C.E.M. and Howarth, S.M., 1998. Relationships between dynamic response characteristics and physical descriptors of catchments in England and Wales. Journal of Hydrology 211 (1-4), 1-16.
  • \n" "
" )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Simulation|Hydrology|IHACRES") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... //#include "ihacres_cal.h" #include "ihacres_cal2.h" #include "ihacres_v1.h" #include "ihacres_elev.h" #include "ihacres_elev_cal.h" //#include "ihacres_climate_scen.h" //#include "ihacres_climate_scen_db.h" #include "ihacres_basin.h" //#include "ihacres_auto_cal.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { // Don't forget to continuously enumerate the case switches // when adding new modules! Also bear in mind that the // enumeration always has to start with [case 0:] and // that [default:] must return NULL!... CSG_Module *pModule; switch( i ) { //case 0: // pModule = new Cihacres_cal; // break; case 0: pModule = new Cihacres_cal2; break; case 1: pModule = new Cihacres_v1; break; case 2: pModule = new Cihacres_basin; break; case 3: pModule = new Cihacres_elev; break; case 4: pModule = new Cihacres_elev_cal; break; //case 6: // pModule = new Cihacres_climate_scen; // break; //case 7: // pModule = new Cihacres_climate_scen_db; // break; default: pModule = NULL; break; } return( pModule ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/MLB_Interface.h000066400000000000000000000102451224124640700272030ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // IHACRES // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Author // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: author@email.de // // // // contact: Author // // Sesame Street. 7 // // 12345 Metropolis // // Nirvana // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /* $Log: not supported by cvs2svn $ /* Revision 1.1 2009/10/20 07:40:39 oconrad /* no message /* /* Revision 1.1.1.1 2005/08/31 14:00:48 oconrad /* no message /* /* Revision 1.1.1.1 2005/08/17 08:25:03 oconrad /* no message /* /* Revision 1.1.1.1 2005/08/15 13:35:24 oconrad /* no message /* */ //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ihacres_H #define HEADER_INCLUDED__ihacres_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef ihacres_noDB_EXPORTS #define ihacres_noDB_EXPORT _SAGA_DLL_EXPORT #else #define ihacres_noDB_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__ihacres_H saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/Makefile.am000066400000000000000000000016261224124640700264770ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libihacres.la libihacres_la_SOURCES =\ convert_sl.cpp\ ihacres_basin.cpp\ ihacres_cal2.cpp\ ihacres_elev.cpp\ ihacres_elev_bands.cpp\ ihacres_elev_cal.cpp\ ihacres_eq.cpp\ ihacres_v1.cpp\ MLB_Interface.cpp\ model_tools.cpp\ snow_module.cpp\ convert_sl.h\ ihacres_basin.h\ ihacres_cal2.h\ ihacres_elev.h\ ihacres_elev_bands.h\ ihacres_elev_cal.h\ ihacres_eq.h\ ihacres_v1.h\ MLB_Interface.h\ model_tools.h\ snow_module.h libihacres_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/Makefile.in000066400000000000000000000463671224124640700265230ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_contrib/contrib_s_liersch/ihacres DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libihacres_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libihacres_la_OBJECTS = convert_sl.lo ihacres_basin.lo \ ihacres_cal2.lo ihacres_elev.lo ihacres_elev_bands.lo \ ihacres_elev_cal.lo ihacres_eq.lo ihacres_v1.lo \ MLB_Interface.lo model_tools.lo snow_module.lo libihacres_la_OBJECTS = $(am_libihacres_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libihacres_la_SOURCES) DIST_SOURCES = $(libihacres_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libihacres.la libihacres_la_SOURCES = \ convert_sl.cpp\ ihacres_basin.cpp\ ihacres_cal2.cpp\ ihacres_elev.cpp\ ihacres_elev_bands.cpp\ ihacres_elev_cal.cpp\ ihacres_eq.cpp\ ihacres_v1.cpp\ MLB_Interface.cpp\ model_tools.cpp\ snow_module.cpp\ convert_sl.h\ ihacres_basin.h\ ihacres_cal2.h\ ihacres_elev.h\ ihacres_elev_bands.h\ ihacres_elev_cal.h\ ihacres_eq.h\ ihacres_v1.h\ MLB_Interface.h\ model_tools.h\ snow_module.h libihacres_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_contrib/contrib_s_liersch/ihacres/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_contrib/contrib_s_liersch/ihacres/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libihacres.la: $(libihacres_la_OBJECTS) $(libihacres_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libihacres_la_OBJECTS) $(libihacres_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_sl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ihacres_basin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ihacres_cal2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ihacres_elev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ihacres_elev_bands.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ihacres_elev_cal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ihacres_eq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ihacres_v1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model_tools.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snow_module.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/convert_sl.cpp000066400000000000000000000073071224124640700273270ustar00rootroot00000000000000/********************************************************** * Version $Id: convert_sl.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #include "convert_sl.h" //--------------------------------------------------------------------- // // DATA TYPE // CONVERTING FUNCTIONS // //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Converting a string to an integer value int convert_sl::StringToInt(string str) { int i; sscanf(str.c_str(),"%d",&i); return i; } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Converting a string to a double value double convert_sl::StringToDouble (string s) { // function adopted from: // http://episteme.arstechnica.com/groupee/forums/a/tpc/f/6330927813/m/736000556631/p/2 double d_return_value; istringstream iss(s); // Extract a double from the input string stream iss >> d_return_value; if (iss.fail()) { return -9999.0; } return d_return_value; } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Any number to string //--------------------------------------------------------------------- string convert_sl::Number2String(double d) { std::ostringstream s; s << d; return(s.str()); } //--------------------------------------------------------------------- string convert_sl::Number2String(float f) { std::ostringstream s; s << f; return(s.str()); } //--------------------------------------------------------------------- string convert_sl::Number2String(int i) { std::ostringstream s; s << i; return(s.str()); } //--------------------------------------------------------------------- string convert_sl::Number2String(long l) { std::ostringstream s; s << l; return(s.str()); } //--------------------------------------------------------------------- //--------------------------------------------------------------------- string convert_sl::Double2String(double d) { std::ostringstream s; s << d; return(s.str()); } //--------------------------------------------------------------------- string convert_sl::Float2String(float f) { std::ostringstream s; s << f; return(s.str()); } //--------------------------------------------------------------------- string convert_sl::Int2String(int i) { // Bjarne Stroustrup's C++ Style and Technique FAQ // http://www.research.att.com/~bs/bs_faq2.html#int-to-string std::ostringstream s; s << i; return(s.str()); } //--------------------------------------------------------------------- bool convert_sl::StringToBool(string str) { if ( (str.substr(0,1) == "0") || (str == "false") || (str == "FALSE") || (str == "False") || (str == "f") || (str == "F") ) { return(false); } else { return(true); } } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Converting a date string 'YYYYMMDD' to three separate integer values void convert_sl::Get_Date_Int(string date, int &year, int &month, int &day) { year = StringToInt(date.substr(0,4)); month = StringToInt(date.substr(4,2)); day = StringToInt(date.substr(6,2)); // divide date string to year, month, and day string //string y(date.c_str(),0,4); //string m(date.c_str(),4,2); //string d(date.c_str(),6,2); //// convert to integer //sscanf(y.c_str(),"%d",&year); //sscanf(m.c_str(),"%d",&month); //sscanf(d.c_str(),"%d",&day); } //--------------------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/convert_sl.h000066400000000000000000000041661224124640700267740ustar00rootroot00000000000000/********************************************************** * Version $Id: convert_sl.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #ifndef __convert_sl_h #define __convert_sl_h #include #include #include // function StringToDouble #ifdef _SAGA_LINUX #include #endif using std::string; using std::istringstream; // function StringToDouble using std::stringstream; // used by function Double2String(), Int2String() namespace convert_sl { // if a string is a char* then: // sprintf(myString, "%d", myInt); // or: // _itoa(myInt, myString, 10); //--------------------------------------------------------------------- // Converting a string to an integer value int StringToInt(string str); //--------------------------------------------------------------------- // Converting a string to a double value double StringToDouble (string s); //--------------------------------------------------------------------- // Any Number to std::string //--------------------------------------------------------------------- string Number2String(double d); string Number2String(float f); string Number2String(int i); string Number2String(long l); //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Converting a double to a string value string Double2String(double d); //--------------------------------------------------------------------- // Converting a float to a string value string Float2String(float f); //--------------------------------------------------------------------- // Converting an integer to a string value string Int2String(int i); //--------------------------------------------------------------------- // Converting a string value to bool bool StringToBool(string str); //--------------------------------------------------------------------- // Converting a date string 'YYYYMMDD' to three separate integer values void Get_Date_Int(string date, int &year, int &month, int &day); }; #endif /* __convert_sl_h */ saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_basin.cpp000066400000000000000000000660731224124640700277500ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_basin.cpp 1261 2011-12-16 15:12:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // ihacres_basin.cpp // // // // Copyright (C) 2008 by // // Stefan Liersch // //-------------------------------------------------------// // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // 2008-01-30 // /////////////////////////////////////////////////////////// //*******************************************************// // ToDo // //-------------------------------------------------------// // - lag COEFFICIENT in write output table IMPLEMENTIEREN !!!!!!! //*******************************************************// #define NULL 0 #include "ihacres_basin.h" #include "convert_sl.h" #include "model_tools.h" //--------------------------------------------------------------------- Cihacres_basin::Cihacres_basin() { //----------------------------------------------------- // 1. Info... Set_Name(_TL("IHACRES Basin")); Set_Author(SG_T("copyrights (c) 2008 Stefan Liersch")); Set_Description(_TW( "The Rainfall-Runoff Model IHACRES \n \n \n" "Reference: \n \n" "Jakeman, A.J. / Hornberger, G.M. (1993). \n" "How Much Complexity Is Warranted in a Rainfall-Runoff Model? \n" "Water Resources Research, (29), NO. 8 (2637-2649) \n \n" "Croke, B. F. W., W. S. Merritt, et al. (2004).\n" "A dynamic model for predicting hydrologic response " "to land cover changes in gauged and " "ungauged catchments. \n" "Journal Of Hydrology 291(1-2): 115-131." )); Parameters.Add_Table_Output( NULL , "TABLEout" , _TL("Table"), _TL("") ); /////////////////////////////////////////////////////////////////// // FIRST MODULE DIALOG _CreateDialog1(); /////////////////////////////////////////////////////////////////// } //--------------------------------------------------------------------- Cihacres_basin::~Cihacres_basin() {} //--------------------------------------------------------------------- //--------------------------------------------------------------------- // ON_EXECUTE //--------------------------------------------------------------------- bool Cihacres_basin::On_Execute() { CSG_Parameters P; //std::ofstream f("_out_elev.txt"); // Assign Parameters from first Module Dialog //--------------------------------------------------------- int nSBS = Parameters("NSUBBASINS") ->asInt(); m_nSubbasins = nSBS + 2; // because list starts with 2 ! m_IHAC_version = Parameters("IHACVERS") ->asInt(); m_StorConf = Parameters("STORAGE") ->asInt(); m_bSnowModule = Parameters("SNOW_MODULE") ->asBool(); //--------------------------------------------------------- //--------------------------------------------------------- // Assign number of storages m_nStorages = ihacres.Assign_nStorages(m_StorConf); //--------------------------------------------------------- //--------------------------------------------------------- // Initialize pointers _Init_Subbasins(m_nSubbasins); m_p_linparms = new C_IHAC_LinearParms(m_nSubbasins,m_nStorages); m_p_nonlinparms = new C_IHAC_NonLinearParms(m_nSubbasins); //--------------------------------------------------------- //--------------------------------------------------------- // open second and third user dialog if ( _CreateDialog2() && _CreateDialog3()) { //--------------------------------------------------------- // searching the first and the last record of the time range ihacres.AssignFirstLastRec(*m_p_InputTable, m_first, m_last, m_date1, m_date2, m_dateField); m_nValues = m_last - m_first + 1; //--------------------------------------------------------- //--------------------------------------------------------- _Init_Pointers(m_nValues); //--------------------------------------------------------- //--------------------------------------------------------- // read input table _ReadInputFile(); //--------------------------------------------------------- //--------------------------------------------------------- // PERFORM STREAMFLOW SIMULATION // FOR EACH ELEVATION BAND //--------------------------------------------------------- // Convert Streamflow vector from m3/s*day-1 to mm/day //m_p_Q_obs_mmday = model_tools::m3s_to_mmday(m_p_Q_obs_m3s, m_p_Q_obs_mmday, m_nValues, m_Area_tot); //--------------------------------------------------------- // SNOW MODULE //--------------------------------------------------------- double Q_init = 1.0; // ??? for (int i = 0; i < m_nSubbasins; i++) { if (m_bSnowModule) { _CalcSnowModule(i); } _Simulate_NonLinearModule(i); _Simulate_Streamflow(i, Q_init); } //--------------------------------------------------------- m_pTable = SG_Create_Table(); _CreateTableSim(); // add tables to SAGA Workspace m_pTable->Set_Name(_TL("IHACRES_Basin_output")); Parameters("TABLEout")->Set_Value(m_pTable); delete[] m_pSubbasin; // smtliche Unter-Pointer noch lschen delete[] m_p_pcpField; delete[] m_p_tmpField; delete m_p_linparms; delete m_p_nonlinparms; if (m_bSnowModule) delete m_pSnowparms; return(true); } // end if ( _CreateDialog2() ) return(false); } //--------------------------------------------------------------------- void Cihacres_basin::_Init_Subbasins(int n) { // instantiate elevation bands m_pSubbasin = new Cihacres_subbasin[n]; // instantiate field numbers m_p_pcpField = new int[n]; m_p_tmpField = new int[n]; if (m_bSnowModule) { m_pSnowparms = new CSnowParms[n]; } } //--------------------------------------------------------------------- void Cihacres_basin::_Init_Pointers(int n) { m_vec_date.resize(n); m_p_Q_obs_m3s = new double[n]; m_p_Q_obs_mmday = new double[n]; for (int i = 0; i < m_nSubbasins; i++) { m_pSubbasin[i].m_pPCP = new double[n]; m_pSubbasin[i].m_pTMP = new double[n]; m_pSubbasin[i].m_pER = new double[n]; m_pSubbasin[i].m_p_Q_sim_mmday = new double[n]; m_pSubbasin[i].m_pTw = new double[n]; m_pSubbasin[i].m_pWI = new double[n]; } if (m_bSnowModule) { for (int eb = 0; eb < m_nSubbasins; eb++) { m_pSubbasin[eb].m_pSnowStorage = new double[n]; m_pSubbasin[eb].m_pMeltRate = new double[n]; } } } //--------------------------------------------------------------------- void Cihacres_basin::_ReadInputFile() { for (int j = 0, k = m_first; j < m_nValues, k < m_last + 1; j++, k++) { m_vec_date[j].append(CSG_String(m_p_InputTable->Get_Record(k)->asString(m_dateField))); m_p_Q_obs_m3s[j] = m_p_InputTable->Get_Record(k)->asDouble(m_streamflowField); for (int eb = 0; eb < m_nSubbasins; eb++) { m_pSubbasin[eb].m_pPCP[j] = m_p_InputTable->Get_Record(k)->asDouble(m_p_pcpField[eb]); m_pSubbasin[eb].m_pTMP[j] = m_p_InputTable->Get_Record(k)->asDouble(m_p_tmpField[eb]); } } } //--------------------------------------------------------------------- //--------------------------------------------------------------------- void Cihacres_basin::_CalcSnowModule(int iSBS) { m_p_SnowModule = new CSnowModule(m_pSubbasin[iSBS].m_pTMP, m_pSubbasin[iSBS].m_pPCP, m_nValues, m_pSnowparms[iSBS].T_Rain, m_pSnowparms[iSBS].T_Melt, m_pSnowparms[iSBS].DD_FAC); m_pSubbasin[iSBS].m_pMeltRate = m_p_SnowModule->Get_MeltRate(m_pSubbasin[iSBS].m_pMeltRate, m_nValues); m_pSubbasin[iSBS].m_pSnowStorage = m_p_SnowModule->Get_SnowStorage(m_pSubbasin[iSBS].m_pSnowStorage, m_nValues); delete m_p_SnowModule; } //--------------------------------------------------------------------- //--------------------------------------------------------------------- void Cihacres_basin::_Simulate_NonLinearModule(int iSBS) { double eR_init = 0.0; double WI_init = 0.5; //---------------------------------------------------------- // calculate excess rainfall time series //---------------------------------------------------------- switch(m_IHAC_version) { case 0: // Jakeman & Hornberger (1993) // The parameter index (fourth parameter) is zero here, because // the parameter settings of the non-linear module are in all elevationbands equal. // If they should be different the index parameter can be used to identify the // corresponding elevation band. ihacres.CalcWetnessTimeConst(m_pSubbasin[iSBS].m_pTMP, m_pSubbasin[iSBS].m_pTw, m_p_nonlinparms, iSBS, m_nValues); // 0 = index (only one instance of m_p_nonlinparms) if (m_bSnowModule) { ihacres.CalcWetnessIndex(m_pSubbasin[iSBS].m_pTw, m_pSubbasin[iSBS].m_pPCP, m_pSubbasin[iSBS].m_pTMP, m_pSubbasin[iSBS].m_pWI, WI_init, m_p_nonlinparms->mp_c[iSBS], m_bSnowModule, m_pSnowparms[iSBS].T_Rain, m_nValues); ihacres.CalcExcessRain(m_pSubbasin[iSBS].m_pPCP, m_pSubbasin[iSBS].m_pTMP, m_pSubbasin[iSBS].m_pWI, m_pSubbasin[iSBS].m_pER, eR_init, m_pSubbasin[iSBS].m_sum_eRainGTpcp, m_nValues, m_bSnowModule, m_pSnowparms[iSBS].T_Rain, m_pSnowparms[iSBS].T_Melt, m_pSubbasin[iSBS].m_pMeltRate); } else { ihacres.CalcWetnessIndex(m_pSubbasin[iSBS].m_pTw, m_pSubbasin[iSBS].m_pPCP, m_pSubbasin[iSBS].m_pTMP, m_pSubbasin[iSBS].m_pWI, WI_init, m_p_nonlinparms->mp_c[iSBS], m_bSnowModule, 0, m_nValues); ihacres.CalcExcessRain(m_pSubbasin[iSBS].m_pPCP, m_pSubbasin[iSBS].m_pTMP, m_pSubbasin[iSBS].m_pWI, m_pSubbasin[iSBS].m_pER, eR_init, m_pSubbasin[iSBS].m_sum_eRainGTpcp, m_nValues, m_bSnowModule, 0,0,0); } break; case 1: // Croke et al. (2005) ihacres.CalcWetnessTimeConst_Redesign(m_pSubbasin[iSBS].m_pTMP, m_pSubbasin[iSBS].m_pTw, m_p_nonlinparms, iSBS, m_nValues); // 0 = index (only one instance of m_p_nonlinparms) if (m_bSnowModule) { ihacres.CalcWetnessIndex_Redesign(m_pSubbasin[iSBS].m_pTw, m_pSubbasin[iSBS].m_pPCP, m_pSubbasin[iSBS].m_pWI, WI_init, m_bSnowModule, m_pSnowparms[iSBS].T_Rain, m_nValues); ihacres.CalcExcessRain_Redesign(m_pSubbasin[iSBS].m_pPCP, m_pSubbasin[iSBS].m_pTMP, m_pSubbasin[iSBS].m_pWI, m_pSubbasin[iSBS].m_pER, eR_init, m_pSubbasin[iSBS].m_sum_eRainGTpcp, m_nValues, m_p_nonlinparms->mp_c[iSBS], m_p_nonlinparms->mp_l[iSBS], m_p_nonlinparms->mp_p[iSBS], m_bSnowModule, m_pSnowparms[iSBS].T_Rain, m_pSnowparms[iSBS].T_Melt, m_pSubbasin[iSBS].m_pMeltRate); } else { ihacres.CalcWetnessIndex_Redesign(m_pSubbasin[iSBS].m_pTw, m_pSubbasin[iSBS].m_pPCP, m_pSubbasin[iSBS].m_pWI, WI_init, m_bSnowModule, 0, m_nValues); ihacres.CalcExcessRain_Redesign(m_pSubbasin[iSBS].m_pPCP, m_pSubbasin[iSBS].m_pTMP, m_pSubbasin[iSBS].m_pWI, m_pSubbasin[iSBS].m_pER, eR_init, m_pSubbasin[iSBS].m_sum_eRainGTpcp, m_nValues, m_p_nonlinparms->mp_c[iSBS], m_p_nonlinparms->mp_l[iSBS], m_p_nonlinparms->mp_p[iSBS], m_bSnowModule, 0,0,0); } break; } // end switch(m_IHAC_vers) } //--------------------------------------------------------------------- //--------------------------------------------------------------------- void Cihacres_basin::_Simulate_Streamflow(int iSBS, double Q_init) { //---------------------------------------------------------- //---------------------------------------------------------- // calculate streamflow //---------------------------------------------------------- switch(m_StorConf) { case 0: // single storage ihacres.SimStreamflowSingle(m_pSubbasin[iSBS].m_pER, Q_init, m_pSubbasin[iSBS].m_p_Q_sim_mmday, m_pSubbasin[iSBS].m_delay, m_p_linparms->a[iSBS], m_p_linparms->b[iSBS], m_nValues); break; case 1: // two storages in parallel ihacres.SimStreamflow2Parallel(m_pSubbasin[iSBS].m_pER, m_pSubbasin[iSBS].m_p_Q_sim_mmday, Q_init, m_p_linparms, iSBS, m_vq, m_vs, m_nValues, m_pSubbasin[iSBS].m_delay); break; case 2: // two storages in series break; } // end switch(m_StorConf) } //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // CREATE TABLE // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- void Cihacres_basin::_CreateTableSim() { int i = 0; // used in function Get_Record(i) CSG_Table_Record *pRecord; CSG_String tmpName; double sim_sbs, sim; // creating the column titles m_pTable->Add_Field("Date", SG_DATATYPE_String); m_pTable->Add_Field("Flow_OBS", SG_DATATYPE_Double); for (int sbs = 0; sbs < m_nSubbasins; sbs++) { tmpName = "SBS_"; tmpName += convert_sl::Int2String(sbs+1).c_str(); m_pTable->Add_Field(tmpName.c_str(), SG_DATATYPE_Double); } m_pTable->Add_Field("Flow_SIM", SG_DATATYPE_Double); for (int j = 0; j < m_nValues; j++) { m_pTable->Add_Record(); pRecord = m_pTable->Get_Record(i); // writing the data into the rows pRecord->Set_Value(0,CSG_String(m_vec_date[j].c_str())); pRecord->Set_Value(1,m_p_Q_obs_m3s[j]); sim_sbs = 0.0; sim = 0.0; for (int sbs = 0; sbs < m_nSubbasins; sbs++) { sim_sbs = model_tools::mmday_to_m3s(m_pSubbasin[sbs].m_p_Q_sim_mmday[j],m_pSubbasin[sbs].m_area); //pRecord->Set_Value(3+eb,model_tools::mmday_to_m3s(m_p_elevbands[eb].m_p_streamflow_sim[j],m_p_elevbands[eb].m_area)); pRecord->Set_Value(2+sbs, sim_sbs); sim += sim_sbs; } pRecord->Set_Value(2+m_nSubbasins,sim); i++; } } /////////////////////////////////////////////////////////////////////// // // DIALOGS // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // DIALOG 1 //--------------------------------------------------------------------- void Cihacres_basin::_CreateDialog1() { CSG_Parameter *pNode; CSG_String s; pNode = Parameters.Add_Choice( NULL , "NSUBBASINS" , _TL("Number of sub-basins"), _TL(""), SG_T("2|3|4|5|6|7|8|9|10") ); s.Printf(SG_T("Node1"), 1); pNode = Parameters.Add_Node(NULL,s,_TL("IHACRES Version"),_TL("")); Parameters.Add_Choice( pNode , "IHACVERS" , _TL("IHACRES Version"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Jakeman & Hornberger (1993)"), // 0 _TL("Croke et al. (2005) !!! not yet implemented !!!") // 1 ) ); s.Printf(SG_T("Node2"), 2); pNode = Parameters.Add_Node(NULL,s,_TL("Storage Configuration"),_TL("")); Parameters.Add_Choice( pNode , "STORAGE" , _TL("Storage"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Single Storage"), // 0 _TL("Two Parallel Storages"), // 1 _TL("Two Storages in Series !!! not yet implemented !!!") // 2 ) ); Parameters.Add_Value( pNode, "SNOW_MODULE", _TL("Using the snow-melt module?"), _TL("If checked, snow-melt module is used."), PARAMETER_TYPE_Bool, false ); } //--------------------------------------------------------------------- // DIALOG 2 //--------------------------------------------------------------------- bool Cihacres_basin::_CreateDialog2() { //std::ofstream f("_out_elev.txt"); int i; CSG_Parameters P; // used to add Parameters in the second dialog CSG_Parameter *pNode, *pNode1; CSG_String s; CSG_String tmpNode, tmpName; P.Set_Name(_TL("IHACRES Basin (Dialog 2)")); // Input file ---------------------------------------------- pNode = P.Add_Table( NULL , "TABLE" , _TL("IHACRES Input Table"), _TL(""), PARAMETER_INPUT ); P.Add_Table_Field( pNode , "DATE_Field" , _TL("Date Column"), _TL("Select the column containing the Date") ); P.Add_Table_Field( pNode , "DISCHARGE_Field" , _TL("Streamflow (obs.) Column"), _TL("Select the column containing the observed streamflow time series") ); for (i = 0; i < m_nSubbasins; i++) { tmpNode = convert_sl::Int2String(i+1).c_str(); tmpName = _TL("PCP Column: Subbasin: "); tmpName+=tmpNode; P.Add_Table_Field( pNode , tmpName.c_str(), tmpName.c_str(), _TL("Select Precipitation Column") ); tmpName = _TL("TMP Column: Subbasin: "); tmpName+=tmpNode; P.Add_Table_Field( pNode , tmpName.c_str() , tmpName.c_str(), _TL("Select Temperature Column") ); } // Input file ---------------------------------------------- for (i = 0; i < m_nSubbasins; i++) { tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+100).c_str(); tmpName = _TL("Subbasin "); tmpName+=convert_sl::Int2String(i+1).c_str(); s.Printf(tmpNode.c_str(), i+100); pNode = P.Add_Node(NULL,s,tmpName.c_str(),_TL("")); tmpName = _TL("Area [km2] Subbasin("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode, tmpName, _TL("Area [km2]"), _TL(""), PARAMETER_TYPE_Double ); tmpName = "Lag Subbasin("; tmpName += tmpNode; tmpName += ")"; P.Add_Value( pNode, tmpName, _TL("Lag coefficient"), _TL(""), PARAMETER_TYPE_Int ); // Parameters of non-linear module ------------------------- tmpNode = "Node"; tmpNode+=convert_sl::Int2String(i+150).c_str(); s.Printf(tmpNode.c_str(), i+150); pNode1 = P.Add_Node(pNode,s,_TL("Non-Linear Module"),_TL("")); tmpName = _TL("TwFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Wetness decline time constant (Tw)"), _TW("Tw is approximately the time constant, or inversely," "the rate at which the catchment wetness declines in the absence of rainfall"), PARAMETER_TYPE_Double, 1.0, 0.01, true, 150.0, true ); tmpName = _TL("TFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1 , tmpName , _TL("Temperature Modulation Factor (f)"), _TL("Temperature Modulation Factor f"), PARAMETER_TYPE_Double, 1.0, 0.0001, true, 10.0, true ); tmpName = _TL("CFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Parameter (c)"), _TL("Parameter (c) to fit streamflow volume"), PARAMETER_TYPE_Double, 0.001, 0.0, true, 1.0, true ); switch(m_IHAC_version) { case 0: // Jakeman & Hornberger (1993) break; case 1: // Croke et al. (2005) tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+200).c_str(); s.Printf(tmpNode.c_str(), i+200); pNode1 = P.Add_Node(pNode,s,_TL("Soil Moisture Power Eq."),_TL("")); tmpName = "LFAC("; tmpName += tmpNode; tmpName += ")"; P.Add_Value( pNode1, tmpName, _TL("Parameter (l)"), _TL("Soil moisture index threshold"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); tmpName = "PFAC("; tmpName += tmpNode; tmpName += ")"; P.Add_Value( pNode1, tmpName, _TL("Parameter (p)"), _TL("non-linear response term"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); break; } // Parameters of non-linear module ------------------------- // Parameters of linear module ----------------------------- switch(m_StorConf) { case 0: // single storage tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); s.Printf(tmpNode.c_str(), i+250); pNode1 = P.Add_Node(pNode,s,_TL("Linear Module"),_TL("")); tmpName = _TL("AFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("(a)"), _TL(""), PARAMETER_TYPE_Double, -0.8, -0.99, true, -0.01, true ); tmpName = _TL("BFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("(b)"), _TL(""), PARAMETER_TYPE_Double, 0.2, 0.001, true, 1.0, true ); break; case 1: // two parallel storages tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); s.Printf(tmpNode.c_str(), i+250); pNode1 = P.Add_Node(pNode,s,_TL("Linear Module"),_TL("")); // Parameter a tmpName = _TL("AQ("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("a(q)"), _TL(""), PARAMETER_TYPE_Double, -0.7, -0.99, true, -0.01, true ); tmpName = _TL("AS("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("a(s)"), _TL(""), PARAMETER_TYPE_Double, -0.9, -0.99, true, -0.01, true ); // Parameter b tmpName = _TL("BQ("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("b(q)"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true, 1.0, true ); break; case 2: // two storages in series break; } // end switch (storconf) // Parameters of linear module ----------------------------- tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+300).c_str(); s.Printf(tmpNode.c_str(), i+300); pNode1 = P.Add_Node(pNode,s,_TL("Time Delay after Start of Rainfall (INTEGER)"),_TL("")); tmpName = _TL("DELAY("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Time Delay (Rain-Runoff)"), _TL("The delay after the start of rainfall, before the discharge starts to rise."), PARAMETER_TYPE_Int, 0, 1, true, 100, true ); // snow module parameters ---------------------------------- if (m_bSnowModule) { tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+350).c_str(); s.Printf(tmpNode.c_str(), i+350); pNode1 = P.Add_Node(pNode,s,_TL("Snow Module Parameters"),_TL("")); tmpName = _TL("T_RAIN("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Temperature Threshold for Rainfall"), _TL("Below this threshold precipitation will fall as snow"), PARAMETER_TYPE_Double, -1.0, -10.0, true, 10.0, true ); tmpName = _TL("T_MELT("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Temperature Threshold for Melting"), _TL("Above this threshold snow will start to melt"), PARAMETER_TYPE_Double, 1.0, -5.0, true, 10.0, true ); tmpName = _TL("DD_FAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Day-Degree Factor"), _TL("Day-Degree Factor depends on catchment characteristics"), PARAMETER_TYPE_Double, 0.7, 0.7, true, 9.2, true ); } // snow module parameters ---------------------------------- } if( SG_UI_Dlg_Parameters(&P, _TL("IHACRES Distributed Input Dialog 2")) ) { // input table m_p_InputTable = P("TABLE") ->asTable(); // field numbers m_dateField = P("DATE_Field") ->asInt(); m_streamflowField = P("DISCHARGE_Field") ->asInt(); for (int i = 0; i < m_nSubbasins; i++) { tmpNode = convert_sl::Int2String(i+1).c_str(); // get precipitation column of Subbasin[i] tmpName = _TL("PCP Column: Subbasin: "); tmpName+=tmpNode; m_p_pcpField[i] = P(tmpName) ->asInt(); // get temperature column of Subbasin[i] tmpName = _TL("TMP Column: Subbasin: "); tmpName+=tmpNode; m_p_tmpField[i] = P(tmpName) ->asInt(); tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+100).c_str(); // get area[km2] of Subbasin[i] tmpName = _TL("Area [km2] Subbasin("); tmpName += tmpNode; tmpName += _TL(")"); m_pSubbasin[i].m_area = P(tmpName) ->asDouble(); // get lag coefficient of Subbasin[i] tmpName = _TL("Lag Subbasin("); tmpName += tmpNode; tmpName += _TL(")"); m_pSubbasin[i].m_lag = P(tmpName) ->asInt(); tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+150).c_str(); // get Tw tmpName = _TL("TwFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nonlinparms->mp_tw[i] = P(tmpName) ->asDouble(); // get f tmpName = _TL("TFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nonlinparms->mp_f[i] = P(tmpName) ->asDouble(); // get c tmpName = _TL("CFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nonlinparms->mp_c[i] = P(tmpName) ->asDouble(); switch(m_IHAC_version) { case 0: // Jakeman & Hornberger (1993) break; case 1: // Croke et al. (2005) tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+200).c_str(); // get l tmpName = _TL("LFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nonlinparms->mp_l[i]= P(tmpName) ->asDouble(); // get p tmpName = _TL("PFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nonlinparms->mp_p[i]= P(tmpName) ->asDouble(); } // linear module parameters switch(m_nStorages) { case 1: // single storage tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); // get a tmpName = _TL("AFAC()"); tmpName += tmpNode; tmpName += _TL(")"); m_p_linparms->a[i] = P(tmpName) ->asDouble(); // get b tmpName = _TL("BFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_linparms->b[i] = P(tmpName) ->asDouble(); break; case 2: // two storages tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); // get aq tmpName = _TL("AQ("); tmpName += tmpNode; tmpName += _TL(")"); m_p_linparms->aq[i] = P(tmpName) ->asDouble(); // get bq tmpName = _TL("BQ("); tmpName += tmpNode; tmpName += _TL(")"); m_p_linparms->bq[i] = P(tmpName) ->asDouble(); // get as tmpName = _TL("AS("); tmpName += tmpNode; tmpName += _TL(")"); m_p_linparms->as[i] = P(tmpName) ->asDouble(); m_p_linparms->bs[i] = ihacres.Calc_Parm_BS(m_p_linparms->aq[i],m_p_linparms->as[i],m_p_linparms->bq[i]); break; } // get delay tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+300).c_str(); tmpName = _TL("DELAY("); tmpName += tmpNode; tmpName += _TL(")"); m_pSubbasin[i].m_delay = P(tmpName) ->asInt(); if (m_bSnowModule) { tmpNode = _TL("Node"); tmpNode+=convert_sl::Int2String(i+350).c_str(); tmpName = _TL("T_RAIN("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms[i].T_Rain = P(tmpName) ->asDouble(); tmpName = _TL("T_MELT("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms[i].T_Melt = P(tmpName) ->asDouble(); tmpName = _TL("DD_FAC("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms[i].DD_FAC = P(tmpName) ->asDouble(); } } // end for (int i = 0; i < m_nSubbasins; i++) return(true); } return(false); } //--------------------------------------------------------------------- // DIALOG 3 //--------------------------------------------------------------------- bool Cihacres_basin::_CreateDialog3() { CSG_String s; CSG_Parameters P; // used to add Parameters in the second dialog CSG_Parameter *pNode; // Dialog design P.Set_Name(_TL("Choose Time Range")); s.Printf(SG_T("Node"), 1); pNode = P.Add_Node(NULL,s,_TL("Time Range"),_TL("")); s.Printf(SG_T("FDAY") , 1-1); P.Add_String(pNode,s,_TL("First Day"),_TL(""), m_p_InputTable->Get_Record(0)->asString(m_dateField)); s.Printf(SG_T("LDAY") , 1-2); P.Add_String(pNode,s,_TL("Last Day"),_TL(""), m_p_InputTable->Get_Record(m_p_InputTable->Get_Record_Count()-1)->asString(m_dateField)); if( SG_UI_Dlg_Parameters(&P, _TL("Choose Time Range")) ) { /////////////////////////////////////////////////////////////// // // ASSIGN DATA FROM SECOND DIALOG // /////////////////////////////////////////////////////////////// m_date1 = P(CSG_String::Format(SG_T("FDAY"),m_dateField).c_str())->asString(); m_date2 = P(CSG_String::Format(SG_T("LDAY"),m_streamflowField).c_str())->asString(); return(true); } return(false); } saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_basin.h000066400000000000000000000164311224124640700274060ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_basin.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // ihacres_basin.h // // // // Copyright (C) 2008 by // // Stefan Liersch // //-------------------------------------------------------// // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // 2008-01-30 // //-------------------------------------------------------// //*******************************************************// // ToDo // //-------------------------------------------------------// // - //*******************************************************// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ihacres_basin_H #define HEADER_INCLUDED__ihacres_basin_H //--------------------------------------------------------- #include "MLB_Interface.h" #include "ihacres_eq.h" //--------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // CLASS Cihacres_sub_basin // /////////////////////////////////////////////////////////////////////// class Cihacres_subbasin { public: /////////////////////////////////////////////////////////////////// // // CONSTRUCTORS // /////////////////////////////////////////////////////////////////// // default Cihacres_subbasin(void) { m_pPCP = NULL; m_pTMP = NULL; m_pER = NULL; m_p_Q_sim_mmday = NULL; m_pTw = NULL; m_pWI = NULL; m_pMeltRate = NULL; m_pSnowStorage = NULL; } Cihacres_subbasin(int nvals) { Initialize(nvals); } // destructor ~Cihacres_subbasin(void) { if (m_pPCP) delete[] m_pPCP; if (m_pTMP) delete[] m_pTMP; if (m_pER) delete[] m_pER; if (m_p_Q_sim_mmday) delete[] m_p_Q_sim_mmday; if (m_pTw) delete[] m_pTw; if (m_pWI) delete[] m_pWI; if (m_pMeltRate) delete[] m_pMeltRate; if (m_pSnowStorage) delete[] m_pSnowStorage; } void Initialize(int nvals) { m_nValues = nvals; m_pPCP = new double[nvals]; m_pTMP = new double[nvals]; m_pER = new double[nvals]; m_p_Q_sim_mmday = new double[nvals]; m_pTw = new double[nvals]; m_pWI = new double[nvals]; m_pMeltRate = new double[nvals]; m_pSnowStorage = new double[nvals]; } /////////////////////////////////////////////////////////////////// // // PARAMETERS // /////////////////////////////////////////////////////////////////// //----------------------------------------------------------------- // TIME SERIES //----------------------------------------------------------------- int m_nValues; double* m_pPCP; // precipitation time series double* m_pTMP; // temperature time series double* m_pER; // excess rainfall time series double* m_p_Q_sim_mmday; // simulated streamflow time series [mm] !!! double* m_pTw; // double* m_pWI; // Wetness Index double* m_pMeltRate; double* m_pSnowStorage; //----------------------------------------------------------------- // //----------------------------------------------------------------- // lag coefficient // this parameter is to account for the time lag between the streamflow signal // at the subbasin outlet and the time of this signal at // the catchment/bain outlet int m_lag; int m_delay; double m_area; // sub-catchment area [km2] double m_sum_eRainGTpcp; private: }; //------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // CLASS Cihacres_basin // /////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------- class Cihacres_basin : public CSG_Module { public: /////////////////////////////////////////////////////////////////// // // CONSTRUCTORS // /////////////////////////////////////////////////////////////////// // default Cihacres_basin(void); // destructor ~Cihacres_basin(void); protected: /////////////////////////////////////////////////////////////////// // // PROTECTED FUNCTIONS // /////////////////////////////////////////////////////////////////// // execute module virtual bool On_Execute (void); private: /////////////////////////////////////////////////////////////////// // // PRIVATE PARAMETERS // /////////////////////////////////////////////////////////////////// //----------------------------------------------------------------- //---------------------------------- // parameters of first module dialog //---------------------------------- int m_nSubbasins; // number of sub-basins //double m_Area_tot; // total catchment area [km2] int m_IHAC_version; // Different versions of IHACRES exist, corresponding // to the version... int m_StorConf; // Storage configuration // 0 = single, 1 = two in parallel, 2 = two in series bool m_bSnowModule; // true if snow module is active int m_nStorages; // number of storages //---------------------------------- // parameters of second module dialog //---------------------------------- // time series variables CSG_Table* m_p_InputTable; // IHACRES input table int m_nValues; // number of selected records date_array m_vec_date; double* m_p_Q_obs_m3s; // pointer containing observed streamflow in [m3/s] double* m_p_Q_obs_mmday; // pointer containing observed streamflow in [mm] Cihacres_subbasin* m_pSubbasin; // Class Cihacres_elev_bands // Field numbers int m_dateField; // table field numbers int m_streamflowField; // subbasin band parameters int* m_p_pcpField; int* m_p_tmpField; //double* m_p_mean_elev; //---------------------------------- // parameters of third module dialog //---------------------------------- CSG_String m_date1; // first day of time series YYYYMMDD CSG_String m_date2; // last day int m_first; int m_last; //---------------------------------- // Model parameter (in: ihacres_eq.h) //---------------------------------- C_IHAC_LinearParms* m_p_linparms; // parameters of the linear storage module C_IHAC_NonLinearParms* m_p_nonlinparms; // parameters of the non-linear rainfall loss module CSnowParms* m_pSnowparms; // 3 snow module paramters CSnowModule* m_p_SnowModule; //int m_delay; double m_vq; double m_vs; CSG_Table* m_pTable; //-------------------------------------------------------- // PRIVATE MEMBER FUNCTIONS //-------------------------------------------------------- void _Init_Subbasins(int n); // n = m_nElevBands void _Init_Pointers(int nvals); void _CreateDialog1(); bool _CreateDialog2(); bool _CreateDialog3(); void _ReadInputFile(); void _CalcSnowModule(int nSubbasins); void _Simulate_NonLinearModule(int nSubbasins); void _Simulate_Streamflow(int nSubbasins, double Q_init); void _CreateTableSim(); // Class ihacres_eq Cihacres_eq ihacres; }; #endif /* HEADER_INCLUDED__ihacres_basin_H */ saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.cpp000066400000000000000000001054051224124640700274660ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_cal2.cpp 1261 2011-12-16 15:12:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // ihacres_cal2 // // // //-------------------------------------------------------// // // // ihacres_cal.cpp // // // // Copyright (C) 2008 by // // Stefan Liersch // //-------------------------------------------------------// // // // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // // // 2008-01-15 // /////////////////////////////////////////////////////////// // //-------------------------------------------------------// // References: // Jakeman, A.J. / Hornberger, G.M (1993). // How Much Complexity Is Warranted in a // Rainfall-Runoff Model? // Water Resources Research, (29), NO. 8 (2637-2649) // Kokkonen, T. S. et al. (2003). // Predicting daily flows in ungauged catchments: // model regionalization from catchment descriptors // at the Coweeta Hydrologic Laboratory, North Carolina // Hydrological Processes (17), 2219-2238 // Croke, B. F. W., W. S. Merritt, et al. (2004). // A dynamic model for predicting hydrologic response // to land cover changes in gauged and // ungauged catchments. // Journal Of Hydrology 291(1-2): 115-131. //-------------------------------------------------------// //--------------------------------------------------------- // ToDo //--------------------------------------------------------- // - beste Simulation automatisch rausschreiben //--------------------------------------------------------- #include // used for textfile output (test only) #include // used for textfile output (test only) #include // random numbers #include // random numbers #include "ihacres_cal2.h" // #include "model_tools.h" // already in ihacres_eq.h #include "convert_sl.h" //--------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // Constructor // /////////////////////////////////////////////////////////////////////// Cihacres_cal2::Cihacres_cal2(void) { //----------------------------------------------------- // 1. Info... Set_Name(_TL("IHACRES Calibration (2)")); Set_Author(SG_T("copyrights (c) 2008 Stefan Liersch")); Set_Description(_TW("Calibration Tool for the Model IHACRES \n \n \n" "Reference: \n \n" "Jakeman, A.J. / Hornberger, G.M. (1993). \n" "How Much Complexity Is Warranted in a Rainfall-Runoff Model? \n" "Water Resources Research, (29), NO. 8 (2637-2649) \n \n" "Croke, B. F. W., W. S. Merritt, et al. (2004).\n" "A dynamic model for predicting hydrologic response " "to land cover changes in gauged and " "ungauged catchments. \n" "Journal Of Hydrology 291(1-2): 115-131." )); Parameters.Add_Table_Output( NULL , "TABLEout" , _TL("Table"), _TL("") ); //----------------------------------------------------- // Create First Module Dialog _CreateDialog1(); //----------------------------------------------------- } /////////////////////////////////////////////////////////////////////// // // Destructor // /////////////////////////////////////////////////////////////////////// Cihacres_cal2::~Cihacres_cal2(void) { //if (m_bSnowModule) //{ // delete m_pSnowModule; // delete[] m_pMeltRate; //} } /////////////////////////////////////////////////////////////////////// // // On_Execute() // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------- // This function is executed when the user is pressing the OK button // in the first module dialog bool Cihacres_cal2::On_Execute(void) { int first, last; double NSE_temp = 0.0; double NSE_max = -9999.9; string nse, nse_text; //--------------------------------------------------------- // Assign parameters from First Module Dialog m_pTable = Parameters("TABLE") ->asTable(); // Field numbers m_dateField = Parameters("DATE_Field") ->asInt(); m_dischargeField= Parameters("DISCHARGE_Field") ->asInt(); m_pcpField = Parameters("PCP_Field") ->asInt(); m_tmpField = Parameters("TMP_Field") ->asInt(); m_inflowField = Parameters("INFLOW_Field") ->asInt(); m_bUpstream = Parameters("bUPSTREAM") ->asBool(); m_bTMP = Parameters("USE_TMP") ->asBool(); m_nsim = Parameters("NSIM") ->asInt(); m_area = Parameters("AREA") ->asDouble(); //m_dev_eRainDis = Parameters("DEV_ERAINDIS") ->asDouble(); //m_dev_eRainPCP = Parameters("DEV_ERAINPCP") ->asDouble(); m_storconf = Parameters("STORAGE") ->asInt(); m_IHAC_version = Parameters("IHACVERS") ->asInt(); m_bSnowModule = Parameters("SNOW_MODULE") ->asBool(); first = last = 0; //--------------------------------------------------------- //--------------------------------------------------------- // After pressing OK in the first Dialog Dialog2 appears. // In the sec if ( _CreateDialog2() ) //--------------------------------------------------------- { //--------------------------------------------------------- // Searching the first and the last record of the time range ihacres.AssignFirstLastRec(*m_pTable, first, last, m_date1, m_date2, m_dateField); //--------------------------------------------------------- //--------------------------------------------------------- // Initialize arrays m_nValues = last - first + 1; _InitPointers(); //--------------------------------------------------------- //--------------------------------------------------------- // Assign selected time range to vector m_vec_date, // discharge[], pcp[], and tmp[] _ReadInputTable(first, last); //--------------------------------------------------------- //--------------------------------------------------------- // Convert streamflow from m3/s to mm/day if (m_bUpstream) { // if the subbasin is upstream (without external inflow) then everything // is as it should be. m_p_Q_obs_mmday = model_tools::m3s_to_mmday(m_p_Q_obs_m3s,m_p_Q_obs_mmday,m_nValues,m_area); } else { // if the subbasin is downstream of other subbasins, thus there // are external inflows the array m_p_Q_obs_mmday must be calculated as following: // m_p_Q_obs_mmday = // (observed streamflow at the outlet of the subbasin) - (observed inflow from the upstream subbasin(s)) _Calc_ObsMinInflow(); m_p_Q_obs_mmday = model_tools::m3s_to_mmday(m_p_Q_dif_m3s, m_p_Q_obs_mmday, m_nValues, m_area); } // calculate sum of observed discharge in [mm] m_sum_obsDisMM = ihacres.SumVector(m_p_Q_obs_mmday, m_nValues); //--------------------------------------------------------- //--------------------------------------------------------- m_pTable = SG_Create_Table(); _CreateOutputTable(); m_counter = 0; //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // SIMULATION // /////////////////////////////////////////////////////////// // initialize random function srand((unsigned) time(NULL)); // using time.h for (int sim = 0; sim < m_nsim && Set_Progress(sim, m_nsim); sim++) { _CalcNonLinearModule(); _CalcLinearModule(); _CalcEfficiency(); // write in output table if criterion is fulfilled NSE_temp = ihacres._Assign_NSE_temp(m_obj_func, m_NSE, m_NSE_highflow, m_NSE_lowflow); if (NSE_temp > m_NSEmin) { if (NSE_temp > NSE_max) { NSE_max = NSE_temp; nse = convert_sl::Double2String(NSE_max).c_str(); nse_text = "max. NSE "; nse_text += nse; Process_Set_Text(CSG_String(nse_text.c_str())); } _WriteOutputTable(); } } //--------------------------------------------------------- m_pTable->Set_Name(SG_T("IHACRES_cal2")); Parameters("TABLEout")->Set_Value(m_pTable); //--------------------------------------------------------- _DeletePointers(); //--------------------------------------------------------- return(true); } // end if (_CreateDialog2()) return(false); } /////////////////////////////////////////////////////////////////////// // // PRIVATE FUNCTIONS // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // InitPointers() //--------------------------------------------------------------------- void Cihacres_cal2::_InitPointers() { int n = m_nValues; m_vec_date.resize(n); if (!m_bUpstream) { m_p_Q_Inflow_m3s = new double[n]; m_p_Q_dif_m3s = new double[n]; } m_p_Q_obs_m3s = new double[n]; m_p_Q_obs_mmday = new double[n]; m_p_Q_sim_mmday = new double[n]; m_pPCP = new double[n]; m_pTMP = new double[n]; m_pExcessRain = new double[n]; m_pTw = new double[n]; m_pWI = new double[n]; if (m_bSnowModule) m_pMeltRate = new double[n]; } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // DeletePointers() //--------------------------------------------------------------------- void Cihacres_cal2::_DeletePointers() { m_vec_date.resize(0); if (!m_bUpstream) { delete[] m_p_Q_Inflow_m3s; delete[] m_p_Q_dif_m3s; } delete[] m_p_Q_obs_m3s; delete[] m_p_Q_obs_mmday; delete[] m_p_Q_sim_mmday; delete[] m_pPCP; delete[] m_pTMP; delete[] m_pExcessRain; delete[] m_pTw; delete[] m_pWI; if (m_bSnowModule) delete[] m_pMeltRate; } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // ReadInputTable() //--------------------------------------------------------------------- void Cihacres_cal2::_ReadInputTable(int first, int last) { int j, k; for (j = 0, k = first; j < m_nValues, k < last + 1; j++, k++) { // put the date string into the vector m_vec_date[j].append(CSG_String(m_pTable->Get_Record(k)->asString(m_dateField))); m_p_Q_obs_m3s[j]= m_pTable->Get_Record(k)->asDouble(m_dischargeField); m_pPCP[j] = m_pTable->Get_Record(k)->asDouble(m_pcpField); m_pTMP[j] = m_pTable->Get_Record(k)->asDouble(m_tmpField); if (!m_bUpstream) m_p_Q_Inflow_m3s[j] = m_pTable->Get_Record(k)->asDouble(m_inflowField); } } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Calculate observed streamflow time series if inflow occurs //--------------------------------------------------------------------- void Cihacres_cal2::_Calc_ObsMinInflow() { for (int i = 0; i < m_nValues; i++) { m_p_Q_dif_m3s[i] = m_p_Q_obs_m3s[i] - m_p_Q_Inflow_m3s[i]; if (m_p_Q_dif_m3s[i] < 0.0) m_p_Q_obs_mmday[i] = 0; } } //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // // SIMULATION // // /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // // NON-LINEAR MODULE // /////////////////////////////////////////////////////////////////////// void Cihacres_cal2::_CalcNonLinearModule() { double eR_init = 0.0; //------------------------------------------------------------- // Assign random values //------------------------------------------------------------- if (m_bSnowModule) { m_SnowParms.T_Rain = model_tools::Random_double(m_T_Rain_lb, m_T_Rain_ub); m_SnowParms.T_Melt = model_tools::Random_double(m_T_Melt_lb, m_T_Melt_ub); m_SnowParms.DD_FAC = model_tools::Random_double(m_DD_FAC_lb, m_DD_FAC_ub); m_pSnowModule = new CSnowModule(m_pTMP, m_pPCP, m_nValues, m_SnowParms.T_Rain, m_SnowParms.T_Melt, m_SnowParms.DD_FAC); m_pMeltRate = m_pSnowModule->Get_MeltRate(m_pMeltRate, m_nValues); delete m_pSnowModule; } m_Tw = model_tools::Random_double(m_TwConst_lb, m_TwConst_ub); m_f = model_tools::Random_double(m_f_lb, m_f_ub); m_c = model_tools::Random_double(m_c_lb, m_c_ub); if (m_IHAC_version == 1) { // Croke etal. (2005) m_l = model_tools::Random_double(m_l_lb, m_l_ub); m_p = model_tools::Random_double(m_p_lb, m_p_ub); } //------------------------------------------------------------- //------------------------------------------------------------- // Simulation (non-linear module) //------------------------------------------------------------- switch(m_IHAC_version) { case 0: // Jakeman & Hornberger (1993) if (m_bTMP) { ihacres.CalcWetnessTimeConst(m_pTMP, m_pTw, m_Tw, m_f, m_nValues); } if (m_bSnowModule) { ihacres.CalcWetnessIndex(m_pTw, m_pPCP, m_pTMP, m_pWI, 0.5, m_c, m_bSnowModule, m_SnowParms.T_Rain, m_nValues); ihacres.CalcExcessRain(m_pPCP, m_pTMP, m_pWI,m_pExcessRain,eR_init, m_sum_eRainGTpcp, m_nValues, m_bSnowModule, m_SnowParms.T_Rain, m_SnowParms.T_Melt, m_pMeltRate); } else { ihacres.CalcWetnessIndex(m_pTw, m_pPCP, m_pTMP, m_pWI, 0.5, m_c, m_bSnowModule, 0, m_nValues); ihacres.CalcExcessRain(m_pPCP, m_pTMP, m_pWI, m_pExcessRain,eR_init, m_sum_eRainGTpcp, m_nValues, m_bSnowModule, 0,0,0); } // end if (m_bSnowModule) break; case 1: // Croke et al. (2005) Redesign if (m_bTMP) { ihacres.CalcWetnessTimeConst_Redesign(m_pTMP, m_pTw, m_Tw, m_f, m_nValues); } if (m_bSnowModule) { ihacres.CalcWetnessIndex_Redesign(m_pTw, m_pPCP, m_pWI, 0.5, m_bSnowModule, m_SnowParms.T_Rain, m_nValues); ihacres.CalcExcessRain_Redesign(m_pPCP, m_pTMP, m_pWI, m_pExcessRain, eR_init, m_sum_eRainGTpcp, m_nValues, m_c, m_l, m_p, m_bSnowModule, m_SnowParms.T_Rain, m_SnowParms.T_Melt, m_pMeltRate); } else { ihacres.CalcWetnessIndex_Redesign(m_pTw, m_pPCP, m_pWI, 0.5, m_bSnowModule, 0, m_nValues); ihacres.CalcExcessRain_Redesign(m_pPCP, m_pTMP, m_pWI, m_pExcessRain, eR_init, m_sum_eRainGTpcp, m_nValues, m_c, m_l, m_p, m_bSnowModule, 0,0,0); } break; } // end switch(m_IHAC_version) } //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // LINEAR MODULE // /////////////////////////////////////////////////////////////////////// void Cihacres_cal2::_CalcLinearModule() { //------------------------------------------------------------- // Assign random values //------------------------------------------------------------- switch(m_storconf) { case 0: // single storage m_a = model_tools::Random_double(m_a_lb, m_a_ub); m_b = model_tools::Random_double(m_b_lb, m_b_ub); break; case 1: // two storages in parallel do { m_aq = model_tools::Random_double(m_aq_lb, m_aq_ub); m_as = model_tools::Random_double(m_as_lb, m_as_ub); m_bq = model_tools::Random_double(m_bq_lb, m_bq_ub); // Calculate parameter m_vq to check parms aq and bq // Equation after Jakeman & Hornberger (1993) m_vq = m_bq / ( 1 + m_aq ); } while (m_vq < 0.0 || m_vq > 1.0); m_bs = ihacres.Calc_Parm_BS(m_aq, m_as, m_bq); break; } //------------------------------------------------------------- //------------------------------------------------------------- // Simulate streamflow (linear module) //------------------------------------------------------------- switch(m_storconf) { case 0: // single storage ihacres.SimStreamflowSingle(m_pExcessRain, m_p_Q_obs_mmday[0], m_p_Q_sim_mmday, m_delay, m_a, m_b, m_nValues); break; case 1: // two storages in parallel ihacres.SimStreamflow2Parallel(m_pExcessRain, m_p_Q_sim_mmday, m_p_Q_obs_mmday[0], m_aq, m_as, m_bq, m_bs, m_vq, m_vs, m_IHAC_version, m_nValues, m_delay); break; case 2: // two storages in series break; } // end switch(m_StorConf) } //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // EFFICIENCY // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // Nash-Sutcliffe efficiency //--------------------------------------------------------------------- void Cihacres_cal2::_CalcEfficiency() { m_NSE = model_tools::CalcEfficiency(m_p_Q_obs_mmday, m_p_Q_sim_mmday,m_nValues); m_NSE_highflow = model_tools::Calc_NSE_HighFlow(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues); m_NSE_lowflow = model_tools::Calc_NSE_LowFlow(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues); m_PBIAS = model_tools::Calc_PBIAS(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues); } //--------------------------------------------------------------------- ///////////////////////////////////////////////////////////////////////////// // // CREATE TABLES // ///////////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // Create output table //--------------------------------------------------------------------- void Cihacres_cal2::_CreateOutputTable() { // creating the column titles m_pTable->Add_Field("NSE", SG_DATATYPE_Double); m_pTable->Add_Field("NSE_high", SG_DATATYPE_Double); m_pTable->Add_Field("NSE_low", SG_DATATYPE_Double); m_pTable->Add_Field("PBIAS", SG_DATATYPE_Double); m_pTable->Add_Field("eR_ovest", SG_DATATYPE_Double); m_pTable->Add_Field("vq", SG_DATATYPE_Double); m_pTable->Add_Field("vs", SG_DATATYPE_Double); m_pTable->Add_Field("T(q)", SG_DATATYPE_Double); m_pTable->Add_Field("T(s)", SG_DATATYPE_Double); m_pTable->Add_Field("Tw", SG_DATATYPE_Double); m_pTable->Add_Field("f", SG_DATATYPE_Double); m_pTable->Add_Field("c", SG_DATATYPE_Double); if ( m_IHAC_version == 1 ) // Croke etal. (2005) { m_pTable->Add_Field("l", SG_DATATYPE_Double); m_pTable->Add_Field("p", SG_DATATYPE_Double); } if (m_bSnowModule) { m_pTable->Add_Field("T_Rain", SG_DATATYPE_Double); m_pTable->Add_Field("T_Melt", SG_DATATYPE_Double); m_pTable->Add_Field("DD_FAC", SG_DATATYPE_Double); } switch(m_storconf) { case 0: // single m_pTable->Add_Field("a", SG_DATATYPE_Double); m_pTable->Add_Field("b", SG_DATATYPE_Double); break; case 1: // two storages in parallel m_pTable->Add_Field("aq", SG_DATATYPE_Double); m_pTable->Add_Field("as", SG_DATATYPE_Double); m_pTable->Add_Field("bq", SG_DATATYPE_Double); m_pTable->Add_Field("bs", SG_DATATYPE_Double); break; } } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Create output table //--------------------------------------------------------------------- void Cihacres_cal2::_WriteOutputTable() { int field = 0; CSG_Table_Record *pRecord; // add a new record to the table m_pTable->Add_Record(); pRecord = m_pTable->Get_Record(m_counter); // writing the data to the current row pRecord->Set_Value(field,m_NSE); field++; pRecord->Set_Value(field,m_NSE_highflow); field++; pRecord->Set_Value(field,m_NSE_lowflow); field++; pRecord->Set_Value(field,m_PBIAS); field++; pRecord->Set_Value(field,m_sum_eRainGTpcp); field++; pRecord->Set_Value(field,m_vq); field++; pRecord->Set_Value(field,m_vs); field++; pRecord->Set_Value(field,ihacres.Calc_TimeOfDecay(m_aq)); field++; pRecord->Set_Value(field,ihacres.Calc_TimeOfDecay(m_as)); field++; pRecord->Set_Value(field,m_Tw); field++; pRecord->Set_Value(field,m_f); field++; pRecord->Set_Value(field,m_c); field++; if ( m_IHAC_version == 1 ) // Croke et al. (2005) { pRecord->Set_Value(field,m_l); field++; pRecord->Set_Value(field,m_p); field++; } if ( m_bSnowModule ) { pRecord->Set_Value(field,m_SnowParms.T_Rain); field++; pRecord->Set_Value(field,m_SnowParms.T_Melt); field++; pRecord->Set_Value(field,m_SnowParms.DD_FAC); field++; } switch(m_storconf) { case 0: // single pRecord->Set_Value(field,m_a); field++; pRecord->Set_Value(field,m_b); field++; break; case 1: // two storages in parallel pRecord->Set_Value(field,m_aq); field++; pRecord->Set_Value(field,m_as); field++; pRecord->Set_Value(field,m_bq); field++; pRecord->Set_Value(field,m_bs); field++; break; } m_counter++; // record counter } //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // DIALOGS // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // DIALOG 1 //--------------------------------------------------------------------- void Cihacres_cal2::_CreateDialog1() { CSG_Parameter *pNode; CSG_String s; pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "DATE_Field" , _TL("Date Column"), _TL("Select the column containing the Date") ); Parameters.Add_Table_Field( pNode , "DISCHARGE_Field" , _TL("Streamflow Column"), _TL("Select the Column containing Discharge Values") ); Parameters.Add_Table_Field( pNode , "PCP_Field" , _TL("Precipitation Column"), _TL("Select the Column containing precipitation Values") ); Parameters.Add_Table_Field( pNode , "TMP_Field" , _TL("Temperature Column"), _TL("Select the Column containing Temperature Values") ); Parameters.Add_Table_Field( pNode , "INFLOW_Field" , _TL("Subbasin Inflow"), _TL("Select the column containing inflow data to the subbasin") ); Parameters.Add_Value( pNode, "bUPSTREAM", _TL("Is the subbasin upstream (no external inflow)"), _TL("If checked, it means there is no external inflow to the subbasin"), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( pNode, "USE_TMP", _TL("Using temperature data?"), _TL("If checked, then temperature data are used."), PARAMETER_TYPE_Bool, true ); pNode = Parameters.Add_Value( NULL, "NSIM", _TL("Number of Simulations"), _TL("Number of Simulations for Calibration"), PARAMETER_TYPE_Int, 1000, 1, true, 10000000, true ); pNode = Parameters.Add_Value( NULL, "AREA", _TL("Area of the Watershed in [km2]"), _TL("Area of the Watershed in [km2] used for unit conversion"), PARAMETER_TYPE_Double, 100.0, 0.00001, true, 0.0, false ); //s.Printf(SG_T("Node2", 2); // pNode = Parameters.Add_Node(NULL,s,SG_T("Non-Linear Module",_TL("")); //Parameters.Add_Value( // pNode, "DEV_ERAINDIS", _TL("Maximum Deviation: ExcessRain-Streamflow [%]"), // _TL("Maximum Deviation between estimated excess rainfall and observed streamflow volumes"), // PARAMETER_TYPE_Double, // 5.0, 0.0, true, 50.0, true //); //Parameters.Add_Value( // pNode, "DEV_ERAINPCP", _TL("Maximum Overestimation of ExcessRain [%]"), // _TL("Maximum Sum of overestimated ExcessRain to total ExcessRain in [%]"), // PARAMETER_TYPE_Double, // 5.0, 0.0, true, 50.0, true //); s.Printf(SG_T("Node3"), 3); pNode = Parameters.Add_Node(NULL,s,SG_T("Storage Configuration"),_TL("")); Parameters.Add_Choice( pNode , "STORAGE" , _TL("Storage"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Single Storage"), // 0 _TL("Two Parallel Storages"), // 1 _TL("Two Storages in Series") // 2 ) ); s.Printf(SG_T("Node4"), 4); pNode = Parameters.Add_Node(NULL,s,_TL("IHACRES Version"),_TL("")); Parameters.Add_Choice( pNode , "IHACVERS" , _TL("IHACRES Version"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Jakeman & Hornberger (1993)"), // 0 _TL("Croke et al. (2005)") // 1 ) ); Parameters.Add_Value( pNode, "SNOW_MODULE", _TL("Snow Module on/off"), _TL("If checked the snow module is active"), PARAMETER_TYPE_Bool, true ); Parameters.Add_Table_Output( NULL , "TABLEout" , _TL("Table"), _TL("") ); Parameters.Add_Table_Output( NULL , "TABLEparms" , _TL("Table"), _TL("") ); } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // DIALOG 2 //--------------------------------------------------------------------- bool Cihacres_cal2::_CreateDialog2() { CSG_String s; CSG_Parameters P; // used to add Parameters in the second dialog CSG_Parameter *pNode, *pNode1; // Dialog design P.Set_Name(_TL("IHACRES Model Parameters")); s.Printf(SG_T("Node1"), 1); pNode = P.Add_Node(NULL,s,SG_T("Time Range"),_TL("")); s.Printf(SG_T("FDAY") , 1-1); P.Add_String(pNode,s,_TL("First Day"),_TL(""), m_pTable->Get_Record(0)->asString(m_dateField)); s.Printf(SG_T("LDAY") , 1-2); P.Add_String(pNode,s,_TL("Last Day"),_TL(""), m_pTable->Get_Record(m_pTable->Get_Record_Count()-1)->asString(m_dateField)); //----------------------------------------------------------------- // Non-linear parameters //----------------------------------------------------------------- s.Printf(SG_T("Node2"), 2); pNode = P.Add_Node(NULL,s,SG_T("Non-Linear Module"),_TL("")); P.Add_Value( pNode, "TwFAC_lb", _TL("(Tw) wetness decline time constant [lower bound]"), _TW("Tw is approximately the time constant, or inversely," "the rate at which the catchment wetness declines in the absence of rainfall"), PARAMETER_TYPE_Double, 1.0, 0.01, true, 150.0, true ); P.Add_Value( pNode, "TwFAC_ub", _TL("(Tw) wetness decline time constant [upper bound]"), _TW("Tw is approximately the time constant, or inversely,SG_T(" "the rate at which the catchment wetness declines in the absence of rainfall"), PARAMETER_TYPE_Double, 50.0, 0.01, true, 150.0, true ); if (m_bTMP) // if observed temperature data are used { P.Add_Value( pNode , "TFAC_lb" , _TL("(f) Temperature Modulation Factor [lower bound]"), _TL("Temperature Modulation Factor f"), PARAMETER_TYPE_Double, 0.05, 0.0001, true, 5.0, true ); P.Add_Value( pNode , "TFAC_ub" , _TL("(f) Temperature Modulation Factor [upper bound]"), _TL("Temperature Modulation Factor f"), PARAMETER_TYPE_Double, 0.5, 0.0001, true, 5.0, true ); } P.Add_Value( pNode, "CFAC_lb", _TL("(c) Parameter [lower bound]"), _TL("Parameter (c) to fit streamflow volume"), PARAMETER_TYPE_Double, 0.001, 0.0, true, 1.0, true ); P.Add_Value( pNode, "CFAC_ub", _TL("(c) Parameter [upper bound]"), _TL("Parameter (c) to fit streamflow volume"), PARAMETER_TYPE_Double, 0.01, 0.0, true, 1.0, true ); if (m_IHAC_version == 1) // Croke et al. (2005) Redesign { s.Printf(SG_T("Node2-2"), 2-2); pNode1 = P.Add_Node(pNode,s,SG_T("Soil moisture index threshold"),_TL("")); P.Add_Value( pNode1 , "SMI_L_lb" , _TL("Soil moisture index (l) [lower bound]"), _TL("Soil moisture index threshold (l), lower bound"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); P.Add_Value( pNode1 , "SMI_L_ub" , _TL("Soil moisture index (l) [upper bound]"), _TL("Soil moisture index threshold (l), upper bound"), PARAMETER_TYPE_Double, 5.0, 0.0, true, 5.0, true ); s.Printf(SG_T("Node2-3"), 2-3); pNode1 = P.Add_Node(pNode,s,_TL("Power on soil moisture"),_TL("")); P.Add_Value( pNode1 , "SM_P_lb" , _TL("Power on soil (p) [lower bound]"), _TL("Power on soil moisture (p), lower bound"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); P.Add_Value( pNode1 , "SM_P_ub" , _TL("Power on soil (p) [upper bound]"), _TL("Power on soil moisture (p), upper bound"), PARAMETER_TYPE_Double, 5.0, 0.0, true, 5.0, true ); } //----------------------------------------------------------------- // Linear module //----------------------------------------------------------------- switch(m_storconf) { case 0: // single storage s.Printf(SG_T("Node3"), 3); pNode = P.Add_Node(NULL,s,_TL("Linear Module"),_TL("")); s.Printf(SG_T("Node3-1"), 3-1); pNode1 = P.Add_Node(pNode,s,_TL("Parameter (a)"),_TL("")); P.Add_Value( pNode1, "AFAC_lb", _TL("(a) [lower bound]"), _TL(""), PARAMETER_TYPE_Double, -0.5, -0.99, true, -0.01, true ); P.Add_Value( pNode1, "AFAC_ub", _TL("(a) [upper bound]"), _TL(""), PARAMETER_TYPE_Double, -0.9, -0.99, true, -0.01, true ); s.Printf(SG_T("Node3-2"), 3-2); pNode1 = P.Add_Node(pNode,s,_TL("Parameter (b)"),_TL("")); P.Add_Value( pNode1, "BFAC_lb", _TL("(b) [lower bound]"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.001, true, 1.0, true ); P.Add_Value( pNode1, "BFAC_ub", _TL("(b) [upper bound]"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.001, true, 1.0, true ); break; case 1: // two parallel storages s.Printf(SG_T("Node3"), 3); pNode = P.Add_Node(NULL,s,_TL("Linear Module"),_TL("")); // Parameter a s.Printf(SG_T("Node3-1"), 3-1); pNode1 = P.Add_Node(pNode,s,_TL("Parameter (a)"),_TL("")); P.Add_Value( pNode1, "AQ_lb", _TL("a(q) [lower bound]"), _TL(""), PARAMETER_TYPE_Double, -0.5, -0.99, true, -0.01, true ); P.Add_Value( pNode1, "AQ_ub", _TL("a(q) [upper bound]"), _TL(""), PARAMETER_TYPE_Double, -0.7, -0.99, true, -0.01, true ); P.Add_Value( pNode1, "AS_lb", _TL("a(s) [lower bound]"), _TL(""), PARAMETER_TYPE_Double, -0.7, -0.99, true, -0.01, true ); P.Add_Value( pNode1, "AS_ub", _TL("a(s) [upper bound]"), _TL(""), PARAMETER_TYPE_Double, -0.99, -0.99, true, -0.01, true ); // Parameter b s.Printf(SG_T("Node3-2"), 3-2); pNode1 = P.Add_Node(pNode,s,SG_T("Parameter (b)"),_TL("")); P.Add_Value( pNode1, "BQ_lb", _TL("b(q) [lower bound]"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true, 1.0, true ); P.Add_Value( pNode1, "BQ_ub", _TL("b(q) [upper bound]"), _TL(""), PARAMETER_TYPE_Double, 0.5, 0.0, true, 1.0, true ); break; case 2: // two storages in series break; } // end switch (m_storconf) //----------------------------------------------------------------- // Snow module //----------------------------------------------------------------- if (m_bSnowModule) // if snow module is active { s.Printf(SG_T("Node2-4"), 2-4); pNode = P.Add_Node(NULL,s,SG_T("Snow Module"),_TL("")); P.Add_Value( pNode, "T_RAIN_lb", _TL("Temperature Threshold for Rainfall (lower bound)"), _TL("Below this threshold precipitation will fall as snow"), PARAMETER_TYPE_Double, -1.0, -10.0, true, 10.0, true ); P.Add_Value( pNode, "T_RAIN_ub", _TL("Temperature Threshold for Rainfall (upper bound)"), _TL("Below this threshold precipitation will fall as snow"), PARAMETER_TYPE_Double, 1.0, -10.0, true, 10.0, true ); P.Add_Value( pNode, "T_MELT_lb", _TL("Temperature Threshold for Melting (lower bound)"), _TL("Above this threshold snow will start to melt"), PARAMETER_TYPE_Double, -1.0, -5.0, true, 10.0, true ); P.Add_Value( pNode, "T_MELT_ub", _TL("Temperature Threshold for Melting (upper bound)"), _TL("Above this threshold snow will start to melt"), PARAMETER_TYPE_Double, 1.0, -5.0, true, 10.0, true ); P.Add_Value( pNode, "DD_FAC_lb", _TL("Day-Degree Factor (lower bound)"), _TL("Day-Degree Factor depends on catchment characteristics"), PARAMETER_TYPE_Double, 0.7, 0.7, true, 9.2, true ); P.Add_Value( pNode, "DD_FAC_ub", _TL("Day-Degree Factor (upper bound)"), _TL("Day-Degree Factor depends on catchment characteristics"), PARAMETER_TYPE_Double, 9.2, 0.7, true, 9.2, true ); } s.Printf(SG_T("Node4"), 4); pNode = P.Add_Node(NULL,s,SG_T("Time Delay after Start of Rainfall (INTEGER)"),_TL("")); P.Add_Value( pNode1, "DELAY", _TL("Time Delay (Rain-Runoff)"), _TL("The delay after the start of rainfall, before the discharge starts to rise."), PARAMETER_TYPE_Int, 1, 1, true, 100, true ); s.Printf(SG_T("Node6"), 6); pNode = P.Add_Node(NULL,s,SG_T("Nash-Sutcliffe Efficiency"),_TL("")); P.Add_Choice( pNode, "OBJ_FUNC" , _TL("Objective Function"), _TL(""), _TL("NSE|NSE high flow|NSE low flow") ); P.Add_Value( pNode, "NSEMIN", _TL("Minimum Nash-Sutcliffe Efficiency"), _TL("Minimum Nash-Sutcliffe Efficiency required to print simulation to calibration table"), PARAMETER_TYPE_Double, 0.7, 0.1, true, 1.0, true ); // End of second dialog design if( SG_UI_Dlg_Parameters(&P, _TL("Choose Time Range")) ) { // assign data from second dialog m_date1 = P(CSG_String::Format(SG_T("FDAY"),m_dateField).c_str())->asString(); m_date2 = P(CSG_String::Format(SG_T("LDAY"),m_dischargeField).c_str())->asString(); //------------------------------------------------- // assign non-linear module parameters //------------------------------------------------- m_TwConst_lb = P("TwFAC_lb") ->asDouble(); m_TwConst_ub = P("TwFAC_ub") ->asDouble(); m_c_lb = P("CFAC_lb") ->asDouble(); m_c_ub = P("CFAC_ub") ->asDouble(); if (m_bTMP) // if observed temperature data are used { m_f_lb = P("TFAC_lb") ->asDouble(); m_f_ub = P("TFAC_ub") ->asDouble(); } if (m_IHAC_version == 1) { m_l_lb = P("SMI_L_lb") ->asDouble(); m_l_ub = P("SMI_L_ub") ->asDouble(); m_p_lb = P("SM_P_lb") ->asDouble(); m_p_ub = P("SM_P_ub") ->asDouble(); } //------------------------------------------------- //------------------------------------------------- // assign linear module parameters //------------------------------------------------- switch (m_storconf) { case 0: m_a_lb = P("AFAC_lb") ->asDouble(); m_a_ub = P("AFAC_ub") ->asDouble(); m_b_lb = P("BFAC_lb") ->asDouble(); m_b_ub = P("BFAC_ub") ->asDouble(); m_delay = P("DELAY") ->asInt(); m_NSEmin = P("NSEMIN") ->asDouble(); break; case 1: // two parallel storages m_aq_lb = P("AQ_lb") ->asDouble(); m_aq_ub = P("AQ_ub") ->asDouble(); m_as_lb = P("AS_lb") ->asDouble(); m_as_ub = P("AS_ub") ->asDouble(); m_bq_lb = P("BQ_lb") ->asDouble(); m_bq_ub = P("BQ_ub") ->asDouble(); m_delay = P("DELAY") ->asInt(); m_obj_func = P("OBJ_FUNC") ->asInt(); m_NSEmin = P("NSEMIN") ->asDouble(); break; case 2: // two storages in series break; } // end switch //------------------------------------------------- if (m_bSnowModule) { m_T_Rain_lb = P("T_RAIN_lb") ->asDouble(); m_T_Rain_ub = P("T_RAIN_ub") ->asDouble(); m_T_Melt_lb = P("T_MELT_lb") ->asDouble(); m_T_Melt_ub = P("T_MELT_ub") ->asDouble(); m_DD_FAC_lb = P("DD_FAC_lb") ->asDouble(); m_DD_FAC_ub = P("DD_FAC_ub") ->asDouble(); } return(true); } else { return(false); } } saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_cal2.h000066400000000000000000000216111224124640700271270ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_cal2.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // IHACRES // // // //-------------------------------------------------------// // // // ihacres_cal2.h // // // // Copyright (C) 2008 by // // Stefan Liersch // //-------------------------------------------------------// // // // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // // // 2008-01-15 // // // /////////////////////////////////////////////////////////// //*******************************************************// // ToDo // //-------------------------------------------------------// // - //*******************************************************// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ihacres_cal2_H #define HEADER_INCLUDED__ihacres_cal2_H //--------------------------------------------------------- #include "MLB_Interface.h" #include "ihacres_eq.h" #include // used for storing date string values in array //using namespace std; typedef std::vector date_array; //typedef std::vector vector_d; //typedef std::vector vector_i; //typedef std::vector vector_b; //--------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // CLASS Cihacres_cal2 // /////////////////////////////////////////////////////////////////////// class Cihacres_cal2 : public CSG_Module { public: // constructor Cihacres_cal2(void); // destructor virtual ~Cihacres_cal2(void); protected: /////////////////////////////////////////////////////////////////// // // PROTECTED FUNCTIONS // /////////////////////////////////////////////////////////////////// // execute module virtual bool On_Execute (void); private: /////////////////////////////////////////////////////////////////// // // PRIVATE PARAMETERS // /////////////////////////////////////////////////////////////////// //----------------------------------------------------------------- // EXTERNAL CLASSES //----------------------------------------------------------------- Cihacres_eq ihacres; // all IHACRES equations are defined here CSnowModule* m_pSnowModule; // (snow_module.h/.cpp) CSnowParms m_SnowParms; //----------------------------------------------------------------- //----------------------------------------------------------------- // TIME SERIES PARAMETERS //----------------------------------------------------------------- int m_nValues; // number of values / time steps in simulation date_array m_vec_date; // Vector containing date values double* m_p_Q_Inflow_m3s; double* m_p_Q_dif_m3s; double* m_p_Q_obs_m3s; // Array containing observed discharge values in [m3/s] double* m_p_Q_obs_mmday;// Array containing observed discharge values in [mm] double* m_p_Q_sim_mmday; // simulated streamflow [mm/day] double* m_pPCP; // Array containing observed precipitation values double* m_pTMP; // Array containing temperature values // non-linear module time series double* m_pExcessRain; // "excess" or effective rainfall [mm] double* m_pTw; // Tw is approximately the time constant, or inversely, // the rate at which the catchment wetness declines // in the absence of rainfall. double* m_pWI; // catchment wetness index double* m_pMeltRate; // if snow module is active double m_sum_obsDisMM; double m_sum_eRainGTpcp; //----------------------------------------------------------------- //----------------------------------------------------------------- // MODEL PARAMETERS / Cihacres_eq //----------------------------------------------------------------- // NON-LINEAR MODULE double m_Tw; double m_f; double m_c; double m_l; double m_p; // LINEAR MODULE double m_a; double m_b; double m_aq; double m_as; double m_bq; double m_bs; double m_vq; double m_vs; //----------------------------------------------------------------- //----------------------------------------------------------------- // PARAMETERS DIALOG 1 //----------------------------------------------------------------- CSG_Table* m_pTable; int m_dateField; int m_dischargeField; int m_pcpField; int m_tmpField; int m_inflowField; bool m_bUpstream; // true = upstream, false = downstream bool m_bTMP; int m_nsim; // number of simulations double m_area; // area of the watershed in [km2] //double m_dev_eRainDis; //double m_dev_eRainPCP; int m_storconf; int m_IHAC_version; bool m_bSnowModule; //----------------------------------------------------------------- //----------------------------------------------------------------- // PARAMETERS DIALOG 2 //----------------------------------------------------------------- CSG_String m_date1, m_date2; //----------------------------------------------------------------- // CALIBRATION PARAMETERS //----------------------------------------------------------------- // non linear module parameters double m_TwConst_ub; // Tw is approximately the time constant, or inversely, double m_TwConst_lb; // the rate at which the catchment wetness declines // in the absence of rainfall. double m_f_lb; // temperature modulation factor which double m_f_ub; // determines how Tw changes with temperature double m_c_lb; // Parameter c is chosen so that the volume double m_c_ub; // of excess rainfall is equal to the total // streamflow over the calibration period // Croke et al. (2005) Redesign of non-linear module double m_l_lb; // soil moisture index threshold double m_l_ub; double m_p_lb; // power on soil moisture double m_p_ub; // linear module parameters (single storage) double m_a_lb; double m_a_ub; double m_b_lb; double m_b_ub; // linear module parameters (2 storages) double m_aq_lb; double m_aq_ub; double m_as_lb; double m_as_ub; double m_bq_lb; double m_bq_ub; // SnowModule calibration parameters double m_T_Rain_lb; double m_T_Rain_ub; double m_T_Melt_lb; double m_T_Melt_ub; double m_DD_FAC_lb; double m_DD_FAC_ub; int m_delay; int m_obj_func; double m_NSEmin; double m_NSE; double m_NSE_highflow; double m_NSE_lowflow; double m_PBIAS; // percent bias int m_counter; // used by writing output table //----------------------------------------------------------------- /////////////////////////////////////////////////////////////////// // // PRIVATE FUNCTIONS // /////////////////////////////////////////////////////////////////// //----------------------------------------------------------------- void _InitPointers(); void _DeletePointers(); void _ReadInputTable(int first, int last); void _Calc_ObsMinInflow(); //----------------------------------------------------------------- //----------------------------------------------------------------- // Simulation //----------------------------------------------------------------- void _CalcNonLinearModule(); void _CalcLinearModule(); void _CalcEfficiency(); //----------------------------------------------------------------- //----------------------------------------------------------------- // Output //----------------------------------------------------------------- void _CreateOutputTable(); //void _CreateTable2Storages(); void _WriteOutputTable(); //void _WriteTable2Storages(); //----------------------------------------------------------------- //----------------------------------------------------------------- // Dialogs //----------------------------------------------------------------- void _CreateDialog1(); bool _CreateDialog2(); //----------------------------------------------------------------- }; #endif /* HEADER_INCLUDED__ihacres_cal2_H */ saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev.cpp000066400000000000000000000653521224124640700276060ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_elev.cpp 1261 2011-12-16 15:12:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // ihacres_elev.cpp // // // // Copyright (C) 2008 by // // Stefan Liersch // //-------------------------------------------------------// // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // 2008-01-08 // /////////////////////////////////////////////////////////// #include "ihacres_elev.h" #include "convert_sl.h" #include "model_tools.h" // TEST OUTPUT ONLY #include //--------------------------------------------------------------------- Cihacres_elev::Cihacres_elev() { //----------------------------------------------------- // 1. Info... Set_Name(_TL("IHACRES Elevation Bands")); Set_Author(SG_T("copyrights (c) 2008 Stefan Liersch")); Set_Description(_TW("The Rainfall-Runoff Model IHACRES \n \n \n" "Reference: \n \n" "Jakeman, A.J. / Hornberger, G.M. (1993). \n" "How Much Complexity Is Warranted in a Rainfall-Runoff Model? \n" "Water Resources Research, (29), NO. 8 (2637-2649) \n \n" "Croke, B. F. W., W. S. Merritt, et al. (2004).\n" "A dynamic model for predicting hydrologic response " "to land cover changes in gauged and " "ungauged catchments. \n" "Journal Of Hydrology 291(1-2): 115-131." )); Parameters.Add_Table_Output( NULL , "TABLEout" , _TL("Table"), _TL("") ); /////////////////////////////////////////////////////////////////// // FIRST MODULE DIALOG _CreateDialog1(); /////////////////////////////////////////////////////////////////// } Cihacres_elev::~Cihacres_elev() {} //--------------------------------------------------------------------- bool Cihacres_elev::On_Execute() { CSG_Parameters P; //std::ofstream f("_out_elev.txt"); // Assign Parameters from first Module Dialog //--------------------------------------------------------- int eb = Parameters("NELEVBANDS") ->asInt(); m_nElevBands = eb + 2; // because list starts with 2 ! m_Area_tot = Parameters("AREA_tot") ->asDouble(); m_IHAC_version = Parameters("IHACVERS") ->asInt(); m_StorConf = Parameters("STORAGE") ->asInt(); m_bSnowModule = Parameters("SNOW_MODULE") ->asBool(); //--------------------------------------------------------- //--------------------------------------------------------- // Assign number of storages m_nStorages = ihacres.Assign_nStorages(m_StorConf); //--------------------------------------------------------- //--------------------------------------------------------- // Initialize pointers _Init_ElevBands(m_nElevBands); m_p_linparms = new C_IHAC_LinearParms(m_nElevBands,m_nStorages); m_p_nonlinparms = new C_IHAC_NonLinearParms(m_nElevBands); //--------------------------------------------------------- //--------------------------------------------------------- // open second and third user dialog if ( _CreateDialog2() && _CreateDialog3()) { //--------------------------------------------------------- // searching the first and the last record of the time range ihacres.AssignFirstLastRec(*m_p_InputTable, m_first, m_last, m_date1, m_date2, m_dateField); m_nValues = m_last - m_first + 1; //--------------------------------------------------------- //--------------------------------------------------------- _Init_Pointers(m_nValues); //--------------------------------------------------------- //--------------------------------------------------------- // read input table _ReadInputFile(); //--------------------------------------------------------- //--------------------------------------------------------- // PERFORM STREAMFLOW SIMULATION // FOR EACH ELEVATION BAND //--------------------------------------------------------- // Convert Streamflow vector from m3/s*day-1 to mm/day m_p_Q_obs_mmday = model_tools::m3s_to_mmday(m_p_Q_obs_m3s, m_p_Q_obs_mmday, m_nValues, m_Area_tot); //--------------------------------------------------------- // SNOW MODULE //--------------------------------------------------------- for (int i = 0; i < m_nElevBands; i++) { if (m_bSnowModule) { _CalcSnowModule(i); } _Simulate_NonLinearModule(i); _Simulate_Streamflow(i); } //--------------------------------------------------------- m_pTable = SG_Create_Table(); _CreateTableSim(); // add tables to SAGA Workspace m_pTable->Set_Name(SG_T("IHACRES_ElevBands_output")); Parameters("TABLEout")->Set_Value(m_pTable); delete[] m_p_elevbands; // smtliche Unter-Pointer noch lschen delete[] m_p_pcpField; delete[] m_p_tmpField; delete m_p_linparms; delete m_p_nonlinparms; if (m_bSnowModule) delete[] m_pSnowparms; return(true); } // end if ( _CreateDialog2() ) // delete[] m_p_elevbands; // delete[] m_p_pcpFields; // delete[] m_p_tmpFields; // delete m_p_linparms; // delete m_p_nonlinparms; return(false); } //--------------------------------------------------------------------- void Cihacres_elev::_Init_ElevBands(int n) { // instantiate elevation bands m_p_elevbands = new Cihacres_elev_bands[n]; // instantiate field numbers m_p_pcpField = new int[n]; m_p_tmpField = new int[n]; if ( m_bSnowModule) { m_pSnowparms = new CSnowParms[n]; } } //--------------------------------------------------------------------- void Cihacres_elev::_Init_Pointers(int nvals) { m_vec_date.resize(nvals); m_p_Q_obs_m3s = new double[nvals]; m_p_Q_obs_mmday = new double[nvals]; for (int eb = 0; eb < m_nElevBands; eb++) { m_p_elevbands[eb].m_p_pcp = new double[nvals]; m_p_elevbands[eb].m_p_tmp = new double[nvals]; m_p_elevbands[eb].m_p_ER = new double[nvals]; m_p_elevbands[eb].m_p_streamflow_sim = new double[nvals]; m_p_elevbands[eb].m_p_Tw = new double[nvals]; m_p_elevbands[eb].m_p_WI = new double[nvals]; if (m_bSnowModule) { m_p_elevbands[eb].m_p_SnowStorage = new double[nvals]; m_p_elevbands[eb].m_p_MeltRate = new double[nvals]; } } } //--------------------------------------------------------------------- void Cihacres_elev::_ReadInputFile() { for (int j = 0, k = m_first; j < m_nValues, k < m_last + 1; j++, k++) { m_vec_date[j].append(CSG_String(m_p_InputTable->Get_Record(k)->asString(m_dateField))); m_p_Q_obs_m3s[j] = m_p_InputTable->Get_Record(k)->asDouble(m_streamflowField); for (int eb = 0; eb < m_nElevBands; eb++) { m_p_elevbands[eb].m_p_pcp[j] = m_p_InputTable->Get_Record(k)->asDouble(m_p_pcpField[eb]); m_p_elevbands[eb].m_p_tmp[j] = m_p_InputTable->Get_Record(k)->asDouble(m_p_tmpField[eb]); } } } //--------------------------------------------------------------------- void Cihacres_elev::_CalcSnowModule(int eb) { m_p_SnowModule = new CSnowModule(m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_pcp, m_nValues, m_pSnowparms[eb].T_Rain, m_pSnowparms[eb].T_Melt, m_pSnowparms[eb].DD_FAC); m_p_elevbands[eb].m_p_MeltRate = m_p_SnowModule->Get_MeltRate(m_p_elevbands[eb].m_p_MeltRate, m_nValues); m_p_elevbands[eb].m_p_SnowStorage = m_p_SnowModule->Get_SnowStorage(m_p_elevbands[eb].m_p_SnowStorage, m_nValues); delete m_p_SnowModule; } //--------------------------------------------------------------------- void Cihacres_elev::_Simulate_NonLinearModule(int eb) { double eR_init = 0.0; //---------------------------------------------------------- // calculate excess rainfall time series //---------------------------------------------------------- switch(m_IHAC_version) { case 0: // Jakeman & Hornberger (1993) // The parameter index (fourth parameter) is zero here, because // the parameter settings of the non-linear module are in all elevationbands equal. // If they should be different the index parameter can be used to identify the // corresponding elevation band. ihacres.CalcWetnessTimeConst(m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_Tw, m_p_nonlinparms, eb, m_nValues); // 0 = index (only one instance of m_p_nonlinparms) if (m_bSnowModule) { ihacres.CalcWetnessIndex(m_p_elevbands[eb].m_p_Tw, m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, 0.5, m_p_nonlinparms->mp_c[eb], m_bSnowModule, m_pSnowparms[eb].T_Rain, m_nValues); ihacres.CalcExcessRain(m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, m_p_elevbands[eb].m_p_ER, eR_init, m_p_elevbands[eb].m_sum_eRainGTpcp, m_nValues, m_bSnowModule, m_pSnowparms[eb].T_Rain, m_pSnowparms[eb].T_Melt, m_p_elevbands[eb].m_p_MeltRate); } else { ihacres.CalcWetnessIndex(m_p_elevbands[eb].m_p_Tw, m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, 0.5, m_p_nonlinparms->mp_c[eb], m_bSnowModule, 0, m_nValues); ihacres.CalcExcessRain(m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, m_p_elevbands[eb].m_p_ER, eR_init, m_p_elevbands[eb].m_sum_eRainGTpcp, m_nValues, m_bSnowModule, 0,0,0); } break; case 1: // Croke et al. (2005) ihacres.CalcWetnessTimeConst_Redesign(m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_Tw, m_p_nonlinparms, eb, m_nValues); // 0 = index (only one instance of m_p_nonlinparms) if (m_bSnowModule) { ihacres.CalcWetnessIndex_Redesign(m_p_elevbands[eb].m_p_Tw, m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_WI, 0.5, m_bSnowModule, m_pSnowparms[eb].T_Rain, m_nValues); ihacres.CalcExcessRain_Redesign(m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, m_p_elevbands[eb].m_p_ER, eR_init, m_p_elevbands[eb].m_sum_eRainGTpcp, m_nValues, m_p_nonlinparms->mp_c[eb], m_p_nonlinparms->mp_l[eb], m_p_nonlinparms->mp_p[eb], m_bSnowModule, m_pSnowparms[eb].T_Rain, m_pSnowparms[eb].T_Melt, m_p_elevbands[eb].m_p_MeltRate); } else { ihacres.CalcWetnessIndex_Redesign(m_p_elevbands[eb].m_p_Tw, m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_WI, 0.5, m_bSnowModule, 0, m_nValues); ihacres.CalcExcessRain_Redesign(m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, m_p_elevbands[eb].m_p_ER, eR_init, m_p_elevbands[eb].m_sum_eRainGTpcp, m_nValues, m_p_nonlinparms->mp_c[eb], m_p_nonlinparms->mp_l[eb], m_p_nonlinparms->mp_p[eb], m_bSnowModule, 0,0,0); } break; } // end switch(m_IHAC_vers) } //--------------------------------------------------------------------- void Cihacres_elev::_Simulate_Streamflow(int eb) { //---------------------------------------------------------- //---------------------------------------------------------- // calculate streamflow //---------------------------------------------------------- switch(m_StorConf) { case 0: // single storage ihacres.SimStreamflowSingle(m_p_elevbands[eb].m_p_ER, m_p_Q_obs_mmday[0], m_p_elevbands[eb].m_p_streamflow_sim, m_delay, m_p_linparms->a[eb], m_p_linparms->b[eb], m_nValues); break; case 1: // two storages in parallel ihacres.SimStreamflow2Parallel(m_p_elevbands[eb].m_p_ER, m_p_elevbands[eb].m_p_streamflow_sim, m_p_Q_obs_mmday[0], m_p_linparms, eb, m_vq, m_vs, m_nValues, m_delay); break; case 2: // two storages in series break; } // end switch(m_StorConf) } //--------------------------------------------------------------------- void Cihacres_elev::_CreateTableSim() { int i = 0; // used in function Get_Record(i) CSG_Table_Record *pRecord; CSG_String tmpName; double sim_eb, sim; // creating the column titles m_pTable->Add_Field("Date", SG_DATATYPE_String); m_pTable->Add_Field("Flow_OBS", SG_DATATYPE_Double); for (int eb = 0; eb < m_nElevBands; eb++) { tmpName = SG_T("ELEVB_"); tmpName += convert_sl::Int2String(eb+1).c_str(); m_pTable->Add_Field(tmpName.c_str(), SG_DATATYPE_Double); } m_pTable->Add_Field(SG_T("Flow_SIM"), SG_DATATYPE_Double); for (int j = 0; j < m_nValues; j++) { m_pTable->Add_Record(); pRecord = m_pTable->Get_Record(i); // writing the data into the rows pRecord->Set_Value(0,CSG_String(m_vec_date[j].c_str())); pRecord->Set_Value(1,m_p_Q_obs_m3s[j]); sim_eb = 0.0; sim = 0.0; for (int eb = 0; eb < m_nElevBands; eb++) { sim_eb = model_tools::mmday_to_m3s(m_p_elevbands[eb].m_p_streamflow_sim[j],m_p_elevbands[eb].m_area); //pRecord->Set_Value(3+eb,model_tools::mmday_to_m3s(m_p_elevbands[eb].m_p_streamflow_sim[j],m_p_elevbands[eb].m_area)); pRecord->Set_Value(2+eb, sim_eb); sim += sim_eb; } pRecord->Set_Value(2+m_nElevBands,sim); i++; } } //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // DIALOGS // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // DIALOG 1 //--------------------------------------------------------------------- void Cihacres_elev::_CreateDialog1() { CSG_Parameter *pNode; CSG_String s; pNode = Parameters.Add_Choice( NULL , "NELEVBANDS" , SG_T("Number of elevation bands"), _TL(""), SG_T("2|3|4|5|6|7|8|9|10") ); pNode = Parameters.Add_Value( pNode, "AREA_tot", _TL("Total Catchment Area [km2]"), _TL(""), PARAMETER_TYPE_Double ); s.Printf(SG_T("Node1"), 1); pNode = Parameters.Add_Node(NULL,s,SG_T("IHACRES Version"),_TL("")); Parameters.Add_Choice( pNode , "IHACVERS" , SG_T("IHACRES Version"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Jakeman & Hornberger (1993)"), // 0 _TL("Croke et al. (2005) !!! not yet implemented !!!") // 1 ) ); s.Printf(SG_T("Node2"), 2); pNode = Parameters.Add_Node(NULL,s,SG_T("Storage Configuration"),_TL("")); Parameters.Add_Choice( pNode , "STORAGE" , SG_T("Storage"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Single Storage"), // 0 _TL("Two Parallel Storages"), // 1 _TL("Two Storages in Series !!! not yet implemented !!!") // 2 ) ); Parameters.Add_Value( pNode, "SNOW_MODULE", _TL("Using the snow-melt module?"), _TL("If checked, snow-melt module is used."), PARAMETER_TYPE_Bool, false ); } //--------------------------------------------------------------------- // DIALOG 2 //--------------------------------------------------------------------- bool Cihacres_elev::_CreateDialog2() { int i; //std::ofstream f("_out_elev.txt"); CSG_Parameters P; // used to add Parameters in the second dialog CSG_Parameter *pNode, *pNode1; CSG_String s; CSG_String tmpNode, tmpName; P.Set_Name(_TL("IHACRES Elevation Bands (Dialog 2)")); // Input file ---------------------------------------------- pNode = P.Add_Table( NULL , "TABLE" , _TL("IHACRES Input Table"), _TL(""), PARAMETER_INPUT ); P.Add_Table_Field( pNode , "DATE_Field" , _TL("Date Column"), SG_T("Select the column containing the Date") ); P.Add_Table_Field( pNode , "DISCHARGE_Field" , _TL("Streamflow (obs.) Column"), SG_T("Select the column containing the observed streamflow time series)") ); for (i = 0; i < m_nElevBands; i++) { tmpNode = convert_sl::Int2String(i+1).c_str(); //s.Printf(tmpNode.c_str(), i); //pNode1 = P.Add_Node(NULL,s,SG_T("Elevation Band Input",_TL("")); tmpName = SG_T("PCP Column: Elevation Band: "); tmpName+=tmpNode; P.Add_Table_Field( pNode , tmpName.c_str(), tmpName.c_str(), SG_T("Select Precipitation Column") ); tmpName = SG_T("TMP Column: Elevation Band: "); tmpName+=tmpNode; P.Add_Table_Field( pNode , tmpName.c_str() , tmpName.c_str(), SG_T("Select Temperature Column") ); } // Input file ---------------------------------------------- for (i = 0; i < m_nElevBands; i++) { tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+100).c_str(); tmpName = SG_T("Elevation Band "); tmpName+=convert_sl::Int2String(i+1).c_str(); s.Printf(tmpNode.c_str(), i+100); pNode = P.Add_Node(NULL,s,tmpName.c_str(),_TL("")); tmpName = SG_T("Area [km2] Elev("); tmpName += tmpNode; tmpName += SG_T(")"); P.Add_Value( pNode, tmpName, _TL("Area [km2]"), _TL(""), PARAMETER_TYPE_Double ); tmpName = SG_T("Mean Elevation [m.a.s.l] Elev("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode, tmpName, _TL("Mean Elevation [m.a.s.l]"), _TL(""), PARAMETER_TYPE_Double ); //} // Parameters of non-linear module ------------------------- tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+150).c_str(); s.Printf(tmpNode.c_str(), i+150); pNode1 = P.Add_Node(pNode,s,SG_T("Non-Linear Module"),_TL("")); tmpName = SG_T("TwFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Wetness decline time constant (Tw)"), _TW("Tw is approximately the time constant, or inversely, " "the rate at which the catchment wetness declines in the absence of rainfall"), PARAMETER_TYPE_Double, 1.0, 0.01, true, 150.0, true ); tmpName = SG_T("TFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, SG_T("Temperature Modulation Factor (f)"), _TL("Temperature Modulation Factor f"), PARAMETER_TYPE_Double, 1.0, 0.0001, true, 10.0, true ); tmpName = SG_T("CFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1,tmpName, _TL("Parameter (c)"), _TL("Parameter (c) to fit streamflow volume"), PARAMETER_TYPE_Double, 0.001, 0.0, true, 1.0, true ); switch(m_IHAC_version) { case 0: // Jakeman & Hornberger (1993) break; case 1: // Croke et al. (2005) tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+200).c_str(); s.Printf(tmpNode.c_str(), i+200); pNode1 = P.Add_Node(pNode,s,SG_T("Soil Moisture Power Eq."),_TL("")); tmpName = SG_T("LFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Parameter (l)"), _TL("Soil moisture index threshold"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); tmpName = SG_T("PFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Parameter (p)"), _TL("non-linear response term"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); break; } // Parameters of non-linear module ------------------------- // Parameters of linear module ----------------------------- switch(m_StorConf) { case 0: // single storage tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); s.Printf(tmpNode.c_str(), i+250); pNode1 = P.Add_Node(pNode,s,SG_T("Linear Module"),_TL("")); tmpName = SG_T("AFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("(a)"), _TL(""), PARAMETER_TYPE_Double, -0.8, -0.99, true, -0.01, true ); tmpName = SG_T("BFAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("(b)"), _TL(""), PARAMETER_TYPE_Double, 0.2, 0.001, true, 1.0, true ); break; case 1: // two parallel storages tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); s.Printf(tmpNode.c_str(), i+250); pNode1 = P.Add_Node(pNode,s,SG_T("Linear Module"),_TL("")); // Parameter a tmpName = SG_T("AQ("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1,tmpName, _TL("a(q)"), _TL(""), PARAMETER_TYPE_Double, -0.7, -0.99, true, -0.01, true ); tmpName = SG_T("AS("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("a(s)"), _TL(""), PARAMETER_TYPE_Double, -0.9, -0.99, true, -0.01, true ); // Parameter b tmpName = SG_T("BQ("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("b(q)"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true, 1.0, true ); break; case 2: // two storages in series break; } // end switch (storconf) // Parameters of linear module ----------------------------- tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+300).c_str(); s.Printf(tmpNode.c_str(), i+300); pNode1 = P.Add_Node(pNode,s,SG_T("Time Delay after Start of Rainfall (INTEGER)"),_TL("")); tmpName = SG_T("DELAY("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1,tmpName, SG_T("Time Delay (Rain-Runoff)"), SG_T("The delay after the start of rainfall, before the discharge starts to rise."), PARAMETER_TYPE_Int, 0, 1, true, 100, true ); // snow module parameters ---------------------------------- if (m_bSnowModule) { tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+350).c_str(); s.Printf(tmpNode.c_str(), i+350); pNode1 = P.Add_Node(pNode,s,SG_T("Snow Module Parameters"),_TL("")); tmpName = SG_T("T_RAIN("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1,tmpName, SG_T("Temperature Threshold for Rainfall)"), SG_T("Below this threshold precipitation will fall as snow"), PARAMETER_TYPE_Double, -1.0, -10.0, true, 10.0, true ); tmpName = SG_T("T_MELT("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1,tmpName, SG_T("Temperature Threshold for Melting"), SG_T("Above this threshold snow will start to melt"), PARAMETER_TYPE_Double, 1.0, -5.0, true, 10.0, true ); tmpName = SG_T("DD_FAC("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1,tmpName, SG_T("Day-Degree Factor"), SG_T("Day-Degree Factor depends on catchment characteristics"), PARAMETER_TYPE_Double, 0.7, 0.7, true, 9.2, true ); } // snow module parameters ---------------------------------- } if( SG_UI_Dlg_Parameters(&P, _TL("IHACRES Distributed Input Dialog 2")) ) { // input table m_p_InputTable = P("TABLE") ->asTable(); // field numbers m_dateField = P("DATE_Field") ->asInt(); m_streamflowField = P("DISCHARGE_Field") ->asInt(); for (int i = 0; i < m_nElevBands; i++) { tmpNode = convert_sl::Int2String(i+1).c_str(); // get precipitation column of Elevation Band[i] tmpName = SG_T("PCP Column: Elevation Band: "); tmpName+=tmpNode; m_p_pcpField[i] = P(tmpName) ->asInt(); // get temperature column of Elevation Band[i] tmpName = SG_T("TMP Column: Elevation Band: "); tmpName+=tmpNode; m_p_tmpField[i] = P(tmpName) ->asInt(); tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+100).c_str(); // get area[km2] of Elevation Band[i] tmpName = SG_T("Area [km2] Elev("); tmpName += tmpNode; tmpName += _TL(")"); m_p_elevbands[i].m_area = P(tmpName) ->asDouble(); // get mean elevation of Elevation Band[i] tmpName = SG_T("Mean Elevation [m.a.s.l] Elev("); tmpName += tmpNode; tmpName += _TL(")"); m_p_elevbands[i].m_mean_elev =P(tmpName) ->asDouble(); // non-linear module parameters tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+150).c_str(); // get Tw tmpName = SG_T("TwFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nonlinparms->mp_tw[i] = P(tmpName) ->asDouble(); // get f tmpName = SG_T("TFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nonlinparms->mp_f[i] = P(tmpName) ->asDouble(); // get c tmpName = SG_T("CFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nonlinparms->mp_c[i] = P(tmpName) ->asDouble(); switch(m_IHAC_version) { case 0: // Jakeman & Hornberger (1993) break; case 1: // Croke et al. (2005) // get l tmpName = SG_T("LFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nonlinparms->mp_l[i]= P(tmpName) ->asDouble(); // get p tmpName = SG_T("PFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nonlinparms->mp_p[i]= P(tmpName) ->asDouble(); } // linear module parameters switch(m_nStorages) { case 1: // single storage tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); // get a tmpName = SG_T("AFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_linparms->a[i] = P(tmpName) ->asDouble(); // get b tmpName = SG_T("BFAC("); tmpName += tmpNode; tmpName += _TL(")"); m_p_linparms->b[i] = P(tmpName) ->asDouble(); break; case 2: // two storages tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); // get aq tmpName = SG_T("AQ("); tmpName += tmpNode; tmpName += _TL(")"); m_p_linparms->aq[i] = P(tmpName) ->asDouble(); // get bq tmpName = SG_T("BQ("); tmpName += tmpNode; tmpName += _TL(")"); m_p_linparms->bq[i] = P(tmpName) ->asDouble(); // get as tmpName = SG_T("AS("); tmpName += tmpNode; tmpName += _TL(")"); m_p_linparms->as[i] = P(tmpName) ->asDouble(); // get bs m_p_linparms->bs[i] = ihacres.Calc_Parm_BS(m_p_linparms->aq[i],m_p_linparms->as[i],m_p_linparms->bq[i]); break; } // get delay tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+300).c_str(); tmpName = SG_T("DELAY("); tmpName += tmpNode; tmpName += _TL(")"); m_delay = P(tmpName) ->asInt(); if (m_bSnowModule) { tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+350).c_str(); // get T_RAIN tmpName = SG_T("T_RAIN("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms[i].T_Rain = P(tmpName) ->asDouble(); // get T_MELT tmpName = SG_T("T_MELT("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms[i].T_Melt = P(tmpName) ->asDouble(); // get DD_FAC tmpName = SG_T("DD_FAC("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms[i].DD_FAC = P(tmpName) ->asDouble(); } } return(true); } return(false); } //--------------------------------------------------------------------- // DIALOG 3 //--------------------------------------------------------------------- bool Cihacres_elev::_CreateDialog3() { CSG_String s; CSG_Parameters P; // used to add Parameters in the second dialog CSG_Parameter *pNode; // Dialog design P.Set_Name(_TL("Choose Time Range")); s.Printf(SG_T("Node1"), 1); pNode = P.Add_Node(NULL,s,SG_T("Time Range"),_TL("")); s.Printf(SG_T("FDAY") , 1-1); P.Add_String(pNode,s,_TL("First Day"),_TL(""), m_p_InputTable->Get_Record(0)->asString(m_dateField)); s.Printf(SG_T("LDAY") , 1-2); P.Add_String(pNode,s,_TL("Last Day"),_TL(""), m_p_InputTable->Get_Record(m_p_InputTable->Get_Record_Count()-1)->asString(m_dateField)); if( SG_UI_Dlg_Parameters(&P, _TL("Choose Time Range")) ) { /////////////////////////////////////////////////////////////// // // ASSIGN DATA FROM SECOND DIALOG // /////////////////////////////////////////////////////////////// m_date1 = P(CSG_String::Format(SG_T("FDAY"),m_dateField).c_str())->asString(); m_date2 = P(CSG_String::Format(SG_T("LDAY"),m_streamflowField).c_str())->asString(); return(true); } return(false); } saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev.h000066400000000000000000000111371224124640700272430ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_elev.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // ihacres_elev.h // // // // Copyright (C) 2008 by // // Stefan Liersch // //-------------------------------------------------------// // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // 2008-01-08 // //-------------------------------------------------------// //*******************************************************// // ToDo // //-------------------------------------------------------// // - m_delay is not yet implemented for each elevation band // as it is suggested by the user dialog. The delay value // of the last elevation band is used instead for all bands. //*******************************************************// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ihacres_elev_H #define HEADER_INCLUDED__ihacres_elev_H //--------------------------------------------------------- #include "MLB_Interface.h" #include "ihacres_eq.h" #include "ihacres_elev_bands.h" #include "snow_module.h" #include // used for storing date string values in array //using namespace std; typedef std::vector date_array; class Cihacres_elev : public CSG_Module { public: //-------------------------------------------------------- // CONSTRUCTORS //-------------------------------------------------------- // default Cihacres_elev(); // destructor virtual ~Cihacres_elev(void); protected: // execute module virtual bool On_Execute(void); private: //-------------------------------------------------------- // PRIVATE MEMBER VARIABLES //-------------------------------------------------------- //---------------------------------- // parameters of first module dialog //---------------------------------- int m_nElevBands; // number of used elevation bands double m_Area_tot; // total catchment area [km2] int m_IHAC_version; // Different versions of IHACRES exist, corresponding // to the version... int m_StorConf; // Storage configuration // 0 = single, 1 = two in parallel, 2 = two in series bool m_bSnowModule; // true if snow module is active int m_nStorages; // number of storages //---------------------------------- // parameters of second module dialog //---------------------------------- // time series variables CSG_Table* m_p_InputTable; // IHACRES input table int m_nValues; // number of selected records date_array m_vec_date; double* m_p_Q_obs_m3s; // pointer containing observed streamflow in [m3/s] double* m_p_Q_obs_mmday; // pointer containing observed streamflow in [mm] Cihacres_elev_bands* m_p_elevbands; // Class Cihacres_elev_bands // Field numbers int m_dateField; // table field numbers int m_streamflowField; // elevation band parameters int* m_p_pcpField; int* m_p_tmpField; //double* m_p_Area; //double* m_p_mean_elev; //---------------------------------- // parameters of third module dialog //---------------------------------- CSG_String m_date1; // first day of time series YYYYMMDD CSG_String m_date2; // last day int m_first; int m_last; //---------------------------------- // Model parameter (in: ihacres_eq.h) //---------------------------------- C_IHAC_LinearParms* m_p_linparms; // parameters of the linear storage module C_IHAC_NonLinearParms* m_p_nonlinparms; // parameters of the non-linear rainfall loss module CSnowParms* m_pSnowparms; // 3 snow module paramters CSnowModule* m_p_SnowModule; int m_delay; double m_vq; double m_vs; CSG_Table* m_pTable; //-------------------------------------------------------- // PRIVATE MEMBER FUNCTIONS //-------------------------------------------------------- void _Init_ElevBands(int n); // n = m_nElevBands void _Init_Pointers(int nvals); void _CreateDialog1(); bool _CreateDialog2(); bool _CreateDialog3(); void _ReadInputFile(); void _CalcSnowModule(int elevband); void _Simulate_NonLinearModule(int elevband); void _Simulate_Streamflow(int elevband); void _CreateTableSim(); // Class ihacres_eq Cihacres_eq ihacres; }; #endif /* HEADER_INCLUDED__ihacres_elev_H */ saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_bands.cpp000066400000000000000000000014521224124640700307440ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_elev_bands.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #define NULL 0 #include "ihacres_elev_bands.h" Cihacres_elev_bands::Cihacres_elev_bands() { m_p_pcp = NULL; m_p_tmp = NULL; m_p_ER = NULL; m_p_streamflow_sim = NULL; m_p_Tw = NULL; m_p_WI = NULL; m_p_MeltRate = NULL; m_p_SnowStorage = NULL; } Cihacres_elev_bands::~Cihacres_elev_bands() { //if (m_p_pcp) delete[] m_p_pcp; //if (m_p_tmp) delete[] m_p_tmp; //if (m_p_ER) delete[] m_p_ER; //if (m_p_streamflow_sim) delete[] m_p_streamflow_sim; //if (m_p_Tw) delete[] m_p_Tw; //if (m_p_WI) delete[] m_p_WI; //if (m_p_MeltRate) delete[] m_p_MeltRate; //if (m_p_SnowStorage) delete[] m_p_SnowStorage; }saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_bands.h000066400000000000000000000054111224124640700304100ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_elev_bands.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // ihacres_elev_bands.h // // // // Copyright (C) 2008 by // // Stefan Liersch // //-------------------------------------------------------// // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // 2008-01-08 // //-------------------------------------------------------// //*******************************************************// // ToDo // //-------------------------------------------------------// // - //*******************************************************// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ihacres_elev_bands_H #define HEADER_INCLUDED__ihacres_elev_bands_H //--------------------------------------------------------- class Cihacres_elev_bands { public: /////////////////////////////////////////////////////////////////// // // CONSTRUCTORS // /////////////////////////////////////////////////////////////////// // default Cihacres_elev_bands(); // destructor ~Cihacres_elev_bands(); /////////////////////////////////////////////////////////////////// // // PARAMETERS // /////////////////////////////////////////////////////////////////// //bool m_b_SnowModule; // true, if snow module is active //int m_IHAC_version; // IHACRES version (Jakeman & Hornberger, 1993 / Croke, B. 2005 /...) // time series variables //double m_nValues; // number of pointer elements (time steps / days / ...) double* m_p_pcp; // precipitation time series double* m_p_tmp; // temperature time series double* m_p_ER; // excess rainfall time series double* m_p_streamflow_sim; // simulated streamflow time series [mm] !!! double* m_p_Tw; // double* m_p_WI; // Wetness Index double* m_p_MeltRate; double* m_p_SnowStorage; double m_sum_eRainGTpcp; double m_mean_elev; // mean elevation of elevation band [m.a.s.l.] double m_area; /////////////////////////////////////////////////////////////////// // // PUBLIC FUNCTIONS // /////////////////////////////////////////////////////////////////// //double Get_Elevation() { return(m_mean_elev); } //double Get_Area() { return(m_area); } private: // elevation band area [km2] }; #endif /* HEADER_INCLUDED__ihacres_elev_bands_H */saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_cal.cpp000066400000000000000000001266031224124640700304220ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_elev_cal.cpp 1261 2011-12-16 15:12:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // ihacres_elev_cal.cpp // // // // Copyright (C) 2008 by // // Stefan Liersch // //-------------------------------------------------------// // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // 2008-01-08 // /////////////////////////////////////////////////////////// #include "ihacres_elev_cal.h" #include "convert_sl.h" #include "model_tools.h" #include // random numbers #include // random numbers // TEST OUTPUT ONLY #include //--------------------------------------------------------------------- Cihacres_elev_cal::Cihacres_elev_cal() { //----------------------------------------------------- // 1. Info... Set_Name(_TL("IHACRES Elevation Bands Calibration")); Set_Author(SG_T("copyrights (c) 2008 Stefan Liersch")); Set_Description(_TW("The Rainfall-Runoff Model IHACRES \n \n \n" "Reference: \n \n" "Jakeman, A.J. / Hornberger, G.M. (1993). \n" "How Much Complexity Is Warranted in a Rainfall-Runoff Model? \n" "Water Resources Research, (29), NO. 8 (2637-2649) \n \n" "Kokkonen, T. S. et al. (2003). \n" "Predicting daily flows in ungauged catchments:" "model regionalization from catchment descriptors" "at the Coweeta Hydrologic Laboratory, North Carolina \n " "Hydrological Processes (17), 2219-2238 \n \n" "Croke, B. F. W., W. S. Merritt, et al. (2004).\n" "A dynamic model for predicting hydrologic response" "to land cover changes in gauged and" "ungauged catchments. \n" "Journal Of Hydrology 291(1-2): 115-131." )); Parameters.Add_Table_Output( NULL , "TABLEout" , _TL("Table"), _TL("") ); Parameters.Add_Table_Output( NULL , "TABLEparms" , _TL("Table"), _TL("") ); /////////////////////////////////////////////////////////////////// // FIRST MODULE DIALOG _CreateDialog1(); /////////////////////////////////////////////////////////////////// } Cihacres_elev_cal::~Cihacres_elev_cal() {} //--------------------------------------------------------------------- bool Cihacres_elev_cal::On_Execute() { double NSE_temp = 0.0; double NSE_max = -9999.9; string nse, nse_text; CSG_Parameters P; //std::ofstream f("_out_elev.txt"); // Assign Parameters from first Module Dialog //--------------------------------------------------------- int eb = Parameters("NELEVBANDS") ->asInt(); m_nElevBands = eb + 2; // because list starts with 2 ! m_nsim = Parameters("NSIM") ->asInt(); m_Area_tot = Parameters("AREA_tot") ->asDouble(); m_IHAC_version = Parameters("IHACVERS") ->asInt(); m_StorConf = Parameters("STORAGE") ->asInt(); m_bSnowModule = Parameters("SNOW_MODULE") ->asBool(); m_obj_func = Parameters("OBJ_FUNC") ->asInt(); m_NSEmin = Parameters("NSEMIN") ->asDouble(); //--------------------------------------------------------- //--------------------------------------------------------- // Assign number of storages m_nStorages = ihacres.Assign_nStorages(m_StorConf); //--------------------------------------------------------- //--------------------------------------------------------- // Initialize pointers _Init_ElevBands(m_nElevBands); m_p_linparms = new C_IHAC_LinearParms(m_nElevBands,m_nStorages); m_p_lin_lb = new C_IHAC_LinearParms(m_nElevBands,m_nStorages); m_p_lin_ub = new C_IHAC_LinearParms(m_nElevBands,m_nStorages); m_p_nonlinparms = new C_IHAC_NonLinearParms(m_nElevBands); m_p_nl_lb = new C_IHAC_NonLinearParms(m_nElevBands); m_p_nl_ub = new C_IHAC_NonLinearParms(m_nElevBands); //--------------------------------------------------------- //--------------------------------------------------------- // open second and third user dialog if ( _CreateDialog2() && _CreateDialog3()) { //--------------------------------------------------------- // searching the first and the last record of the time range ihacres.AssignFirstLastRec(*m_p_InputTable, m_first, m_last, m_date1, m_date2, m_dateField); m_nValues = m_last - m_first + 1; //--------------------------------------------------------- //--------------------------------------------------------- _Init_Pointers(m_nValues); //--------------------------------------------------------- //--------------------------------------------------------- // read input table _ReadInputFile(); //--------------------------------------------------------- //--------------------------------------------------------- // PERFORM STREAMFLOW SIMULATION // FOR EACH ELEVATION BAND //--------------------------------------------------------- // Convert Streamflow vector from m3/s*day-1 to mm/day m_p_Q_obs_mmday = model_tools::m3s_to_mmday(m_p_Q_obs_m3s, m_p_Q_obs_mmday, m_nValues, m_Area_tot); //--------------------------------------------------------- m_pTable_parms = SG_Create_Table(); _CreateTableParms(); m_counter = 0; //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // SIMULATION // /////////////////////////////////////////////////////////// // initialize random function srand((unsigned) time(NULL)); // using time.h for (int sim = 0; sim < m_nsim && Set_Progress(sim, m_nsim); sim++) { _Simulate_NonLinearModule(); _Simulate_Streamflow(); _Sum_Streamflow(); m_NSE = m_NSE_lowflow = m_NSE_highflow = m_PBIAS = 0; _CalcEfficiency(); // write in output table if criterion is fulfilled NSE_temp = ihacres._Assign_NSE_temp(m_obj_func, m_NSE, m_NSE_highflow, m_NSE_lowflow); if (NSE_temp > m_NSEmin) { if (NSE_temp > NSE_max) { NSE_max = NSE_temp; nse = convert_sl::Double2String(NSE_max).c_str(); nse_text = "max. NSE "; nse_text += nse; Process_Set_Text(CSG_String(nse_text.c_str())); } _WriteTableParms(); } } //--------------------------------------------------------- m_pTable_parms->Set_Name(SG_T("ihacres_elevbands_cal")); Parameters("TABLEparms")->Set_Value(m_pTable_parms); //m_pTable = SG_Create_Table(); //_CreateTableSim(); //// add tables to SAGA Workspace //m_pTable->Set_Name("ihacres_elevBands_output"); //Parameters("TABLEout")->Set_Value(m_pTable); delete[] m_p_elevbands; // smtliche Unter-Pointer noch lschen delete[] m_p_pcpField; delete[] m_p_tmpField; delete[] m_p_Q_obs_m3s; delete[] m_p_Q_obs_mmday; delete[] m_p_Q_sim_mmday; delete m_p_linparms; delete m_p_nonlinparms; delete m_p_lin_lb; delete m_p_lin_ub; delete m_p_nl_lb; delete m_p_nl_ub; if (m_bSnowModule) { delete[] m_pSnowparms; delete[] m_pSnowparms_lb; delete[] m_pSnowparms_ub; } delete[] m_vq; delete[] m_vs; return(true); } // end if ( _CreateDialog2() ) // delete[] m_p_elevbands; // delete[] m_p_pcpFields; // delete[] m_p_tmpFields; // delete m_p_linparms; // delete m_p_nonlinparms; return(false); } //--------------------------------------------------------------------- void Cihacres_elev_cal::_Init_ElevBands(int nvals) { // instantiate elevation bands m_p_elevbands = new Cihacres_elev_bands[nvals]; // instantiate field numbers m_p_pcpField = new int[nvals]; m_p_tmpField = new int[nvals]; if (m_bSnowModule) { m_pSnowparms = new CSnowParms[nvals]; m_pSnowparms_lb = new CSnowParms[nvals]; m_pSnowparms_ub = new CSnowParms[nvals]; } m_vq = new double[nvals]; m_vs = new double[nvals]; } //--------------------------------------------------------------------- void Cihacres_elev_cal::_Init_Pointers(int nvals) { m_vec_date.resize(nvals); m_p_Q_obs_m3s = new double[nvals]; m_p_Q_obs_mmday = new double[nvals]; m_p_Q_sim_mmday = new double[nvals]; for (int eb = 0; eb < m_nElevBands; eb++) { m_p_elevbands[eb].m_p_pcp = new double[nvals]; m_p_elevbands[eb].m_p_tmp = new double[nvals]; m_p_elevbands[eb].m_p_ER = new double[nvals]; m_p_elevbands[eb].m_p_streamflow_sim = new double[nvals]; m_p_elevbands[eb].m_p_Tw = new double[nvals]; m_p_elevbands[eb].m_p_WI = new double[nvals]; if (m_bSnowModule) { m_p_elevbands[eb].m_p_SnowStorage = new double[nvals]; m_p_elevbands[eb].m_p_MeltRate = new double[nvals]; } } } //--------------------------------------------------------------------- void Cihacres_elev_cal::_ReadInputFile() { for (int j = 0, k = m_first; j < m_nValues, k < m_last + 1; j++, k++) { m_vec_date[j].append(CSG_String(m_p_InputTable->Get_Record(k)->asString(m_dateField))); m_p_Q_obs_m3s[j] = m_p_InputTable->Get_Record(k)->asDouble(m_streamflowField); for (int eb = 0; eb < m_nElevBands; eb++) { m_p_elevbands[eb].m_p_pcp[j] = m_p_InputTable->Get_Record(k)->asDouble(m_p_pcpField[eb]); m_p_elevbands[eb].m_p_tmp[j] = m_p_InputTable->Get_Record(k)->asDouble(m_p_tmpField[eb]); } } } //--------------------------------------------------------------------- void Cihacres_elev_cal::_CalcSnowModule(int eb) { m_p_SnowModule = new CSnowModule(m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_pcp, m_nValues, m_pSnowparms[eb].T_Rain, m_pSnowparms[eb].T_Melt, m_pSnowparms[eb].DD_FAC); m_p_elevbands[eb].m_p_MeltRate = m_p_SnowModule->Get_MeltRate(m_p_elevbands[eb].m_p_MeltRate, m_nValues); m_p_elevbands[eb].m_p_SnowStorage = m_p_SnowModule->Get_SnowStorage(m_p_elevbands[eb].m_p_SnowStorage, m_nValues); delete m_p_SnowModule; } //--------------------------------------------------------------------- void Cihacres_elev_cal::_Simulate_NonLinearModule() { double eR_init = 0.0; for (int eb = 0; eb < m_nElevBands; eb++) { //------------------------------------------------------------- // Assign random values //------------------------------------------------------------- if (m_bSnowModule) { m_pSnowparms[eb].T_Rain = model_tools::Random_double(m_pSnowparms_lb[eb].T_Rain,m_pSnowparms_ub[eb].T_Rain); m_pSnowparms[eb].T_Melt = model_tools::Random_double(m_pSnowparms_lb[eb].T_Melt,m_pSnowparms_ub[eb].T_Melt); m_pSnowparms[eb].DD_FAC = model_tools::Random_double(m_pSnowparms_lb[eb].DD_FAC,m_pSnowparms_ub[eb].DD_FAC); m_p_SnowModule = new CSnowModule(m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_pcp, m_nValues, m_pSnowparms[eb].T_Rain, m_pSnowparms[eb].T_Melt, m_pSnowparms[eb].DD_FAC); m_p_elevbands[eb].m_p_MeltRate = m_p_SnowModule->Get_MeltRate(m_p_elevbands[eb].m_p_MeltRate, m_nValues); delete m_p_SnowModule; } m_p_nonlinparms->mp_tw[eb] = model_tools::Random_double(m_p_nl_lb->mp_tw[eb], m_p_nl_ub->mp_tw[eb]); m_p_nonlinparms->mp_f[eb] = model_tools::Random_double(m_p_nl_lb->mp_f[eb], m_p_nl_ub->mp_f[eb]); m_p_nonlinparms->mp_c[eb] = model_tools::Random_double(m_p_nl_lb->mp_c[eb], m_p_nl_ub->mp_c[eb]); if (m_IHAC_version == 1) { // Croke etal. (2005) m_p_nonlinparms->mp_l[eb]= model_tools::Random_double(m_p_nl_ub->mp_l[eb],m_p_nl_ub->mp_l[eb]); m_p_nonlinparms->mp_p[eb]= model_tools::Random_double(m_p_nl_ub->mp_p[eb],m_p_nl_ub->mp_p[eb]); } //---------------------------------------------------------- // calculate excess rainfall time series //---------------------------------------------------------- switch(m_IHAC_version) { case 0: // Jakeman & Hornberger (1993) // The parameter index (fourth parameter) is zero here, because // the parameter settings of the non-linear module are in all elevationbands equal. // If they should be different the index parameter can be used to identify the // corresponding elevation band. ihacres.CalcWetnessTimeConst(m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_Tw, m_p_nonlinparms, eb, m_nValues); // 0 = index (only one instance of m_p_nonlinparms) if (m_bSnowModule) { ihacres.CalcWetnessIndex(m_p_elevbands[eb].m_p_Tw, m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, 0.5, m_p_nonlinparms->mp_c[eb], m_bSnowModule, m_pSnowparms[eb].T_Rain, m_nValues); ihacres.CalcExcessRain(m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, m_p_elevbands[eb].m_p_ER, eR_init, m_p_elevbands[eb].m_sum_eRainGTpcp, m_nValues, m_bSnowModule, m_pSnowparms[eb].T_Rain, m_pSnowparms[eb].T_Melt, m_p_elevbands[eb].m_p_MeltRate); } else { ihacres.CalcWetnessIndex(m_p_elevbands[eb].m_p_Tw, m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, 0.5, m_p_nonlinparms->mp_c[eb], m_bSnowModule, 0, m_nValues); ihacres.CalcExcessRain(m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, m_p_elevbands[eb].m_p_ER, eR_init, m_p_elevbands[eb].m_sum_eRainGTpcp, m_nValues, m_bSnowModule, 0,0,0); } break; case 1: // Croke et al. (2005) ihacres.CalcWetnessTimeConst_Redesign(m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_Tw, m_p_nonlinparms, eb, m_nValues); // 0 = index (only one instance of m_p_nonlinparms) if (m_bSnowModule) { ihacres.CalcWetnessIndex_Redesign(m_p_elevbands[eb].m_p_Tw, m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_WI, 0.5, m_bSnowModule, m_pSnowparms[eb].T_Rain, m_nValues); ihacres.CalcExcessRain_Redesign(m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, m_p_elevbands[eb].m_p_ER, eR_init, m_p_elevbands[eb].m_sum_eRainGTpcp, m_nValues, m_p_nonlinparms->mp_c[eb], m_p_nonlinparms->mp_l[eb], m_p_nonlinparms->mp_p[eb], m_bSnowModule, m_pSnowparms[eb].T_Rain, m_pSnowparms[eb].T_Melt, m_p_elevbands[eb].m_p_MeltRate); } else { ihacres.CalcWetnessIndex_Redesign(m_p_elevbands[eb].m_p_Tw, m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_WI, 0.5, m_bSnowModule, 0, m_nValues); ihacres.CalcExcessRain_Redesign(m_p_elevbands[eb].m_p_pcp, m_p_elevbands[eb].m_p_tmp, m_p_elevbands[eb].m_p_WI, m_p_elevbands[eb].m_p_ER, eR_init, m_p_elevbands[eb].m_sum_eRainGTpcp, m_nValues, m_p_nonlinparms->mp_c[eb], m_p_nonlinparms->mp_l[eb], m_p_nonlinparms->mp_p[eb], m_bSnowModule, 0,0,0); } break; } // end switch(m_IHAC_vers) } } //--------------------------------------------------------------------- void Cihacres_elev_cal::_Simulate_Streamflow() { //------------------------------------------------------------- // Assign random values //------------------------------------------------------------- for (int eb = 0; eb < m_nElevBands; eb++) { switch(m_StorConf) { case 0: // single storage m_p_linparms->a[eb] = model_tools::Random_double(m_p_lin_lb->a[eb],m_p_lin_ub->a[eb]); m_p_linparms->b[eb] = model_tools::Random_double(m_p_lin_lb->b[eb],m_p_lin_ub->b[eb]); break; case 1: // two storages in parallel do { m_p_linparms->aq[eb] = model_tools::Random_double(m_p_lin_lb->aq[eb], m_p_lin_ub->aq[eb]); m_p_linparms->as[eb] = model_tools::Random_double(m_p_lin_lb->as[eb], m_p_lin_ub->as[eb]); m_p_linparms->bq[eb] = model_tools::Random_double(m_p_lin_lb->bq[eb], m_p_lin_ub->bq[eb]); // Calculate parameter m_vq to check parms aq and bq // Equation after Jakeman & Hornberger (1993) m_vq[eb] = m_p_linparms->bq[eb] / ( 1 + m_p_linparms->aq[eb] ); } while (m_vq[eb] < 0.0 || m_vq[eb] > 1.0); m_p_linparms->bs[eb] = ihacres.Calc_Parm_BS(m_p_linparms->aq[eb], m_p_linparms->as[eb], m_p_linparms->bq[eb]); break; } //---------------------------------------------------------- // calculate streamflow //---------------------------------------------------------- switch(m_StorConf) { case 0: // single storage ihacres.SimStreamflowSingle(m_p_elevbands[eb].m_p_ER, m_p_Q_obs_mmday[0], m_p_elevbands[eb].m_p_streamflow_sim, m_delay, m_p_linparms->a[eb], m_p_linparms->b[eb], m_nValues); break; case 1: // two storages in parallel ihacres.SimStreamflow2Parallel(m_p_elevbands[eb].m_p_ER, m_p_elevbands[eb].m_p_streamflow_sim, m_p_Q_obs_mmday[0], m_p_linparms, eb, m_vq[eb], m_vs[eb], m_nValues, m_delay); break; case 2: // two storages in series break; } // end switch(m_StorConf) }// end for (int eb... } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Summarize streamflow from elevation bands //--------------------------------------------------------------------- void Cihacres_elev_cal::_Sum_Streamflow() { //std::ofstream f("_cal_elev.txt"); double sum = 0.0; for (int n = 0; n < m_nValues; n++) { for (int eb = 0; eb < m_nElevBands; eb++) { sum += m_p_elevbands[eb].m_p_streamflow_sim[n] * m_p_elevbands[eb].m_area / m_Area_tot; //f << m_p_elevbands[eb].m_p_streamflow_sim[n] << ", "); } //f << std::endl; m_p_Q_sim_mmday[n] = sum; sum = 0.0; } } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Nash-Sutcliffe efficiency //--------------------------------------------------------------------- void Cihacres_elev_cal::_CalcEfficiency() { m_NSE = model_tools::CalcEfficiency(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues); m_NSE_highflow = model_tools::Calc_NSE_HighFlow(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues); m_NSE_lowflow = model_tools::Calc_NSE_LowFlow(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues); m_PBIAS = model_tools::Calc_PBIAS(m_p_Q_obs_mmday, m_p_Q_sim_mmday, m_nValues); } //--------------------------------------------------------------------- ///////////////////////////////////////////////////////////////////////////// // // CREATE TABLES // ///////////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // Create output table //--------------------------------------------------------------------- void Cihacres_elev_cal::_CreateTableParms() { char c[12]; // creating the column titles m_pTable_parms->Add_Field("NSE", SG_DATATYPE_Double); m_pTable_parms->Add_Field("NSE_high", SG_DATATYPE_Double); m_pTable_parms->Add_Field("NSE_low", SG_DATATYPE_Double); m_pTable_parms->Add_Field("PBIAS", SG_DATATYPE_Double); //m_pTable_parms->Add_Field("eR_ovest", SG_DATATYPE_Double); for (int i = 0; i < m_nElevBands; i++) { sprintf(c,"%s_%d","vq",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","vs",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","T(q)",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","T(s)",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","Tw",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","f",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","c",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); if ( m_IHAC_version == 1 ) // Croke etal. (2005) { sprintf(c,"%s_%d","l",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","p",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); } if (m_bSnowModule) { sprintf(c,"%s_%d","T_Rain",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","T_Melt",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","DD_FAC",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); } switch(m_StorConf) { case 0: // single sprintf(c,"%s_%d","a",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","b",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); break; case 1: // two storages in parallel sprintf(c,"%s_%d","aq",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","as",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","bq",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); sprintf(c,"%s_%d","bs",i+1); m_pTable_parms->Add_Field(c, SG_DATATYPE_Double); break; } } } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Create output table //--------------------------------------------------------------------- void Cihacres_elev_cal::_WriteTableParms() { int field = 0; CSG_Table_Record *pRecord; // add a new record to the table m_pTable_parms->Add_Record(); pRecord = m_pTable_parms->Get_Record(m_counter); // writing the data to the current row pRecord->Set_Value(field,m_NSE); field++; pRecord->Set_Value(field,m_NSE_highflow); field++; pRecord->Set_Value(field,m_NSE_lowflow); field++; pRecord->Set_Value(field,m_PBIAS); field++; //pRecord->Set_Value(field,m_sum_eRainGTpcp); field++; for (int eb = 0; eb < m_nElevBands; eb++) { pRecord->Set_Value(field,m_vq[eb]); field++; pRecord->Set_Value(field,m_vs[eb]); field++; pRecord->Set_Value(field,ihacres.Calc_TimeOfDecay(m_p_linparms->aq[eb])); field++; pRecord->Set_Value(field,ihacres.Calc_TimeOfDecay(m_p_linparms->as[eb])); field++; pRecord->Set_Value(field,m_p_nonlinparms->mp_tw[eb]); field++; pRecord->Set_Value(field,m_p_nonlinparms->mp_f[eb]); field++; pRecord->Set_Value(field,m_p_nonlinparms->mp_c[eb]); field++; if ( m_IHAC_version == 1 ) { pRecord->Set_Value(field,m_p_nonlinparms->mp_l[eb]); field++; pRecord->Set_Value(field,m_p_nonlinparms->mp_p[eb]); field++; } if ( m_bSnowModule ) { pRecord->Set_Value(field,m_pSnowparms[eb].T_Rain); field++; pRecord->Set_Value(field,m_pSnowparms[eb].T_Melt); field++; pRecord->Set_Value(field,m_pSnowparms[eb].DD_FAC); field++; } switch ( m_StorConf ) { case 0: // single storage pRecord->Set_Value(field,m_p_linparms->a[eb]); field++; pRecord->Set_Value(field,m_p_linparms->b[eb]); field++; break; case 1: pRecord->Set_Value(field,m_p_linparms->aq[eb]); field++; pRecord->Set_Value(field,m_p_linparms->as[eb]); field++; pRecord->Set_Value(field,m_p_linparms->bq[eb]); field++; pRecord->Set_Value(field,m_p_linparms->bs[eb]); field++; break; } } m_counter++; } //--------------------------------------------------------------------- //--------------------------------------------------------------------- void Cihacres_elev_cal::_CreateTableSim() { int i = 0; // used in function Get_Record(i) CSG_Table_Record *pRecord; CSG_String tmpName; double sim_eb, sim; // creating the column titles m_pTable->Add_Field("Date", SG_DATATYPE_String); m_pTable->Add_Field("Flow_OBS", SG_DATATYPE_Double); for (int eb = 0; eb < m_nElevBands; eb++) { tmpName = SG_T("ELEVB_"); tmpName += convert_sl::Int2String(eb+1).c_str(); m_pTable->Add_Field(tmpName.c_str(), SG_DATATYPE_Double); } m_pTable->Add_Field("Flow_SIM", SG_DATATYPE_Double); for (int j = 0; j < m_nValues; j++) { m_pTable->Add_Record(); pRecord = m_pTable->Get_Record(i); // writing the data into the rows pRecord->Set_Value(0,CSG_String(m_vec_date[j].c_str())); pRecord->Set_Value(1,m_p_Q_obs_m3s[j]); sim_eb = 0.0; sim = 0.0; for (int eb = 0; eb < m_nElevBands; eb++) { sim_eb = model_tools::mmday_to_m3s(m_p_elevbands[eb].m_p_streamflow_sim[j],m_p_elevbands[eb].m_area); //pRecord->Set_Value(3+eb,model_tools::mmday_to_m3s(m_p_elevbands[eb].m_p_streamflow_sim[j],m_p_elevbands[eb].m_area)); pRecord->Set_Value(2+eb, sim_eb); sim += sim_eb; } pRecord->Set_Value(2+m_nElevBands,sim); i++; } } //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // DIALOGS // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // DIALOG 1 //--------------------------------------------------------------------- void Cihacres_elev_cal::_CreateDialog1() { CSG_Parameter *pNode; CSG_String s; pNode = Parameters.Add_Choice( NULL , "NELEVBANDS" , SG_T("Number of elevation bands"), _TL(""), SG_T("2|3|4|5|6|7|8|9|10") ); pNode = Parameters.Add_Value( NULL, "NSIM", _TL("Number of Simulations"), _TL("Number of Simulations for Calibration"), PARAMETER_TYPE_Int, 1000, 1, true, 10000000, true ); pNode = Parameters.Add_Value( pNode, "AREA_tot", _TL("Total Catchment Area [km2]"), _TL(""), PARAMETER_TYPE_Double ); s.Printf(SG_T("Node1"), 1); pNode = Parameters.Add_Node(NULL,s,SG_T("IHACRES Version"),_TL("")); Parameters.Add_Choice( pNode , "IHACVERS" , SG_T("IHACRES Version"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Jakeman & Hornberger (1993)"), // 0 _TL("Croke et al. (2005) !!! not yet implemented !!!") // 1 ) ); s.Printf(SG_T("Node2"), 2); pNode = Parameters.Add_Node(NULL,s,SG_T("Storage Configuration"),_TL("")); Parameters.Add_Choice( pNode , "STORAGE" , SG_T("Storage"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Single Storage"), // 0 _TL("Two Parallel Storages"), // 1 _TL("Two Storages in Series !!! not yet implemented !!!") // 2 ) ); Parameters.Add_Value( pNode, "SNOW_MODULE", _TL("Using the snow-melt module?"), _TL("If checked, snow-melt module is used."), PARAMETER_TYPE_Bool, false ); s.Printf(SG_T("Node6"), 6); pNode = Parameters.Add_Node(NULL,s,SG_T("Nash-Sutcliffe Efficiency"),_TL("")); Parameters.Add_Choice( pNode, "OBJ_FUNC" , SG_T("Objective Function"), _TL(""), SG_T("NSE|NSE high flow|NSE low flow") ); Parameters.Add_Value( pNode, "NSEMIN", SG_T("Minimum Nash-Sutcliffe Efficiency"), SG_T("Minimum Nash-Sutcliffe Efficiency required to print simulation to calibration table"), PARAMETER_TYPE_Double, 0.7, 0.1, true, 1.0, true ); } //--------------------------------------------------------------------- // DIALOG 2 //--------------------------------------------------------------------- bool Cihacres_elev_cal::_CreateDialog2() { int i; //std::ofstream f("_out_elev.txt"); CSG_Parameters P; // used to add Parameters in the second dialog CSG_Parameter *pNode, *pNode1; CSG_String s; CSG_String tmpNode, tmpName; P.Set_Name(_TL("IHACRES Elevation Bands (Dialog 2)")); // Input file ---------------------------------------------- pNode = P.Add_Table( NULL , "TABLE" , _TL("IHACRES Input Table"), _TL(""), PARAMETER_INPUT ); P.Add_Table_Field( pNode , "DATE_Field" , _TL("Date Column"), SG_T("Select the column containing the Date") ); P.Add_Table_Field( pNode , "DISCHARGE_Field" , _TL("Streamflow (obs.) Column"), SG_T("Select the column containing the observed streamflow time series") ); for (i = 0; i < m_nElevBands; i++) { tmpNode = convert_sl::Int2String(i+1).c_str(); //s.Printf(tmpNode.c_str(), i); //pNode1 = P.Add_Node(NULL,s,SG_T("Elevation Band Input",_TL("")); tmpName = SG_T("PCP Column: Elevation Band: "); tmpName+=tmpNode; P.Add_Table_Field( pNode , tmpName.c_str(), tmpName.c_str(), SG_T("Select Precipitation Column") ); tmpName = SG_T("TMP Column: Elevation Band: "); tmpName+=tmpNode; P.Add_Table_Field( pNode , tmpName.c_str() , tmpName.c_str(), SG_T("Select Temperature Column") ); } // Input file ---------------------------------------------- for (i = 0; i < m_nElevBands; i++) { tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+100).c_str(); tmpName = SG_T("Elevation Band "); tmpName+=convert_sl::Int2String(i+1).c_str(); s.Printf(tmpNode.c_str(), i+100); pNode = P.Add_Node(NULL,s,tmpName.c_str(),_TL("")); tmpName = SG_T("Area [km2] Elev("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode, tmpName, _TL("Area [km2]"), _TL(""), PARAMETER_TYPE_Double ); tmpName = SG_T("Mean Elevation [m.a.s.l] Elev("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode, tmpName, _TL("Mean Elevation [m.a.s.l]"), _TL(""), PARAMETER_TYPE_Double ); // Parameters of non-linear module ------------------------- tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+150).c_str(); s.Printf(tmpNode.c_str(), i+150); pNode1 = P.Add_Node(pNode,s,SG_T("Non-Linear Module"),_TL("")); tmpName = SG_T("TwFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("(Tw) wetness decline time constant [lower bound]"), _TW("Tw is approximately the time constant, or inversely," "the rate at which the catchment wetness declines in the absence of rainfall"), PARAMETER_TYPE_Double, 1.0, 0.01, true, 150.0, true ); tmpName = SG_T("TwFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("(Tw) wetness decline time constant [upper bound]"), _TW("Tw is approximately the time constant, or inversely," "the rate at which the catchment wetness declines in the absence of rainfall"), PARAMETER_TYPE_Double, 1.0, 0.01, true, 150.0, true ); tmpName = SG_T("TFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, SG_T("(f) Temperature Modulation Factor [lower bound]"), _TL("Temperature Modulation Factor f"), PARAMETER_TYPE_Double, 0.05, 0.0001, true, 5.0, true ); tmpName = SG_T("TFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, SG_T("(f) Temperature Modulation Factor [upper bound]"), _TL("Temperature Modulation Factor f"), PARAMETER_TYPE_Double, 0.5, 0.0001, true, 5.0, true ); tmpName = SG_T("CFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1,tmpName, _TL("(c) Parameter [lower bound]"), _TL("Parameter (c) to fit streamflow volume"), PARAMETER_TYPE_Double, 0.001, 0.0, true, 1.0, true ); tmpName = SG_T("CFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1,tmpName, _TL("(c) Parameter [upper bound]"), _TL("Parameter (c) to fit streamflow volume"), PARAMETER_TYPE_Double, 0.01, 0.0, true, 1.0, true ); switch(m_IHAC_version) { case 0: // Jakeman & Hornberger (1993) break; case 1: // Croke et al. (2005) tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+200).c_str(); s.Printf(tmpNode.c_str(), i+200); pNode1 = P.Add_Node(pNode,s,SG_T("Soil Moisture Power Eq."),_TL("")); tmpName = SG_T("LFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Parameter (l) [lower bound]"), _TL("Soil moisture index threshold"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); tmpName = SG_T("LFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Parameter (l) [upper bound]"), _TL("Soil moisture index threshold"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); tmpName = SG_T("PFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Parameter (p) [lower bound]"), _TL("non-linear response term"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); tmpName = SG_T("PFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("Parameter (p) [upper bound]"), _TL("non-linear response term"), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); break; } // Parameters of non-linear module ------------------------- // Parameters of linear module ----------------------------- switch(m_StorConf) { case 0: // single storage tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); s.Printf(tmpNode.c_str(), i+250); pNode1 = P.Add_Node(pNode,s,SG_T("Linear Module"),_TL("")); tmpName = SG_T("AFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("(a) [lower bound]"), _TL(""), PARAMETER_TYPE_Double, -0.8, -0.99, true, -0.01, true ); tmpName = SG_T("AFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("(a) [upper bound]"), _TL(""), PARAMETER_TYPE_Double, -0.8, -0.99, true, -0.01, true ); tmpName = SG_T("BFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("(b) [lower bound]"), _TL(""), PARAMETER_TYPE_Double, 0.2, 0.001, true, 1.0, true ); tmpName = SG_T("BFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("(b) [upper bound]"), _TL(""), PARAMETER_TYPE_Double, 0.2, 0.001, true, 1.0, true ); break; case 1: // two parallel storages tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); s.Printf(tmpNode.c_str(), i+250); pNode1 = P.Add_Node(pNode,s,SG_T("Linear Module"),_TL("")); // Parameter a tmpName = SG_T("AQ_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("a(q) [lower bound]"), _TL(""), PARAMETER_TYPE_Double, -0.7, -0.99, true, -0.01, true ); tmpName = SG_T("AQ_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("a(q) [upper bound]"), _TL(""), PARAMETER_TYPE_Double, -0.7, -0.99, true, -0.01, true ); tmpName = SG_T("AS_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("a(s) [lower bound]"), _TL(""), PARAMETER_TYPE_Double, -0.9, -0.99, true, -0.01, true ); tmpName = SG_T("AS_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("a(s) [upper bound]"), _TL(""), PARAMETER_TYPE_Double, -0.9, -0.99, true, -0.01, true ); // Parameter b tmpName = SG_T("BQ_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("b(q) [lower bound]"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true, 1.0, true ); tmpName = SG_T("BQ_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, _TL("b(q) [upper bound]"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true, 1.0, true ); break; case 2: // two storages in series break; } // end switch (storconf) // Parameters of linear module ----------------------------- tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+300).c_str(); s.Printf(tmpNode.c_str(), i+300); pNode1 = P.Add_Node(pNode,s,SG_T("Time Delay after Start of Rainfall (INTEGER)"),_TL("")); tmpName = SG_T("DELAY("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, SG_T("Time Delay (Rain-Runoff)"), SG_T("The delay after the start of rainfall, before the discharge starts to rise."), PARAMETER_TYPE_Int, 0, 1, true, 100, true ); // snow module parameters ---------------------------------- if (m_bSnowModule) { tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+350).c_str(); s.Printf(tmpNode.c_str(), i+350); pNode1 = P.Add_Node(pNode,s,SG_T("Snow Module Parameters"),_TL("")); tmpName = SG_T("T_RAIN_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, SG_T("Temperature Threshold for Rainfall [lower bound]"), SG_T("Below this threshold precipitation will fall as snow"), PARAMETER_TYPE_Double, -1.0, -10.0, true, 10.0, true ); tmpName = SG_T("T_RAIN_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, SG_T("Temperature Threshold for Rainfall [upper bound]"), SG_T("Below this threshold precipitation will fall as snow"), PARAMETER_TYPE_Double, -1.0, -10.0, true, 10.0, true ); tmpName = SG_T("T_MELT_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, SG_T("Temperature Threshold for Melting [lower bound]"), SG_T("Above this threshold snow will start to melt"), PARAMETER_TYPE_Double, 1.0, -5.0, true, 10.0, true ); tmpName = SG_T("T_MELT_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, SG_T("Temperature Threshold for Melting [upper bound]"), SG_T("Above this threshold snow will start to melt"), PARAMETER_TYPE_Double, 1.0, -5.0, true, 10.0, true ); tmpName = SG_T("DD_FAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, SG_T("Day-Degree Factor [lower bound]"), SG_T("Day-Degree Factor depends on catchment characteristics"), PARAMETER_TYPE_Double, 0.7, 0.7, true, 9.2, true ); tmpName = SG_T("DD_FAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); P.Add_Value( pNode1, tmpName, SG_T("Day-Degree Factor [upper bound]"), SG_T("Day-Degree Factor depends on catchment characteristics"), PARAMETER_TYPE_Double, 0.7, 0.7, true, 9.2, true ); } // snow module parameters ---------------------------------- } if( SG_UI_Dlg_Parameters(&P, _TL("IHACRES Distributed Input Dialog 2")) ) { // input table m_p_InputTable = P("TABLE") ->asTable(); // field numbers m_dateField = P("DATE_Field") ->asInt(); m_streamflowField = P("DISCHARGE_Field") ->asInt(); for (int i = 0; i < m_nElevBands; i++) { tmpNode = convert_sl::Int2String(i+1).c_str(); // get precipitation column of Elevation Band[i] tmpName = SG_T("PCP Column: Elevation Band: "); tmpName+=tmpNode; m_p_pcpField[i] = P(tmpName) ->asInt(); // get temperature column of Elevation Band[i] tmpName = SG_T("TMP Column: Elevation Band: "); tmpName+=tmpNode; m_p_tmpField[i] = P(tmpName) ->asInt(); tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+100).c_str(); // get area[km2] of Elevation Band[i] tmpName = SG_T("Area [km2] Elev("); tmpName += tmpNode; tmpName += _TL(")"); m_p_elevbands[i].m_area = P(tmpName) ->asDouble(); // get mean elevation of Elevation Band[i] tmpName = SG_T("Mean Elevation [m.a.s.l] Elev("); tmpName += tmpNode; tmpName += _TL(")"); m_p_elevbands[i].m_mean_elev =P(tmpName) ->asDouble(); // non-linear module parameters tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+150).c_str(); // get Tw tmpName = SG_T("TwFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nl_lb->mp_tw[i] = P(tmpName) ->asDouble(); tmpName = SG_T("TwFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nl_ub->mp_tw[i] = P(tmpName) ->asDouble(); // get f tmpName = SG_T("TFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nl_lb->mp_f[i] = P(tmpName) ->asDouble(); tmpName = SG_T("TFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nl_ub->mp_f[i] = P(tmpName) ->asDouble(); // get c tmpName = SG_T("CFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nl_lb->mp_c[i] = P(tmpName) ->asDouble(); tmpName = SG_T("CFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nl_ub->mp_c[i] = P(tmpName) ->asDouble(); switch(m_IHAC_version) { case 0: // Jakeman & Hornberger (1993) break; case 1: // Croke et al. (2005) tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+200).c_str(); // get l tmpName = SG_T("LFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nl_lb->mp_l[i]= P(tmpName) ->asDouble(); tmpName = SG_T("LFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nl_ub->mp_l[i]= P(tmpName) ->asDouble(); // get p tmpName = SG_T("PFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nl_lb->mp_p[i]= P(tmpName) ->asDouble(); tmpName = SG_T("PFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_p_nl_ub->mp_p[i]= P(tmpName) ->asDouble(); } // linear module parameters switch(m_nStorages) { case 1: // single storage tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); // get a tmpName = SG_T("AFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_p_lin_lb->a[i] = P(tmpName) ->asDouble(); tmpName = SG_T("AFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_p_lin_ub->a[i] = P(tmpName) ->asDouble(); // get b tmpName = SG_T("BFAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_p_lin_lb->b[i] = P(tmpName) ->asDouble(); tmpName = SG_T("BFAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_p_lin_ub->b[i] = P(tmpName) ->asDouble(); break; case 2: // two storages tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+250).c_str(); // get aq tmpName = SG_T("AQ_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_p_lin_lb->aq[i] = P(tmpName) ->asDouble(); tmpName = SG_T("AQ_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_p_lin_ub->aq[i] = P(tmpName) ->asDouble(); // get bq tmpName = SG_T("BQ_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_p_lin_lb->bq[i] = P(tmpName) ->asDouble(); tmpName = SG_T("BQ_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_p_lin_ub->bq[i] = P(tmpName) ->asDouble(); // get as tmpName = SG_T("AS_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_p_lin_lb->as[i] = P(tmpName) ->asDouble(); tmpName = SG_T("AS_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_p_lin_ub->as[i] = P(tmpName) ->asDouble(); break; } // get delay tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+300).c_str(); tmpName = SG_T("DELAY("); tmpName += tmpNode; tmpName += _TL(")"); m_delay = P(tmpName) ->asInt(); if (m_bSnowModule) { tmpNode = SG_T("Node"); tmpNode+=convert_sl::Int2String(i+350).c_str(); tmpName = SG_T("T_RAIN_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms_lb[i].T_Rain = P(tmpName) ->asDouble(); tmpName = SG_T("T_RAIN_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms_ub[i].T_Rain = P(tmpName) ->asDouble(); tmpName = SG_T("T_MELT_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms_lb[i].T_Melt = P(tmpName) ->asDouble(); tmpName = SG_T("T_MELT_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms_ub[i].T_Melt = P(tmpName) ->asDouble(); tmpName = SG_T("DD_FAC_lb("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms_lb[i].DD_FAC = P(tmpName) ->asDouble(); tmpName = SG_T("DD_FAC_ub("); tmpName += tmpNode; tmpName += _TL(")"); m_pSnowparms_ub[i].DD_FAC = P(tmpName) ->asDouble(); } } // end for (int i = 0; i < m_nSubbasins; i++) return(true); } return(false); } //--------------------------------------------------------------------- // DIALOG 3 //--------------------------------------------------------------------- bool Cihacres_elev_cal::_CreateDialog3() { CSG_String s; CSG_Parameters P; // used to add Parameters in the second dialog CSG_Parameter *pNode; // Dialog design P.Set_Name(_TL("Choose Time Range")); s.Printf(SG_T("Node1"), 1); pNode = P.Add_Node(NULL,s,SG_T("Time Range"),_TL("")); s.Printf(SG_T("FDAY") , 1-1); P.Add_String(pNode,s,_TL("First Day"),_TL(""), m_p_InputTable->Get_Record(0)->asString(m_dateField)); s.Printf(SG_T("LDAY") , 1-2); P.Add_String(pNode,s,_TL("Last Day"),_TL(""), m_p_InputTable->Get_Record(m_p_InputTable->Get_Record_Count()-1)->asString(m_dateField)); if( SG_UI_Dlg_Parameters(&P, _TL("Choose Time Range")) ) { /////////////////////////////////////////////////////////////// // // ASSIGN DATA FROM SECOND DIALOG // /////////////////////////////////////////////////////////////// m_date1 = P(CSG_String::Format(SG_T("FDAY"),m_dateField).c_str())->asString(); m_date2 = P(CSG_String::Format(SG_T("LDAY"),m_streamflowField).c_str())->asString(); return(true); } return(false); } saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_elev_cal.h000066400000000000000000000117521224124640700300650ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_elev_cal.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // ihacres_elev_cal.h // // // // Copyright (C) 2008 by // // Stefan Liersch // //-------------------------------------------------------// // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // 2008-02-13 // //-------------------------------------------------------// //*******************************************************// // ToDo // //-------------------------------------------------------// // - //*******************************************************// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ihacres_elev_cal_H #define HEADER_INCLUDED__ihacres_elev_cal_H //--------------------------------------------------------- #include "MLB_Interface.h" #include "ihacres_eq.h" #include "ihacres_elev_bands.h" #include "snow_module.h" #include // used for storing date string values in array //using namespace std; typedef std::vector date_array; class Cihacres_elev_cal : public CSG_Module { public: //-------------------------------------------------------- // CONSTRUCTORS //-------------------------------------------------------- // default Cihacres_elev_cal(); // destructor virtual ~Cihacres_elev_cal(void); protected: // execute module virtual bool On_Execute(void); private: //-------------------------------------------------------- // PRIVATE MEMBER VARIABLES //-------------------------------------------------------- int m_counter; //---------------------------------- // parameters of first module dialog //---------------------------------- int m_nElevBands; // number of used elevation bands int m_nsim; // number of simulations double m_Area_tot; // total catchment area [km2] int m_IHAC_version; // Different versions of IHACRES exist, corresponding // to the version... int m_StorConf; // Storage configuration // 0 = single, 1 = two in parallel, 2 = two in series bool m_bSnowModule; // true if snow module is active int m_nStorages; // number of storages int m_obj_func; double m_NSEmin; //---------------------------------- // parameters of second module dialog //---------------------------------- // time series variables CSG_Table* m_p_InputTable; // IHACRES input table int m_nValues; // number of selected records date_array m_vec_date; double* m_p_Q_obs_m3s; // pointer containing observed streamflow in [m3/s] double* m_p_Q_obs_mmday; // pointer containing observed streamflow in [mm] double* m_p_Q_sim_mmday; Cihacres_elev_bands* m_p_elevbands; // Class Cihacres_elev_cal_bands // Field numbers int m_dateField; // table field numbers int m_streamflowField; // elevation band parameters int* m_p_pcpField; int* m_p_tmpField; //double* m_p_Area; //double* m_p_mean_elev; //---------------------------------- // parameters of third module dialog //---------------------------------- CSG_String m_date1; // first day of time series YYYYMMDD CSG_String m_date2; // last day int m_first; int m_last; //---------------------------------- // Model parameter (in: ihacres_eq.h) //---------------------------------- C_IHAC_LinearParms* m_p_lin_lb; C_IHAC_LinearParms* m_p_lin_ub; C_IHAC_LinearParms* m_p_linparms; // parameters of the linear storage module C_IHAC_NonLinearParms* m_p_nl_lb; C_IHAC_NonLinearParms* m_p_nl_ub; C_IHAC_NonLinearParms* m_p_nonlinparms; // parameters of the non-linear rainfall loss module CSnowParms* m_pSnowparms_lb; CSnowParms* m_pSnowparms_ub; CSnowParms* m_pSnowparms; // 3 snow module paramters CSnowModule* m_p_SnowModule; int m_delay; double* m_vq; double* m_vs; double m_NSE; double m_NSE_highflow; double m_NSE_lowflow; double m_PBIAS; CSG_Table* m_pTable; CSG_Table* m_pTable_parms; //-------------------------------------------------------- // PRIVATE MEMBER FUNCTIONS //-------------------------------------------------------- void _Init_ElevBands(int n); // n = m_nElevBands void _Init_Pointers(int nvals); void _CreateDialog1(); bool _CreateDialog2(); bool _CreateDialog3(); void _ReadInputFile(); void _CalcSnowModule(int elevband); void _Simulate_NonLinearModule(); void _Simulate_Streamflow(); void _Sum_Streamflow(); void _CalcEfficiency(); void _CreateTableSim(); void _CreateTableParms(); void _WriteTableParms(); // Class ihacres_eq Cihacres_eq ihacres; }; #endif /* HEADER_INCLUDED__ihacres_elev_cal_H */ saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_eq.cpp000066400000000000000000001150141224124640700272470ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_eq.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // ihacres_eq.cpp // // // // Copyright (C) 2006 by // // Stefan Liersch // //-------------------------------------------------------// // // // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // // // 2006-08-27 // // // //-------------------------------------------------------// #include // used for textfile output (test only) #include // used for textfile output (test only) #include "ihacres_eq.h" #include // exp() //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // COMMENTS // //--------------------------------------------------------- // 2007-11-08 // added to function CalcWetnessIndex() // if (WetnessIndex[i] > 1.0) WetnessIndex[i] = 1.0; //--------------------------------------------------------- /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // // CONSTRUCTORS // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // DEFAULT CONSTRUCTOR //--------------------------------------------------------------------- Cihacres_eq::Cihacres_eq() {}; //--------------------------------------------------------------------- // two storages // using vector as input // if no temperature data are available Cihacres_eq::Cihacres_eq(date_array date_in, vector_d streamflow, vector_d pcp, double TwConst, double f, double c, double l, double p, double aq, double as, double bq, double bs) { sizeAll = streamflow.size(); date = date_in; streamflow_obs = streamflow; precipitation = pcp; this->TwConst = TwConst; this->f = f; this->c = c; this->l = l; this->p = p; this->aq = aq; this->as = as; this->bq = bq; this->bs = bs; // Initialize Vectors _InitVectorsStart(streamflow_obs.size()); } //--------------------------------------------------------------------- // two storages // using vector as input // if temperature data are available Cihacres_eq::Cihacres_eq(date_array date_in, vector_d streamflow, vector_d pcp, vector_d tmp, double TwConst, double f, double c, double l, double p, double aq, double as, double bq, double bs, double area, bool TMP_data_exist, int IHAC_vers, int storconf, bool bSnowModule, CSnowModule *SnowMod, //double T_Rain, double T_Melt, double DD_FAC, int delay) { // Initialize Parameters and Vectors sizeAll = streamflow.size(); date = date_in; streamflow_obs = streamflow; precipitation = pcp; temperature = tmp; this->TwConst = TwConst; this->f = f; this->c = c; this->l = l; this->p = p; this->aq = aq; this->as = as; this->bq = bq; this->bs = bs; this->delay = delay; this->area = area; IHAC_version = IHAC_vers; this->bSnowModule = bSnowModule; m_pSnowMod = SnowMod; // Initialize Vectors containing calculated values _InitVectorsStart(sizeAll); // Convert Streamflow vector from m3/s*day-1 to mm/day streamflowMM_obs = model_tools::m3s_to_mmday(streamflow_obs, streamflowMM_obs, area); // perform simulation if (bSnowModule) { RunNonLinearModule(TMP_data_exist, bSnowModule, m_pSnowMod->Get_T_Rain()); } else { RunNonLinearModule(TMP_data_exist, bSnowModule, 0.0); } //switch (IHAC_version) //{ //case 0: // Jakeman & Hornberger (1993) // if (bSnowModule) // { // RunNonLinearModule(TMP_data_exist, bSnowModule, m_pSnowMod->Get_T_Rain()); // } else { // RunNonLinearModule(TMP_data_exist, bSnowModule, 0.0); // } // break; //case 1: // Croke et al. (2005) Redesign // //RunNonLinearModule5Parms(); // break; //} switch(storconf) { case 0: // single storage this->a = aq; this->b = bq; SimStreamflowSingle(excessRain, streamflowMM_obs[0], streamflow_sim, delay, a, b); break; case 1: // two storages in parallel SimStreamflow2Parallel(excessRain, streamflow_sim, streamflowMM_obs[0], aq, as, bq, bs, vq, vs, IHAC_vers, delay); break; } // end switch(storconf) NSE = model_tools::CalcEfficiency(streamflowMM_obs, streamflow_sim); } //--------------------------------------------------------------------- // two storages // using double arrays as input // if no temperature data are available Cihacres_eq::Cihacres_eq(int size, // array size date_array date_in, double *streamflow, double *pcp, double TwConst, double f, double c, double aq, double as, double bq, double bs) { // assign values to global parameters sizeAll = size; date = date_in; streamflow_obs.resize(sizeAll); precipitation.resize(sizeAll); for (int i = 0; i < sizeAll; i++) { streamflow_obs[i] = streamflow[i]; precipitation[i] = pcp[i]; } this->TwConst = TwConst; this->f = f; this->c = c; this->aq = aq; this->as = as; this->bq = bq; this->bs = bs; // Initialize Vectors _InitVectorsStart(sizeAll); } //--------------------------------------------------------------------- // two storages // using double arrays as input // if temperature data are available Cihacres_eq::Cihacres_eq(int size, // array size date_array date_in, double *streamflow, double *pcp, double *tmp, double TwConst, double f, double c, double aq, double as, double bq, double bs) { sizeAll = size; date = date_in; streamflow_obs.resize(size); precipitation.resize(size); temperature.resize(size); for (int i = 0; i < size; i++) { streamflow_obs[i] = streamflow[i]; precipitation[i] = pcp[i]; temperature[i] = tmp[i]; } this->TwConst = TwConst; this->f = f; this->c = c; this->aq = aq; this->as = as; this->bq = bq; this->bs = bs; // Initialize Vectors _InitVectorsStart(streamflow_obs.size()); } //--------------------------------------------------------------------- // end constructors /////////////////////////////////////////////////// // destructor Cihacres_eq::~Cihacres_eq(void) { _ZeroAllVectors(); } /////////////////////////////////////////////////////////////////////// // // PUBLIC MEMBER FUNCTIONS // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // Run Non-Linear Module //--------------------------------------------------------------------- void Cihacres_eq::RunNonLinearModule(bool TMP_data_exist, bool bSnowModule, double T_Rain) { double WI_init = 0.5; double eR_init = 0.0; switch (IHAC_version) { case 0: // Jakeman & Hornberger (1993) // if temperature data are available (TMP_data_exist = true), then adjust the rate // at which the catchment wetness declines in the absence of rainfall // to daily temperature if (TMP_data_exist){ CalcWetnessTimeConst(temperature, Tw, TwConst, f); } if (bSnowModule) { // calculate the catchment wetness index CalcWetnessIndex(Tw, precipitation, temperature, WetnessIndex, WI_init, c, bSnowModule, m_pSnowMod->Get_T_Rain()); // calculate effective rainfall sum_eRainMM = CalcExcessRain(precipitation, temperature, WetnessIndex, excessRain, eR_init, sum_eRainGTpcp, bSnowModule, m_pSnowMod); } else { CalcWetnessIndex(Tw, precipitation, temperature, WetnessIndex, WI_init, c, bSnowModule, 0.0); sum_eRainMM = CalcExcessRain(precipitation, temperature, WetnessIndex, excessRain, eR_init, sum_eRainGTpcp, bSnowModule, m_pSnowMod); } break; case 1: // Croke et al. (2005) if (TMP_data_exist) { CalcWetnessTimeConst_Redesign(temperature, Tw, TwConst, f); } if (bSnowModule) { // calculate the catchment wetness index CalcWetnessIndex_Redesign(Tw, precipitation, WetnessIndex, bSnowModule, m_pSnowMod->Get_T_Rain()); // calculate effective rainfall sum_eRainMM = CalcExcessRain_Redesign(precipitation, temperature, WetnessIndex, excessRain, eR_init, sum_eRainGTpcp, c, l, p, bSnowModule, m_pSnowMod); } else { // calculate the catchment wetness index CalcWetnessIndex_Redesign(Tw, precipitation, WetnessIndex, bSnowModule, 0.0); // calculate effective rainfall sum_eRainMM = CalcExcessRain_Redesign(precipitation, temperature, WetnessIndex, excessRain, eR_init, sum_eRainGTpcp, c, l, p, bSnowModule, m_pSnowMod); } break; } } //--------------------------------------------------------------------- // Simulate Streamflow (single storage) //--------------------------------------------------------------------- void Cihacres_eq::SimStreamflowSingle(vector_d &excessRain, double initVal, vector_d &streamflow_sim, int delay, double a, double b) { int i; int size = streamflow_sim.size(); // using the first observed streamflow value as initial simulation value for (i = 0; i < delay; i++) streamflow_sim[i] = initVal; // start calculation with second value for (i = delay; i < size; i++) { streamflow_sim[i] = -a * streamflow_sim[i-1] + b * excessRain[i-delay]; } } //--------------------------------------------------------------------- // Simulate Streamflow (single storage) //--------------------------------------------------------------------- void Cihacres_eq::SimStreamflowSingle(double *excessRain, double initVal, double *streamflow_sim, int delay, double a, double b, int size) { int i; // using the first observed streamflow value as initial simulation value for (i = 0; i < delay; i++) streamflow_sim[i] = initVal; // start calculation with second value for (i = delay; i < size; i++) { streamflow_sim[i] = -a * streamflow_sim[i-1] + b * excessRain[i-delay]; } } //--------------------------------------------------------------------- // Simulate Streamflow (2 parallel storages) //--------------------------------------------------------------------- void Cihacres_eq::SimStreamflow2Parallel(vector_d &excessRain, vector_d &streamflow_sim, double initVal, double aq, double as, double bq, double bs, double &vq, double &vs, int IHAC_vers, int delay) { int i; int size = streamflow_sim.size(); double *sf_q = new double[size]; // quick streamflow component double *sf_s = new double[size]; // slow streamflow component // calculate the dependent b-value // after Jakeman etc. vq = bq / (1 + aq); vs = 1 - vq; // using the first observed streamflow value as initial simulation value for (i = 0; i < delay; i++) { streamflow_sim[i] = initVal; sf_q[i] = initVal * vq; sf_s[i] = initVal * vs; } // using the first observed streamflow value as initial simulation value //for (i = 0; i < delay; i++) //{ // streamflow_sim[i] = initVal; // sf_q[i] = initVal / 2; // sf_s[i] = initVal / 2; //} //// calculate the dependent b-value //if (IHAC_vers == 1) // after Kokkonen //{ // vq = bq / (bq + bs); // vs = 1 - vq; //} else { // after Jakeman etc. // vq = bq / (1 + aq); // vs = 1 - vq; //} // calculate streamflow for (i = delay; i < size; i++) { sf_q[i] = -aq * sf_q[i-1] + bq * excessRain[i-delay]; sf_s[i] = -as * sf_s[i-1] + bs * excessRain[i-delay]; streamflow_sim[i] = sf_q[i] + sf_s[i]; } /* switch(IHAC_vers) { case 0 : // after Jakeman & Hornberger (1993) vq = bq / (1 + aq); vs = 1 - vq; if (!b_freebee) bs = vs * (1 + as); // calculate quick and slow components for (i = delay; i < size; i++) { sf_q[i] = -aq * sf_q[i-1] + bq * excessRain[i-delay]; sf_s[i] = -as * sf_s[i-1] + bs * excessRain[i-delay]; streamflow_sim[i] = sf_q[i] + sf_s[i]; } break; case 1 : // after Kokkonen et al. (2003) vq = bq / (bq + bs); vs = 1 - vq; if (!b_freebee) bs = vs * (1 + as); // calculate quick and slow components for (i = delay; i < size; i++) { sf_q[i] = -aq * sf_q[i-1] + bq * excessRain[i-delay]; sf_s[i] = -as * sf_s[i-1] + bs * excessRain[i-delay]; streamflow_sim[i] = sf_q[i] + sf_s[i]; } break; case 2: // Ahandere Mahn vq = bq / (1 + aq); vs = 1 - vq; if (!b_freebee) bs = vs * (1 + as); // calculate quick and slow components for (i = delay; i < size; i++) { sf_q[i] = -aq * sf_q[i-1] + bq * excessRain[i-delay]; sf_s[i] = -as * sf_s[i-1] + bs * excessRain[i-delay]; streamflow_sim[i] = sf_q[i] + sf_s[i]; } break; case 3 : // after Croke et al. (2005) vq = bq / (1 + aq); vs = 1 - vq; if (!b_freebee) bs = vs * (1 + as); // calculate quick and slow components for (i = delay; i < size; i++) { sf_q[i] = -aq * sf_q[i-1] + bq * excessRain[i-delay]; sf_s[i] = -as * sf_s[i-1] + bs * excessRain[i-delay]; streamflow_sim[i] = sf_q[i] + sf_s[i]; } break; } */ delete[] sf_q; delete[] sf_s; } //--------------------------------------------------------------------- // Simulate Streamflow (2 parallel storages) //--------------------------------------------------------------------- void Cihacres_eq::SimStreamflow2Parallel(double *excessRain, double *streamflow_sim, double initVal, double aq, double as, double bq, double bs, double &vq, double &vs, int IHAC_vers, int size, int delay) { int i; double *sf_q = new double[size]; // quick streamflow component double *sf_s = new double[size]; // slow streamflow component // calculate the dependent b-value // after Jakeman etc. vq = bq / (1 + aq); vs = 1 - vq; // using the first observed streamflow value as initial simulation value for (i = 0; i < delay; i++) { streamflow_sim[i] = initVal; sf_q[i] = initVal * vq; sf_s[i] = initVal * vs; } //// using the first observed streamflow value as initial simulation value //for (i = 0; i < delay; i++) //{ // streamflow_sim[i] = initVal; // sf_q[i] = initVal / 2; // sf_s[i] = initVal / 2; //} //// calculate the dependent b-value //if (IHAC_vers == 1) // after Kokkonen //{ // vq = bq / (bq + bs); // vs = 1 - vq; //} else { // after Jakeman etc. // vq = bq / (1 + aq); // vs = 1 - vq; //} // calculate streamflow for (i = delay; i < size; i++) { sf_q[i] = -aq * sf_q[i-1] + bq * excessRain[i-delay]; sf_s[i] = -as * sf_s[i-1] + bs * excessRain[i-delay]; streamflow_sim[i] = sf_q[i] + sf_s[i]; } /* switch(IHAC_vers) { case 0 : // after Jakeman & Hornberger (1993) vq = bq / (1 + aq); vs = 1 - vq; if (!b_freebee) bs = vs * (1 + as); // calculate quick and slow components for (i = delay; i < size; i++) { sf_q[i] = -aq * sf_q[i-1] + bq * excessRain[i-delay]; sf_s[i] = -as * sf_s[i-1] + bs * excessRain[i-delay]; streamflow_sim[i] = sf_q[i] + sf_s[i]; } break; case 1 : // after Kokkonen et al. (2003) vq = bq / (bq + bs); vs = 1 - vq; if (!b_freebee) bs = vs * (1 + as); // calculate quick and slow components for (i = delay; i < size; i++) { sf_q[i] = -aq * sf_q[i-1] + bq * excessRain[i-delay]; sf_s[i] = -as * sf_s[i-1] + bs * excessRain[i-delay]; streamflow_sim[i] = sf_q[i] + sf_s[i]; } break; case 2: // Jakeman & SnowModule vq = bq / (1 + aq); vs = 1 - vq; if (!b_freebee) bs = vs * (1 + as); // calculate quick and slow components for (i = delay; i < size; i++) { sf_q[i] = -aq * sf_q[i-1] + bq * excessRain[i-delay]; sf_s[i] = -as * sf_s[i-1] + bs * excessRain[i-delay]; streamflow_sim[i] = sf_q[i] + sf_s[i]; } break; case 3 : // after Croke et al. (2005) vq = bq / (1 + aq); vs = 1 - vq; if (!b_freebee) bs = vs * (1 + as); // calculate quick and slow components for (i = delay; i < size; i++) { sf_q[i] = -aq * sf_q[i-1] + bq * excessRain[i-delay]; sf_s[i] = -as * sf_s[i-1] + bs * excessRain[i-delay]; streamflow_sim[i] = sf_q[i] + sf_s[i]; } break; } */ delete[] sf_q; delete[] sf_s; } //--------------------------------------------------------------------- // Simulate Streamflow (2 parallel storages) //--------------------------------------------------------------------- void Cihacres_eq::SimStreamflow2Parallel(double *excessRain, double *streamflow_sim, double initVal, // first observed streamflow value C_IHAC_LinearParms* linparms, int index, double &vq, double &vs, int size, int delay) { int i; double *sf_q = new double[size]; // quick streamflow component double *sf_s = new double[size]; // slow streamflow component // calculate the dependent b-value // after Jakeman etc. vq = linparms->bq[index] / (1 + linparms->aq[index]); vs = 1 - vq; // using the first observed streamflow value as initial simulation value for (i = 0; i < delay; i++) { streamflow_sim[i] = initVal; sf_q[i] = initVal * vq; sf_s[i] = initVal * vs; } // calculate streamflow for (i = delay; i < size; i++) { sf_q[i] = -linparms->aq[index] * sf_q[i-1] + linparms->bq[index] * excessRain[i-delay]; sf_s[i] = -linparms->as[index] * sf_s[i-1] + linparms->bs[index] * excessRain[i-delay]; streamflow_sim[i] = sf_q[i] + sf_s[i]; } delete[] sf_q; delete[] sf_s; } //--------------------------------------------------------------------- // Calculate Parameter b(q) //--------------------------------------------------------------------- double Cihacres_eq::Calc_Parm_BS(double aq, double as, double bq) { return( (1 - (bq / (1 + aq))) * (1 + as) ); } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Calculate time of decay (quick or slow) //--------------------------------------------------------------------- double Cihacres_eq::Calc_TimeOfDecay(double a) { return( -1 / log(-a) ); } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Calculate Wetness Time Constant //--------------------------------------------------------------------- void Cihacres_eq::CalcWetnessTimeConst(vector_d &temperature, vector_d &Tw, double TwConst, double f) { for (unsigned int i = 0; i < Tw.size(); i++) { Tw[i] = TwConst * exp((20.0 - temperature[i]) * f); } } //--------------------------------------------------------------------- // Calculate Wetness Time Constant //--------------------------------------------------------------------- void Cihacres_eq::CalcWetnessTimeConst(double *temperature, double *Tw, double TwConst, double f, int size) { for (int i = 0; i < size; i++) { Tw[i] = TwConst * exp((20.0 - temperature[i]) * f); } } //--------------------------------------------------------------------- // Calculate Wetness Time Constant //--------------------------------------------------------------------- void Cihacres_eq::CalcWetnessTimeConst(double *temperature, double *Tw, C_IHAC_NonLinearParms* nonlinparms, int index, int size) { for (int i = 0; i < size; i++) { Tw[i] = nonlinparms->mp_tw[index] * exp((20.0 - temperature[i]) * nonlinparms->mp_f[index]); } } //--------------------------------------------------------------------- // Calculate Wetness Time Constant // For ihacres_climate_scen //--------------------------------------------------------------------- void Cihacres_eq::CalcWetnessTimeConst_scen(double *temperature, double *Tw, C_IHAC_NonLinearParms* nonlinparms, int index, int size) { Tw[0] = 0.0; for (int i = 1; i < size; i++) { Tw[i] = nonlinparms->mp_tw[index] * exp((20.0 - temperature[i]) * nonlinparms->mp_f[index]); } } //--------------------------------------------------------------------- // Calculate Wetness Time Constant (Croke et al. 2005) //--------------------------------------------------------------------- void Cihacres_eq::CalcWetnessTimeConst_Redesign(vector_d &temperature, vector_d &Tw, double TwConst, double f) { double Tr = 20.0; // reference temperature for (unsigned int i = 0; i < Tw.size(); i++) { Tw[i] = TwConst * exp(0.062 * f * (Tr - temperature[i])); } } //--------------------------------------------------------------------- // Calculate Wetness Time Constant (Croke et al. 2005) //--------------------------------------------------------------------- void Cihacres_eq::CalcWetnessTimeConst_Redesign(double *temperature, double *Tw, double TwConst, double f, int size) { double Tr = 20.0; // reference temperature for (int i = 0; i < size; i++) { Tw[i] = TwConst * exp(0.062 * f * (Tr - temperature[i])); } } //--------------------------------------------------------------------- // Calculate Wetness Time Constant (Croke et al. 2005) //--------------------------------------------------------------------- void Cihacres_eq::CalcWetnessTimeConst_Redesign(double *temperature, double *Tw, C_IHAC_NonLinearParms* nonlinparms, int index, int size) { double Tr = 20.0; // reference temperature for (int i = 0; i < size; i++) { Tw[i] = nonlinparms->mp_tw[index] * exp(0.062 * nonlinparms->mp_f[index] * (Tr - temperature[i])); } } //--------------------------------------------------------------------- // Calculate Wetness Index //--------------------------------------------------------------------- void Cihacres_eq::CalcWetnessIndex(vector_d &Tw, vector_d &precipitation, vector_d &temperature, vector_d &WetnessIndex, double WI_init, double c, bool bSnowModule, double T_Rain) { WetnessIndex[0] = WI_init; // starting at the second value (i=1) for (unsigned int i = 1; i < WetnessIndex.size(); i++) { if (bSnowModule && temperature[i] < T_Rain) { WetnessIndex[i] = (1 - (1 / Tw[i])) * WetnessIndex[i-1]; } else { WetnessIndex[i] = c * precipitation[i] + (1 - (1 / Tw[i])) * WetnessIndex[i-1]; } // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // if (WetnessIndex[i] > 1.0) WetnessIndex[i] = 1.0; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } } //--------------------------------------------------------------------- // Calculate Wetness Index //--------------------------------------------------------------------- void Cihacres_eq::CalcWetnessIndex(double *Tw, double *precipitation, double *temperature, double *WetnessIndex, double WI_init, double c, bool bSnowModule, double T_Rain, int size) { //WetnessIndex[0] = 0.5; WetnessIndex[0] = WI_init; // starting at the second value (i=1) for (int i = 1; i < size; i++) { if (bSnowModule && temperature[i] < T_Rain) { WetnessIndex[i] = (1 - (1 / Tw[i])) * WetnessIndex[i-1]; } else { WetnessIndex[i] = c * precipitation[i] + (1 - (1 / Tw[i])) * WetnessIndex[i-1]; } // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // if (WetnessIndex[i] > 1.0) WetnessIndex[i] = 1.0; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } } //--------------------------------------------------------------------- // Calculate Wetness Index after Croke et al. (2005) //--------------------------------------------------------------------- void Cihacres_eq::CalcWetnessIndex_Redesign(vector_d &Tw, vector_d &precipitation, vector_d &WetnessIndex, bool bSnowModule,double T_Rain) { WetnessIndex[0] = 0.5; // starting at the second value (i=1) for (unsigned int i = 1; i < WetnessIndex.size(); i++) { WetnessIndex[i] = precipitation[i] + (1 - (1 / Tw[i])) * WetnessIndex[i-1]; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // if (WetnessIndex[i] > 1.0) WetnessIndex[i] = 1.0; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } } //--------------------------------------------------------------------- // Calculate Wetness Index after Croke et al. (2005) //--------------------------------------------------------------------- void Cihacres_eq::CalcWetnessIndex_Redesign(double *Tw, double *precipitation,double *WetnessIndex, double WI_init, bool bSnowModule,double T_Rain, int size) { //WetnessIndex[0] = 0.5; WetnessIndex[0] = WI_init; // starting at the second value (i=1) for (int i = 1; i < size; i++) { WetnessIndex[i] = precipitation[i] + (1 - (1 / Tw[i])) * WetnessIndex[i-1]; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // if (WetnessIndex[i] > 1.0) WetnessIndex[i] = 1.0; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } } //--------------------------------------------------------------------- // Calculate Effective or Excess Rainfall //--------------------------------------------------------------------- double Cihacres_eq::CalcExcessRain(vector_d &precipitation, vector_d &temperature, vector_d &WetnessIndex, vector_d &excessRain, double eR_init, double &sum_eRainGTpcp, bool bSnowModule, CSnowModule* pSnowModule) //double T_Rain, double T_Melt, double* MeltRate) { double sum = 0.0; // sum of total ExcessRain of the period sum_eRainGTpcp = 0.0; excessRain[0] = eR_init; if (precipitation[0] > 0.0) excessRain[0] = precipitation[0] / 2; // starting at the second value (i=1) for (unsigned int i = 1; i < excessRain.size(); i++) { // "excess" rainfall after Jakeman & Hornberger (1993) // ExcessRain[i] = pcp[i] * WetnessIndex[i]; // "excess" rainfall after Croke et al. (2004) excessRain[i] = precipitation[i] * ((WetnessIndex[i] + WetnessIndex[i-1]) / 2); if (excessRain[i] > precipitation[i]) { // if calculated excess rain volume is greater than observed precipitation, // then summarize volume differences and set to current pcp value sum_eRainGTpcp += excessRain[i] - precipitation[i]; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // if excess rainfall is greater than observed precip, then // it is reduced to precip! //excessRain[i] = precipitation[i]; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } if (excessRain[i] < 0.0) excessRain[i] = 0.0; // snow module ******************************************** if (bSnowModule) { if (temperature[i] < pSnowModule->Get_T_Rain()) excessRain[i] = 0.0; if (temperature[i] > pSnowModule->Get_T_Melt()) excessRain[i] += pSnowModule->Get_MeltRate(i); if ((temperature[i] < pSnowModule->Get_T_Melt()) && (temperature[i] > pSnowModule->Get_T_Rain())) excessRain[i] += pSnowModule->Get_MeltRate(i); } // end snow module **************************************** sum += excessRain[i]; } sum += excessRain[0]; // add the initial value return sum; } //--------------------------------------------------------------------- // Calculate Effective or Excess Rainfall //--------------------------------------------------------------------- double Cihacres_eq::CalcExcessRain(double *precipitation, double* temperature, double *WetnessIndex, double *excessRain, double eR_init, double &sum_eRainGTpcp, int size, bool bSnowModule, double T_Rain, double T_Melt, double* MeltRate) { double sum = 0.0; // sum of total ExcessRain of the period sum_eRainGTpcp = 0.0; //excessRain[0] = 0.0; excessRain[0] = eR_init; //if (precipitation[0] > 0.0) excessRain[0] = precipitation[0] / 2; // starting at the second value (i=1) for (int i = 1; i < size; i++) { // "excess" rainfall after Jakeman & Hornberger (1993) // ExcessRain[i] = pcp[i] * WetnessIndex[i]; // "excess" rainfall after Croke et al. (2004) excessRain[i] = precipitation[i] * ((WetnessIndex[i] + WetnessIndex[i-1]) / 2); if (excessRain[i] > precipitation[i]) { // if calculated excess rain volume is greater than observed precipitation, // then summarize volume differences and set to current pcp value sum_eRainGTpcp += excessRain[i] - precipitation[i]; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // if excess rainfall is greater than observed precip, then // it is reduced to precip! //excessRain[i] = precipitation[i]; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } if (excessRain[i] < 0.0) excessRain[i] = 0.0; // snow module ******************************************** if (bSnowModule) { if (temperature[i] < T_Rain) excessRain[i] = 0.0; if (temperature[i] > T_Melt) excessRain[i] += MeltRate[i]; if ((temperature[i] < T_Melt) && (temperature[i] > T_Rain)) excessRain[i] += MeltRate[i]; } // end snow module **************************************** sum += excessRain[i]; } sum += excessRain[0]; // add the initial value return sum; } //--------------------------------------------------------------------- // Calculate Effective or Excess Rainfall after Croke et al. (2005) //--------------------------------------------------------------------- double Cihacres_eq::CalcExcessRain_Redesign(vector_d &precipitation, vector_d& temperature, vector_d &WetnessIndex, vector_d &excessRain, double eR_init, double &sum_eRainGTpcp, double c, double l, double p, bool bSnowModule, CSnowModule* pSnowMod) { double sum = 0.0; // sum of total ExcessRain of the period sum_eRainGTpcp = 0.0; excessRain[0] = eR_init; if (precipitation[0] > 0.0) excessRain[0] = precipitation[0] / 2; // starting at the second value (i=1) for (unsigned int i = 1; i < excessRain.size(); i++) { // "excess" rainfall after Jakeman & Hornberger (1993) // ExcessRain[i] = pcp[i] * WetnessIndex[i]; // "excess" rainfall after Croke et al. (2004) // excessRain[i] = precipitation[i] * ((WetnessIndex[i] + WetnessIndex[i-1]) / 2); // excess rainfall after Croke et al. (2005) // The first equation is as described in the paper, // but Barry Croke told me that parameter "c" must be outside the brackets !!! // excessRain[i] = pow((c *(WetnessIndex[i] - l)),p) * precipitation[i]; if ( WetnessIndex[i] - l < 0.0 ) { excessRain[i] = 0.0; } else { excessRain[i] = c * pow((WetnessIndex[i] - l),p) * precipitation[i]; } if (excessRain[i] > precipitation[i]) { // if calculated excess rain volume is greater than observed precipitation, // then summarize volume differences and set to current pcp value sum_eRainGTpcp += excessRain[i] - precipitation[i]; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // if excess rainfall is greater than observed precip, then // it is reduced to precip! //excessRain[i] = precipitation[i]; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } if (excessRain[i] < 0.0) excessRain[i] = 0.0; // snow module ******************************************** if (bSnowModule) { if (temperature[i] < pSnowMod->Get_T_Rain()) excessRain[i] = 0.0; if (temperature[i] > pSnowMod->Get_T_Melt()) excessRain[i] += pSnowMod->Get_MeltRate(i); if ((temperature[i] < pSnowMod->Get_T_Melt()) && (temperature[i] > pSnowMod->Get_T_Rain())) excessRain[i] += pSnowMod->Get_MeltRate(i); } // end snow module **************************************** sum += excessRain[i]; } sum += excessRain[0]; // add the initial value return sum; } //--------------------------------------------------------------------- // Calculate Effective or Excess Rainfall after Croke et al. (2005) //--------------------------------------------------------------------- double Cihacres_eq::CalcExcessRain_Redesign(double *precipitation, double* temperature, double *WetnessIndex, double *excessRain, double eR_init, double &sum_eRainGTpcp, int size, double c, double l, double p, bool bSnowModule, double T_Rain, double T_Melt, double* MeltRate) { double sum = 0.0; // sum of total ExcessRain of the period sum_eRainGTpcp = 0.0; //excessRain[0] = 0.0; excessRain[0] = eR_init; //if (precipitation[0] > 0.0) excessRain[0] = precipitation[0] / 2; // starting at the second value (i=1) for (int i = 1; i < size; i++) { // excess rainfall after Croke et al. (2005) // The first equation is as described in the paper, // but Barry Croke told me that parameter "c" must be outside the brackets !!! // excessRain[i] = pow((c *(WetnessIndex[i] - l)),p) * precipitation[i]; excessRain[i] = c * pow((WetnessIndex[i] - l),p) * precipitation[i]; if (excessRain[i] > precipitation[i]) { // if calculated excess rain volume is greater than observed precipitation, // then summarize volume differences and set to current pcp value sum_eRainGTpcp += excessRain[i] - precipitation[i]; excessRain[i] = precipitation[i]; } if (excessRain[i] < 0.0) excessRain[i] = 0.0; // snow module ******************************************** if (bSnowModule) { if (temperature[i] < T_Rain) excessRain[i] = 0.0; if (temperature[i] > T_Melt) excessRain[i] += MeltRate[i]; if ((temperature[i] < T_Melt) && (temperature[i] > T_Rain)) excessRain[i] += MeltRate[i]; } // end snow module **************************************** sum += excessRain[i]; } sum += excessRain[0]; // add the initial value return sum; } //--------------------------------------------------------------------- // Assign first and last record (user selection) //--------------------------------------------------------------------- void Cihacres_eq::AssignFirstLastRec(CSG_Table &pTable, int &first, int &last, CSG_String date1, CSG_String date2, int dateField) { int j; /////////////////////////////////////////////////////////////// // searching the first and the last record of the time range /////////////////////////////////////////////////////////////// for (j = 0; j < pTable.Get_Record_Count(); j++) { if (!date1.Cmp(pTable.Get_Record(j)->asString(dateField))) { first = j; } else if (!date2.Cmp(pTable.Get_Record(j)->asString(dateField))) { last = j; } } } //--------------------------------------------------------------------- int Cihacres_eq::Assign_nStorages(int storconf) { switch(storconf) { case 0: return(1); break; case 1: return(2); break; case 2: return(2); break; default : return(1); } } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Summarize all Values in a Vector //--------------------------------------------------------------------- double Cihacres_eq::SumVector(vector_d &input) { double sum = 0; for (unsigned int j = 0; j < input.size(); j++) { sum += input[j]; } return sum; } //--------------------------------------------------------------------- // Summarize all Values in an Array //--------------------------------------------------------------------- double Cihacres_eq::SumVector(double *input, int size) { double sum = 0; for (int j = 0; j < size; j++) { sum += input[j]; } return sum; } //--------------------------------------------------------------------- // Assign temporary Nash-Sutcliffe efficiency according to // objective function (NSE, NSE_highflow, NSE_lowflow) //--------------------------------------------------------------------- double Cihacres_eq::_Assign_NSE_temp(int obj_func, double NSE, double NSE_highflow, double NSE_lowflow) { switch(obj_func) { case 0: // NSE return(NSE); case 1: // NSE high flow return(NSE_highflow); case 2: // NSE low flow (not yet implemented!) return(NSE_lowflow); break; default: return(NSE); } // end switch(m_obj_func) } //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // GET FUNCTIONS // /////////////////////////////////////////////////////////////////////// double Cihacres_eq::get_vq() { // return (bq / (bq + bs)); return(vq); } //--------------------------------------------------------------------- double Cihacres_eq::get_vs() { // return (1 - get_vq()); return(vs); } //--------------------------------------------------------------------- //--------------------------------------------------------------------- double Cihacres_eq::get_sum_streamflowMM_obs(int size) { double sum_streamflowMM_obs = 0.0; // calculate sum of observed streamflow in [mm] for (int j = 0; j < size; j++) { sum_streamflowMM_obs += streamflowMM_obs[j]; } return(sum_streamflowMM_obs); } //--------------------------------------------------------------------- double Cihacres_eq::get_sum_precipitation(int size) { double sum_pcp = 0.0; for (int i = 0; i < size; i++) { sum_pcp += precipitation[i]; } return(sum_pcp); } //--------------------------------------------------------------------- double Cihacres_eq::get_NSE() { return(NSE); } //--------------------------------------------------------------------- vector_d Cihacres_eq::get_streamflow_sim() { return(streamflow_sim); } //--------------------------------------------------------------------- vector_d Cihacres_eq::get_excessRain() { return(excessRain); } //--------------------------------------------------------------------- vector_d Cihacres_eq::get_WetnessIndex() { return(WetnessIndex); } //--------------------------------------------------------------------- vector_d Cihacres_eq::get_Tw() { return(Tw); } //--------------------------------------------------------------------- //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // PRIVATE MEMBER FUNCTIONS // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // Initialize (Resize) global Vectors //--------------------------------------------------------------------- void Cihacres_eq::_InitVectorsStart(int size) { streamflow_sim.resize(size); excessRain.resize(size); WetnessIndex.resize(size); Tw.resize(size); streamflowMM_obs.resize(size); //if (IHAC_version == 2) //{ // m_pSnowMod->SnowStorage = new double[size]; // m_pSnowMod->MeltRate = new double[size]; // for (int i = 0; i < size; i++) // { // m_pSnowMod->SnowStorage[i] = 0.0; // m_pSnowMod->MeltRate[i] = 0.0; // } // //SnowModule(m_pSnowMod->SnowStorage,m_pSnowMod->MeltRate,temperature,precipitation, m_pSnowMod->T_Rain,m_pSnowMod->T_Melt,m_pSnowMod->DD_FAC, size); //} } //--------------------------------------------------------------------- // Zero all Vectors //--------------------------------------------------------------------- void Cihacres_eq::_ZeroAllVectors() { // Resize all Vectors to Zero streamflow_sim.resize(0); excessRain.resize(0); WetnessIndex.resize(0); Tw.resize(0); date.resize(0); streamflow_obs.resize(0); precipitation.resize(0); temperature.resize(0); } saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_eq.h000066400000000000000000000421601224124640700267150ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_eq.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // ihacres_eq.h // // // // Copyright (C) 2006 by // // Stefan Liersch // //-------------------------------------------------------// // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // 2006-08-27 // // modified: 2008-01-28 // //-------------------------------------------------------// // // References: // Jakeman, A.J. / Hornberger, G.M (1993). // How Much Complexity Is Warranted in a // Rainfall-Runoff Model? // Water Resources Research, (29), NO. 8 (2637-2649) // Kokkonen, T. S. et al. (2003). // Predicting daily flows in ungauged catchments: // model regionalization from catchment descriptors // at the Coweeta Hydrologic Laboratory, North Carolina // Hydrological Processes (17), 2219-2238 // Croke, B. F. W., W. S. Merritt, et al. (2004). // A dynamic model for predicting hydrologic response // to land cover changes in gauged and // ungauged catchments. // Journal Of Hydrology 291(1-2): 115-131. // Croke, B. F. W., Andrews, F., Jakeman, A. J., Cuddy, S., Luddy, A.: // (2005). Redesign of the IHACRES rainfall-runoff model /////////////////////////////////////////////////////////// //*******************************************************// // NOTES // //*******************************************************// // This class provides functions of the rainfall-runoff // model IHACRES. On the one hand the class can be used as // a provider of functions using the standard constructor // or the class can be instantiated and then performs the // calculations automatically. // // Every function working with fields can be provided with // arrays (pointer) or vector. You find for both solutions // the appropriate function. //*******************************************************// //*******************************************************// // ToDo // //-------------------------------------------------------// // - Difference eRain-streamflow_obs // - Tau(q) and Tau(s) // - Tau-values for different storages // - if TMP_data_exist = false ??? // - hourly data (not only daily) // // - SNOW MODULE // - snow module on/off // - snow module integration in CalcExcessRain (add bool variable) // - implementation of an instanteneous store // - implement more efficiency criterions //*******************************************************// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ihacres_eq_H #define HEADER_INCLUDED__ihacres_eq_H //--------------------------------------------------------- #include // CSG_Table #include // used for storing date string values in array // and double arrays (streamflow, pcp, tmp ...) #include using namespace std; #include "snow_module.h" #include "model_tools.h" typedef std::vector date_array; typedef vector vector_d; //--------------------------------------------------------- //--------------------------------------------------------- // A CLASS TO DEAL WITH PARAMETERS OF THE // LINEAR STORAGE MODULE //--------------------------------------------------------- class C_IHAC_LinearParms { public: C_IHAC_LinearParms() { _ZeroPointers(); } C_IHAC_LinearParms(int size, int nStorages) { _ZeroPointers(); this->nStorages = nStorages; if (nStorages == 1) { a = new double[size]; b = new double[size]; } if (nStorages == 2) { aq = new double[size]; as = new double[size]; bq = new double[size]; bs = new double[size]; } } ~C_IHAC_LinearParms(void) { if (nStorages == 1) { if (a) delete[] a; if (b) delete[] b; } if (nStorages == 2) { if (aq) delete[] aq; if (as) delete[] as; if (bq) delete[] bq; if (bs) delete[] bs; } } // linear module parameters int nStorages; double* a; double* b; double* aq; double* as; double* bq; double* bs; private: void _ZeroPointers() { a = NULL; b = NULL; aq = NULL; as = NULL; bq = NULL; bs = NULL; } }; //--------------------------------------------------------- //--------------------------------------------------------- // A CLASS TO DEAL WITH PARAMETERS OF THE // NON-LINEAR RAINFALL-LOSSES MODULE //--------------------------------------------------------- class C_IHAC_NonLinearParms { public: C_IHAC_NonLinearParms() { mp_tw = NULL; mp_f = NULL; mp_c = NULL; mp_l = NULL; mp_p = NULL; mp_eR_flow_dif = NULL; }; C_IHAC_NonLinearParms(int size) { mp_tw = new double[size]; mp_f = new double[size]; mp_c = new double[size]; mp_l = new double[size]; mp_p = new double[size]; mp_eR_flow_dif = new double[size]; }; ~C_IHAC_NonLinearParms(void) { if (mp_tw) delete[] mp_tw; if (mp_f) delete[] mp_f; if (mp_c) delete[] mp_c; if (mp_l) delete[] mp_l; if (mp_p) delete[] mp_p; if (mp_eR_flow_dif) delete[] mp_eR_flow_dif; }; // non-linear module parms double* mp_tw; double* mp_f; double* mp_c; double* mp_l; double* mp_p; double* mp_eR_flow_dif; }; //--------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // CLASS Cihacres_eq // /////////////////////////////////////////////////////////////////////// class Cihacres_eq { public: /////////////////////////////////////////////////////////////////// // // CONSTRUCTORS // /////////////////////////////////////////////////////////////////// // default Cihacres_eq(); // two storages // using vector as input // if no temperature data are available Cihacres_eq (date_array date, vector_d streamflow_obs, vector_d precipitation, double Tw, double f, double c, double l, double p, double aq, double as, double bq, double bs); // two storages // using vector as input // if temperature data are available Cihacres_eq (date_array date, vector_d streamflow_obs, vector_d precipitation, vector_d temperature, double Tw, double f, double c, double l, double p, double aq, double as, double bq, double bs, double area, bool TMP_data_exist, int IHAC_vers, int storconf, bool bSnowModule, CSnowModule *SnowMod, //double T_Rain, //double T_Melt, //double DD_FAC, int delay); // two storages // using double arrays as input // if no temperature data are available Cihacres_eq (int size, // array size date_array date, double *streamflow_obs, double *precipitation, double Tw, double f, double c, double aq, double as, double bq, double bs); // two storages // if temperature data are available // using double arrays as input Cihacres_eq (int size, // array size date_array date, double *streamflow_obs, double *precipitation, double *temperature, double Tw, double f, double c, double aq, double as, double bq, double bs); // end constructors /////////////////////////////////////////////// // destructor ~Cihacres_eq(void); /////////////////////////////////////////////////////////////////// // // PUBLIC MEMEBER VARIABLES // /////////////////////////////////////////////////////////////////// // Variables int sizeAll; // incoming data array size (number of records in input data) CSnowModule *m_pSnowMod; // class Snow Module double* m_pMeltRate; /////////////////////////////////////////////////////////////////// // // PUBLIC MEMBER FUNCTIONS // /////////////////////////////////////////////////////////////////// //-------------------------------------------------------- void RunNonLinearModule (bool TMP_data_exist, bool bSnowModule, double T_Rain); // simulate streamflow (single storage) void SimStreamflowSingle (vector_d &excessRain, double initVal, vector_d &streamflow_sim, int delay, double a, double b); void SimStreamflowSingle (double *excessRain, double initVal, double *streamflow_sim, int delay, double a, double b, int size); // simulate streamflow with two parallel storages void SimStreamflow2Parallel (vector_d &excessRain, vector_d &streamflow_sim, double initVal, // first observed streamflow value double aq, double as, double bq, double bs, double &vq, double &vs, int IHAC_vers, int delay); void SimStreamflow2Parallel (double *excessRain, double *streamflow_sim, double initVal, // first observed streamflow value double aq, double as, double bq, double bs, double &vq, double &vs, int IHAC_vers, int size, int delay); void SimStreamflow2Parallel (double *excessRain, double *streamflow_sim, double initVal, // first observed streamflow value C_IHAC_LinearParms* linparms, int index, double &vq, double &vs, int size, int delay); double Calc_Parm_BS (double aq, double as, double bq); // calculate time of decay for quick or slow component (aq or bq) double Calc_TimeOfDecay (double a); //-------------------------------------------------------- // calculating the time constant, or inversely the rate at which // the catchment wetness declines in the absence of rainfall void CalcWetnessTimeConst (vector_d &temperature, vector_d &Tw, double TwConst, double f); void CalcWetnessTimeConst (double *temperature, double *Tw, double TwConst, double f, int size); void CalcWetnessTimeConst (double* temperature, double* Tw, C_IHAC_NonLinearParms* nonlinparms, int index, int size); // For ihacres_climate_scen void CalcWetnessTimeConst_scen(double* temperature, double* Tw, C_IHAC_NonLinearParms* nonlinparms, int index, int size); // modified version after Croke et al. (2005) void CalcWetnessTimeConst_Redesign(vector_d &temperature, vector_d &Tw, double TwConst, double f); // modified version after Croke et al. (2005) void CalcWetnessTimeConst_Redesign(double *temperature, double *Tw, double TwConst, double f, int size); void CalcWetnessTimeConst_Redesign(double *temperature, double *Tw, C_IHAC_NonLinearParms* nonlinparms, int index, int size); // calculating the catchment wetness index, // or antecedent precipitation index void CalcWetnessIndex (vector_d &Tw, vector_d &precipitation, vector_d &temperature, vector_d &WetnessIndex, double WI_init, double c, bool bSnowModule, double T_Rain); void CalcWetnessIndex (double *Tw, double *precipitation, double *temperature, double *WetnessIndex, double WI_init, double c, bool bSnowModule, double T_Rain, int size); // modified version after Croke et al. (2005) void CalcWetnessIndex_Redesign(vector_d &Tw, vector_d &precipitation, vector_d &WetnessIndex, bool bSnowModule,double T_Rain); // modified version after Croke et al. (2005) void CalcWetnessIndex_Redesign(double *Tw, double *precipitation, double *WetnessIndex, double WI_init, bool bSnowModule,double T_Rain, int size); // calculate the effecive or excess rainfall and // calculate total effective rainfall over the period in [mm] double CalcExcessRain (vector_d &precipitation, vector_d &temperature, vector_d &WetnessIndex, vector_d &excessRain, double eR_init, double &sum_eRainGTpcp, bool bSnowModule, CSnowModule* pSnowModule); double CalcExcessRain (double *precipitation, double *temperature, double *WetnessIndex, double *excessRain, double eR_init, double &sum_eRainGTpcp, int size, bool bSnowModule, double T_Rain, double T_Melt, double* MeltRate); // modified version after Croke et al. (2005) double CalcExcessRain_Redesign (vector_d &precipitation, vector_d &temperature, vector_d &WetnessIndex, vector_d &excessRain, double eR_init, double &sum_eRainGTpcp, double c, // mass balance parameter double l, // soil moisture index threshold double p, // power on soil moisture bool bSnowModule, CSnowModule* m_pSnowMod); // modified version after Croke et al. (2005) double CalcExcessRain_Redesign (double *precipitation, double *temperature, double *WetnessIndex, double *excessRain, double eR_init, double &sum_eRainGTpcp, int size, double c, // mass balance parameter double l, // soil moisture index threshold double p, // power on soil moisture bool bSnowModule, double T_Rain, double T_Melt, double* MeltRate); //-------------------------------------------------------- //-------------------------------------------------------- void AssignFirstLastRec (CSG_Table &pTable, int &first, int &last, CSG_String date1,CSG_String date2, int dateField); int Assign_nStorages (int storconf); double SumVector (vector_d &input); double SumVector (double *input, int size); double _Assign_NSE_temp (int obj_func, double NSE, double NSE_highflow, double NSE_lowflow); //-------------------------------------------------------- // Get Functions //-------------------------------------------------------- double get_vq(); // fraction of quick flow double get_vs(); // fraction of slow flow double get_sum_streamflowMM_obs(int size); // sum of observed streamflow in [mm] double get_sum_precipitation(int size); double get_NSE(); vector_d get_streamflow_sim(); vector_d get_excessRain(); vector_d get_WetnessIndex(); vector_d get_Tw(); private: /////////////////////////////////////////////////////////////////// // Private Member Variables /////////////////////////////////////////////////////////////////// // incoming arrays / vectors date_array date; // Vector containing date values vector_d streamflow_obs; // Vector containing observed streamflow data vector_d precipitation; // Vector containing measured precipitation vector_d temperature; // Vector containing measured temperature vector_d streamflowMM_obs; // Streamflow time series in [mm] // double sum_eRainGTpcp; // sum of excess rainfall that is greater // than precipitation in one simulation // Vectors (arrays) vector_d streamflow_sim; // Vector containing simulated streamflow data vector_d excessRain; // Vector containing estimated excess or effective rainfall vector_d WetnessIndex; // catchment wetness index vector_d Tw; // parameters bool TMP_data_exist; // if temperature data are available (TMP_data_exist = true) double RainRunoffCoef; // Rainfall-Runoff coefficient double NSE; // Nash-Sutcliffe Efficiency double sum_streamflow_obs; double sum_streamflow_sim; double sum_eRainMM; // sum of estimated effective rainfall [mm] // non-linear IHACRES module parameters double c; double f; double TwConst; // Tw is approximately the time constant, or inversely, // the rate at which the catchment wetness declines // in the absence of rainfall. // Additional parameters for Croke et al. (2005) Redesign version double l; // soil moisture index threshold double p; // power on soil moisture // linear IHACRES module parameters double a; double b; double aq; double as; double bq; double bs; double vq; // fraction of quick flow double vs; // fraction of slow flow int delay; // The delay after the start of rainfall, // before the discharge starts to rise. double area; // area of the watershed in [km2] int IHAC_version; // Different versions of IHACRES exist, corresponding // to the version... bool bSnowModule; // if true, snow module is active /* // snow module parameters vector_d SnowStorage; vector_d MeltRate; double T_Rain; double T_Melt; double DD_FAC; */ /////////////////////////////////////////////////////////////////// // Private Member Functions /////////////////////////////////////////////////////////////////// // initialize Vectors void _InitVectorsStart (int size); // Resize all vectors *.resize(0) void _ZeroAllVectors (); }; // end class ihacres_eq //--------------------------------------------------------- #endif /* #ifndef HEADER_INCLUDED__ihacres_eq_H */ saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_v1.cpp000066400000000000000000000600311224124640700271660ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_v1.cpp 1261 2011-12-16 15:12:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // ihacres_v1 // // // //-------------------------------------------------------// // // // ihacres_v1.cpp // // // // Copyright (C) 2006 by // // Stefan Liersch // //-------------------------------------------------------// // // // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // // // 2006-08-31 // //-------------------------------------------------------// // // References: // Jakeman, A.J. / Hornberger, G.M (1993). // How Much Complexity Is Warranted in a // Rainfall-Runoff Model? // Water Resources Research, (29), NO. 8 (2637-2649) // Kokkonen, T. S. et al. (2003). // Predicting daily flows in ungauged catchments: // model regionalization from catchment descriptors // at the Coweeta Hydrologic Laboratory, North Carolina // Hydrological Processes (17), 2219-2238 // Croke, B. F. W., W. S. Merritt, et al. (2004). // A dynamic model for predicting hydrologic response // to land cover changes in gauged and // ungauged catchments. // Journal Of Hydrology 291(1-2): 115-131. //-------------------------------------------------------// //--------------------------------------------------------- #include // used for textfile output (test only) #include // used for textfile output (test only) #include "ihacres_v1.h" //#include "ihacres_cal.h" #include "model_tools.h" //--------------------------------------------------------- // constructor Cihacres_v1::Cihacres_v1(void) { //----------------------------------------------------- // 1. Info... Set_Name(_TL("IHACRES Version 1.0")); Set_Author(SG_T("copyrights (c) 2008 Stefan Liersch")); Set_Description(_TW("The Rainfall-Runoff Model IHACRES \n \n \n" "Reference: \n \n" "Jakeman, A.J. / Hornberger, G.M. (1993). \n" "How Much Complexity Is Warranted in a Rainfall-Runoff Model? \n" "Water Resources Research, (29), NO. 8 (2637-2649) \n \n" "Croke, B. F. W. et al.(2004).\n" "A dynamic model for predicting hydrologic response " "to land cover changes in gauged and " "ungauged catchments. \n" "Journal Of Hydrology 291(1-2): 115-131." )); /////////////////////////////////////////////////////////////////// // FIRST MODULE DIALOG CreateDialog1(); /////////////////////////////////////////////////////////////////// } //--------------------------------------------------------- // destructor Cihacres_v1::~Cihacres_v1(void) {} //--------------------------------------------------------- bool Cihacres_v1::On_Execute(void) { /////////////////////////////////////////////////////////////////// // // VARIABLES // /////////////////////////////////////////////////////////////////// int j,k; //counter CSG_Table *pTable, *pTable_out, *pTable_parms, *pTable_settings; bool bTMP; // true, if temperature data are used to // to refine wetness index estimation. bool writeAllTimeSeries; int storconf; // storage configuration // 0 = single, 1 = two parallel, 2 = two in series // Assign Parameters from first Module Dialog //--------------------------------------------------------- pTable = Parameters("TABLE") ->asTable(); // Field numbers dateField = Parameters("DATE_Field") ->asInt(); dischargeField = Parameters("DISCHARGE_Field") ->asInt(); pcpField = Parameters("PCP_Field") ->asInt(); tmpField = Parameters("TMP_Field") ->asInt(); bTMP = Parameters("USE_TMP") ->asBool(); c = Parameters("CFAC") ->asDouble(); TwConst = Parameters("TwFAC") ->asDouble(); m_area = Parameters("AREA") ->asDouble(); storconf = Parameters("STORAGE") ->asInt(); IHAC_version = Parameters("IHACVERS") ->asInt(); bSnowModule = Parameters("SNOW_MODULE") ->asBool(); writeAllTimeSeries = Parameters("WRITEALL_TS") ->asBool(); first = last = 0; //--------------------------------------------------------- /////////////////////////////////////////////////////////////////// // Create Second Dialog and assign linear module parameters if ( CreateDialog2(bTMP, storconf, IHAC_version, pTable, dateField, dischargeField) ) { /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// // searching the first and the last record of the time range ihacres->AssignFirstLastRec(*pTable, first, last, date1, date2, dateField); /////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// // INITIALIZE VECTORS sizeAll = last - first + 1; // global array variables date.resize(sizeAll); m_Q_obs_m3s.resize(sizeAll); m_Q_obs_mmday.resize(sizeAll); precipitation.resize(sizeAll); if (bTMP) temperature.resize(sizeAll); for (j = 0, k = first; j < sizeAll, k < last + 1; j++, k++) { date[j].append(CSG_String (pTable->Get_Record(k)->asString(dateField))); m_Q_obs_m3s[j] = pTable->Get_Record(k)->asDouble(dischargeField); precipitation[j] = pTable->Get_Record(k)->asDouble(pcpField); if (bTMP) temperature[j] = pTable->Get_Record(k)->asDouble(tmpField); } if (bSnowModule && bTMP) { m_pSnowModule = new CSnowModule(temperature, precipitation, T_Rain, T_Melt, DD_FAC); if (!bSnowModule) m_pSnowModule = NULL; //m_pSnowModule->MeltRate = new double[sizeAll]; //m_pSnowModule->SnowStorage = new double[sizeAll]; } //--------------------------------------------------------- // Convert streamflow from m3/s to mm/day /////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// // // INSTANTIATE CLASS IHACRES // /////////////////////////////////////////////////////////////// // different constructors are available for class ihacres_eq, // depending on availability of temperature data, // storage characteristics, and data storage properties (vector / arrays) switch(storconf) { case 0: // single storage ihacres = new Cihacres_eq(date, m_Q_obs_m3s, precipitation, temperature, TwConst, f, c, l, p, a, 0, b, 0, m_area, bTMP, IHAC_version, storconf, bSnowModule, m_pSnowModule, delay); break; case 1: // two storages in parallel // if temperature data available // and using vectors to store time series data // and 2 storages in parallel ihacres = new Cihacres_eq(date, m_Q_obs_m3s, precipitation, temperature, TwConst, f, c, l, p, aq, as, bq, bs, m_area, bTMP, IHAC_version, storconf, bSnowModule, m_pSnowModule, delay); break; } // end switch //--------------------------------------------------------- // create output tables and add them to SAGA workspace //--------------------------------------------------------- pTable_out = SG_Create_Table(); CreateTableSim(pTable_out, date, m_Q_obs_m3s, ihacres->get_streamflow_sim());//ihacres->streamflow_sim); // add tables to SAGA Workspace pTable_out->Set_Name(SG_T("IHACRES_Sim")); Parameters("TABLEout")->Set_Value(pTable_out); pTable_settings = SG_Create_Table(); if (bSnowModule) { CreateTableSettings(pTable_settings, TwConst, c, f, aq, as, bq, bs, ihacres->get_vq(), ihacres->get_vs(), bSnowModule, m_pSnowModule->Get_T_Rain(), m_pSnowModule->Get_T_Melt(), m_pSnowModule->Get_DD_FAC(), delay, model_tools::CalcRunoffCoeff(m_Q_obs_mmday,precipitation), ihacres->get_NSE(), m_area); } else { CreateTableSettings(pTable_settings, TwConst, c, f, aq, as, bq, bs, ihacres->get_vq(), ihacres->get_vs(), bSnowModule, 0, 0, 0, delay, model_tools::CalcRunoffCoeff(m_Q_obs_mmday,precipitation), ihacres->get_NSE(), m_area); } pTable_settings->Set_Name(SG_T("IHACRES_Settings")); Parameters("TABLEsettings")->Set_Value(pTable_settings); if (writeAllTimeSeries) { pTable_parms = SG_Create_Table(); CreateTableParms(pTable_parms, date, m_Q_obs_m3s, precipitation, temperature, ihacres->get_streamflow_sim(), ihacres->get_excessRain(), ihacres->get_WetnessIndex(), ihacres->get_Tw()); pTable_parms->Set_Name(SG_T("IHACRES_Parms")); Parameters("TABLEparms")->Set_Value(pTable_parms); } /////////////////////////////////////////////////////////////// // DELETE AND RESIZE /////////////////////////////////////////////////////////////// delete ihacres; date.resize(0); m_Q_obs_m3s.resize(0); m_Q_obs_mmday.resize(0); precipitation.resize(0); if (bTMP) temperature.resize(0); if (bSnowModule) delete m_pSnowModule; /////////////////////////////////////////////////////////////// //--------------------------------------------------------- return( true ); // bool Cihacres_cal::On_Execute(void) } else { return(false); } } // end function On_Execute() /////////////////////////////////////////////////////////////////////// // // PRIVATE FUNCTIONS // /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // // CREATE OUTPUT TABLES // /////////////////////////////////////////////////////////////////////// void Cihacres_v1::CreateTableSim(CSG_Table *pTable, date_array date, vector_d strfl_obs, vector_d strfl_sim) { int i = 0; // used in function Get_Record(i) CSG_Table_Record *pRecord; // creating the column titles pTable->Add_Field("Date", SG_DATATYPE_String); pTable->Add_Field("Flow OBS", SG_DATATYPE_Double); pTable->Add_Field("Flow SIM", SG_DATATYPE_Double); for (unsigned int j = 0; j < date.size(); j++) { pTable->Add_Record(); pRecord = pTable->Get_Record(i); // writing the data into the rows pRecord->Set_Value(0,CSG_String(date[j].c_str())); pRecord->Set_Value(1,strfl_obs[j]); pRecord->Set_Value(2,model_tools::mmday_to_m3s(strfl_sim[j],m_area)); i++; } } void Cihacres_v1::CreateTableParms(CSG_Table *pTable, date_array date, vector_d strfl_obs, vector_d precipitation, vector_d temperature, vector_d strfl_sim, vector_d excessRain, vector_d wi, vector_d Tw) { int i = 0; // used in function Get_Record(i) CSG_Table_Record *pRecord; // creating the column titles pTable->Add_Field("Date", SG_DATATYPE_String); pTable->Add_Field("Flow OBS", SG_DATATYPE_Double); pTable->Add_Field("Flow SIM", SG_DATATYPE_Double); pTable->Add_Field("TMP", SG_DATATYPE_Double); pTable->Add_Field("PCP", SG_DATATYPE_Double); pTable->Add_Field("ExcessRain", SG_DATATYPE_Double); pTable->Add_Field("WetnessIndex", SG_DATATYPE_Double); pTable->Add_Field("Tau", SG_DATATYPE_Double); for (unsigned int j = 0; j < date.size(); j++) { pTable->Add_Record(); pRecord = pTable->Get_Record(i); // writing the data into the rows pRecord->Set_Value(0,CSG_String(date[j].c_str())); pRecord->Set_Value(1,strfl_obs[j]); pRecord->Set_Value(2,model_tools::mmday_to_m3s(strfl_sim[j], m_area)); pRecord->Set_Value(3,temperature[j]); pRecord->Set_Value(4,precipitation[j]); pRecord->Set_Value(5,excessRain[j]); pRecord->Set_Value(6,wi[j]); pRecord->Set_Value(7,Tw[j]); i++; } } void Cihacres_v1::CreateTableSettings(CSG_Table *pTable, double Tw, double c, double f, double aq, double as, double bq, double bs, double vq , double vs, bool bSnowModule, double T_Rain, double T_Melt, double DD_FAC, int delay, double RRCoef, double NSE, double m_area) { int count = 1; CSG_Table_Record *pRecord; // creating the column titles pTable->Add_Field("Parameters", SG_DATATYPE_String); pTable->Add_Field("Settings", SG_DATATYPE_Double); pTable->Add_Record(); pRecord = pTable->Get_Record(0); pRecord->Set_Value(0,SG_T("Tau")); pRecord->Set_Value(1,Tw); pTable->Add_Record(); pRecord = pTable->Get_Record(1); pRecord->Set_Value(0,SG_T("c")); pRecord->Set_Value(1,c); pTable->Add_Record(); pRecord = pTable->Get_Record(2); pRecord->Set_Value(0,SG_T("f")); pRecord->Set_Value(1,f); pTable->Add_Record(); pRecord = pTable->Get_Record(3); pRecord->Set_Value(0,SG_T("a(q)")); pRecord->Set_Value(1,aq); pTable->Add_Record(); pRecord = pTable->Get_Record(4); pRecord->Set_Value(0,SG_T("a(s)")); pRecord->Set_Value(1,as); pTable->Add_Record(); pRecord = pTable->Get_Record(5); pRecord->Set_Value(0,SG_T("b(q)")); pRecord->Set_Value(1,bq); pTable->Add_Record(); pRecord = pTable->Get_Record(6); pRecord->Set_Value(0,SG_T("b(s)")); pRecord->Set_Value(1,bs); //pRecord->Set_Value(1,vs * (1 + as)); pTable->Add_Record(); pRecord = pTable->Get_Record(7); pRecord->Set_Value(0,SG_T("v(q)")); pRecord->Set_Value(1,vq); pTable->Add_Record(); pRecord = pTable->Get_Record(8); pRecord->Set_Value(0,SG_T("v(s)")); pRecord->Set_Value(1,vs); pTable->Add_Record(); pRecord= pTable->Get_Record(9); pRecord->Set_Value(0,SG_T("T(q)")); pRecord->Set_Value(1,ihacres->Calc_TimeOfDecay(aq)); pTable->Add_Record(); pRecord= pTable->Get_Record(10); pRecord->Set_Value(0,SG_T("T(s)")); pRecord->Set_Value(1,ihacres->Calc_TimeOfDecay(as)); if (bSnowModule) { pTable->Add_Record(); pRecord = pTable->Get_Record(10+count); pRecord->Set_Value(0,SG_T("T_Rain")); pRecord->Set_Value(1,T_Rain); count++; pTable->Add_Record(); pRecord = pTable->Get_Record(10+count); pRecord->Set_Value(0,SG_T("T_Melt")); pRecord->Set_Value(1,T_Melt); count++; pTable->Add_Record(); pRecord = pTable->Get_Record(10+count); pRecord->Set_Value(0,SG_T("DD_Fac")); pRecord->Set_Value(1,DD_FAC); count++; } pTable->Add_Record(); pRecord = pTable->Get_Record(10+count); pRecord->Set_Value(0,SG_T("RR-Delay")); pRecord->Set_Value(1,delay); count++; pTable->Add_Record(); pRecord = pTable->Get_Record(10+count); pRecord->Set_Value(0,SG_T("RRCoef")); pRecord->Set_Value(1,RRCoef); count++; pTable->Add_Record(); pRecord = pTable->Get_Record(10+count); pRecord->Set_Value(0,SG_T("NSE")); pRecord->Set_Value(1,NSE); count++; pTable->Add_Record(); pRecord = pTable->Get_Record(10+count); pRecord->Set_Value(0,SG_T("Area")); pRecord->Set_Value(1,m_area); count++; } /////////////////////////////////////////////////////////////////////// // // DIALOGS // /////////////////////////////////////////////////////////////////////// void Cihacres_v1::CreateDialog1() { CSG_Parameter *pNode; CSG_String s; pNode = Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "DATE_Field" , _TL("Date Column"), SG_T("Select the column containing the Date") ); Parameters.Add_Table_Field( pNode , "DISCHARGE_Field" , _TL("Streamflow Column"), SG_T("Select the Column containing Discharge Values") ); Parameters.Add_Table_Field( pNode , "PCP_Field" , _TL("Precipitation Column"), SG_T("Select the Column containing precipitation Values") ); Parameters.Add_Table_Field( pNode , "TMP_Field" , _TL("Temperature Column"), SG_T("Select the Column containing Temperature Values") ); Parameters.Add_Value( pNode, "USE_TMP", _TL("Using temperature data?"), _TL("If checked, then temperature data are used."), PARAMETER_TYPE_Bool, true ); pNode = Parameters.Add_Value( NULL, "AREA", _TL("Area of the Watershed in [km2]"), _TL("Area of the Watershed in [km2] used for unit conversion"), PARAMETER_TYPE_Double, 100.0, 0.00001, true, 0.0, false ); s.Printf(SG_T("Node2"), 2); pNode = Parameters.Add_Node(NULL,s,SG_T("Non-Linear Module"),_TL("")); Parameters.Add_Value( pNode, "CFAC", _TL("Parameter (c)"), _TL("Parameter (c) to fit streamflow volume"), PARAMETER_TYPE_Double, 0.001, 0.0, true, 1.0, true ); Parameters.Add_Value( pNode, "TwFAC", _TL("(Tw) wetness decline time constant"), _TW("Tw is approximately the time constant, or inversely," "the rate at which the catchment wetness declines in the absence of rainfall"), PARAMETER_TYPE_Double, 1.0, 0.01, true, 150.0, true ); s.Printf(SG_T("Node3"), 3); pNode = Parameters.Add_Node(NULL,s,SG_T("Storage Configuration"),_TL("")); Parameters.Add_Choice( pNode , "STORAGE" , _TL("Storage"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Single Storage"), // 0 _TL("Two Parallel Storages"), // 1 _TL("Two Storages in Series !!! not yet implemented !!!") // 2 ) ); s.Printf(SG_T("Node4"), 4); pNode = Parameters.Add_Node(NULL,s,SG_T("IHACRES Version"),_TL("")); Parameters.Add_Choice( pNode , "IHACVERS" , _TL("IHACRES Version"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Jakeman & Hornberger (1993)"), // 0 _TL("Croke et al. (2005)") // 1 ) ); Parameters.Add_Value( pNode, "SNOW_MODULE", _TL("Using the snow-melt module?"), _TL("If checked, snow-melt module is used."), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL, "WRITEALL_TS", _TL("Write all calculated Time Series in a table?"), _TL("If checked, then a second output table with all Time Series data is created."), PARAMETER_TYPE_Bool, true ); Parameters.Add_Table_Output( NULL , "TABLEout" , _TL("Table"), _TL("") ); Parameters.Add_Table_Output( NULL , "TABLEparms" , _TL("Table"), _TL("") ); Parameters.Add_Table_Output( NULL , "TABLEsettings", _TL("Table"), _TL("") ); } //--------------------------------------------------------------------- // DIALOG 2 //--------------------------------------------------------------------- bool Cihacres_v1::CreateDialog2(bool bTMP, int storconf, int IHAC_version, CSG_Table *pTable, int dateField, int dischargeField) { CSG_String s; CSG_Parameters P; // used to add Parameters in the second dialog CSG_Parameter *pNode, *pNode1; // Dialog design P.Set_Name(_TL("IHACRES Model Parameters (Calibration)")); s.Printf(SG_T("Node1"), 1); pNode = P.Add_Node(NULL,s,SG_T("Time Range"),_TL("")); s.Printf(SG_T("FDAY") , 1-1); P.Add_String(pNode,s,_TL("First Day"),_TL(""), pTable->Get_Record(0)->asString(dateField)); s.Printf(SG_T("LDAY") , 1-2); P.Add_String(pNode,s,_TL("Last Day"),_TL(""), pTable->Get_Record(pTable->Get_Record_Count()-1)->asString(dateField)); if (bTMP) // if observed temperature data are used { s.Printf(SG_T("Node2"), 2); pNode = P.Add_Node(NULL,s,SG_T("Non-Linear Module"),_TL("")); s.Printf(SG_T("Node2-1"), 2-1); pNode1 = P.Add_Node(pNode,s,SG_T("Temperature Modulation Factor"),_TL("")); P.Add_Value( pNode1 , "TFac" , _TL("Temperature Modulation Factor (f)"), _TL("Temperature Modulation Factor f"), PARAMETER_TYPE_Double, 1.0, 0.0001, true, 10.0, true ); } // End if (bTMP) switch(IHAC_version) { case 0: // Jakeman & Hornberger (1993) break; case 1: // Croke et al. (2005) s.Printf(SG_T("Node4"), 4); pNode = P.Add_Node(NULL,s,SG_T("Soil Moisture Power Eq."),_TL("")); s.Printf(SG_T("Node4-1"), 4-1); pNode1 = P.Add_Node(pNode,s,SG_T("Parameter l"),_TL("")); P.Add_Value( pNode1,"L",_TL("Soil moisture index (l)"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); s.Printf(SG_T("Node4-2"), 4-2); pNode1 = P.Add_Node(pNode,s,SG_T("Parameter p"),_TL("")); P.Add_Value( pNode1,"P",_TL("Power on soil (p)"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true, 5.0, true ); break; } // end switch (IHAC_version) switch(storconf) { case 0: // single storage s.Printf(SG_T("Node3"), 3); pNode = P.Add_Node(NULL,s,SG_T("Linear Module"),_TL("")); s.Printf(SG_T("Node3-1"), 3-1); pNode1 = P.Add_Node(pNode,s,SG_T("Parameter (a)"),_TL("")); P.Add_Value( pNode1, "AFAC", _TL("(a)"), _TL(""), PARAMETER_TYPE_Double, -0.8, -0.99, true, -0.01, true ); s.Printf(SG_T("Node3-2"), 3-2); pNode1 = P.Add_Node(pNode,s,SG_T("Parameter (b)"),_TL("")); P.Add_Value( pNode1, "BFAC", _TL("(b)"), _TL(""), PARAMETER_TYPE_Double, 0.2, 0.001, true, 1.0, true ); break; case 1: // two parallel storages s.Printf(SG_T("Node3"), 3); pNode = P.Add_Node(NULL,s,SG_T("Linear Module"),_TL("")); // Parameter a s.Printf(SG_T("Node3-1"), 3-1); pNode1 = P.Add_Node(pNode,s,SG_T("Parameter (a)"),_TL("")); P.Add_Value( pNode1, "AQ", _TL("a(q)"), _TL(""), PARAMETER_TYPE_Double, -0.7, -0.99, true, -0.01, true ); P.Add_Value( pNode1, "AS", _TL("a(s)"), _TL(""), PARAMETER_TYPE_Double, -0.9, -0.99, true, -0.01, true ); // Parameter b s.Printf(SG_T("Node3-2"), 3-2); pNode1 = P.Add_Node(pNode,s,SG_T("Parameter (b)"),_TL("")); P.Add_Value( pNode1, "BQ", _TL("b(q)"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true, 1.0, true ); break; case 2: // two storages in series break; } // end switch (storconf) if (bSnowModule) { s.Printf(SG_T("Node5"), 5); pNode1 = P.Add_Node(NULL,s,SG_T("Snow Module Parameters"),_TL("")); P.Add_Value( pNode1, "T_RAIN", _TL("Temperature Threshold for Rainfall"), _TL("Below this threshold precipitation will fall as snow"), PARAMETER_TYPE_Double, -1.0, -10.0, true, 10.0, true ); P.Add_Value( pNode1, "T_MELT", _TL("Temperature Threshold for Melting"), _TL("Above this threshold snow will start to melt"), PARAMETER_TYPE_Double, 1.0, -5.0, true, 10.0, true ); P.Add_Value( pNode1, "DD_FAC", _TL("Day-Degree Factor"), _TL("Day-Degree Factor depends on catchment characteristics"), PARAMETER_TYPE_Double, 0.7, 0.7, true, 9.2, true ); } s.Printf(SG_T("Node6"), 6); pNode1 = P.Add_Node(NULL,s,SG_T("Time Delay after Start of Rainfall (INTEGER)"),_TL("")); P.Add_Value( pNode1, "DELAY", _TL("Time Delay (Rain-Runoff)"), _TL("The delay after the start of rainfall, before the discharge starts to rise."), PARAMETER_TYPE_Int, 1, 0, true, 100, true ); // End of second dialog design if( SG_UI_Dlg_Parameters(&P, _TL("Choose Time Range")) ) { /////////////////////////////////////////////////////////////// // // ASSIGN DATA FROM SECOND DIALOG // /////////////////////////////////////////////////////////////// date1 = P(CSG_String::Format(SG_T("FDAY"),dateField).c_str()) ->asString(); date2 = P(CSG_String::Format(SG_T("LDAY"),dischargeField).c_str()) ->asString(); // if observed temperature data are used if (bTMP) f = P("TFac") ->asDouble(); switch(IHAC_version) { case 0: break; case 1: l = P("L") ->asDouble(); p = P("P") ->asDouble(); break; } if (bSnowModule) { T_Rain = P("T_RAIN") ->asDouble(); T_Melt = P("T_MELT") ->asDouble(); DD_FAC = P("DD_FAC") ->asDouble(); } switch (storconf) { case 0: // single storage a = P("AFAC") ->asDouble(); b = P("BFAC") ->asDouble(); delay = P("DELAY") ->asInt(); break; case 1: // two parallel storages aq = P("AQ") ->asDouble(); as = P("AS") ->asDouble(); bq = P("BQ") ->asDouble(); //bs = P("BS") ->asDouble(); bs = ihacres->Calc_Parm_BS(aq,as,bq); delay = P("DELAY") ->asInt(); break; case 2: // two storages in series break; } // end switch (storconf) return(true); } else { return(false); } }saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/ihacres_v1.h000066400000000000000000000134251224124640700266400ustar00rootroot00000000000000/********************************************************** * Version $Id: ihacres_v1.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // IHACRES // // // //-------------------------------------------------------// // // // ihacres_v1.h // // // // Copyright (C) 2006 by // // Stefan Liersch // //-------------------------------------------------------// // // // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // // // 2006-08-31 // // // /////////////////////////////////////////////////////////// //*******************************************************// // ToDo // //-------------------------------------------------------// // - strzt ab, wenn im zweiten Dialog auf Cancel gedrckt wird // // - add NSE_highflow to output table // - wenn SingleStore, dann wird IHACRES_Sim output table nicht korrekt geschrieben // (Spalte Streamflow sim) // - implement 2 or n storages in series // - number of simulations for linear module // - choosing the number of Top simulations from non-linear module calibration // - Gltigkeitsbereiche auf Sinn prfen // - WriteTable1Storage // - Streamflow simulation function using n, m values // - if (bTMP) = false ??? //*******************************************************// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ihacres_v1_H #define HEADER_INCLUDED__ihacres_v1_H //--------------------------------------------------------- #include "MLB_Interface.h" #include "ihacres_eq.h" #include // used for storing date string values in array using namespace std; typedef std::vector date_array; typedef vector vector_d; //--------------------------------------------------------- class Cihacres_v1 : public CSG_Module { public: // constructor Cihacres_v1(void); // destructor virtual ~Cihacres_v1(void); protected: // execute module virtual bool On_Execute (void); private: //-------------------------------------------------------- // Private Member Variables //-------------------------------------------------------- int sizeAll; // number of selected records date_array date; vector_d m_Q_obs_m3s; vector_d m_Q_obs_mmday; vector_d precipitation; vector_d temperature; // Field numbers int dateField; // table field numbers int dischargeField; int pcpField; int tmpField; int first; // number of the record (index) of first date int last; // number of the record (index) of last date CSG_String date1, date2; // first and last date of selected period double m_area; // area of the watershed in [km2] // Non-Linear Module Parameters double TwConst; // Tw is approximately the time constant, or inversely, // the rate at which the catchment wetness declines // in the absence of rainfall. double f; // temperature modulation factor which double c; // Parameter c is chosen so that the volume // of excess rainfall is equal to the total // streamflow over the calibration period double l; // Croke et al. (2005) double p; // Croke et al. (2005) // Linear Module Parameters double a; // linear module (single storage) double b; double aq; // linear module (two storages) double as; double bq; double bs; int delay; // The delay after the start of rainfall, // before the discharge starts to rise. int IHAC_version; // Different versions of IHACRES exist, corresponding // to the version... bool bSnowModule; // snow module parameters CSnowModule *m_pSnowModule; double *m_pMeltRate; double T_Rain; double T_Melt; double DD_FAC; //vector_d SnowStorage; //vector_d MeltRate; //CSnowModule_alt *m_pSnowModule; //-------------------------------------------------------- // Private Member Functions //-------------------------------------------------------- void CreateTableSim (CSG_Table *pTable, date_array date, vector_d strfl_obs, vector_d strfl_sim); void CreateTableParms (CSG_Table *pTable, date_array date, vector_d strfl_obs, vector_d precipitation, vector_d temperature, vector_d strfl_sim, vector_d excessRain, vector_d wi, vector_d Tw); void CreateTableSettings (CSG_Table *pTable, double Tw, double c, double f, double aq, double as, double bq, double bs, double vq, double vs, bool bSnowModule, double T_Rain, double T_Melt, double DD_FAC, int delay, double RRCoef, double NSE, double area); void CreateDialog1 (); bool CreateDialog2 (bool bTMP, int storconf, int IHAC_version, CSG_Table *pTable, int dateField, int dischargeField); // Class ihacres_eq Cihacres_eq *ihacres; }; #endif /* #ifndef HEADER_INCLUDED__ihacres_v1_H */saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/model_tools.cpp000066400000000000000000000225571224124640700274750ustar00rootroot00000000000000/********************************************************** * Version $Id: model_tools.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ #include "model_tools.h" #include #include // random numbers //------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // OBJECTIVE FUNCTIONS // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // Calculate Nash-Sutcliff efficiency //--------------------------------------------------------------------- double model_tools::CalcEfficiency(double *obs, double *sim, int nvals) { int i; double sum_obsminsim_2 = 0.0; double sum_obsminmean_2 = 0.0; double mean_obs = 0.0; //double sum_obs = 0.0; // sum of observed discharge // calculate mean of observed time series for (i = 0; i < nvals; i++) mean_obs += obs[i] / nvals; for (i = 0; i < nvals; i++) { sum_obsminsim_2 += pow(obs[i] - sim[i], 2.0); sum_obsminmean_2 += pow(obs[i] - mean_obs, 2.0); } return (1 - sum_obsminsim_2 / sum_obsminmean_2); } //------------------------------------------------------------------- double model_tools::CalcEfficiency(vector_d &obs, vector_d &sim) { int i; int nvals = obs.size(); double sum_obsminsim_2 = 0.0; double sum_obsminmean_2 = 0.0; double mean_obs = 0.0; //double sum_obs = 0.0; // sum of observed discharge // calculate mean of observed time series for (i = 0; i < nvals; i++) mean_obs += obs[i] / nvals; for (i = 0; i < nvals; i++) { sum_obsminsim_2 += pow(obs[i] - sim[i], 2.0); sum_obsminmean_2 += pow(obs[i] - mean_obs, 2.0); } return (1 - sum_obsminsim_2 / sum_obsminmean_2); } //------------------------------------------------------------------- // Calculate Nash-Sutcliff efficiency adapted to high flow // Reference: // Liu and De Smedt, 2004. WetSpa Extension, // A GIS-based Hydrologic Model for Flood Prediction and Watershed Management // Documentation and User Manual. Brussels. Vrije Universiteit Brussel. double model_tools::Calc_NSE_HighFlow(double *obs, double *sim, int nvals) { int i; double mean_obs = 0.0; double sum_numerator = 0.0; double sum_denominator = 0.0; // calculate mean of observed time series for (i = 0; i < nvals; i++) mean_obs += obs[i] / nvals; for (i = 0; i < nvals; i++) { sum_numerator += ( (obs[i] + mean_obs) * pow(sim[i] - obs[i], 2.0)); sum_denominator += ( (obs[i] + mean_obs) * pow(obs[i] - mean_obs, 2.0)); } return ( 1 - sum_numerator / sum_denominator ); } //------------------------------------------------------------------- //------------------------------------------------------------------- // Calculate Nash-Sutcliff efficiency adapted to high flow // Reference: // Liu and De Smedt, 2004. WetSpa Extension, // A GIS-based Hydrologic Model for Flood Prediction and Watershed Management // Documentation and User Manual. Brussels. Vrije Universiteit Brussel. double model_tools::Calc_NSE_LowFlow(double *obs, double *sim, int nvals) { int i; double mean_obs = 0.0; double sum_log_obsminsim_2 = 0.0; double sum_log_obsminmean_2 = 0.0; // calculate mean of observed time series for (i = 0; i < nvals; i++) mean_obs += obs[i] / nvals; for (i = 0; i < nvals; i++) { sum_log_obsminsim_2 += pow( (log(obs[i])-log(sim[i])),2 ); sum_log_obsminmean_2 += pow( (log(obs[i])-log(mean_obs)),2 ); } return( 1 - sum_log_obsminsim_2 / sum_log_obsminmean_2); } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Calculate PBIAS //--------------------------------------------------------------------- double model_tools::Calc_PBIAS(double* obs, double* sim, int nvals) { double sim_min_obs = 0.0; double sum_obs = 0.0; for (int i = 0; i < nvals; i++) { sim_min_obs += sim[i] - obs[i]; sum_obs += obs[i]; } return(sim_min_obs * 100 / sum_obs); } //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // RUNOFF COEFFICIENT // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // Calculate Runoff Coefficient //--------------------------------------------------------------------- double model_tools::CalcRunoffCoeff(vector_d &streamflow, vector_d &precipitation) { // calculate runoff coefficient as stated in: // Kokkonen, T. S. et al. (2003). double sum_flow = 0; double sum_pcp = 0; for (unsigned int i = 0; i < streamflow.size(); i++) { sum_flow += streamflow[i]; sum_pcp += precipitation[i]; } return (sum_flow / sum_pcp * 100); } //--------------------------------------------------------------------- double model_tools::CalcRunoffCoeff(double *streamflow, double *precipitation, int nvals) { // calculate runoff coefficient as stated in: // Kokkonen, T. S. et al. (2003). double sum_flow = 0; double sum_pcp = 0; for (int i = 0; i < nvals; i++) { sum_flow += streamflow[i]; sum_pcp += precipitation[i]; } return (sum_flow / sum_pcp * 100); } /////////////////////////////////////////////////////////////////////// // // UNIT CONVERSION // /////////////////////////////////////////////////////////////////////// double model_tools::m3s_to_mmday(double val, double area) { return(val * 86.4 / area); } //--------------------------------------------------------------------- double *model_tools::m3s_to_mmday(double *m3s, double *mmday, int nvals, double area) { for (int i = 0; i < nvals; i++) mmday[i] = m3s[i] * 86.4 / area; return(mmday); } //--------------------------------------------------------------------- vector_d model_tools::m3s_to_mmday(vector_d &m3s, vector_d &mmday, double area) { for (unsigned int i = 0; i < m3s.size(); i++) mmday[i] = m3s[i] * 86.4 / area; return(mmday); } //--------------------------------------------------------------------- double model_tools::mmday_to_m3s(double val, double area) { return(val * area / 86.4); } //--------------------------------------------------------------------- double *model_tools::mmday_to_m3s(double *mmday, double *m3s, int nvals, double area) { for (int i = 0; i < nvals; i++) m3s[i] = mmday[i] * area / 86.4; return(m3s); } //--------------------------------------------------------------------- vector_d model_tools::mmday_to_m3s(vector_d &mmday, vector_d &m3s, double area) { for (unsigned int i = 0; i < m3s.size(); i++) m3s[i] = mmday[i] * area / 86.4; return(m3s); } /////////////////////////////////////////////////////////////////////// // // MISC // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // Create a random number //--------------------------------------------------------------------- double model_tools::Random_double(double lb, double ub) { // lb = lower bound, ub = upper bound double random; random = rand()/(1.+RAND_MAX); random = lb + (ub - lb) * random; return(random); } //------------------------------------------------------------------- //--------------------------------------------------------------------- // Leap year function //--------------------------------------------------------------------- bool model_tools::LeapYear(int year) { if ( (year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0) ) return(true); else return(false); } //------------------------------------------------------------------- //--------------------------------------------------------------------- // Find indices of lowest values //--------------------------------------------------------------------- void model_tools::FindLowestIndices(double *array, int nvals, int *TopIndex, int top) { double min_temp = 99999999.0; double x = -99999999.0; int index = 0; for (int k = 0; k < top; k++) { for (int j = 0; j < nvals; j++) { if (array[j] < min_temp && array[j] > x) { min_temp = array[j]; index = j; } } TopIndex[k] = index; x = min_temp; min_temp = 99999999.0; } } //--------------------------------------------------------------------- // Find indices of highest values //--------------------------------------------------------------------- void model_tools::FindHighestIndices(double *array, int nvals, int *TopIndex, int top, double min) { double max_temp = -99999999.0; double x = 99999999.0; int index = 0; bool exist = false; for (int k = 0; k < top; k++) { for (int j = 0; j < nvals; j++) { if (array[j] > max_temp && array[j] < x && array[j] > min) { max_temp = array[j]; index = j; exist = true; } } if (exist) { TopIndex[k] = index; } else { TopIndex[k] = -1; } exist = false; x = max_temp; max_temp = -99999999.0; } } //--------------------------------------------------------------------- //--------------------------------------------------------------------- // summarize arrays //--------------------------------------------------------------------- double model_tools::SumArray(double* array, unsigned int size) { double sum = 0.0; for (unsigned int i = 0; i < size; i++) { sum += array[i]; } return(sum); } //--------------------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/model_tools.h000066400000000000000000000154151224124640700271350ustar00rootroot00000000000000/********************************************************** * Version $Id: model_tools.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // model_tools.h // // // // Copyright (C) 2007 by // // Stefan Liersch // //-------------------------------------------------------// // e-mail: stefan.liersch@ufz.de // // stefan.liersch@gmail.com // // 2008-01-24 // //-------------------------------------------------------// #ifndef HEADER_INCLUDED__model_tools_H #define HEADER_INCLUDED__model_tools_H #include typedef std::vector vector_d; namespace model_tools { /////////////////////////////////////////////////////////////////////// // // OBJECTIVE FUNCTIONS // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // Calculate Nash-Sutcliff efficiency //--------------------------------------------------------------------- double CalcEfficiency(double *obs, double *sim, int nvals); double CalcEfficiency(vector_d &obs, vector_d &sim); // Calculate Nash-Sutcliff efficiency adapted to high flow // Reference: // Liu and De Smedt, 2004. WetSpa Extension, // A GIS-based Hydrologic Model for Flood Prediction and Watershed Management // Documentation and User Manual. Brussels. Vrije Universiteit Brussel. double Calc_NSE_HighFlow(double *obs, double *sim, int nvals); double Calc_NSE_LowFlow (double *obs, double *sim, int nvals); //--------------------------------------------------------------------- //--------------------------------------------------------------------- // PBIAS //--------------------------------------------------------------------- double Calc_PBIAS(double* obs, double* sim, int nvals); //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // RUNOFF COEFFICIENT // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // Calculate rainfall-runoff coefficient double CalcRunoffCoeff (double *streamflow, double *precipitation, int nvals); double CalcRunoffCoeff (vector_d &streamflow, vector_d &precipitation); //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // UNIT CONVERSION FUNCTIONS // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- double m3s_to_mmday(double val, double area); double* m3s_to_mmday(double *m3s, double *mmday, int nvals, double area); vector_d m3s_to_mmday(vector_d &m3s, vector_d &mmday, double area); double mmday_to_m3s(double val, double area); double* mmday_to_m3s(double *mmday, double *m3s, int nvals, double area); vector_d mmday_to_m3s(vector_d &mmday, vector_d &m3s, double area); //--------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////// // // MISC // /////////////////////////////////////////////////////////////////////// //--------------------------------------------------------------------- // Produce a random number within the given lower and upper bound // Don't forget to initialize the random function before calling // this function with: srand((unsigned) time(NULL)); // using time.h // include 'stdlib.h' and 'time.h' in the calling program double Random_double(double lb, double ub); //--------------------------------------------------------------------- //--------------------------------------------------------------------- // Returns true if the year is a leap year bool LeapYear(int year); //--------------------------------------------------------------------- //--------------------------------------------------------------------- // This function receives an array of doubles and // returns the indices of the lowest values. // array = array of doubles // nvals = number of values in array // TopIndex = array of indices = return values // top = number of lowest values which indices will be stored in TopIndex void FindLowestIndices(double* array, int nvals, int* TopIndex, int top); //--------------------------------------------------------------------- //--------------------------------------------------------------------- // This function receives an array of doubles and // returns the indices of the highest values. // array = array of doubles // nvals = number of values in array // TopIndex = array of indices = return values // top = number of highest values which indices will be stored in TopIndex // min = minimum void FindHighestIndices(double* array, int nvals, int* TopIndex, int top, double min); //--------------------------------------------------------------------- //--------------------------------------------------------------------- // summarize arrays //--------------------------------------------------------------------- double SumArray(double* array, unsigned int size); }; /////////////////////////////////////////////////////////////////////// // // dynamic array template class // /////////////////////////////////////////////////////////////////////// // http://www.codeguru.com/forum/showthread.php?s=&threadid=231046 template class dynamic_array { public: dynamic_array(){}; dynamic_array(int rows, int cols) { for(int i=0; i(cols)); } } // other ctors .... inline std::vector & operator[](int i) { return data_[i]; } inline const std::vector & operator[] (int i) const { return data_[i]; } // other accessors, like at() ... void resize(int rows, int cols) { data_.resize(rows); for(int i = 0; i < rows; ++i) data_[i].resize(cols); } // other member functions, like reserve().... private: std::vector > data_; }; //--------------------------------------------------------------------- // An example to use the template class //--------------------------------------------------------------------- //int main() //{ // dynamic_array a(3, 3); // a[1][1] = 2; // int x = a[1][1]; // return 0; //} /////////////////////////////////////////////////////////////////////// #endif /* HEADER_INCLUDED__model_tools_H */ saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/snow_module.cpp000066400000000000000000000224521224124640700275020ustar00rootroot00000000000000/********************************************************** * Version $Id: snow_module.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //////////////////////////////////////////////////////////////// // File: // snow_module.cpp // // A class to calculate a time series of // snow melt and snow storage. // // Author: // Stefan Liersch: stefan.liersch@gmail.com, stefan.liersch@ufz.de // // Date: 2007-10-05 // last modified: 2007-10-05 // //-------------------------------------------------------------- // DESCRIPTION //-------------------------------------------------------------- // This class provides functions to calculate snow melt processes, // based on the simple degree-day method. // INPUT: // - Daily temperature and precipitation time series // This could be double* pointers or double vectors. // In both cases the output (snow storage and melt rate) will be double* !!! // - T_Rain : temperature threshold, T < T_Rain precip = snow (range: -10 to +10�C) // - T_Melt : temperature threshold, T > T_Melt = Snow storage starts melting (range: -5 to +10�C) // - DD_FAC : day-degree factor (range: 0.7 to 9.2) // OUTPUT: // - double* m_pSnowStorage[i] // - double* m_pMeltRate[i] //-------------------------------------------------------------- // REFERENCES //-------------------------------------------------------------- // - The Encyclopedia of Water // http://www.wileywater.com/Contributor/Sample_3.htm // - Chang, A. T. C., J. L. Foster, P. Gloersen, W. J. Campbell, E. G. Josberger, A. Rango and Z. F. Danes (1987) // Estimating snowpack parameters in the Colorado River basin. // In: Proc. Large Scale Effects of Seasonal Snow Cover, // IAHS Publ. No. 166, 343-353. // - Singh, P. and Singh, V.P. (2001) // Snow and Glacier Hydrology. // Kluwer Academic Publishers, Dordrecht, The Netherlands, p. 221 //-------------------------------------------------------------- // ToDo //-------------------------------------------------------------- // - implementation for vector instead of double* //-------------------------------------------------------------- //-------------------------------------------------------------- #include #include "snow_module.h" //-------------------------------------------------------------- //-------------------------------------------------------------- #define max(a, b) (((a) > (b)) ? (a) : (b)) //-------------------------------------------------------------- //-------------------------------------------------------------- // CONSTRUCTORS //-------------------------------------------------------------- CSnowModule::CSnowModule(int size) { InitParms(size); } //-------------------------------------------------------------- // double* INPUT // CSnowModule::CSnowModule(double *temperature, double *precipitation, int size, double T_Rain, double T_Melt, double DD_FAC) { m_T_Rain = T_Rain; m_T_Melt = T_Melt; m_DD_FAC = DD_FAC; m_size = size; InitParms(m_size); // perform snow storage and snow melt calculations Calc_SnowModule(temperature, precipitation, m_size, T_Rain, T_Melt, DD_FAC); } //-------------------------------------------------------------- // vector INPUT // CSnowModule::CSnowModule(vector_d temperature, vector_d precipitation, double T_Rain, double T_Melt, double DD_FAC) { m_T_Rain = T_Rain; m_T_Melt = T_Melt; m_DD_FAC = DD_FAC; m_size = temperature.size(); InitParms(m_size); // perform snow storage and snow melt calculations Calc_SnowModule(temperature, precipitation, T_Rain, T_Melt, DD_FAC); } //-------------------------------------------------------------- // DESTRUCTOR //-------------------------------------------------------------- CSnowModule::~CSnowModule() { if (m_pSnowStorage) delete[] m_pSnowStorage; if (m_pMeltRate) delete[] m_pMeltRate; } //-------------------------------------------------------------- // // PUBLIC FUNCTIONS // //-------------------------------------------------------------- void CSnowModule::InitParms(int size) { m_size = size; m_pSnowStorage = new double[m_size]; m_pMeltRate = new double[m_size]; _ZeroPointers(); } //-------------------------------------------------------------- double *CSnowModule::Get_SnowStorage(double *snow_storage, int size) { for (int i = 0; i < size; i++) snow_storage[i] = m_pSnowStorage[i]; return(snow_storage); } //-------------------------------------------------------------- double *CSnowModule::Get_MeltRate(double *melt_rate, int size) { for (int i = 0; i < size; i++) melt_rate[i] = m_pMeltRate[i]; return(melt_rate); } //-------------------------------------------------------------- // // SET FUNCTIONS // //-------------------------------------------------------------- bool CSnowModule::Set_T_Rain(double value) { if (value >= -10.0 && value <= 10.0) { m_T_Rain = value; return(true); } else { return(false); } } //-------------------------------------------------------------- bool CSnowModule::Set_T_Melt(double value) { if (value >= -5.0 && value <= 10.0) { m_T_Melt = value; return(true); } else { return(false); } } //-------------------------------------------------------------- bool CSnowModule::Set_DD_FAC(double value) { if (value >= 0.7 && value <= 9.2) { m_DD_FAC = value; return(true); } else { return(false); } } //-------------------------------------------------------------- // // CALCULATE Snow storage and melt rate // //-------------------------------------------------------------- //-------------------------------------------------------------- // double* INPUT //-------------------------------------------------------------- bool CSnowModule::Calc_SnowModule(double *temperature, double *precipitation, unsigned int size, double T_Rain, double T_Melt, double DD_FAC) { // still missing!!! // what happens with precipitation at the same day as // snowmelt is calculated? // is it correct to handle this in excess rainfall function only? if (size != m_size) return(false); _ZeroPointers(); m_T_Rain = T_Rain; m_T_Melt = T_Melt; m_DD_FAC = DD_FAC; double T_diff; for (unsigned int i = 1; i < size; i++) { // calculate snow accumulation if (temperature[i] < T_Rain) { m_pSnowStorage[i] = m_pSnowStorage[i-1] + precipitation[i]; m_pMeltRate[i] = 0.0; } // calculate snowmelt if (temperature[i] > T_Melt) { T_diff = temperature[i] - T_Melt; m_pMeltRate[i] = DD_FAC * max(0.0,T_diff); if (m_pMeltRate[i] > m_pSnowStorage[i-1]) { m_pMeltRate[i] = m_pSnowStorage[i-1]; m_pSnowStorage[i] = 0.0; } m_pSnowStorage[i] = m_pSnowStorage[i-1] - m_pMeltRate[i]; } // if temperature between T_Rain and T_Melt if ((temperature[i] > T_Rain) && (temperature[i] < T_Melt)) { /* T_diff = temperature[i] - T_Melt; m_pMeltRate[i] = (DD_FAC * max(0.0, T_diff)) / 2; */ m_pMeltRate[i] = 0.0; if (precipitation[i] > 0.0) m_pMeltRate[i] = precipitation[i] / 2; if (m_pMeltRate[i] > m_pSnowStorage[i-1]) { m_pMeltRate[i] = m_pSnowStorage[i-1]; m_pSnowStorage[i] = 0.0; } m_pSnowStorage[i] = m_pSnowStorage[i-1] - m_pMeltRate[i]; } if (m_pSnowStorage[i] < 0.0) m_pSnowStorage[i] = 0.0; } return(true); } //-------------------------------------------------------------- // vector INPUT //-------------------------------------------------------------- bool CSnowModule::Calc_SnowModule(vector_d temperature, vector_d precipitation, double T_Rain, double T_Melt, double DD_FAC) { // still missing!!! // what happens with precipitation at the same day as // snowmelt is calculated? // is it correct to handle this in excess rainfall function only? if (temperature.size() != m_size || precipitation.size() != m_size) return(false); int size = m_size; _ZeroPointers(); m_T_Rain = T_Rain; m_T_Melt = T_Melt; m_DD_FAC = DD_FAC; double T_diff; for (int i = 1; i < size; i++) { // calculate snow accumulation if (temperature[i] < T_Rain) { m_pSnowStorage[i] = m_pSnowStorage[i-1] + precipitation[i]; m_pMeltRate[i] = 0.0; } // calculate snowmelt if (temperature[i] > T_Melt) { T_diff = temperature[i] - T_Melt; m_pMeltRate[i] = DD_FAC * max(0.0,T_diff); if (m_pMeltRate[i] > m_pSnowStorage[i-1]) { m_pMeltRate[i] = m_pSnowStorage[i-1]; m_pSnowStorage[i] = 0.0; } m_pSnowStorage[i] = m_pSnowStorage[i-1] - m_pMeltRate[i]; } // if temperature between T_Rain and T_Melt if ((temperature[i] > T_Rain) && (temperature[i] < T_Melt)) { /* T_diff = temperature[i] - T_Melt; m_pMeltRate[i] = (DD_FAC * max(0.0, T_diff)) / 2; */ m_pMeltRate[i] = 0.0; if (precipitation[i] > 0.0) m_pMeltRate[i] = precipitation[i] / 2; if (m_pMeltRate[i] > m_pSnowStorage[i-1]) { m_pMeltRate[i] = m_pSnowStorage[i-1]; m_pSnowStorage[i] = 0.0; } m_pSnowStorage[i] = m_pSnowStorage[i-1] - m_pMeltRate[i]; } if (m_pSnowStorage[i] < 0.0) m_pSnowStorage[i] = 0.0; } return(true); } //-------------------------------------------------------------- // // PRIVATE FUNCTIONS // //-------------------------------------------------------------- void CSnowModule::_ZeroPointers() { // This is important, because only on days where snow // accumulats or melts a value is assigned to the pointers if (m_pSnowStorage != NULL && m_pMeltRate != NULL && m_size > 0) { for (unsigned int i = 0; i < m_size; i++) { m_pSnowStorage[i] = 0.0; m_pMeltRate[i] = 0.0; } } } saga-2.1.0+dfsg/src/modules_contrib/contrib_s_liersch/ihacres/snow_module.h000066400000000000000000000105531224124640700271460ustar00rootroot00000000000000/********************************************************** * Version $Id: snow_module.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ //////////////////////////////////////////////////////////////// // File: // snow_module.h // // A class to calculate a time series of // snow melt and snow storage. // // Author: // Stefan Liersch: stefan.liersch@gmail.com, stefan.liersch@ufz.de // // Date: 2007-10-05 // last modified: 2007-10-05 // //-------------------------------------------------------------- // DESCRIPTION //-------------------------------------------------------------- // This class provides functions to calculate snow melt processes, // based on the simple degree-day method. // INPUT: // - Daily temperature and precipitation time series // This could be double* pointers or double vectors. // In both cases the output (snow storage and melt rate) will be double* !!! // - T_Rain : temperature threshold, T < T_Rain precip = snow (range: -10 to +10�C) // - T_Melt : temperature threshold, T > T_Melt = Snow storage starts melting (range: -5 to +10�C) // - DD_FAC : day-degree factor (range: 0.7 to 9.2) // OUTPUT: // - double* m_pSnowStorage[i] // - double* m_pMeltRate[i] //-------------------------------------------------------------- // REFERENCES //-------------------------------------------------------------- // - The Encyclopedia of Water // http://www.wileywater.com/Contributor/Sample_3.htm // - Chang, A. T. C., J. L. Foster, P. Gloersen, W. J. Campbell, E. G. Josberger, A. Rango and Z. F. Danes (1987) // Estimating snowpack parameters in the Colorado River basin. // In: Proc. Large Scale Effects of Seasonal Snow Cover, // IAHS Publ. No. 166, 343-353. // - Singh, P. and Singh, V.P. (2001) // Snow and Glacier Hydrology. // Kluwer Academic Publishers, Dordrecht, The Netherlands, p. 221 //-------------------------------------------------------------- // ToDo //-------------------------------------------------------------- // - implementation for vector instead of double* //-------------------------------------------------------------- #ifndef HEADER_INCLUDED__snow_module_H #define HEADER_INCLUDED__snow_module_H #include // used for storing date string values in array typedef std::vector vector_d; //-------------------------------------------------------------- class CSnowParms { public: CSnowParms() { T_Rain = 0.0; T_Melt = 0.0; DD_FAC = 0.0; } double T_Rain; double T_Melt; double DD_FAC; }; //-------------------------------------------------------------- class CSnowModule { public: CSnowModule(int size); CSnowModule(double *temperature, double *precipitation, int size, double T_Rain, double T_Melt, double DD_FAC); // using double vectors as input instead of double* CSnowModule(vector_d temperature, vector_d precipitation, double T_Rain, double T_Melt, double DD_FAC); ~CSnowModule(); //---------------------------------------------- // PUBLIC FUNCTIONS //---------------------------------------------- void InitParms(int size); double Get_SnowStorage(unsigned int i) { return( i < m_size ? m_pSnowStorage[i] : -9999); } double* Get_SnowStorage(double *snow_storage, int size); double Get_MeltRate(unsigned int i) { return( i < m_size ? m_pMeltRate[i] : -9999); } double* Get_MeltRate(double *melt_rate, int size); double Get_T_Rain() { return(m_T_Rain); } double Get_T_Melt() { return(m_T_Melt); } double Get_DD_FAC() { return(m_DD_FAC); } bool Set_T_Rain(double value); bool Set_T_Melt(double value); bool Set_DD_FAC(double value); bool Calc_SnowModule(double *temperature, double *precipitation, unsigned int size,// pointer size (temperature, precip) double T_Rain, double T_Melt, double DD_FAC); //---------------------------------------------- private: void _ZeroPointers(); // variables double* m_pSnowStorage; double* m_pMeltRate; unsigned int m_size; // number of values in arrays, time steps double m_T_Rain; double m_T_Melt; double m_DD_FAC; //-------------------------------------------------------------- // // FUNCTIONS FOR VECTORS // //-------------------------------------------------------------- public: bool Calc_SnowModule(vector_d temperature, vector_d precipitation, double T_Rain, double T_Melt, double DD_FAC); }; #endif /* HEADER_INCLUDED__snow_module_H */ saga-2.1.0+dfsg/src/modules_contrib/garden/000077500000000000000000000000001224124640700205655ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_contrib/garden/Makefile.am000066400000000000000000000001251224124640700226170ustar00rootroot00000000000000if WITH_GUI SUBDIRS = garden_3d_viewer garden_webservices else SUBDIRS = endif saga-2.1.0+dfsg/src/modules_contrib/garden/Makefile.in000066400000000000000000000426171224124640700226440ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_contrib/garden DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = garden_3d_viewer garden_webservices DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @WITH_GUI_FALSE@SUBDIRS = @WITH_GUI_TRUE@SUBDIRS = garden_3d_viewer garden_webservices all: all-recursive .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) --gnu src/modules_contrib/garden/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_contrib/garden/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/000077500000000000000000000000001224124640700237745ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_control.cpp000066400000000000000000000667221224124640700316750ustar00rootroot00000000000000/********************************************************** * Version $Id: 3d_multigrid_view_control.cpp 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3d_viewer // // // //-------------------------------------------------------// // // // 3d_multigrid_view_control.cpp // // // // Copyright (C) 2013 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include #include #include #include //--------------------------------------------------------- #include "3d_multigrid_view_control.h" #include "3d_multigrid_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define m_Settings (*m_pSettings) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- BEGIN_EVENT_TABLE(C3D_MultiGrid_View_Control, wxPanel) EVT_SIZE (C3D_MultiGrid_View_Control::On_Size) EVT_PAINT (C3D_MultiGrid_View_Control::On_Paint) EVT_KEY_DOWN (C3D_MultiGrid_View_Control::On_Key_Down) EVT_LEFT_DOWN (C3D_MultiGrid_View_Control::On_Mouse_LDown) EVT_LEFT_UP (C3D_MultiGrid_View_Control::On_Mouse_LUp) EVT_RIGHT_DOWN (C3D_MultiGrid_View_Control::On_Mouse_RDown) EVT_RIGHT_UP (C3D_MultiGrid_View_Control::On_Mouse_RUp) EVT_MIDDLE_DOWN (C3D_MultiGrid_View_Control::On_Mouse_MDown) EVT_MIDDLE_UP (C3D_MultiGrid_View_Control::On_Mouse_MUp) EVT_MOTION (C3D_MultiGrid_View_Control::On_Mouse_Motion) EVT_MOUSEWHEEL (C3D_MultiGrid_View_Control::On_Mouse_Wheel) END_EVENT_TABLE() /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- C3D_MultiGrid_View_Control::C3D_MultiGrid_View_Control(wxWindow *pParent, CSG_Parameter_Grid_List *pGrids, int Field_Color, CSG_Parameters &Settings) : wxPanel(pParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxSUNKEN_BORDER|wxNO_FULL_REPAINT_ON_RESIZE) { m_pGrids = pGrids; m_pSettings = &Settings; m_cField = Field_Color; m_Shading = 1; m_Style = 1; m_xRotate = 0.0; m_yRotate = 0.0; m_zRotate = 0.0; m_xShift = 0.0; m_yShift = 0.0; m_zShift = 1000.0; m_bCentral = true; m_bStereo = false; m_bFrame = true; m_Light_Hgt = 45.0 * M_DEG_TO_RAD; m_Light_Dir = 90.0 * M_DEG_TO_RAD; m_dCentral = 500.0; //----------------------------------------------------- CSG_Parameter *pNode = m_pSettings->Add_Node(NULL, "NODE_CONTROL", _TL("3D View"), _TL("")); m_pSettings->Add_Colors( pNode , "COLORS" , _TL("Colors"), _TL("") ); m_pSettings->Add_Value( pNode , "BGCOLOR" , _TL("Background Color"), _TL(""), PARAMETER_TYPE_Color, 0 ); m_pSettings->Add_Range( pNode , "C_RANGE" , _TL("Colors Value Range"), _TL("") ); m_pSettings->Add_Value( pNode , "SIZE_DEF" , _TL("Point Size: Default"), _TL(""), PARAMETER_TYPE_Int, 0, 0, true ); m_pSettings->Add_Value( pNode , "SIZE_SCALE" , _TL("Point Size: Scaling"), _TL(""), PARAMETER_TYPE_Double, 250.0, 1.0, true ); m_pSettings->Add_Value( pNode , "EXAGGERATION" , _TL("Exaggeration"), _TL(""), PARAMETER_TYPE_Double, 1.0 ); m_pSettings->Add_Value( pNode , "STEREO_DIST" , _TL("Stereo Eye Distance [Degree]"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); //----------------------------------------------------- Update_Extent(); } //--------------------------------------------------------- C3D_MultiGrid_View_Control::~C3D_MultiGrid_View_Control(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void C3D_MultiGrid_View_Control::On_Size(wxSizeEvent &event) { _Set_Size(); event.Skip(); } //--------------------------------------------------------- void C3D_MultiGrid_View_Control::On_Paint(wxPaintEvent &WXUNUSED(event)) { if( m_Image.IsOk() && m_Image.GetWidth() > 0 && m_Image.GetHeight() > 0 ) { wxPaintDC dc(this); dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false); } } //--------------------------------------------------------- void C3D_MultiGrid_View_Control::Update_View(void) { if( _Draw_Image() ) { wxClientDC dc(this); dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false); } } //--------------------------------------------------------- void C3D_MultiGrid_View_Control::Update_Extent(void) { m_Extent.Assign(m_pGrids->asGrid(0)->Get_Extent()); m_zMin = m_pGrids->asGrid(0)->Get_ZMin(); m_zMax = m_pGrids->asGrid(0)->Get_ZMax(); for(int i=1; iGet_Count(); i++) { m_Extent.Union(m_pGrids->asGrid(i)->Get_Extent()); if( m_zMin > m_pGrids->asGrid(i)->Get_ZMin() ) m_zMin = m_pGrids->asGrid(i)->Get_ZMin(); if( m_zMax < m_pGrids->asGrid(i)->Get_ZMax() ) m_zMax = m_pGrids->asGrid(i)->Get_ZMax(); } Update_View(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void C3D_MultiGrid_View_Control::On_Key_Down(wxKeyEvent &event) { switch( event.GetKeyCode() ) { default: event.Skip(); return; case WXK_NUMPAD_ADD: case WXK_ADD: m_xRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_SUBTRACT: case WXK_SUBTRACT: m_xRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_F3: m_yRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_F4: m_yRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_MULTIPLY: case WXK_MULTIPLY: m_zRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_DIVIDE: case WXK_DIVIDE: m_zRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_INSERT: m_xShift -= 10.0; break; case WXK_DELETE: m_xShift += 10.0; break; case WXK_HOME: m_yShift -= 10.0; break; case WXK_END: m_yShift += 10.0; break; case WXK_PAGEUP: m_zShift -= 10.0; break; case WXK_PAGEDOWN: m_zShift += 10.0; break; case 'A': m_bStereo = !m_bStereo; break; case WXK_F1: m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() + 0.5); break; case WXK_F2: m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() - 0.5); break; case WXK_F5: m_Settings("SIZE_DEF") ->Set_Value(m_Settings("SIZE_DEF") ->asDouble() - 1.0); break; case WXK_F6: m_Settings("SIZE_DEF") ->Set_Value(m_Settings("SIZE_DEF") ->asDouble() + 1.0); break; case WXK_F7: m_Settings("SIZE_SCALE") ->Set_Value(m_Settings("SIZE_SCALE") ->asDouble() - 10.0); break; case WXK_F8: m_Settings("SIZE_SCALE") ->Set_Value(m_Settings("SIZE_SCALE") ->asDouble() + 10.0); break; } Update_View(); ((C3D_MultiGrid_View_Dialog *)GetParent())->Update_Rotation(); } //--------------------------------------------------------- #define GET_MOUSE_X_RELDIFF ((double)(m_Mouse_Down.x - event.GetX()) / (double)GetClientSize().x) #define GET_MOUSE_Y_RELDIFF ((double)(m_Mouse_Down.y - event.GetY()) / (double)GetClientSize().y) //--------------------------------------------------------- void C3D_MultiGrid_View_Control::On_Mouse_LDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_zRotate; m_yDown = m_xRotate; CaptureMouse(); } void C3D_MultiGrid_View_Control::On_Mouse_LUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_zRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_xRotate = m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180; Update_View(); ((C3D_MultiGrid_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void C3D_MultiGrid_View_Control::On_Mouse_RDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_xShift; m_yDown = m_yShift; CaptureMouse(); } void C3D_MultiGrid_View_Control::On_Mouse_RUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_xShift = m_xDown - GET_MOUSE_X_RELDIFF * 1000.0; m_yShift = m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0; Update_View(); ((C3D_MultiGrid_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void C3D_MultiGrid_View_Control::On_Mouse_MDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_yRotate; m_yDown = m_zShift; CaptureMouse(); } void C3D_MultiGrid_View_Control::On_Mouse_MUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_yRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_zShift = m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0; Update_View(); ((C3D_MultiGrid_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void C3D_MultiGrid_View_Control::On_Mouse_Motion(wxMouseEvent &event) { if( HasCapture() && event.Dragging() ) { if( event.LeftIsDown() ) { m_zRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_xRotate = m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180; } else if( event.RightIsDown() ) { m_xShift = m_xDown - GET_MOUSE_X_RELDIFF * 1000.0; m_yShift = m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0; } else if( event.MiddleIsDown() ) { m_yRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_zShift = m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0; } else { return; } Update_View(); ((C3D_MultiGrid_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void C3D_MultiGrid_View_Control::On_Mouse_Wheel(wxMouseEvent &event) { if( event.GetWheelRotation() ) { m_zShift += 0.5 * event.GetWheelRotation(); Update_View(); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void C3D_MultiGrid_View_Control::_Set_Size(void) { Update_View(); } //--------------------------------------------------------- bool C3D_MultiGrid_View_Control::_Draw_Image(void) { wxSize dcSize = GetClientSize(); if( m_pGrids->Get_Count() <= 0 || dcSize.x <= 0 || dcSize.y <= 0 || m_Extent.Get_XRange() <= 0.0 || m_Extent.Get_YRange() <= 0.0 ) { return( false ); } //------------------------------------------------- if( !m_Image.IsOk() || dcSize.x != m_Image.GetWidth() || dcSize.y != m_Image.GetHeight() ) { m_Image .Create(dcSize.x, dcSize.y); m_Image_zMax.Create(dcSize.x, dcSize.y); } //------------------------------------------------- r_Scale = (m_Image.GetWidth() / (double)m_Image.GetHeight()) > (m_Extent.Get_XRange() / m_Extent.Get_YRange()) ? m_Image.GetWidth () / m_Extent.Get_XRange() : m_Image.GetHeight() / m_Extent.Get_YRange(); r_sin_x = sin(m_xRotate - M_PI_180); r_cos_x = cos(m_xRotate - M_PI_180); r_sin_y = sin(m_yRotate); r_cos_y = cos(m_yRotate); r_sin_z = sin(m_zRotate); r_cos_z = cos(m_zRotate); r_xc = m_Extent.Get_XCenter(); r_yc = m_Extent.Get_YCenter(); r_zc = m_zMin + 0.5 * (m_zMax - m_zMin); r_Scale_z = r_Scale * m_Settings("EXAGGERATION")->asDouble(); //----------------------------------------------------- m_Size_Def = m_Settings("SIZE_DEF")->asInt(); m_Size_Scale = 1.0 / m_Settings("SIZE_SCALE")->asDouble(); _Draw_Background(); //----------------------------------------------------- m_Image_zMax.Assign(999999.0); m_Color_Mode = COLOR_MODE_RGB; for(int i=0; iGet_Count(); i++) { _Draw_Grid(m_pGrids->asGrid(i)); } _Draw_Frame(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void C3D_MultiGrid_View_Control::_Draw_Grid(CSG_Grid *pGrid) { double z_NoData_Lo = pGrid->Get_NoData_Value(); double z_NoData_Hi = pGrid->Get_NoData_hiValue(); CSG_Colors Colors; if( SG_UI_DataObject_Colors_Get(pGrid, &Colors) ) m_pColors = &Colors; else m_pColors = m_Settings("COLORS")->asColors(); m_cMin = pGrid->Get_ZMin(); m_cScale = m_pColors->Get_Count() / pGrid->Get_ZRange(); #pragma omp parallel for for(int y=1; yGet_NY(); y++) { double p_x, p_y[2]; TNode a[2], b[2]; p_x = pGrid->Get_XMin(); p_y[1] = pGrid->Get_YMin() + y * pGrid->Get_Cellsize(); p_y[0] = p_y[1] - pGrid->Get_Cellsize(); b[0].y = p_y[0]; b[0].x = p_x; b[0].z = pGrid->asDouble(0, y - 1); b[0].c = b[0].z; _Get_Projection(b[0]); b[1].y = p_y[1]; b[1].x = p_x; b[1].z = pGrid->asDouble(0, y ); b[1].c = b[1].z; _Get_Projection(b[1]); for(int x=1; xGet_NX(); x++) { p_x += pGrid->Get_Cellsize(); a[0] = b[0]; b[0].y = p_y[0]; b[0].x = p_x; b[0].z = pGrid->asDouble(x, y - 1); b[0].c = b[0].z; _Get_Projection(b[0]); a[1] = b[1]; b[1].y = p_y[1]; b[1].x = p_x; b[1].z = pGrid->asDouble(x, y ); b[1].c = b[1].z; _Get_Projection(b[1]); _Draw_Triangle(a[0], b[1], a[1], z_NoData_Lo, z_NoData_Hi); _Draw_Triangle(a[0], b[1], b[0], z_NoData_Lo, z_NoData_Hi); } } } //--------------------------------------------------------- inline void C3D_MultiGrid_View_Control::_Draw_Triangle(TNode a, TNode b, TNode c, double c_NoData_Lo, double c_NoData_Hi) { if( SG_IS_BETWEEN(c_NoData_Lo, a.c, c_NoData_Hi) || SG_IS_BETWEEN(c_NoData_Lo, b.c, c_NoData_Hi) || SG_IS_BETWEEN(c_NoData_Lo, c.c, c_NoData_Hi) ) return; TNode t[3]; t[0] = a; t[1] = b; t[2] = c; //----------------------------------------------------- double dim; if( !m_Shading ) { dim = -1.0; } else { double s, a, A, B, C; A = t[0].z * (t[1].x - t[2].x) + t[1].z * (t[2].x - t[0].x) + t[2].z * (t[0].x - t[1].x); B = t[0].y * (t[1].z - t[2].z) + t[1].y * (t[2].z - t[0].z) + t[2].y * (t[0].z - t[1].z); C = t[0].x * (t[1].y - t[2].y) + t[1].x * (t[2].y - t[0].y) + t[2].x * (t[0].y - t[1].y); if( C != 0.0 ) { A = - A / C; B = - B / C; s = atan(sqrt(A*A + B*B)); if( A != 0.0 ) a = M_PI_180 + atan2(B, A); else a = B > 0.0 ? M_PI_270 : (B < 0.0 ? M_PI_090 : -1.0); } s = M_PI_090 - s; dim = (acos(sin(s) * sin(m_Light_Hgt) + cos(s) * cos(m_Light_Hgt) * cos(a - m_Light_Dir))) / M_PI_090; } //----------------------------------------------------- _Draw_Triangle(t, dim); } //--------------------------------------------------------- inline void C3D_MultiGrid_View_Control::_Draw_Point(int x, int y, double z, int color, int size) { if( z > 0.0 ) { _Draw_Pixel(x, y, z, color); if( size > 0 && size < 50 ) { for(int iy=1; iy<=size; iy++) { for(int ix=0; ix<=size; ix++) { if( ix*ix + iy*iy <= size*size ) { _Draw_Pixel(x + ix, y + iy, z, color); _Draw_Pixel(x + iy, y - ix, z, color); _Draw_Pixel(x - ix, y - iy, z, color); _Draw_Pixel(x - iy, y + ix, z, color); } } } } } } //--------------------------------------------------------- inline void C3D_MultiGrid_View_Control::_Draw_Line(TNode a, TNode b, int Color) { if( (a.x < 0 && b.x < 0) || (a.x >= m_Image.GetWidth () && b.x >= m_Image.GetWidth ()) || (a.y < 0 && b.y < 0) || (a.y >= m_Image.GetHeight() && b.y >= m_Image.GetHeight()) ) { return; } double i, n, dx, dy, dz; dx = b.x - a.x; dy = b.y - a.y; dz = b.z - a.z; if( b.z < 0.0 || a.z < 0.0 ) return; if( fabs(dx) > fabs(dy) && fabs(dx) > 0.0 ) { n = fabs(dx); dx = dx < 0 ? -1 : 1; dy /= n; dz /= n; } else if( fabs(dy) > 0.0 ) { n = fabs(dy); dx /= n; dy = dy < 0 ? -1 : 1; dz /= n; } else { _Draw_Pixel((int)a.x, (int)a.y, a.z, Color); return; } //----------------------------------------------------- for(i=0; i<=n; i++, a.x+=dx, a.y+=dy, a.z+=dz) { _Draw_Pixel((int)a.x, (int)a.y, a.z, Color); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void C3D_MultiGrid_View_Control::_Draw_Triangle(TNode p[3], double dim) { if( p[0].z < 0.0 || p[1].z < 0.0 || p[2].z < 0.0 ) return; //----------------------------------------------------- if( p[1].y < p[0].y ) { TNode pp = p[1]; p[1] = p[0]; p[0] = pp; } if( p[2].y < p[0].y ) { TNode pp = p[2]; p[2] = p[0]; p[0] = pp; } if( p[2].y < p[1].y ) { TNode pp = p[2]; p[2] = p[1]; p[1] = pp; } //----------------------------------------------------- TSG_Rect r; r.yMin = p[0].y; r.yMax = p[2].y; r.xMin = p[0].x < p[1].x ? (p[0].x < p[2].x ? p[0].x : p[2].x) : (p[1].x < p[2].x ? p[1].x : p[2].x); r.xMax = p[0].x > p[1].x ? (p[0].x > p[2].x ? p[0].x : p[2].x) : (p[1].x > p[2].x ? p[1].x : p[2].x); if( r.yMin >= r.yMax || r.xMin >= r.xMax ) { return; // no area } if( (r.yMin < 0.0 && r.yMax < 0.0) || (r.yMin >= m_Image.GetHeight() && r.yMax >= m_Image.GetHeight()) || (r.xMin < 0.0 && r.xMax < 0.0) || (r.xMin >= m_Image.GetWidth () && r.xMax >= m_Image.GetWidth ()) ) { return; // completely outside grid } //----------------------------------------------------- TNode d[3]; if( (d[0].y = p[2].y - p[0].y) > 0.0 ) { d[0].x = (p[2].x - p[0].x) / d[0].y; d[0].z = (p[2].z - p[0].z) / d[0].y; d[0].c = (p[2].c - p[0].c) / d[0].y; } if( (d[1].y = p[1].y - p[0].y) > 0.0 ) { d[1].x = (p[1].x - p[0].x) / d[1].y; d[1].z = (p[1].z - p[0].z) / d[1].y; d[1].c = (p[1].c - p[0].c) / d[1].y; } if( (d[2].y = p[2].y - p[1].y) > 0.0 ) { d[2].x = (p[2].x - p[1].x) / d[2].y; d[2].z = (p[2].z - p[1].z) / d[2].y; d[2].c = (p[2].c - p[1].c) / d[2].y; } //----------------------------------------------------- int ay = (int)r.yMin; if( ay < 0 ) ay = 0; if( ay < r.yMin ) ay++; int by = (int)r.yMax; if( by >= m_Image.GetHeight() ) by = m_Image.GetHeight() - 1; for(int y=ay; y<=by; y++) { if( y <= p[1].y && d[1].y > 0.0 ) { _Draw_Triangle_Line(y, p[0].x + (y - p[0].y) * d[0].x, p[0].x + (y - p[0].y) * d[1].x, p[0].z + (y - p[0].y) * d[0].z, p[0].z + (y - p[0].y) * d[1].z, p[0].c + (y - p[0].y) * d[0].c, p[0].c + (y - p[0].y) * d[1].c, dim ); } else if( d[2].y > 0.0 ) { _Draw_Triangle_Line(y, p[0].x + (y - p[0].y) * d[0].x, p[1].x + (y - p[1].y) * d[2].x, p[0].z + (y - p[0].y) * d[0].z, p[1].z + (y - p[1].y) * d[2].z, p[0].c + (y - p[0].y) * d[0].c, p[1].c + (y - p[1].y) * d[2].c, dim ); } } } //--------------------------------------------------------- inline void C3D_MultiGrid_View_Control::_Draw_Triangle_Line(int y, double xa, double xb, double za, double zb, double ca, double cb, double dim) { if( xb < xa ) { double d; d = xa; xa = xb; xb = d; d = za; za = zb; zb = d; d = ca; ca = cb; cb = d; } if( xb > xa ) { double dz = (zb - za) / (xb - xa); double dc = (cb - ca) / (xb - xa); int ax = (int)xa; if( ax < 0 ) ax = 0; if( ax < xa ) ax++; int bx = (int)xb; if( bx >= m_Image.GetWidth() ) bx = m_Image.GetWidth() - 1; for(int x=ax; x<=bx; x++) { double z = za + dz * (x - xa); double c = ca + dc * (x - xa); _Draw_Pixel(x, y, z, _Get_Color(c, dim)); } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void C3D_MultiGrid_View_Control::_Draw_Background(void) { BYTE r, g, b, *pRGB; int i, n, color; color = m_Settings("BGCOLOR")->asColor(); if( m_bStereo ) { color = (int)((SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3.0); color = SG_GET_RGB(color, color, color); } r = SG_GET_R(color); g = SG_GET_G(color); b = SG_GET_B(color); n = m_Image.GetWidth() * m_Image.GetHeight(); for(i=0, pRGB=m_Image.GetData(); iasColor(); color = SG_GET_RGB(SG_GET_R(color) + 128, SG_GET_G(color) + 128, SG_GET_B(color) + 128); for(int i=0; i<2; i++) { p[i][0].x = r.Get_XMin(); p[i][0].y = r.Get_YMin(); p[i][1].x = r.Get_XMax(); p[i][1].y = r.Get_YMin(); p[i][2].x = r.Get_XMax(); p[i][2].y = r.Get_YMax(); p[i][3].x = r.Get_XMin(); p[i][3].y = r.Get_YMax(); p[i][0].z = p[i][1].z = p[i][2].z = p[i][3].z = i == 0 ? m_zMin - buffer * (m_zMax - m_zMin) / 100.0 : m_zMax + buffer * (m_zMax - m_zMin) / 100.0; for(int j=0; j<4; j++) { _Get_Projection(p[i][j]); } _Draw_Line(p[i][0], p[i][1], color); _Draw_Line(p[i][1], p[i][2], color); _Draw_Line(p[i][2], p[i][3], color); _Draw_Line(p[i][3], p[i][0], color); } _Draw_Line(p[0][0], p[1][0], color); _Draw_Line(p[0][1], p[1][1], color); _Draw_Line(p[0][2], p[1][2], color); _Draw_Line(p[0][3], p[1][3], color); } //--------------------------------------------------------- inline void C3D_MultiGrid_View_Control::_Draw_Pixel(int x, int y, double z, int color) { if( x >= 0 && x < m_Image.GetWidth() && y >= 0 && y < m_Image.GetHeight() && z < m_Image_zMax[y][x] ) { BYTE *RGB = m_Image.GetData() + 3 * (y * m_Image.GetWidth() + x); switch( m_Color_Mode ) { case COLOR_MODE_RGB: RGB[0] = SG_GET_R(color); RGB[1] = SG_GET_G(color); RGB[2] = SG_GET_B(color); break; case COLOR_MODE_RED: RGB[0] = (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3; break; case COLOR_MODE_BLUE: RGB[1] = RGB[2] = (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3; break; } m_Image_zMax[y][x] = z; } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline int C3D_MultiGrid_View_Control::_Get_Color(double value, double dim) { int Color; double iClass = m_cScale * (value - m_cMin); if( iClass < 0 ) { Color = m_pColors->Get_Color(0); } else if( iClass >= m_pColors->Get_Count() - 1 ) { Color = m_pColors->Get_Color(m_pColors->Get_Count() - 1); } else { int a = m_pColors->Get_Color( (int)iClass); int b = m_pColors->Get_Color(1 + (int)iClass); double d = iClass - (int)iClass; Color = SG_GET_RGB( SG_GET_R(a) + d * (SG_GET_R(b) - SG_GET_R(a)), SG_GET_G(a) + d * (SG_GET_G(b) - SG_GET_G(a)), SG_GET_B(a) + d * (SG_GET_B(b) - SG_GET_B(a)) ); } if( dim >= 0.0 ) { int r = (int)(dim * SG_GET_R(Color)); if( r < 0 ) r = 0; else if( r > 255 ) r = 255; int g = (int)(dim * SG_GET_G(Color)); if( g < 0 ) g = 0; else if( g > 255 ) g = 255; int b = (int)(dim * SG_GET_B(Color)); if( b < 0 ) b = 0; else if( b > 255 ) b = 255; Color = SG_GET_RGB(r, g, b); } return( Color ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void C3D_MultiGrid_View_Control::_Get_Projection(TNode &p) { TSG_Point_Z q; p.x = (p.x - r_xc) * r_Scale; p.y = (p.y - r_yc) * r_Scale; p.z = (p.z - r_zc) * r_Scale_z; double a = (r_cos_y * p.z + r_sin_y * (r_sin_z * p.y + r_cos_z * p.x)); double b = (r_cos_z * p.y - r_sin_z * p.x); q.x = r_cos_y * (r_sin_z * p.y + r_cos_z * p.x) - r_sin_y * p.z; q.y = r_sin_x * a + r_cos_x * b; q.z = r_cos_x * a - r_sin_x * b; q.x += m_xShift; q.y += m_yShift; q.z += m_zShift; if( m_bCentral ) { q.x *= m_dCentral / q.z; q.y *= m_dCentral / q.z; } else { double z = m_dCentral / m_zShift; q.x *= z; q.y *= z; // q.z = -q.z; } p.x = q.x + 0.5 * m_Image.GetWidth (); p.y = q.y + 0.5 * m_Image.GetHeight(); p.z = q.z; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_control.h000066400000000000000000000161701224124640700313320ustar00rootroot00000000000000/********************************************************** * Version $Id: 3d_multigrid_view_control.h 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3d_viewer // // // //-------------------------------------------------------// // // // 3d_multigrid_view_control.h // // // // Copyright (C) 2013 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__3d_multigrid_view_control_H #define HEADER_INCLUDED__3d_multigrid_view_control_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { COLOR_MODE_RGB, COLOR_MODE_RED, COLOR_MODE_BLUE }; //--------------------------------------------------------- typedef struct SNode { double x, y, z, c; } TNode; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class C3D_MultiGrid_View_Control : public wxPanel { public: C3D_MultiGrid_View_Control(wxWindow *pParent, CSG_Parameter_Grid_List *pGrids, int Field_Color, CSG_Parameters &Settings); virtual ~C3D_MultiGrid_View_Control(void); bool m_bCentral, m_bStereo, m_bFrame; int m_cField, m_Style, m_Shading; double m_xRotate, m_yRotate, m_zRotate, m_xShift, m_yShift, m_zShift, m_dCentral, m_Light_Hgt, m_Light_Dir; void Update_View (void); void Update_Extent (void); void On_Size (wxSizeEvent &event); void On_Paint (wxPaintEvent &event); void On_Key_Down (wxKeyEvent &event); void On_Mouse_LDown (wxMouseEvent &event); void On_Mouse_LUp (wxMouseEvent &event); void On_Mouse_RDown (wxMouseEvent &event); void On_Mouse_RUp (wxMouseEvent &event); void On_Mouse_MDown (wxMouseEvent &event); void On_Mouse_MUp (wxMouseEvent &event); void On_Mouse_Motion (wxMouseEvent &event); void On_Mouse_Wheel (wxMouseEvent &event); private: int m_Color_Mode, m_Size_Def; double m_xDown, m_yDown, m_cMin, m_cScale, m_Size_Scale, m_zMin, m_zMax; double r_sin_x, r_sin_y, r_sin_z, r_cos_x, r_cos_y, r_cos_z, r_xc, r_yc, r_zc, r_Scale, r_Scale_z; CSG_Rect m_Extent; CSG_Matrix m_Image_zMax; CSG_Parameters *m_pSettings; CSG_Colors *m_pColors; CSG_Parameter_Grid_List *m_pGrids; wxPoint m_Mouse_Down; wxImage m_Image; void _Set_Size (void); bool _Draw_Image (void); void _Draw_Grid (CSG_Grid *pGrid); void _Draw_Point (int iPoint); void _Draw_Point (int x, int y, double z, int color, int Size); void _Draw_Line (TNode a, TNode b, int Color); void _Draw_Triangle (TNode a, TNode b, TNode c, double c_NoData_Lo, double c_NoData_Hi); void _Draw_Triangle (TNode p[3], double dim); void _Draw_Triangle_Line (int y, double xa, double xb, double za, double zb, double ca, double cb, double dim); void _Draw_Background (void); void _Draw_Frame (void); void _Draw_Pixel (int x, int y, double z, int color); int _Get_Color (double value, double dim = -1.0); void _Get_Projection (TNode &p); DECLARE_EVENT_TABLE() }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__3d_multigrid_view_control_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_dialog.cpp000066400000000000000000000227641224124640700314520ustar00rootroot00000000000000/********************************************************** * Version $Id: 3d_multigrid_view_dialog.cpp 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3d_viewer // // // //-------------------------------------------------------// // // // 3d_multigrid_view_dialog.cpp // // // // Copyright (C) 2013 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "3d_multigrid_view_control.h" #include "3d_multigrid_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- BEGIN_EVENT_TABLE(C3D_MultiGrid_View_Dialog, CSGDI_Dialog) EVT_MOUSEWHEEL (C3D_MultiGrid_View_Dialog::On_Mouse_Wheel) EVT_BUTTON (wxID_ANY , C3D_MultiGrid_View_Dialog::On_Button) EVT_CHECKBOX (wxID_ANY , C3D_MultiGrid_View_Dialog::On_Update_Control) EVT_TEXT_ENTER (wxID_ANY , C3D_MultiGrid_View_Dialog::On_Update_Control) EVT_SLIDER (wxID_ANY , C3D_MultiGrid_View_Dialog::On_Update_Control) EVT_CHOICE (wxID_ANY , C3D_MultiGrid_View_Dialog::On_Update_Choices) END_EVENT_TABLE() //--------------------------------------------------------- C3D_MultiGrid_View_Dialog::C3D_MultiGrid_View_Dialog(CSG_Parameter_Grid_List *pGrids, int Field_Color) : CSGDI_Dialog(_TL("Multi-Grid 3D Viewer"), SGDI_DLG_STYLE_START_MAXIMISED) { SetWindowStyle(wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE); //----------------------------------------------------- m_Settings.Create(NULL, _TL("Viewer Settings"), _TL("")); m_pView = new C3D_MultiGrid_View_Control (this, pGrids, Field_Color, m_Settings); //----------------------------------------------------- wxArrayString Styles, Shadings; Styles .Add(_TL("faces and wire")); Styles .Add(_TL("faces")); Styles .Add(_TL("wire")); Shadings.Add(_TL("none")); Shadings.Add(_TL("shading")); Shadings.Add(_TL("shading (fixed light source)")); //----------------------------------------------------- Add_Button(_TL("Close"), wxID_OK); m_pBtn_Prop = Add_Button (_TL("Advanced Settings") , wxID_ANY); Add_Spacer(); m_pStyle = Add_Choice (_TL("Draw Style") , Styles , m_pView->m_Style); m_pShading = Add_Choice (_TL("Shading") , Shadings , m_pView->m_Shading); Add_Spacer(); m_pCheck_Central = Add_CheckBox (_TL("Central Projection") , m_pView->m_bCentral); m_pCheck_Stereo = Add_CheckBox (_TL("Anaglyph") , m_pView->m_bStereo); m_pCheck_Frame = Add_CheckBox (_TL("Bounding Box") , m_pView->m_bFrame); Add_Spacer(); m_pSlide_xRotate = Add_Slider (_TL("X-Rotation") , m_pView->m_xRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_yRotate = Add_Slider (_TL("Y-Rotation") , m_pView->m_yRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_zRotate = Add_Slider (_TL("Z-Rotation") , m_pView->m_zRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_Central = Add_Slider (_TL("Eye Distance") , m_pView->m_dCentral, 1.0, 2000.0); m_pSlide_Light_Hgt = Add_Slider (_TL("Light Source A") , m_pView->m_Light_Hgt, -M_PI_090, M_PI_090); m_pSlide_Light_Dir = Add_Slider (_TL("Light Source B") , m_pView->m_Light_Dir, -M_PI_360, M_PI_360); // Add_Spacer(); // m_pParameters = Add_TextCtrl (_TL("Function Parameters"), wxTE_MULTILINE|wxTE_READONLY); Add_Output(m_pView); } //--------------------------------------------------------- void C3D_MultiGrid_View_Dialog::On_Mouse_Wheel(wxMouseEvent &event) { m_pView->On_Mouse_Wheel(event); } //--------------------------------------------------------- void C3D_MultiGrid_View_Dialog::On_Update_Control(wxCommandEvent &event) { if( event.GetEventObject() == m_pCheck_Central ) { m_pView->m_bCentral = m_pCheck_Central ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pCheck_Stereo ) { m_pView->m_bStereo = m_pCheck_Stereo ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pCheck_Frame ) { m_pView->m_bFrame = m_pCheck_Frame ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pSlide_xRotate ) { m_pView->m_xRotate = m_pSlide_xRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_yRotate ) { m_pView->m_yRotate = m_pSlide_yRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_zRotate ) { m_pView->m_zRotate = m_pSlide_zRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_Central ) { m_pView->m_dCentral = m_pSlide_Central ->Get_Value(); } else if( event.GetEventObject() == m_pSlide_Light_Dir ) { m_pView->m_Light_Dir = m_pSlide_Light_Dir->Get_Value(); } else if( event.GetEventObject() == m_pSlide_Light_Hgt ) { m_pView->m_Light_Hgt = m_pSlide_Light_Hgt->Get_Value(); } else { return; } m_pView->Update_View(); } //--------------------------------------------------------- void C3D_MultiGrid_View_Dialog::On_Update_Choices(wxCommandEvent &event) { if( event.GetEventObject() == m_pField_Color ) { m_Settings("C_RANGE")->asRange()->Set_Range(0.0, 0.0); m_pView ->m_cField = m_pField_Color->GetSelection(); m_pView ->Update_Extent(); } else if( event.GetEventObject() == m_pStyle ) { m_pView ->m_Style = m_pStyle->GetSelection(); m_pView ->Update_View(); } else if( event.GetEventObject() == m_pShading ) { m_pView ->m_Shading = m_pShading->GetSelection(); m_pView ->Update_View(); } else { return; } } //--------------------------------------------------------- void C3D_MultiGrid_View_Dialog::On_Button(wxCommandEvent &event) { if( event.GetEventObject() == m_pBtn_Prop ) { if( SG_UI_Dlg_Parameters(&m_Settings, m_Settings.Get_Name()) ) { m_pView ->Update_View(); } } else { event.Skip(); } } //--------------------------------------------------------- void C3D_MultiGrid_View_Dialog::Update_Rotation(void) { double d; d = fmod(M_RAD_TO_DEG * m_pView->m_xRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_xRotate->Set_Value(d); d = fmod(M_RAD_TO_DEG * m_pView->m_yRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_yRotate->Set_Value(d); d = fmod(M_RAD_TO_DEG * m_pView->m_zRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_zRotate->Set_Value(d); m_pCheck_Stereo ->SetValue(m_pView->m_bStereo); m_pCheck_Frame ->SetValue(m_pView->m_bFrame); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_dialog.h000066400000000000000000000124621224124640700311110ustar00rootroot00000000000000/********************************************************** * Version $Id: 3d_multigrid_view_dialog.h 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3d_viewer // // // //-------------------------------------------------------// // // // 3d_multigrid_view_dialog.h // // // // Copyright (C) 2013 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__3d_multigrid_view_dialog_H #define HEADER_INCLUDED__3d_multigrid_view_dialog_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class C3D_MultiGrid_View_Dialog : public CSGDI_Dialog { public: C3D_MultiGrid_View_Dialog(CSG_Parameter_Grid_List *pShapes, int Field_Color); void Update_Rotation (void); private: wxButton *m_pBtn_Prop; wxCheckBox *m_pCheck_Central, *m_pCheck_Stereo, *m_pCheck_Frame; wxChoice *m_pField_Color, *m_pStyle, *m_pShading; wxTextCtrl *m_pFormula, *m_pParameters; CSGDI_Slider *m_pSlide_xRotate, *m_pSlide_yRotate, *m_pSlide_zRotate, *m_pSlide_Central, *m_pSlide_Light_Hgt, *m_pSlide_Light_Dir; class C3D_MultiGrid_View_Control *m_pView; CSG_Parameters m_Settings; void On_Update_Control (wxCommandEvent &event); void On_Update_Choices (wxCommandEvent &event); void On_Button (wxCommandEvent &event); void On_Mouse_Wheel (wxMouseEvent &event); DECLARE_EVENT_TABLE() }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__3d_multigrid_view_dialog_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_module.cpp000066400000000000000000000115051224124640700314670ustar00rootroot00000000000000/********************************************************** * Version $Id: 3d_multigrid_view_module.cpp 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3d_viewer // // // //-------------------------------------------------------// // // // 3d_multigrid_view_module.cpp // // // // Copyright (C) 2013 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute for Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "3d_multigrid_view_module.h" #include "3d_multigrid_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- C3D_MultiGrid_View_Module::C3D_MultiGrid_View_Module(void) { //----------------------------------------------------- Set_Name (_TL("Multi-Grid 3D Viewer")); Set_Author (SG_T("O. Conrad (c) 2013")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool C3D_MultiGrid_View_Module::On_Execute(void) { if( !SG_UI_Get_Window_Main() ) { Message_Add(_TL("multi-grid viewer can only be run from graphical user interface")); return( false ); } CSG_Parameter_Grid_List *pGrids = Parameters("GRIDS")->asGridList(); if( pGrids->Get_Count() <= 0 ) { Message_Add(_TL("multi-grid viewer will not be started")); return( false ); } C3D_MultiGrid_View_Dialog dlg(pGrids, 0); dlg.ShowModal(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3d_multigrid_view_module.h000066400000000000000000000101421224124640700311300ustar00rootroot00000000000000/********************************************************** * Version $Id: 3d_multigrid_view_module.h 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3d_viewer // // // //-------------------------------------------------------// // // // 3d_multigrid_view_module.h // // // // Copyright (C) 2013 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__3d_multigrid_view_module_H #define HEADER_INCLUDED__3d_multigrid_view_module_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class C3D_MultiGrid_View_Module : public CSG_Module { public: C3D_MultiGrid_View_Module(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__points_view_module_H saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.cpp000066400000000000000000000667711224124640700310250ustar00rootroot00000000000000/********************************************************** * Version $Id: 3dshapes_view_control.cpp 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3dshapes_viewer // // // //-------------------------------------------------------// // // // 3dshapes_view_control.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include #include #include #include //--------------------------------------------------------- #include "3dshapes_view_control.h" #include "3dshapes_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define m_Settings (*m_pSettings) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- BEGIN_EVENT_TABLE(C3DShapes_View_Control, wxPanel) EVT_SIZE (C3DShapes_View_Control::On_Size) EVT_PAINT (C3DShapes_View_Control::On_Paint) EVT_KEY_DOWN (C3DShapes_View_Control::On_Key_Down) EVT_LEFT_DOWN (C3DShapes_View_Control::On_Mouse_LDown) EVT_LEFT_UP (C3DShapes_View_Control::On_Mouse_LUp) EVT_RIGHT_DOWN (C3DShapes_View_Control::On_Mouse_RDown) EVT_RIGHT_UP (C3DShapes_View_Control::On_Mouse_RUp) EVT_MIDDLE_DOWN (C3DShapes_View_Control::On_Mouse_MDown) EVT_MIDDLE_UP (C3DShapes_View_Control::On_Mouse_MUp) EVT_MOTION (C3DShapes_View_Control::On_Mouse_Motion) EVT_MOUSEWHEEL (C3DShapes_View_Control::On_Mouse_Wheel) END_EVENT_TABLE() /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- C3DShapes_View_Control::C3DShapes_View_Control(wxWindow *pParent, CSG_Shapes *pShapes, int Field_Color, CSG_Parameters &Settings) : wxPanel(pParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxSUNKEN_BORDER|wxNO_FULL_REPAINT_ON_RESIZE) { m_pShapes = pShapes; m_pSettings = &Settings; m_cField = Field_Color; m_Shading = 1; m_Style = 1; m_cWire = SG_GET_RGB(150, 150, 150); m_xRotate = 0.0; m_yRotate = 0.0; m_zRotate = 0.0; m_xShift = 0.0; m_yShift = 0.0; m_zShift = 1000.0; m_bCentral = true; m_bStereo = false; m_bFrame = true; m_Light_Hgt = 45.0 * M_DEG_TO_RAD; m_Light_Dir = 90.0 * M_DEG_TO_RAD; m_dCentral = 500.0; //----------------------------------------------------- CSG_Parameter *pNode = m_pSettings->Add_Node(NULL, "NODE_CONTROL", _TL("3D View"), _TL("")); m_pSettings->Add_Colors( pNode , "COLORS" , _TL("Colors"), _TL("") ); m_pSettings->Add_Value( pNode , "BGCOLOR" , _TL("Background Color"), _TL(""), PARAMETER_TYPE_Color, 0 ); m_pSettings->Add_Range( pNode , "C_RANGE" , _TL("Colors Value Range"), _TL("") ); m_pSettings->Add_Value( pNode , "COLOR_WIRE" , _TL("Wire Frame Color"), _TL(""), PARAMETER_TYPE_Color, m_cWire ); m_pSettings->Add_Value( pNode , "SIZE_DEF" , _TL("Point Size: Default"), _TL(""), PARAMETER_TYPE_Int, 0, 0, true ); m_pSettings->Add_Value( pNode , "SIZE_SCALE" , _TL("Point Size: Scaling"), _TL(""), PARAMETER_TYPE_Double, 250.0, 1.0, true ); m_pSettings->Add_Value( pNode , "EXAGGERATION" , _TL("Exaggeration"), _TL(""), PARAMETER_TYPE_Double, 1.0 ); m_pSettings->Add_Value( pNode , "STEREO_DIST" , _TL("Stereo Eye Distance [Degree]"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); //----------------------------------------------------- Update_Extent(); } //--------------------------------------------------------- C3DShapes_View_Control::~C3DShapes_View_Control(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void C3DShapes_View_Control::On_Size(wxSizeEvent &event) { _Set_Size(); event.Skip(); } //--------------------------------------------------------- void C3DShapes_View_Control::On_Paint(wxPaintEvent &WXUNUSED(event)) { if( m_Image.IsOk() && m_Image.GetWidth() > 0 && m_Image.GetHeight() > 0 ) { wxPaintDC dc(this); dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false); } } //--------------------------------------------------------- void C3DShapes_View_Control::Update_View(void) { if( _Draw_Image() ) { wxClientDC dc(this); dc.DrawBitmap(wxBitmap(m_Image), 0, 0, false); } } //--------------------------------------------------------- void C3DShapes_View_Control::Update_Extent(void) { m_Extent.Assign(m_pShapes->Get_Extent()); m_zStats.Invalidate(); m_cStats.Invalidate(); for(int iShape=0; iShapeGet_Count(); iShape++) { CSG_Shape *pShape = m_pShapes->Get_Shape(iShape); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { m_zStats.Add_Value(pShape->Get_Z(iPoint, iPart)); } } m_cStats.Add_Value(pShape->asDouble(m_cField)); } m_Settings("C_RANGE")->asRange()->Set_Range( m_cStats.Get_Mean() - 1.5 * m_cStats.Get_StdDev(), m_cStats.Get_Mean() + 1.5 * m_cStats.Get_StdDev() ); Update_View(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void C3DShapes_View_Control::On_Key_Down(wxKeyEvent &event) { switch( event.GetKeyCode() ) { default: event.Skip(); return; case WXK_NUMPAD_ADD: case WXK_ADD: m_xRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_SUBTRACT: case WXK_SUBTRACT: m_xRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_F3: m_yRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_F4: m_yRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_MULTIPLY: case WXK_MULTIPLY: m_zRotate -= 4.0 * M_DEG_TO_RAD; break; case WXK_NUMPAD_DIVIDE: case WXK_DIVIDE: m_zRotate += 4.0 * M_DEG_TO_RAD; break; case WXK_INSERT: m_xShift -= 10.0; break; case WXK_DELETE: m_xShift += 10.0; break; case WXK_HOME: m_yShift -= 10.0; break; case WXK_END: m_yShift += 10.0; break; case WXK_PAGEUP: m_zShift -= 10.0; break; case WXK_PAGEDOWN: m_zShift += 10.0; break; case 'A': m_bStereo = !m_bStereo; break; case WXK_F1: m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() + 0.5); break; case WXK_F2: m_Settings("EXAGGERATION")->Set_Value(m_Settings("EXAGGERATION")->asDouble() - 0.5); break; case WXK_F5: m_Settings("SIZE_DEF") ->Set_Value(m_Settings("SIZE_DEF") ->asDouble() - 1.0); break; case WXK_F6: m_Settings("SIZE_DEF") ->Set_Value(m_Settings("SIZE_DEF") ->asDouble() + 1.0); break; case WXK_F7: m_Settings("SIZE_SCALE") ->Set_Value(m_Settings("SIZE_SCALE") ->asDouble() - 10.0); break; case WXK_F8: m_Settings("SIZE_SCALE") ->Set_Value(m_Settings("SIZE_SCALE") ->asDouble() + 10.0); break; } Update_View(); ((C3DShapes_View_Dialog *)GetParent())->Update_Rotation(); } //--------------------------------------------------------- #define GET_MOUSE_X_RELDIFF ((double)(m_Mouse_Down.x - event.GetX()) / (double)GetClientSize().x) #define GET_MOUSE_Y_RELDIFF ((double)(m_Mouse_Down.y - event.GetY()) / (double)GetClientSize().y) //--------------------------------------------------------- void C3DShapes_View_Control::On_Mouse_LDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_zRotate; m_yDown = m_xRotate; CaptureMouse(); } void C3DShapes_View_Control::On_Mouse_LUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_zRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_xRotate = m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180; Update_View(); ((C3DShapes_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void C3DShapes_View_Control::On_Mouse_RDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_xShift; m_yDown = m_yShift; CaptureMouse(); } void C3DShapes_View_Control::On_Mouse_RUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_xShift = m_xDown - GET_MOUSE_X_RELDIFF * 1000.0; m_yShift = m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0; Update_View(); ((C3DShapes_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void C3DShapes_View_Control::On_Mouse_MDown(wxMouseEvent &event) { SetFocus(); m_Mouse_Down = event.GetPosition(); m_xDown = m_yRotate; m_yDown = m_zShift; CaptureMouse(); } void C3DShapes_View_Control::On_Mouse_MUp(wxMouseEvent &event) { if( HasCapture() ) { ReleaseMouse(); } if( m_Mouse_Down.x != event.GetX() || m_Mouse_Down.y != event.GetY() ) { m_yRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_zShift = m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0; Update_View(); ((C3DShapes_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void C3DShapes_View_Control::On_Mouse_Motion(wxMouseEvent &event) { if( HasCapture() && event.Dragging() ) { if( event.LeftIsDown() ) { m_zRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_xRotate = m_yDown + GET_MOUSE_Y_RELDIFF * M_PI_180; } else if( event.RightIsDown() ) { m_xShift = m_xDown - GET_MOUSE_X_RELDIFF * 1000.0; m_yShift = m_yDown - GET_MOUSE_Y_RELDIFF * 1000.0; } else if( event.MiddleIsDown() ) { m_yRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_zShift = m_yDown + GET_MOUSE_Y_RELDIFF * 1000.0; } else { return; } Update_View(); ((C3DShapes_View_Dialog *)GetParent())->Update_Rotation(); } } //--------------------------------------------------------- void C3DShapes_View_Control::On_Mouse_Wheel(wxMouseEvent &event) { if( event.GetWheelRotation() ) { m_zShift += 0.5 * event.GetWheelRotation(); Update_View(); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void C3DShapes_View_Control::_Set_Size(void) { Update_View(); } //--------------------------------------------------------- bool C3DShapes_View_Control::_Draw_Image(void) { wxSize dcSize = GetClientSize(); if( m_pShapes->Get_Count() <= 0 || dcSize.x <= 0 || dcSize.y <= 0 || m_Extent.Get_XRange() <= 0.0 || m_Extent.Get_YRange() <= 0.0 || m_cField < 0 || m_cField >= m_pShapes->Get_Field_Count() || m_zStats.Get_Range() <= 0.0 ) { return( false ); } //------------------------------------------------- if( !m_Image.IsOk() || dcSize.x != m_Image.GetWidth() || dcSize.y != m_Image.GetHeight() ) { m_Image .Create(dcSize.x, dcSize.y); m_Image_zMax.Create(dcSize.x, dcSize.y); } //------------------------------------------------- if( m_Settings("C_RANGE")->asRange()->Get_LoVal() >= m_Settings("C_RANGE")->asRange()->Get_HiVal() ) { m_Settings("C_RANGE")->asRange()->Set_Range( m_cStats.Get_Mean() - 1.5 * m_pShapes->Get_StdDev(m_cField), m_cStats.Get_Mean() + 1.5 * m_pShapes->Get_StdDev(m_cField) ); } m_pColors = m_Settings("COLORS")->asColors(); m_cMin = m_Settings("C_RANGE")->asRange()->Get_LoVal(); m_cScale = m_pColors->Get_Count() / (m_Settings("C_RANGE")->asRange()->Get_HiVal() - m_cMin); m_cWire = m_Settings("COLOR_WIRE")->asColor(); //------------------------------------------------- r_Scale = (m_Image.GetWidth() / (double)m_Image.GetHeight()) > (m_Extent.Get_XRange() / m_Extent.Get_YRange()) ? m_Image.GetWidth () / m_Extent.Get_XRange() : m_Image.GetHeight() / m_Extent.Get_YRange(); r_sin_x = sin(m_xRotate - M_PI_180); r_cos_x = cos(m_xRotate - M_PI_180); r_sin_y = sin(m_yRotate); r_cos_y = cos(m_yRotate); r_sin_z = sin(m_zRotate); r_cos_z = cos(m_zRotate); r_xc = m_Extent.Get_XCenter(); r_yc = m_Extent.Get_YCenter(); r_zc = m_zStats.Get_Minimum() + 0.5 * m_zStats.Get_Range(); r_Scale_z = r_Scale * m_Settings("EXAGGERATION")->asDouble(); //------------------------------------------------- m_Size_Def = m_Settings("SIZE_DEF")->asInt(); m_Size_Scale = 1.0 / m_Settings("SIZE_SCALE")->asDouble(); _Draw_Background(); //------------------------------------------------- if( m_bStereo == false ) { m_Image_zMax.Assign(999999.0); m_Color_Mode = COLOR_MODE_RGB; for(int i=0; iGet_Count(); i++) { _Draw_Shape(m_pShapes->Get_Shape(i)); } _Draw_Frame(); } //------------------------------------------------- else { int i; double d = m_Settings("STEREO_DIST")->asDouble() / 2.0; m_Image_zMax.Assign(999999.0); r_sin_y = sin(m_yRotate - d * M_DEG_TO_RAD); r_cos_y = cos(m_yRotate - d * M_DEG_TO_RAD); m_Color_Mode = COLOR_MODE_RED; for(i=0; iGet_Count(); i++) { _Draw_Shape(m_pShapes->Get_Shape(i)); } _Draw_Frame(); m_Image_zMax.Assign(999999.0); r_sin_y = sin(m_yRotate + d * M_DEG_TO_RAD); r_cos_y = cos(m_yRotate + d * M_DEG_TO_RAD); m_Color_Mode = COLOR_MODE_BLUE; for(i=0; iGet_Count(); i++) { _Draw_Shape(m_pShapes->Get_Shape(i)); } _Draw_Frame(); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void C3DShapes_View_Control::_Draw_Shape(CSG_Shape *pShape) { int c; TSG_Point p; TNode a, b; c = _Get_Color(pShape->asDouble(m_cField)); for(int iPart=0; iPartGet_Part_Count(); iPart++) { switch( pShape->Get_Type() ) { case SHAPE_TYPE_Point: { p = pShape->Get_Point(0); a.x = p.x; a.y = p.y; a.z = pShape->Get_Z(0); _Get_Projection(a); _Draw_Point(a.x, a.y, a.z, c, 1); } break; case SHAPE_TYPE_Line: { p = pShape->Get_Point(0); a.x = p.x; a.y = p.y; a.z = pShape->Get_Z(0); _Get_Projection(a); for(int iPoint=1; iPointGet_Point_Count(iPart); iPoint++) { b = a; p = pShape->Get_Point(iPoint, iPart); a.x = p.x; a.y = p.y; a.z = pShape->Get_Z(iPoint, iPart); _Get_Projection(a); _Draw_Line(a, b, c); } } break; case SHAPE_TYPE_Polygon: { p = pShape->Get_Point(pShape->Get_Point_Count(iPart) - 1, iPart); a.x = p.x; a.y = p.y; a.z = pShape->Get_Z(pShape->Get_Point_Count(iPart) - 1); _Get_Projection(a); for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { b = a; p = pShape->Get_Point(iPoint, iPart); a.x = p.x; a.y = p.y; a.z = pShape->Get_Z(iPoint, iPart); _Get_Projection(a); _Draw_Line(a, b, c); } } break; } } } //--------------------------------------------------------- inline void C3DShapes_View_Control::_Draw_Point(int x, int y, double z, int color, int size) { if( z > 0.0 ) { _Draw_Pixel(x, y, z, color); if( size > 0 && size < 50 ) { for(int iy=1; iy<=size; iy++) { for(int ix=0; ix<=size; ix++) { if( ix*ix + iy*iy <= size*size ) { _Draw_Pixel(x + ix, y + iy, z, color); _Draw_Pixel(x + iy, y - ix, z, color); _Draw_Pixel(x - ix, y - iy, z, color); _Draw_Pixel(x - iy, y + ix, z, color); } } } } } } //--------------------------------------------------------- inline void C3DShapes_View_Control::_Draw_Line(TNode a, TNode b, int Color) { if( (a.x < 0 && b.x < 0) || (a.x >= m_Image.GetWidth () && b.x >= m_Image.GetWidth ()) || (a.y < 0 && b.y < 0) || (a.y >= m_Image.GetHeight() && b.y >= m_Image.GetHeight()) ) { return; } double i, n, dx, dy, dz; dx = b.x - a.x; dy = b.y - a.y; dz = b.z - a.z; if( b.z < 0.0 || a.z < 0.0 ) return; if( fabs(dx) > fabs(dy) && fabs(dx) > 0.0 ) { n = fabs(dx); dx = dx < 0 ? -1 : 1; dy /= n; dz /= n; } else if( fabs(dy) > 0.0 ) { n = fabs(dy); dx /= n; dy = dy < 0 ? -1 : 1; dz /= n; } else { _Draw_Pixel((int)a.x, (int)a.y, a.z, Color); return; } //----------------------------------------------------- for(i=0; i<=n; i++, a.x+=dx, a.y+=dy, a.z+=dz) { _Draw_Pixel((int)a.x, (int)a.y, a.z, Color); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void C3DShapes_View_Control::_Draw_Triangle(TNode p[3], double dim) { if( p[0].z < 0.0 || p[1].z < 0.0 || p[2].z < 0.0 ) return; //----------------------------------------------------- if( p[1].y < p[0].y ) { TNode pp = p[1]; p[1] = p[0]; p[0] = pp; } if( p[2].y < p[0].y ) { TNode pp = p[2]; p[2] = p[0]; p[0] = pp; } if( p[2].y < p[1].y ) { TNode pp = p[2]; p[2] = p[1]; p[1] = pp; } //----------------------------------------------------- TSG_Rect r; r.yMin = p[0].y; r.yMax = p[2].y; r.xMin = p[0].x < p[1].x ? (p[0].x < p[2].x ? p[0].x : p[2].x) : (p[1].x < p[2].x ? p[1].x : p[2].x); r.xMax = p[0].x > p[1].x ? (p[0].x > p[2].x ? p[0].x : p[2].x) : (p[1].x > p[2].x ? p[1].x : p[2].x); if( r.yMin >= r.yMax || r.xMin >= r.xMax ) { return; // no area } if( (r.yMin < 0.0 && r.yMax < 0.0) || (r.yMin >= m_Image.GetHeight() && r.yMax >= m_Image.GetHeight()) || (r.xMin < 0.0 && r.xMax < 0.0) || (r.xMin >= m_Image.GetWidth () && r.xMax >= m_Image.GetWidth ()) ) { return; // completely outside grid } //----------------------------------------------------- TNode d[3]; if( (d[0].y = p[2].y - p[0].y) > 0.0 ) { d[0].x = (p[2].x - p[0].x) / d[0].y; d[0].z = (p[2].z - p[0].z) / d[0].y; d[0].c = (p[2].c - p[0].c) / d[0].y; } if( (d[1].y = p[1].y - p[0].y) > 0.0 ) { d[1].x = (p[1].x - p[0].x) / d[1].y; d[1].z = (p[1].z - p[0].z) / d[1].y; d[1].c = (p[1].c - p[0].c) / d[1].y; } if( (d[2].y = p[2].y - p[1].y) > 0.0 ) { d[2].x = (p[2].x - p[1].x) / d[2].y; d[2].z = (p[2].z - p[1].z) / d[2].y; d[2].c = (p[2].c - p[1].c) / d[2].y; } //----------------------------------------------------- int ay = (int)r.yMin; if( ay < 0 ) ay = 0; if( ay < r.yMin ) ay++; int by = (int)r.yMax; if( by >= m_Image.GetHeight() ) by = m_Image.GetHeight() - 1; for(int y=ay; y<=by; y++) { if( y <= p[1].y && d[1].y > 0.0 ) { _Draw_Triangle_Line(y, p[0].x + (y - p[0].y) * d[0].x, p[0].x + (y - p[0].y) * d[1].x, p[0].z + (y - p[0].y) * d[0].z, p[0].z + (y - p[0].y) * d[1].z, p[0].c + (y - p[0].y) * d[0].c, p[0].c + (y - p[0].y) * d[1].c, dim ); } else if( d[2].y > 0.0 ) { _Draw_Triangle_Line(y, p[0].x + (y - p[0].y) * d[0].x, p[1].x + (y - p[1].y) * d[2].x, p[0].z + (y - p[0].y) * d[0].z, p[1].z + (y - p[1].y) * d[2].z, p[0].c + (y - p[0].y) * d[0].c, p[1].c + (y - p[1].y) * d[2].c, dim ); } } } //--------------------------------------------------------- inline void C3DShapes_View_Control::_Draw_Triangle_Line(int y, double xa, double xb, double za, double zb, double ca, double cb, double dim) { if( xb < xa ) { double d; d = xa; xa = xb; xb = d; d = za; za = zb; zb = d; d = ca; ca = cb; cb = d; } if( xb > xa ) { double dz = (zb - za) / (xb - xa); double dc = (cb - ca) / (xb - xa); int ax = (int)xa; if( ax < 0 ) ax = 0; if( ax < xa ) ax++; int bx = (int)xb; if( bx >= m_Image.GetWidth() ) bx = m_Image.GetWidth() - 1; for(int x=ax; x<=bx; x++) { double z = za + dz * (x - xa); double c = ca + dc * (x - xa); _Draw_Pixel(x, y, z, _Get_Color(c, dim)); } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void C3DShapes_View_Control::_Draw_Background(void) { BYTE r, g, b, *pRGB; int i, n, color; color = m_Settings("BGCOLOR")->asColor(); if( m_bStereo ) { color = (int)((SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3.0); color = SG_GET_RGB(color, color, color); } r = SG_GET_R(color); g = SG_GET_G(color); b = SG_GET_B(color); n = m_Image.GetWidth() * m_Image.GetHeight(); for(i=0, pRGB=m_Image.GetData(); iasColor(); color = SG_GET_RGB(SG_GET_R(color) + 128, SG_GET_G(color) + 128, SG_GET_B(color) + 128); for(int i=0; i<2; i++) { p[i][0].x = r.Get_XMin(); p[i][0].y = r.Get_YMin(); p[i][1].x = r.Get_XMax(); p[i][1].y = r.Get_YMin(); p[i][2].x = r.Get_XMax(); p[i][2].y = r.Get_YMax(); p[i][3].x = r.Get_XMin(); p[i][3].y = r.Get_YMax(); p[i][0].z = p[i][1].z = p[i][2].z = p[i][3].z = i == 0 ? m_zStats.Get_Minimum() - buffer * m_zStats.Get_Range() / 100.0 : m_zStats.Get_Maximum() + buffer * m_zStats.Get_Range() / 100.0; for(int j=0; j<4; j++) { _Get_Projection(p[i][j]); } _Draw_Line(p[i][0], p[i][1], color); _Draw_Line(p[i][1], p[i][2], color); _Draw_Line(p[i][2], p[i][3], color); _Draw_Line(p[i][3], p[i][0], color); } _Draw_Line(p[0][0], p[1][0], color); _Draw_Line(p[0][1], p[1][1], color); _Draw_Line(p[0][2], p[1][2], color); _Draw_Line(p[0][3], p[1][3], color); } //--------------------------------------------------------- inline void C3DShapes_View_Control::_Draw_Pixel(int x, int y, double z, int color) { if( x >= 0 && x < m_Image.GetWidth() && y >= 0 && y < m_Image.GetHeight() && z < m_Image_zMax[y][x] ) { BYTE *RGB = m_Image.GetData() + 3 * (y * m_Image.GetWidth() + x); switch( m_Color_Mode ) { case COLOR_MODE_RGB: RGB[0] = SG_GET_R(color); RGB[1] = SG_GET_G(color); RGB[2] = SG_GET_B(color); break; case COLOR_MODE_RED: RGB[0] = (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3; break; case COLOR_MODE_BLUE: RGB[1] = RGB[2] = (SG_GET_R(color) + SG_GET_G(color) + SG_GET_B(color)) / 3; break; } m_Image_zMax[y][x] = z; } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline int C3DShapes_View_Control::_Get_Color(double value, double dim) { int Color = (int)(m_cScale * (value - m_cMin)); Color = m_pColors->Get_Color(Color < 0 ? 0 : (Color >= m_pColors->Get_Count() ? m_pColors->Get_Count() - 1 : Color)); if( dim >= 0.0 ) { int r = (int)(dim * SG_GET_R(Color)); if( r < 0 ) r = 0; else if( r > 255 ) r = 255; int g = (int)(dim * SG_GET_G(Color)); if( g < 0 ) g = 0; else if( g > 255 ) g = 255; int b = (int)(dim * SG_GET_B(Color)); if( b < 0 ) b = 0; else if( b > 255 ) b = 255; Color = SG_GET_RGB(r, g, b); } return( Color ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline void C3DShapes_View_Control::_Get_Projection(TNode &p) { TSG_Point_Z q; p.x = (p.x - r_xc) * r_Scale; p.y = (p.y - r_yc) * r_Scale; p.z = (p.z - r_zc) * r_Scale_z; double a = (r_cos_y * p.z + r_sin_y * (r_sin_z * p.y + r_cos_z * p.x)); double b = (r_cos_z * p.y - r_sin_z * p.x); q.x = r_cos_y * (r_sin_z * p.y + r_cos_z * p.x) - r_sin_y * p.z; q.y = r_sin_x * a + r_cos_x * b; q.z = r_cos_x * a - r_sin_x * b; q.x += m_xShift; q.y += m_yShift; q.z += m_zShift; if( m_bCentral ) { q.x *= m_dCentral / q.z; q.y *= m_dCentral / q.z; } else { double z = m_dCentral / m_zShift; q.x *= z; q.y *= z; // q.z = -q.z; } p.x = q.x + 0.5 * m_Image.GetWidth (); p.y = q.y + 0.5 * m_Image.GetHeight(); p.z = q.z; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_control.h000066400000000000000000000160171224124640700304560ustar00rootroot00000000000000/********************************************************** * Version $Id: 3dshapes_view_control.h 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3dshapes_viewer // // // //-------------------------------------------------------// // // // 3dshapes_view_control.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__3dshapes_view_control_H #define HEADER_INCLUDED__3dshapes_view_control_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { COLOR_MODE_RGB, COLOR_MODE_RED, COLOR_MODE_BLUE }; //--------------------------------------------------------- typedef struct SNode { double x, y, z, c; } TNode; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class C3DShapes_View_Control : public wxPanel { public: C3DShapes_View_Control(wxWindow *pParent, CSG_Shapes *pShapes, int Field_Color, CSG_Parameters &Settings); virtual ~C3DShapes_View_Control(void); bool m_bCentral, m_bStereo, m_bFrame; int m_cField, m_Style, m_Shading; double m_xRotate, m_yRotate, m_zRotate, m_xShift, m_yShift, m_zShift, m_dCentral, m_Light_Hgt, m_Light_Dir; void Update_View (void); void Update_Extent (void); void On_Size (wxSizeEvent &event); void On_Paint (wxPaintEvent &event); void On_Key_Down (wxKeyEvent &event); void On_Mouse_LDown (wxMouseEvent &event); void On_Mouse_LUp (wxMouseEvent &event); void On_Mouse_RDown (wxMouseEvent &event); void On_Mouse_RUp (wxMouseEvent &event); void On_Mouse_MDown (wxMouseEvent &event); void On_Mouse_MUp (wxMouseEvent &event); void On_Mouse_Motion (wxMouseEvent &event); void On_Mouse_Wheel (wxMouseEvent &event); private: int m_Color_Mode, m_Size_Def, m_cWire; double m_xDown, m_yDown, m_cMin, m_cScale, m_Size_Scale; double r_sin_x, r_sin_y, r_sin_z, r_cos_x, r_cos_y, r_cos_z, r_xc, r_yc, r_zc, r_Scale, r_Scale_z; CSG_Rect m_Extent; CSG_Matrix m_Image_zMax; CSG_Simple_Statistics m_zStats, m_cStats; CSG_Parameters *m_pSettings; CSG_Colors *m_pColors; CSG_Shapes *m_pShapes; wxPoint m_Mouse_Down; wxImage m_Image; void _Set_Size (void); bool _Draw_Image (void); void _Draw_Shape (CSG_Shape *pShape); void _Draw_Point (int iPoint); void _Draw_Point (int x, int y, double z, int color, int Size); void _Draw_Line (TNode a, TNode b, int Color); void _Draw_Triangle (TNode p[3], double dim); void _Draw_Triangle_Line (int y, double xa, double xb, double za, double zb, double ca, double cb, double dim); void _Draw_Background (void); void _Draw_Frame (void); void _Draw_Pixel (int x, int y, double z, int color); int _Get_Color (double value, double dim = -1.0); void _Get_Projection (TNode &p); DECLARE_EVENT_TABLE() }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__3dshapes_view_control_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_dialog.cpp000066400000000000000000000231571224124640700305730ustar00rootroot00000000000000/********************************************************** * Version $Id: 3dshapes_view_dialog.cpp 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3dshapes_viewer // // // //-------------------------------------------------------// // // // 3dshapes_view_dialog.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "3dshapes_view_control.h" #include "3dshapes_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- BEGIN_EVENT_TABLE(C3DShapes_View_Dialog, CSGDI_Dialog) EVT_MOUSEWHEEL (C3DShapes_View_Dialog::On_Mouse_Wheel) EVT_BUTTON (wxID_ANY , C3DShapes_View_Dialog::On_Button) EVT_CHECKBOX (wxID_ANY , C3DShapes_View_Dialog::On_Update_Control) EVT_TEXT_ENTER (wxID_ANY , C3DShapes_View_Dialog::On_Update_Control) EVT_SLIDER (wxID_ANY , C3DShapes_View_Dialog::On_Update_Control) EVT_CHOICE (wxID_ANY , C3DShapes_View_Dialog::On_Update_Choices) END_EVENT_TABLE() //--------------------------------------------------------- C3DShapes_View_Dialog::C3DShapes_View_Dialog(CSG_Shapes *pShapes, int Field_Color) : CSGDI_Dialog(_TL("Simple 3D Shapes Viewer"), SGDI_DLG_STYLE_START_MAXIMISED) { SetWindowStyle(wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE); //----------------------------------------------------- m_Settings.Create(NULL, _TL("Viewer Settings"), _TL("")); m_pView = new C3DShapes_View_Control (this, pShapes, Field_Color, m_Settings); //----------------------------------------------------- wxArrayString Attributes, Styles, Shadings; for(int i=0; iGet_Field_Count(); i++) { Attributes.Add(pShapes->Get_Field_Name(i)); } Styles .Add(_TL("faces and wire")); Styles .Add(_TL("faces")); Styles .Add(_TL("wire")); Shadings.Add(_TL("none")); Shadings.Add(_TL("shading")); Shadings.Add(_TL("shading (fixed light source)")); //----------------------------------------------------- Add_Button(_TL("Close"), wxID_OK); m_pBtn_Prop = Add_Button (_TL("Advanced Settings") , wxID_ANY); Add_Spacer(); m_pField_Color = Add_Choice (_TL("Color Attribute") , Attributes, m_pView->m_cField); m_pStyle = Add_Choice (_TL("Draw Style") , Styles , m_pView->m_Style); m_pShading = Add_Choice (_TL("Shading") , Shadings , m_pView->m_Shading); Add_Spacer(); m_pCheck_Central = Add_CheckBox (_TL("Central Projection") , m_pView->m_bCentral); m_pCheck_Stereo = Add_CheckBox (_TL("Anaglyph") , m_pView->m_bStereo); m_pCheck_Frame = Add_CheckBox (_TL("Bounding Box") , m_pView->m_bFrame); Add_Spacer(); m_pSlide_xRotate = Add_Slider (_TL("X-Rotation") , m_pView->m_xRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_yRotate = Add_Slider (_TL("Y-Rotation") , m_pView->m_yRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_zRotate = Add_Slider (_TL("Z-Rotation") , m_pView->m_zRotate * M_RAD_TO_DEG, -180.0, 180.0); m_pSlide_Central = Add_Slider (_TL("Eye Distance") , m_pView->m_dCentral, 1.0, 2000.0); m_pSlide_Light_Hgt = Add_Slider (_TL("Light Source A") , m_pView->m_Light_Hgt, -M_PI_090, M_PI_090); m_pSlide_Light_Dir = Add_Slider (_TL("Light Source B") , m_pView->m_Light_Dir, -M_PI_360, M_PI_360); // Add_Spacer(); // m_pParameters = Add_TextCtrl (_TL("Function Parameters"), wxTE_MULTILINE|wxTE_READONLY); Add_Output(m_pView); } //--------------------------------------------------------- void C3DShapes_View_Dialog::On_Mouse_Wheel(wxMouseEvent &event) { m_pView->On_Mouse_Wheel(event); } //--------------------------------------------------------- void C3DShapes_View_Dialog::On_Update_Control(wxCommandEvent &event) { if( event.GetEventObject() == m_pCheck_Central ) { m_pView->m_bCentral = m_pCheck_Central ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pCheck_Stereo ) { m_pView->m_bStereo = m_pCheck_Stereo ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pCheck_Frame ) { m_pView->m_bFrame = m_pCheck_Frame ->GetValue() == 1 ? 1 : 0; } else if( event.GetEventObject() == m_pSlide_xRotate ) { m_pView->m_xRotate = m_pSlide_xRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_yRotate ) { m_pView->m_yRotate = m_pSlide_yRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_zRotate ) { m_pView->m_zRotate = m_pSlide_zRotate ->Get_Value() * M_DEG_TO_RAD; } else if( event.GetEventObject() == m_pSlide_Central ) { m_pView->m_dCentral = m_pSlide_Central ->Get_Value(); } else if( event.GetEventObject() == m_pSlide_Light_Dir ) { m_pView->m_Light_Dir = m_pSlide_Light_Dir->Get_Value(); } else if( event.GetEventObject() == m_pSlide_Light_Hgt ) { m_pView->m_Light_Hgt = m_pSlide_Light_Hgt->Get_Value(); } else { return; } m_pView->Update_View(); } //--------------------------------------------------------- void C3DShapes_View_Dialog::On_Update_Choices(wxCommandEvent &event) { if( event.GetEventObject() == m_pField_Color ) { m_Settings("C_RANGE")->asRange()->Set_Range(0.0, 0.0); m_pView ->m_cField = m_pField_Color->GetSelection(); m_pView ->Update_Extent(); } else if( event.GetEventObject() == m_pStyle ) { m_pView ->m_Style = m_pStyle->GetSelection(); m_pView ->Update_View(); } else if( event.GetEventObject() == m_pShading ) { m_pView ->m_Shading = m_pShading->GetSelection(); m_pView ->Update_View(); } else { return; } } //--------------------------------------------------------- void C3DShapes_View_Dialog::On_Button(wxCommandEvent &event) { if( event.GetEventObject() == m_pBtn_Prop ) { if( SG_UI_Dlg_Parameters(&m_Settings, m_Settings.Get_Name()) ) { m_pView ->Update_View(); } } else { event.Skip(); } } //--------------------------------------------------------- void C3DShapes_View_Dialog::Update_Rotation(void) { double d; d = fmod(M_RAD_TO_DEG * m_pView->m_xRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_xRotate->Set_Value(d); d = fmod(M_RAD_TO_DEG * m_pView->m_yRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_yRotate->Set_Value(d); d = fmod(M_RAD_TO_DEG * m_pView->m_zRotate, 360.0); if( d < -180.0 ) d += 360.0; else if( d > 180.0 ) d -= 360.0; m_pSlide_zRotate->Set_Value(d); m_pCheck_Stereo ->SetValue(m_pView->m_bStereo); m_pCheck_Frame ->SetValue(m_pView->m_bFrame); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_dialog.h000066400000000000000000000123761224124640700302410ustar00rootroot00000000000000/********************************************************** * Version $Id: 3dshapes_view_dialog.h 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3dshapes_viewer // // // //-------------------------------------------------------// // // // 3dshapes_view_dialog.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__3dshapes_view_dialog_H #define HEADER_INCLUDED__3dshapes_view_dialog_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class C3DShapes_View_Dialog : public CSGDI_Dialog { public: C3DShapes_View_Dialog(CSG_Shapes *pShapes, int Field_Color); void Update_Rotation (void); private: wxButton *m_pBtn_Prop; wxCheckBox *m_pCheck_Central, *m_pCheck_Stereo, *m_pCheck_Frame; wxChoice *m_pField_Color, *m_pStyle, *m_pShading; wxTextCtrl *m_pFormula, *m_pParameters; CSGDI_Slider *m_pSlide_xRotate, *m_pSlide_yRotate, *m_pSlide_zRotate, *m_pSlide_Central, *m_pSlide_Light_Hgt, *m_pSlide_Light_Dir; class C3DShapes_View_Control *m_pView; CSG_Parameters m_Settings; void On_Update_Control (wxCommandEvent &event); void On_Update_Choices (wxCommandEvent &event); void On_Button (wxCommandEvent &event); void On_Mouse_Wheel (wxMouseEvent &event); DECLARE_EVENT_TABLE() }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__3dshapes_view_dialog_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_module.cpp000066400000000000000000000123751224124640700306210ustar00rootroot00000000000000/********************************************************** * Version $Id: 3dshapes_view_module.cpp 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3dshapes_view_module // // // //-------------------------------------------------------// // // // 3dshapes_view_module.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute for Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "3dshapes_view_module.h" #include "3dshapes_view_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- C3DShapes_View_Module::C3DShapes_View_Module(void) { //----------------------------------------------------- Set_Name (_TL("3D Shapes Viewer")); Set_Author (SG_T("O. Conrad (c) 2011")); Set_Description (_TW( "This module is a very simple viewer for 3D shapes. It is still a small plant which shall grow in SAGA's garden until it is really powerful." )); //----------------------------------------------------- CSG_Parameter *pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "COLOR" , _TL("Color"), _TL("") ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool C3DShapes_View_Module::On_Execute(void) { if( !SG_UI_Get_Window_Main() ) { Message_Add(_TL("point cloud viewer can only be run from graphical user interface")); return( false ); } CSG_Shapes *pShapes = Parameters("SHAPES")->asShapes(); if( pShapes->Get_Count() <= 0 ) { Message_Add(_TL("point cloud viewer will not be started, because point cloud has no points")); return( false ); } if( pShapes->Get_Vertex_Type() == SG_VERTEX_TYPE_XY ) { Message_Add(_TL("point cloud viewer will not be started, because point cloud has no points")); return( false ); } C3DShapes_View_Dialog dlg(pShapes, Parameters("COLOR")->asInt()); dlg.ShowModal(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/3dshapes_view_module.h000066400000000000000000000101161224124640700302550ustar00rootroot00000000000000/********************************************************** * Version $Id: 3dshapes_view_module.h 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3dshapes_viewer // // // //-------------------------------------------------------// // // // 3dshapes_view_module.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__3dshapes_view_module_H #define HEADER_INCLUDED__3dshapes_view_module_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class C3DShapes_View_Module : public CSG_Module { public: C3DShapes_View_Module(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__points_view_module_H saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.cpp000066400000000000000000000110061224124640700270700ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // 3dshapes_viewer // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute for Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Garden - 3D Shapes Viewer") ); case MLB_INFO_Author: return( SG_T("O.Conrad (c) 2011") ); case MLB_INFO_Description: return( _TL("3D Shapes Viewer" )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Garden|Visualisation" )); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "3dshapes_view_module.h" #include "3d_multigrid_view_module.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new C3DShapes_View_Module ); case 1: return( new C3D_MultiGrid_View_Module ); default: return( NULL ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/MLB_Interface.h000066400000000000000000000076061224124640700265500ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 1644 2013-04-02 09:41:18Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // pointcloud_viewer // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute for Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__pointcloud_viewer_mlb_H #define HEADER_INCLUDED__pointcloud_viewer_mlb_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef pointcloud_viewer_EXPORTS #define pointcloud_viewer_EXPORT _SAGA_DLL_EXPORT #else #define pointcloud_viewer_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__pointcloud_viewer_mlb_H saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/Makefile.am000066400000000000000000000022741224124640700260350ustar00rootroot00000000000000if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` else DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libgarden_3d_viewer.la libgarden_3d_viewer_la_SOURCES =\ MLB_Interface.cpp\ 3d_multigrid_view_control.cpp\ 3d_multigrid_view_dialog.cpp\ 3d_multigrid_view_module.cpp\ 3dshapes_view_control.cpp\ 3dshapes_view_dialog.cpp\ 3dshapes_view_module.cpp\ MLB_Interface.h\ 3d_multigrid_view_control.h\ 3d_multigrid_view_dialog.h\ 3d_multigrid_view_module.h\ 3dshapes_view_control.h\ 3dshapes_view_dialog.h\ 3dshapes_view_module.h libgarden_3d_viewer_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS) saga-2.1.0+dfsg/src/modules_contrib/garden/garden_3d_viewer/Makefile.in000066400000000000000000000467511224124640700260560ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_contrib/garden/garden_3d_viewer DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgarden_3d_viewer_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la \ $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la am_libgarden_3d_viewer_la_OBJECTS = MLB_Interface.lo \ 3d_multigrid_view_control.lo 3d_multigrid_view_dialog.lo \ 3d_multigrid_view_module.lo 3dshapes_view_control.lo \ 3dshapes_view_dialog.lo 3dshapes_view_module.lo libgarden_3d_viewer_la_OBJECTS = $(am_libgarden_3d_viewer_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgarden_3d_viewer_la_SOURCES) DIST_SOURCES = $(libgarden_3d_viewer_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_FALSE@DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) @SAGA_UNICODE_TRUE@DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) @SAGA_UNICODE_FALSE@DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` @SAGA_UNICODE_TRUE@DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libgarden_3d_viewer.la libgarden_3d_viewer_la_SOURCES = \ MLB_Interface.cpp\ 3d_multigrid_view_control.cpp\ 3d_multigrid_view_dialog.cpp\ 3d_multigrid_view_module.cpp\ 3dshapes_view_control.cpp\ 3dshapes_view_dialog.cpp\ 3dshapes_view_module.cpp\ MLB_Interface.h\ 3d_multigrid_view_control.h\ 3d_multigrid_view_dialog.h\ 3d_multigrid_view_module.h\ 3dshapes_view_control.h\ 3dshapes_view_dialog.h\ 3dshapes_view_module.h libgarden_3d_viewer_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_contrib/garden/garden_3d_viewer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_contrib/garden/garden_3d_viewer/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgarden_3d_viewer.la: $(libgarden_3d_viewer_la_OBJECTS) $(libgarden_3d_viewer_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgarden_3d_viewer_la_OBJECTS) $(libgarden_3d_viewer_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/3d_multigrid_view_control.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/3d_multigrid_view_dialog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/3d_multigrid_view_module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/3dshapes_view_control.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/3dshapes_view_dialog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/3dshapes_view_module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_contrib/garden/garden_webservices/000077500000000000000000000000001224124640700244265ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_contrib/garden/garden_webservices/MLB_Interface.cpp000066400000000000000000000107561224124640700275350ustar00rootroot00000000000000/********************************************************** * Version $Id: table.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // garden_webservices // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Garden - Web Service Data Access" )); case MLB_INFO_Author: return( SG_T("SAGA User Group Associaton (c) 2011" )); case MLB_INFO_Description: return( _TW("Web Service Data Access" )); case MLB_INFO_Version: return( SG_T("1.0" )); case MLB_INFO_Menu_Path: return( _TL("Garden|Web Service Data Access" )); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "wms_import.h" #include "osm_import.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CWMS_Import ); case 1: return( new COSM_Import ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_contrib/garden/garden_webservices/MLB_Interface.h000066400000000000000000000067621224124640700272040ustar00rootroot00000000000000/********************************************************** * Version $Id: table.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // garden_webservices // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__MLB_INTERFACE_H #define HEADER_INCLUDED__MLB_INTERFACE_H //--------------------------------------------------------- #include //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__MLB_INTERFACE_H saga-2.1.0+dfsg/src/modules_contrib/garden/garden_webservices/Makefile.am000066400000000000000000000015661224124640700264720ustar00rootroot00000000000000if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` else DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libgarden_webservices.la libgarden_webservices_la_SOURCES =\ MLB_Interface.cpp\ osm_import.cpp\ wms_import.cpp\ MLB_Interface.h\ osm_import.h\ wms_import.h libgarden_webservices_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_contrib/garden/garden_webservices/Makefile.in000066400000000000000000000452161224124640700265030ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_contrib/garden/garden_webservices DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgarden_webservices_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgarden_webservices_la_OBJECTS = MLB_Interface.lo osm_import.lo \ wms_import.lo libgarden_webservices_la_OBJECTS = \ $(am_libgarden_webservices_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgarden_webservices_la_SOURCES) DIST_SOURCES = $(libgarden_webservices_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_FALSE@DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) @SAGA_UNICODE_TRUE@DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) @SAGA_UNICODE_FALSE@DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` @SAGA_UNICODE_TRUE@DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libgarden_webservices.la libgarden_webservices_la_SOURCES = \ MLB_Interface.cpp\ osm_import.cpp\ wms_import.cpp\ MLB_Interface.h\ osm_import.h\ wms_import.h libgarden_webservices_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_contrib/garden/garden_webservices/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_contrib/garden/garden_webservices/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgarden_webservices.la: $(libgarden_webservices_la_OBJECTS) $(libgarden_webservices_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgarden_webservices_la_OBJECTS) $(libgarden_webservices_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osm_import.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wms_import.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_contrib/garden/garden_webservices/osm_import.cpp000066400000000000000000000310131224124640700273200ustar00rootroot00000000000000/********************************************************** * Version $Id: table.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // garden_webservices // // // //-------------------------------------------------------// // // // osm_import.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include #include "osm_import.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- COSM_Import::COSM_Import(void) { Set_Name (_TL("Import from Open Street Map")); Set_Author (SG_T("O. Conrad (c) 2010")); Set_Description (_TW( "This module works as Web Map Service (WMS) client. " "More information on the WMS specifications can be obtained from the " "Open Geospatial Consortium (OGC) at " "http://www.opengeospatial.org/. " )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "POINTS" , _TL("OSM Locations"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL , "WAYS" , _TL("OSM Ways"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); Parameters.Add_Shapes( NULL , "RELATIONS" , _TL("OSM Relations"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Line ); Parameters.Add_Shapes( NULL , "AREAS" , _TL("OSM Areas"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); //----------------------------------------------------- Parameters.Add_String( NULL , "USERNAME" , _TL("User Name"), _TL(""), SG_T("") ); Parameters.Add_String( NULL , "PASSWORD" , _TL("Password"), _TL(""), SG_T(""), false, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool COSM_Import::On_Execute(void) { //----------------------------------------------------- m_pPoints = Parameters("POINTS") ->asShapes(); m_pWays = Parameters("WAYS") ->asShapes(); m_pAreas = Parameters("AREAS") ->asShapes(); m_bDown = false; //----------------------------------------------------- wxHTTP Server; Server.SetUser (Parameters("USERNAME")->asString()); Server.SetPassword (Parameters("PASSWORD")->asString()); if( Server.Connect(SG_T("api.openstreetmap.org")) == false ) { Message_Add(_TL("Unable to connect to server.")); return( false ); } //----------------------------------------------------- //----------------------------------------------------- // // Request.Set_Name(SG_T("osm")); // Request.Add_Property(SG_T("version") , SG_T("0.6")); // Request.Add_Property(SG_T("generator") , SG_T("OpenStreetMap server")); // SG_T("api/capabilities"); // http://api.openstreetmap.org/api/0.6/map?bbox=10.0,53.0,10.1,53.1 return( true ); } //--------------------------------------------------------- bool COSM_Import::On_Execute_Finish(void) { return( true ); } //--------------------------------------------------------- bool COSM_Import::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode) { switch( Mode ) { //----------------------------------------------------- case MODULE_INTERACTIVE_LDOWN: if( m_bDown == false ) { m_bDown = true; m_ptDown = ptWorld; } break; //----------------------------------------------------- case MODULE_INTERACTIVE_LUP: if( m_bDown == true ) { m_bDown = false; wxHTTP Server; // Server.SetUser (Parameters("USERNAME")->asString()); // Server.SetPassword (Parameters("PASSWORD")->asString()); Server.SetUser (SG_T("")); Server.SetPassword (SG_T("")); if( Server.Connect(SG_T("api.openstreetmap.org")) == false ) { Message_Add(_TL("Unable to connect to server.")); return( false ); } CSG_Rect r(m_ptDown, ptWorld); wxInputStream *pStream = Server.GetInputStream(wxString::Format(SG_T("/api/0.6/map?bbox=%f,%f,%f,%f"), r.Get_XMin(), r.Get_YMin(), r.Get_XMax(), r.Get_YMax()) ); if( (pStream ) == NULL ) { Message_Add(_TL("received empty stream.")); return( false ); } Process_Set_Text(_TL("loading OSM data")); wxXmlDocument XML; if( !XML.Load(*pStream) ) { return( false ); } Process_Set_Text(_TL("ready")); if( !Load_Nodes(XML.GetRoot()) ) { return( false ); } Load_Ways(XML.GetRoot()); DataObject_Update(m_pPoints); DataObject_Update(m_pWays); DataObject_Update(m_pAreas); m_Nodes.Destroy(); } break; } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool COSM_Import::Load_Nodes(wxXmlNode *pRoot) { long id; double lon, lat; wxString sValue; //----------------------------------------------------- m_Nodes.Destroy(); m_Nodes.Add_Field(SG_T("ID") , SG_DATATYPE_DWord); m_Nodes.Add_Field(SG_T("LON") , SG_DATATYPE_Double); m_Nodes.Add_Field(SG_T("LAT") , SG_DATATYPE_Double); m_pPoints->Create(SHAPE_TYPE_Point, SG_T("OSM Locations")); m_pPoints->Add_Field(SG_T("ID"), SG_DATATYPE_DWord); //----------------------------------------------------- wxXmlNode *pNode = pRoot->GetChildren(); while( pNode ) { if( !pNode->GetName().CmpNoCase(SG_T("node")) ) { if( pNode->GetPropVal(SG_T("id" ), &sValue) && sValue.ToLong (&id) && pNode->GetPropVal(SG_T("lon"), &sValue) && sValue.ToDouble(&lon) && pNode->GetPropVal(SG_T("lat"), &sValue) && sValue.ToDouble(&lat) ) { wxXmlNode *pTag = pNode->GetChildren(); if( !pTag || !pTag->GetName().CmpNoCase(SG_T("created_by")) ) { CSG_Table_Record *pRecord = m_Nodes.Add_Record(); pRecord->Set_Value(0, id); pRecord->Set_Value(1, lon); pRecord->Set_Value(2, lat); } else { CSG_Shape *pShape = m_pPoints->Add_Shape(); pShape->Add_Point(lon, lat); pShape->Set_Value(0, id); } } } pNode = pNode->GetNext(); } m_Nodes.Set_Index(0, TABLE_INDEX_Ascending); //----------------------------------------------------- return( m_Nodes.Get_Count() > 0 ); } //--------------------------------------------------------- bool COSM_Import::Find_Node(long id, double &lon, double &lat) { CSG_Table_Record *pRecord = Find_Node(id); if( pRecord ) { lon = pRecord->asDouble(1); lat = pRecord->asDouble(2); return( true ); } return( false ); } //--------------------------------------------------------- CSG_Table_Record * COSM_Import::Find_Node(long id) { int a, b, d, i; if( m_Nodes.Get_Count() == 1 ) { if( m_Nodes.Get_Record_byIndex(0)->asInt(0) == id ) { return( m_Nodes.Get_Record_byIndex(0) ); } } else if( m_Nodes.Get_Count() > 1 ) { a = 0; if( id < (d = m_Nodes.Get_Record_byIndex(a)->asInt(0)) ) return( NULL ); if( id == d ) return( m_Nodes.Get_Record_byIndex(a) ); b = m_Nodes.Get_Count() - 1; if( id > (d = m_Nodes.Get_Record_byIndex(b)->asInt(0)) ) return( NULL ); if( id == d ) return( m_Nodes.Get_Record_byIndex(b) ); for( ; b - a > 1; ) { i = a + (b - a) / 2; d = m_Nodes.Get_Record_byIndex(i)->asInt(0); if( id > d ) { a = i; } else if( id < d ) { b = i; } else { return( m_Nodes.Get_Record_byIndex(i) ); } } } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool COSM_Import::Load_Ways(wxXmlNode *pRoot) { long id, idnode, Nodes[2000], nNodes; wxString sValue; //----------------------------------------------------- m_pWays ->Create(SHAPE_TYPE_Line , SG_T("OSM Ways")); m_pWays ->Add_Field(SG_T("ID"), SG_DATATYPE_DWord); m_pAreas ->Create(SHAPE_TYPE_Polygon , SG_T("OSM Areas")); m_pAreas ->Add_Field(SG_T("ID"), SG_DATATYPE_DWord); //----------------------------------------------------- wxXmlNode *pNode = pRoot->GetChildren(); while( pNode ) { if( !pNode->GetName().CmpNoCase(SG_T("way")) ) { if( pNode->GetPropVal(SG_T("id" ), &sValue) && sValue.ToLong (&id) ) { wxXmlNode *pChild = pNode->GetChildren(); nNodes = 0; while( pChild ) { if( !pChild->GetName().CmpNoCase(SG_T("nd")) && pChild->GetPropVal(SG_T("ref"), &sValue) && sValue.ToLong(&idnode) ) { Nodes[nNodes++] = idnode; } pChild = pChild->GetNext(); } if( nNodes > 1 ) { CSG_Shape *pShape = Nodes[0] == Nodes[nNodes - 1] ? m_pAreas->Add_Shape() : m_pWays->Add_Shape(); for(int i=0; iAdd_Point(lon, lat); } } } } } pNode = pNode->GetNext(); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_webservices/osm_import.h000066400000000000000000000112621224124640700267710ustar00rootroot00000000000000/********************************************************** * Version $Id: table.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // garden_webservices // // // //-------------------------------------------------------// // // // osm_import.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__OSM_Import_H #define HEADER_INCLUDED__OSM_Import_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class COSM_Import : public CSG_Module_Interactive { public: COSM_Import(void); protected: virtual bool On_Execute (void); virtual bool On_Execute_Finish (void); virtual bool On_Execute_Position (CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode); private: bool m_bDown; CSG_Point m_ptDown; CSG_Table m_Nodes; CSG_Shapes *m_pPoints, *m_pWays, *m_pAreas; bool Load_Nodes (class wxXmlNode *pRoot); bool Find_Node (long id, double &lon, double &lat); CSG_Table_Record * Find_Node (long id); bool Load_Ways (class wxXmlNode *pRoot); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__OSM_Import_H saga-2.1.0+dfsg/src/modules_contrib/garden/garden_webservices/wms_import.cpp000066400000000000000000000573301224124640700273420ustar00rootroot00000000000000/********************************************************** * Version $Id: table.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // garden_webservices // // // //-------------------------------------------------------// // // // wms_import.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include #include #include "wms_import.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define V_SRS(Version) (Version.Contains(SG_T("1.3")) ? SG_T("CRS") : SG_T("SRS")) #define S_SRS(Version) (Version.Cmp(SG_T("1.3.0")) ? SG_T("&SRS=") : SG_T("&CRS=")) #define V_MAP(Version) (Version.Cmp(SG_T("1.0.0")) ? SG_T("GetMap") : SG_T("Map")) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CWMS_Capabilities::CWMS_Capabilities(void) { m_pLayers = NULL; _Reset(); } CWMS_Capabilities::CWMS_Capabilities(wxHTTP *pServer, const CSG_String &Directory, CSG_String &Version) { m_pLayers = NULL; _Reset(); Create(pServer, Directory, Version); } //--------------------------------------------------------- CWMS_Capabilities::~CWMS_Capabilities(void) {} //--------------------------------------------------------- void CWMS_Capabilities::_Reset(void) { m_MaxLayers = -1; m_MaxWidth = -1; m_MaxHeight = -1; m_Name .Clear(); m_Title .Clear(); m_Abstract .Clear(); m_Online .Clear(); m_Contact .Clear(); m_Fees .Clear(); m_Access .Clear(); m_Keywords .Clear(); m_Formats .Clear(); m_Projections .Clear(); m_Layers_Title .Clear(); if( m_pLayers ) { for(int i=0; iGetInputStream(sRequest.c_str())) != NULL ) { wxXmlDocument Capabilities; if( Capabilities.Load(*pStream) ) { bResult = _Get_Capabilities(Capabilities.GetRoot(), Version); Capabilities.Save(CSG_String::Format(SG_T("e:\\%s.xml"), m_Title.c_str()).c_str()); } delete(pStream); } } return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- wxXmlNode * CWMS_Capabilities::_Get_Child(wxXmlNode *pNode, const CSG_String &Name) { if( pNode && (pNode = pNode->GetChildren()) != NULL ) { do { if( !pNode->GetName().CmpNoCase(Name.c_str()) ) { return( pNode ); } } while( (pNode = pNode->GetNext()) != NULL ); } return( NULL ); } //--------------------------------------------------------- bool CWMS_Capabilities::_Get_Child_Content(wxXmlNode *pNode, CSG_String &Value, const CSG_String &Name) { if( (pNode = _Get_Child(pNode, Name)) != NULL ) { Value = pNode->GetNodeContent().wc_str(); return( true ); } return( false ); } //--------------------------------------------------------- bool CWMS_Capabilities::_Get_Child_Content(wxXmlNode *pNode, int &Value, const CSG_String &Name) { long lValue; if( (pNode = _Get_Child(pNode, Name)) != NULL && pNode->GetNodeContent().ToLong(&lValue) ) { Value = lValue; return( true ); } return( false ); } //--------------------------------------------------------- bool CWMS_Capabilities::_Get_Child_Content(wxXmlNode *pNode, double &Value, const CSG_String &Name) { double dValue; if( (pNode = _Get_Child(pNode, Name)) != NULL && pNode->GetNodeContent().ToDouble(&dValue) ) { Value = dValue; return( true ); } return( false ); } //--------------------------------------------------------- bool CWMS_Capabilities::_Get_Node_PropVal(wxXmlNode *pNode, CSG_String &Value, const CSG_String &Property) { wxString PropVal; if( pNode != NULL && pNode->GetPropVal(Property.c_str(), &PropVal) ) { Value = PropVal.wc_str(); return( true ); } return( false ); } bool CWMS_Capabilities::_Get_Child_PropVal(wxXmlNode *pNode, CSG_String &Value, const CSG_String &Name, const CSG_String &Property) { return( (pNode = _Get_Child(pNode, Name)) != NULL && _Get_Node_PropVal(pNode, Value, Property) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWMS_Capabilities::_Get_Capabilities(wxXmlNode *pRoot, CSG_String &Version) { wxXmlNode *pNode, *pChild; //----------------------------------------------------- // 1. Service if( (pNode = _Get_Child(pRoot, SG_T("Service"))) == NULL ) { return( false ); } _Get_Node_PropVal (pRoot, Version , SG_T("version")); _Get_Child_Content(pNode, m_Name , SG_T("Name")); _Get_Child_Content(pNode, m_Title , SG_T("Title")); _Get_Child_Content(pNode, m_Abstract , SG_T("Abstract")); _Get_Child_Content(pNode, m_Fees , SG_T("Fees")); _Get_Child_Content(pNode, m_Access , SG_T("AccessConstraints")); _Get_Child_Content(pNode, m_MaxLayers , SG_T("LayerLimit")); _Get_Child_Content(pNode, m_MaxWidth , SG_T("MaxWidth")); _Get_Child_Content(pNode, m_MaxHeight , SG_T("MaxHeight")); _Get_Child_PropVal(pNode, m_Online , SG_T("OnlineResource"), SG_T("xlink:href")); if( (pChild = _Get_Child(pNode, SG_T("KeywordList"))) != NULL ) { wxXmlNode *pKeyword = pChild->GetChildren(); while( pKeyword ) { if( !pKeyword->GetName().CmpNoCase(SG_T("Format")) ) { m_Keywords.Add(pKeyword->GetNodeContent().wx_str()); } pKeyword = pKeyword->GetNext(); } } if( (pChild = _Get_Child(pNode, SG_T("ContactInformation"))) != NULL ) { } //----------------------------------------------------- // 2. Capabilities if( (pNode = _Get_Child(pRoot, SG_T("Capability"))) == NULL ) { return( false ); } //----------------------------------------------------- // 2.a) Request if( (pChild = _Get_Child(_Get_Child(_Get_Child(pNode, SG_T("Request")), V_MAP(Version)), SG_T("Format"))) != NULL ) { if( !Version.Cmp(SG_T("1.0.0")) ) { pChild = pChild->GetChildren(); while( pChild ) { m_Formats += pChild->GetName().wc_str(); m_Formats += SG_T("|"); pChild = pChild->GetNext(); } } else { do { if( !pChild->GetName().CmpNoCase(SG_T("Format")) ) { m_Formats += pChild->GetNodeContent().wc_str(); m_Formats += SG_T("|"); } } while( (pChild = pChild->GetNext()) != NULL ); } } //----------------------------------------------------- // 2.b) Exception, Vendor Specific Capabilities, User Defined Symbolization, ... //----------------------------------------------------- // 2.c) Layers if( (pNode = _Get_Child(pNode, SG_T("Layer"))) == NULL ) { return( false ); } CSG_String s; if( !(_Get_Child_PropVal(pNode, s, SG_T("BoundingBox"), SG_T("minx")) && s.asDouble(m_GeoBBox.xMin)) || !(_Get_Child_PropVal(pNode, s, SG_T("BoundingBox"), SG_T("miny")) && s.asDouble(m_GeoBBox.yMin)) || !(_Get_Child_PropVal(pNode, s, SG_T("BoundingBox"), SG_T("maxx")) && s.asDouble(m_GeoBBox.xMax)) || !(_Get_Child_PropVal(pNode, s, SG_T("BoundingBox"), SG_T("maxy")) && s.asDouble(m_GeoBBox.yMax)) ) { m_GeoBBox.xMin = m_GeoBBox.yMin = m_GeoBBox.xMax = m_GeoBBox.yMax = 0.0; } _Get_Child_Content(pNode, m_Layers_Title , SG_T("Title")); if( (pChild = _Get_Child(pNode, V_SRS(Version))) != NULL ) { do { if( !pChild->GetName().CmpNoCase(V_SRS(Version)) ) { m_sProjections .Add(pChild->GetNodeContent().wx_str()); // m_Projections += Get_EPSG_Name(CSG_String(&pChild->GetNodeContent())); m_Projections += SG_T("|"); } } while( (pChild = pChild->GetNext()) != NULL ); } if( (pChild = pNode->GetChildren()) != NULL ) { do { _Get_Layer(pChild); } while( (pChild = pChild->GetNext()) != NULL ); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWMS_Capabilities::_Get_Layer(wxXmlNode *pNode) { if( pNode && !pNode->GetName().CmpNoCase(SG_T("Layer")) ) { CWMS_Layer *pLayer = new CWMS_Layer; if( _Get_Child_Content(pNode, pLayer->m_Name, SG_T("Name")) ) { _Get_Child_Content(pNode, pLayer->m_Title, SG_T("Title")); //--------------------------------------------- m_pLayers = (CWMS_Layer **)SG_Realloc(m_pLayers, (m_nLayers + 1) * sizeof(CWMS_Layer *)); m_pLayers[m_nLayers++] = pLayer; return( true ); } delete(pLayer); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_String CWMS_Capabilities::Get_Summary(void) { CSG_String s; if( m_Name.Length() > 0 ) { s += SG_T("\n[Name] ") + m_Name + SG_T("\n"); } if( m_Title.Length() > 0 ) { s += SG_T("\n[Title] ") + m_Title + SG_T("\n"); } if( m_Abstract.Length() > 0 ) { s += SG_T("\n[Abstract] ") + m_Abstract + SG_T("\n"); } if( m_Fees.Length() > 0 ) { s += SG_T("\n[Fees] ") + m_Fees + SG_T("\n"); } if( m_Online.Length() > 0 ) { s += SG_T("\n[Online Resource] ") + m_Online + SG_T("\n"); } if( m_Keywords.Get_Count() > 0 ) { s += SG_T("\n[Keywords] "); for(int i=0; i 0 ) s += SG_T(", "); s += m_Keywords[i]; } s += SG_T("\n"); } if( m_MaxLayers > 0 ) { s += CSG_String::Format(SG_T("\n[Max. Layers] %d\n"), m_MaxLayers); } if( m_MaxWidth > 0 ) { s += CSG_String::Format(SG_T("\n[Max. Width] %d\n"), m_MaxWidth); } if( m_MaxHeight > 0 ) { s += CSG_String::Format(SG_T("\n[Max. Height] %d\n"), m_MaxHeight); } if( m_Contact.Length() > 0 ) { s += SG_T("\n[Contact] ") + m_Contact + SG_T("\n"); } if( m_Access.Length() > 0 ) { s += SG_T("\n[Access] ") + m_Access + SG_T("\n"); } return( s ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CWMS_Import::CWMS_Import(void) { Set_Name (_TL("Import a Map via Web Map Service (WMS)")); Set_Author (SG_T("O. Conrad (c) 2008")); Set_Description (_TW( "This module works as Web Map Service (WMS) client. " "More information on the WMS specifications can be obtained from the " "Open Geospatial Consortium (OGC) at " "http://www.opengeospatial.org/. " )); //----------------------------------------------------- Parameters.Add_Grid_Output( NULL , "MAP" , _TL("WMS Map"), _TL("") ); //----------------------------------------------------- Parameters.Add_String( NULL , "SERVER" , _TL("Server"), _TL(""), // SG_T("www.gaia-mv.de/dienste/DTK10f") // 260000.0x, 5950000.0y Cellsize 1.0 // SG_T("www.gis2.nrw.de/wmsconnector/wms/stobo") // SG_T("www2.demis.nl/mapserver/request.asp") // SG_T("www.geoserver.nrw.de/GeoOgcWms1.3/servlet/TK25") // SG_T("www.geographynetwork.com/servlet/com.esri.wms.Esrimap") SG_T("ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/wms") // WGS84: Center -3.5x 55.0y Cellsize 0.005 ); Parameters.Add_String( NULL , "USERNAME" , _TL("User Name"), _TL(""), SG_T("") ); Parameters.Add_String( NULL , "PASSWORD" , _TL("Password"), _TL(""), SG_T(""), false, true ); } //--------------------------------------------------------- CWMS_Import::~CWMS_Import(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWMS_Import::On_Execute(void) { wxHTTP Server; CSG_String sServer, sDirectory, sVersion; CWMS_Capabilities Capabilities; //----------------------------------------------------- sServer = Parameters("SERVER")->asString(); if( sServer.Contains(SG_T("http://")) ) { sServer = Parameters("SERVER")->asString() + 7; } sDirectory = SG_T("/") + sServer.AfterFirst(SG_T('/')); sServer = sServer.BeforeFirst(SG_T('/')); //----------------------------------------------------- Server.SetUser (Parameters("USERNAME")->asString()); Server.SetPassword (Parameters("PASSWORD")->asString()); if( Server.Connect(sServer.c_str()) == false ) { Message_Add(_TL("Unable to connect to server.")); return( false ); } //----------------------------------------------------- if( Capabilities.Create(&Server, sDirectory, sVersion) == false ) { Message_Add(_TL("Unable to get capabilities.")); return( false ); } Message_Add(Capabilities.Get_Summary(), false); Message_Add(CSG_String::Format(SG_T("\n%s\nmin: %fx - %fy\nmax: %fx - %fy\n"), _TL("Extent"), Capabilities.m_GeoBBox.xMin, Capabilities.m_GeoBBox.yMin, Capabilities.m_GeoBBox.xMax, Capabilities.m_GeoBBox.yMax), false ); //----------------------------------------------------- if( Get_Map(&Server, sDirectory, sVersion, Capabilities) == false ) { Message_Add(_TL("Unable to get map.")); return( false ); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWMS_Import::Do_Dialog(CWMS_Capabilities &Cap) { return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWMS_Import::Get_Map(wxHTTP *pServer, const CSG_String &Directory, const CSG_String &Version, CWMS_Capabilities &Cap) { bool bResult = false; int i, n; CSG_Rect r(Cap.m_GeoBBox); CSG_Parameters p; //----------------------------------------------------- // if( Cap.m_MaxWidth > 2 && NX > Cap.m_MaxWidth ) NX = Cap.m_MaxWidth; // if( Cap.m_MaxHeight > 2 && NY > Cap.m_MaxHeight ) NY = Cap.m_MaxHeight; p.Add_Range (NULL , "X_RANGE" , _TL("X Range") , _TL(""), r.Get_XMin(), r.Get_XMax(), r.Get_XMin(), r.Get_XRange() > 0.0, r.Get_XMax(), r.Get_XRange() > 0.0); p.Add_Range (NULL , "Y_RANGE" , _TL("Y Range") , _TL(""), r.Get_YMin(), r.Get_YMax(), r.Get_YMin(), r.Get_YRange() > 0.0, r.Get_YMax(), r.Get_YRange() > 0.0); p.Add_Value (NULL , "CELLSIZE", _TL("Cellsize") , _TL(""), PARAMETER_TYPE_Double, r.Get_XRange() / 2001.0, 0.0, true); p.Add_Choice(NULL , "FORMAT" , _TL("Format") , _TL(""), Cap.m_Formats); p.Add_Choice(NULL , "PROJ" , _TL("Projections"), _TL(""), Cap.m_Projections); CSG_Parameter *pNode = p("FORMAT"); for(i=0; iasChoice()->Get_Count(); i++) { CSG_String s(pNode->asChoice()->Get_Item(i)); if( !s.CmpNoCase(SG_T("image/png")) ) pNode->Set_Value(i); } for(i=0; im_Name, Cap.m_pLayers[i]->m_Title, SG_T(""), PARAMETER_TYPE_Bool, false); } //----------------------------------------------------- if( pServer && Dlg_Parameters(&p, _TL("WMS Import")) ) { long tFormat; int NX, NY; double Cellsize; CSG_String Layers, Format; //------------------------------------------------- r.Assign( p("X_RANGE")->asRange()->Get_LoVal(), p("Y_RANGE")->asRange()->Get_LoVal(), p("X_RANGE")->asRange()->Get_HiVal(), p("Y_RANGE")->asRange()->Get_HiVal() ); Cellsize = p("CELLSIZE") ->asDouble(); NX = 1 + (int)(r.Get_XRange() / Cellsize); NY = 1 + (int)(r.Get_YRange() / Cellsize); //------------------------------------------------- Layers.Clear(); for(i=0, n=0; im_Name)->asBool() ) { if( n++ > 0 ) Layers += SG_T(","); Layers += Cap.m_pLayers[i]->m_Name; } } if( n == 0 ) { return( false ); } //------------------------------------------------- Format = p("FORMAT")->asString(); if( Format.Contains(SG_T("image/gif")) ) tFormat = wxBITMAP_TYPE_GIF; else if( Format.Contains(SG_T("image/jpeg")) ) tFormat = wxBITMAP_TYPE_JPEG; else if( Format.Contains(SG_T("image/png")) ) tFormat = wxBITMAP_TYPE_PNG; else if( Format.Contains(SG_T("image/wbmp")) ) tFormat = wxBITMAP_TYPE_BMP; else if( Format.Contains(SG_T("image/bmp")) ) tFormat = wxBITMAP_TYPE_BMP; else if( Format.Contains(SG_T("image/tiff")) ) tFormat = wxBITMAP_TYPE_TIF; else if( Format.Contains(SG_T("GIF")) ) tFormat = wxBITMAP_TYPE_GIF; else if( Format.Contains(SG_T("JPEG")) ) tFormat = wxBITMAP_TYPE_JPEG; else if( Format.Contains(SG_T("PNG")) ) tFormat = wxBITMAP_TYPE_PNG; else { return( false ); } //------------------------------------------------- CSG_String sRequest(Directory); sRequest += SG_T("?SERVICE=WMS"); sRequest += SG_T("&VERSION=") + Version; sRequest += SG_T("&REQUEST=GetMap"); sRequest += SG_T("&LAYERS=") + Layers; if( Cap.m_sProjections.Get_Count() > 0 ) sRequest += S_SRS(Version) + Cap.m_sProjections[p("PROJ")->asInt()]; sRequest += SG_T("&FORMAT=") + Format; sRequest += CSG_String::Format(SG_T("&WIDTH=%d&HEIGHT=%d"), NX, NY); sRequest += CSG_String::Format(SG_T("&BBOX=%f,%f,%f,%f"), r.m_rect.xMin, r.m_rect.yMin, r.m_rect.xMax, r.m_rect.yMax); Message_Add(sRequest, true); //------------------------------------------------- wxInputStream *pStream; if( (pStream = pServer->GetInputStream(sRequest.c_str())) == NULL ) { Message_Add(_TL("could not open GetMap stream")); } else { wxImage Image; if( Image.LoadFile(*pStream, tFormat) == false ) { Message_Add(_TL("could not read image")); CSG_String s = SG_T("\n"); pStream->SeekI(0, wxFromStart); while( !pStream->Eof() ) { s += (char)pStream->GetC(); } Message_Add(s); } else { CSG_Grid *pGrid = SG_Create_Grid(SG_DATATYPE_Int, Image.GetWidth(), Image.GetHeight(), Cellsize, r.m_rect.xMin, r.m_rect.yMin); for(int y=0, yy=pGrid->Get_NY()-1; yGet_NY() && Set_Progress(y, pGrid->Get_NY()); y++, yy--) { for(int x=0; xGet_NX(); x++) { pGrid->Set_Value(x, y, SG_GET_RGB(Image.GetRed(x, yy), Image.GetGreen(x, yy), Image.GetBlue(x, yy))); } } //----------------------------------------- pGrid->Set_Name(Cap.m_Title); Parameters("MAP")->Set_Value(pGrid); DataObject_Set_Colors(pGrid, 100, SG_COLORS_BLACK_WHITE); CSG_Parameters Parms; if( DataObject_Get_Parameters(pGrid, Parms) && Parms("COLORS_TYPE") ) { Parms("COLORS_TYPE")->Set_Value(3); // Color Classification Type: RGB DataObject_Set_Parameters(pGrid, Parms); } bResult = true; } delete(pStream); } } return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_contrib/garden/garden_webservices/wms_import.h000066400000000000000000000143751224124640700270110ustar00rootroot00000000000000/********************************************************** * Version $Id: table.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // garden_webservices // // // //-------------------------------------------------------// // // // wms_import.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__WMS_Import_H #define HEADER_INCLUDED__WMS_Import_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CWMS_Layer { public: CWMS_Layer(void) {} virtual ~CWMS_Layer(void) {} TSG_Rect m_GeoBBox; CSG_String m_Name, m_Title; }; //--------------------------------------------------------- class CWMS_Capabilities { public: CWMS_Capabilities(void); CWMS_Capabilities(class wxHTTP *pServer, const CSG_String &Directory, CSG_String &Version); virtual ~CWMS_Capabilities(void); bool Create (class wxHTTP *pServer, const CSG_String &Directory, CSG_String &Version); CSG_String Get_Summary (void); int m_MaxLayers, m_MaxWidth, m_MaxHeight, m_nLayers; TSG_Rect m_GeoBBox; CSG_String m_Name, m_Title, m_Abstract, m_Online, m_Contact, m_Fees, m_Access, m_Formats, m_Layers_Title, m_Projections; CSG_Strings m_Keywords, m_sProjections; CWMS_Layer **m_pLayers; private: void _Reset (void); class wxXmlNode * _Get_Child (class wxXmlNode *pNode, const CSG_String &Name); bool _Get_Child_Content (class wxXmlNode *pNode, CSG_String &Value, const CSG_String &Name); bool _Get_Child_Content (class wxXmlNode *pNode, int &Value, const CSG_String &Name); bool _Get_Child_Content (class wxXmlNode *pNode, double &Value, const CSG_String &Name); bool _Get_Node_PropVal (class wxXmlNode *pNode, CSG_String &Value, const CSG_String &Property); bool _Get_Child_PropVal (class wxXmlNode *pNode, CSG_String &Value, const CSG_String &Name, const CSG_String &Property); bool _Get_Capabilities (class wxXmlNode *pRoot, CSG_String &Version); bool _Get_Layer (class wxXmlNode *pNode); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CWMS_Import : public CSG_Module { public: CWMS_Import(void); virtual ~CWMS_Import(void); protected: virtual bool On_Execute (void); private: bool Do_Dialog (CWMS_Capabilities &Cap); bool Get_Map (class wxHTTP *pServer, const CSG_String &Directory, const CSG_String &Version, CWMS_Capabilities &Cap); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__WMS_Import_H saga-2.1.0+dfsg/src/modules_geostatistics/000077500000000000000000000000001224124640700205525ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/Makefile.am000066400000000000000000000000311224124640700226000ustar00rootroot00000000000000SUBDIRS = geostatistics saga-2.1.0+dfsg/src/modules_geostatistics/Makefile.in000066400000000000000000000424631224124640700226300ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_geostatistics DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = geostatistics all: all-recursive .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) --gnu src/modules_geostatistics/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_geostatistics/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/000077500000000000000000000000001224124640700234375ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/Makefile.am000066400000000000000000000003101224124640700254650ustar00rootroot00000000000000if WITH_GUI SUBDIRS = geostatistics_points geostatistics_kriging geostatistics_grid geostatistics_regression else SUBDIRS = geostatistics_points geostatistics_grid geostatistics_regression endif saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/Makefile.in000066400000000000000000000431371224124640700255140ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_geostatistics/geostatistics DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = geostatistics_points geostatistics_grid \ geostatistics_regression geostatistics_kriging DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @WITH_GUI_FALSE@SUBDIRS = geostatistics_points geostatistics_grid geostatistics_regression @WITH_GUI_TRUE@SUBDIRS = geostatistics_points geostatistics_kriging geostatistics_grid geostatistics_regression all: all-recursive .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) --gnu src/modules_geostatistics/geostatistics/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_geostatistics/geostatistics/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/000077500000000000000000000000001224124640700273315ustar00rootroot00000000000000GSGrid_Directional_Statistics.cpp000066400000000000000000000324071224124640700356320ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/********************************************************** * Version $Id: GSGrid_Directional_Statistics.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // GSGrid_Directional_Statistics.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GSGrid_Directional_Statistics.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { id_Mean = 0, id_DifMean, id_Min, id_Max, id_Range, id_Var, id_StdDev, id_StdDevLo, id_StdDevHi, id_DevMean, id_Percent, id_Count }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGSGrid_Directional_Statistics::CGSGrid_Directional_Statistics(void) { Set_Name (_TL("Directional Statistics for Single Grid")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Calculates for each cell statistical properties (arithmetic mean, minimum, maximum, " "variance, standard deviation) of all cells lying in given direction based on the input grid. " )); Parameters.Add_Grid(NULL, "GRID" , _TL("Grid") , _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "MEAN" , _TL("Arithmetic Mean") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "DIFMEAN" , _TL("Difference from Arithmetic Mean") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "MIN" , _TL("Minimum") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "MAX" , _TL("Maximum") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "RANGE" , _TL("Range") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "VAR" , _TL("Variance") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "STDDEV" , _TL("Standard Deviation") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "STDDEVLO" , _TL("Mean less Standard Deviation") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "STDDEVHI" , _TL("Mean plus Standard Deviation") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "DEVMEAN" , _TL("Deviation from Arithmetic Mean") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "PERCENT" , _TL("Percentile") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Shapes( NULL, "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT_OPTIONAL, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL, "POINTS_OUT" , _TL("Directional Statistics for Points"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); Parameters.Add_Value( NULL, "DIRECTION" , _TL("Direction [Degree]"), _TL(""), PARAMETER_TYPE_Double ); Parameters.Add_Value( NULL, "TOLERANCE" , _TL("Tolerance [Degree]"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true, 45.0, true ); Parameters.Add_Value( NULL, "MAXDISTANCE" , _TL("Maximum Distance [Cells]"), _TL("Maximum distance parameter is ignored if set to zero (default)."), PARAMETER_TYPE_Int, 0.0, 0.0, true ); Parameters.Add_Parameters( NULL, "WEIGHTING" , _TL("Weighting"), _TL("") )->asParameters()->Assign(m_Cells.Get_Weighting().Get_Parameters()); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGSGrid_Directional_Statistics::On_Execute(void) { int Radius; double Direction, Tolerance, s[id_Count]; CSG_Shapes *pPoints; //----------------------------------------------------- m_pGrid = Parameters("GRID") ->asGrid(); m_pMean = Parameters("MEAN") ->asGrid(); m_pDifMean = Parameters("DIFMEAN") ->asGrid(); m_pMin = Parameters("MIN") ->asGrid(); m_pMax = Parameters("MAX") ->asGrid(); m_pRange = Parameters("RANGE") ->asGrid(); m_pVar = Parameters("VAR") ->asGrid(); m_pStdDev = Parameters("STDDEV") ->asGrid(); m_pStdDevLo = Parameters("STDDEVLO") ->asGrid(); m_pStdDevHi = Parameters("STDDEVHI") ->asGrid(); m_pDevMean = Parameters("DEVMEAN") ->asGrid(); m_pPercent = Parameters("PERCENT") ->asGrid(); pPoints = Parameters("POINTS") ->asShapes(); //----------------------------------------------------- if( !(m_pMean || m_pDifMean || m_pMin || m_pMax || m_pRange || m_pVar || m_pStdDev || m_pStdDevLo || m_pStdDevHi || m_pPercent || pPoints) ) { Message_Dlg(_TL("no target specified")); return( false ); } //----------------------------------------------------- Direction = Parameters("DIRECTION") ->asDouble() * M_DEG_TO_RAD; Tolerance = Parameters("TOLERANCE") ->asDouble() * M_DEG_TO_RAD; Radius = Parameters("MAXDISTANCE") ->asInt(); if( Radius <= 0 ) { Radius = 1 + (int)SG_Get_Length(Get_NX(), Get_NY()); } m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters()); if( !m_Cells.Set_Sector(Radius, Direction, Tolerance) ) { return( false ); } //----------------------------------------------------- if( m_pMean || m_pDifMean || m_pMin || m_pMax || m_pRange || m_pVar || m_pStdDev || m_pStdDevLo || m_pStdDevHi || m_pPercent ) { for(int y=0; ySet_Value(x, y, s[id_Mean ]); if( m_pDifMean ) m_pDifMean ->Set_Value(x, y, s[id_DifMean ]); if( m_pMin ) m_pMin ->Set_Value(x, y, s[id_Min ]); if( m_pMax ) m_pMax ->Set_Value(x, y, s[id_Max ]); if( m_pRange ) m_pRange ->Set_Value(x, y, s[id_Range ]); if( m_pVar ) m_pVar ->Set_Value(x, y, s[id_Var ]); if( m_pStdDev ) m_pStdDev ->Set_Value(x, y, s[id_StdDev ]); if( m_pStdDevLo ) m_pStdDevLo ->Set_Value(x, y, s[id_StdDevLo]); if( m_pStdDevHi ) m_pStdDevHi ->Set_Value(x, y, s[id_StdDevHi]); if( m_pDevMean ) m_pDevMean ->Set_Value(x, y, s[id_DevMean ]); if( m_pPercent ) m_pPercent ->Set_Value(x, y, s[id_Percent ]); } else { if( m_pMean ) m_pMean ->Set_NoData(x, y); if( m_pDifMean ) m_pDifMean ->Set_NoData(x, y); if( m_pMin ) m_pMin ->Set_NoData(x, y); if( m_pMax ) m_pMax ->Set_NoData(x, y); if( m_pRange ) m_pRange ->Set_NoData(x, y); if( m_pVar ) m_pVar ->Set_NoData(x, y); if( m_pStdDev ) m_pStdDev ->Set_NoData(x, y); if( m_pStdDevLo ) m_pStdDevLo ->Set_NoData(x, y); if( m_pStdDevHi ) m_pStdDevHi ->Set_NoData(x, y); if( m_pDevMean ) m_pDevMean ->Set_NoData(x, y); if( m_pPercent ) m_pPercent ->Set_NoData(x, y); } } } } //----------------------------------------------------- if( pPoints ) { if( Parameters("POINTS_OUT")->asShapes() && Parameters("POINTS_OUT")->asShapes() != pPoints ) { pPoints = Parameters("POINTS_OUT")->asShapes(); pPoints->Create(*Parameters("POINTS")->asShapes()); pPoints->Set_Name(CSG_String::Format(SG_T("%s [a: %.2f, d: %.2f]"), _TL("Directional Statistics"), Direction * M_RAD_TO_DEG, Tolerance * M_RAD_TO_DEG)); } int x, y, id_Offset = pPoints->Get_Field_Count(); pPoints->Add_Field(_TL("MEAN") , SG_DATATYPE_Double); pPoints->Add_Field(_TL("DIFF_MEAN") , SG_DATATYPE_Double); pPoints->Add_Field(_TL("MIN") , SG_DATATYPE_Double); pPoints->Add_Field(_TL("MAX") , SG_DATATYPE_Double); pPoints->Add_Field(_TL("RANGE") , SG_DATATYPE_Double); pPoints->Add_Field(_TL("VARIANCE") , SG_DATATYPE_Double); pPoints->Add_Field(_TL("STDDEV") , SG_DATATYPE_Double); pPoints->Add_Field(_TL("STDDEV_LO") , SG_DATATYPE_Double); pPoints->Add_Field(_TL("STDDEV_HI") , SG_DATATYPE_Double); pPoints->Add_Field(_TL("STDDEV_MEAN") , SG_DATATYPE_Double); pPoints->Add_Field(_TL("PERCENTILE") , SG_DATATYPE_Double); for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { CSG_Shape *pPoint = pPoints->Get_Shape(iPoint); if( Get_System()->Get_World_to_Grid(x, y, pPoint->Get_Point(0)) && Get_Statistics(x, y, s) ) { for(int i=0; iSet_Value(id_Offset + i, s[i]); } } else { for(int i=0; iSet_NoData(id_Offset + i); } } } DataObject_Update(pPoints); } //----------------------------------------------------- m_Cells.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGSGrid_Directional_Statistics::Get_Statistics(int x, int y, double *s) { if( m_pGrid->is_InGrid(x, y) ) { int i, ix, iy, nLower; double z, iz, id, iw; CSG_Simple_Statistics Statistics; for(i=0, nLower=0, z=m_pGrid->asDouble(x, y); i 0.0 && m_pGrid->is_InGrid(ix, iy) ) { Statistics.Add_Value(iz = m_pGrid->asDouble(ix, iy), iw); if( z > iz ) { nLower++; } } } //------------------------------------------------- if( Statistics.Get_Weights() > 0.0 ) { s[id_Mean ] = Statistics.Get_Mean(); s[id_DifMean ] = m_pGrid->asDouble(x, y) - Statistics.Get_Mean(); s[id_Min ] = Statistics.Get_Minimum(); s[id_Max ] = Statistics.Get_Maximum(); s[id_Range ] = Statistics.Get_Range(); s[id_Var ] = Statistics.Get_Variance(); s[id_StdDev ] = Statistics.Get_StdDev(); s[id_StdDevLo] = Statistics.Get_Mean() - Statistics.Get_StdDev(); s[id_StdDevHi] = Statistics.Get_Mean() + Statistics.Get_StdDev(); s[id_DevMean ] = Statistics.Get_StdDev() > 0.0 ? ((z - Statistics.Get_Mean()) / Statistics.Get_StdDev()) : 0.0; s[id_Percent ] = 100.0 * nLower / (double)Statistics.Get_Count(); return( true ); } } //----------------------------------------------------- return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- GSGrid_Directional_Statistics.h000066400000000000000000000110701224124640700352700ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/********************************************************** * Version $Id: GSGrid_Directional_Statistics.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // GSGrid_Directional_Statistics.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GSGrid_Directional_Statistics_H #define HEADER_INCLUDED__GSGrid_Directional_Statistics_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGSGrid_Directional_Statistics : public CSG_Module_Grid { public: CGSGrid_Directional_Statistics(void); protected: virtual bool On_Execute (void); private: CSG_Grid_Cell_Addressor m_Cells; CSG_Grid *m_pGrid, *m_pMean, *m_pDifMean, *m_pMin, *m_pMax, *m_pRange, *m_pVar, *m_pStdDev, *m_pStdDevLo, *m_pStdDevHi, *m_pDevMean, *m_pPercent; bool Get_Statistics (int x, int y, double *s); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__GSGrid_Directional_Statistics_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.cpp000066400000000000000000000214651224124640700331770ustar00rootroot00000000000000/********************************************************** * Version $Id: GSGrid_Residuals.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // GSGrid_Residuals.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GSGrid_Residuals.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGSGrid_Residuals::CGSGrid_Residuals(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Residual Analysis (Grid)")); Set_Author (SG_T("O.Conrad (c) 2003")); Set_Description (_TW("Relations of each grid cell to its neighborhood. " "Wilson & Gallant (2000) used this type of calculation in terrain analysis.\n" "\n" "Reference:\n" "- Wilson, J.P., Gallant, J.C., [Eds.] (2000): " "'Terrain analysis - principles and applications', " "New York, John Wiley & Sons, Inc.\n" )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL, "GRID" , _TL("Grid") , _TL(""), PARAMETER_INPUT); Parameters.Add_Grid( NULL, "MEAN" , _TL("Mean Value") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Grid( NULL, "DIFF" , _TL("Difference from Mean Value") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Grid( NULL, "STDDEV" , _TL("Standard Deviation") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Grid( NULL, "RANGE" , _TL("Value Range") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Grid( NULL, "MIN" , _TL("Minimum Value") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Grid( NULL, "MAX" , _TL("Maximum Value") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Grid( NULL, "DEVMEAN" , _TL("Deviation from Mean Value") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Grid( NULL, "PERCENT" , _TL("Percentile") , _TL(""), PARAMETER_OUTPUT); Parameters.Add_Value( NULL, "RADIUS" , _TL("Radius (Cells)") , _TL(""), PARAMETER_TYPE_Int, 7, 1, true); Parameters.Add_Parameters( NULL, "WEIGHTING" , _TL("Weighting"), _TL("") )->asParameters()->Assign(m_Cells.Get_Weighting().Get_Parameters()); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGSGrid_Residuals::On_Execute(void) { m_pGrid = Parameters("GRID") ->asGrid(); m_pMean = Parameters("MEAN") ->asGrid(); m_pDiff = Parameters("DIFF") ->asGrid(); m_pStdDev = Parameters("STDDEV") ->asGrid(); m_pRange = Parameters("RANGE") ->asGrid(); m_pMin = Parameters("MIN") ->asGrid(); m_pMax = Parameters("MAX") ->asGrid(); m_pDevMean = Parameters("DEVMEAN") ->asGrid(); m_pPercent = Parameters("PERCENT") ->asGrid(); DataObject_Set_Colors(m_pDiff , 100, SG_COLORS_RED_GREY_BLUE, true); DataObject_Set_Colors(m_pStdDev , 100, SG_COLORS_RED_GREY_BLUE, true); DataObject_Set_Colors(m_pRange , 100, SG_COLORS_RED_GREY_BLUE, true); DataObject_Set_Colors(m_pMin , 100, SG_COLORS_RED_GREY_BLUE, true); DataObject_Set_Colors(m_pMax , 100, SG_COLORS_RED_GREY_BLUE, true); DataObject_Set_Colors(m_pDevMean, 100, SG_COLORS_RED_GREY_BLUE, true); DataObject_Set_Colors(m_pPercent, 100, SG_COLORS_RED_GREY_BLUE, true); //----------------------------------------------------- m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters()); if( !m_Cells.Set_Radius(Parameters("RADIUS")->asInt()) ) { return( false ); } //----------------------------------------------------- for(int y=0; yis_InGrid(x, y) ) { int i, ix, iy, nLower; double z, iz, id, iw; CSG_Simple_Statistics Statistics; for(i=0, nLower=0, z=m_pGrid->asDouble(x, y); i 0.0 && m_pGrid->is_InGrid(ix, iy) ) { Statistics.Add_Value(iz = m_pGrid->asDouble(ix, iy), iw); if( z > iz ) { nLower++; } } } //------------------------------------------------- if( Statistics.Get_Weights() > 0.0 ) { m_pMean ->Set_Value(x, y, Statistics.Get_Mean()); m_pDiff ->Set_Value(x, y, z - Statistics.Get_Mean()); m_pStdDev ->Set_Value(x, y, Statistics.Get_StdDev()); m_pRange ->Set_Value(x, y, Statistics.Get_Range()); m_pMin ->Set_Value(x, y, Statistics.Get_Minimum()); m_pMax ->Set_Value(x, y, Statistics.Get_Maximum()); m_pDevMean ->Set_Value(x, y, Statistics.Get_StdDev() > 0.0 ? ((z - Statistics.Get_Mean()) / Statistics.Get_StdDev()) : 0.0); m_pPercent ->Set_Value(x, y, 100.0 * nLower / (double)Statistics.Get_Count()); return( true ); } } //----------------------------------------------------- m_pMean ->Set_NoData(x, y); m_pDiff ->Set_NoData(x, y); m_pStdDev ->Set_NoData(x, y); m_pRange ->Set_NoData(x, y); m_pMin ->Set_NoData(x, y); m_pMax ->Set_NoData(x, y); m_pDevMean ->Set_NoData(x, y); m_pPercent ->Set_NoData(x, y); return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Residuals.h000066400000000000000000000112451224124640700326370ustar00rootroot00000000000000/********************************************************** * Version $Id: GSGrid_Residuals.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // GSGrid_Residuals.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GSGrid_Residuals_H #define HEADER_INCLUDED__GSGrid_Residuals_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGSGrid_Residuals : public CSG_Module_Grid { public: CGSGrid_Residuals(void); protected: virtual bool On_Execute (void); private: CSG_Grid_Cell_Addressor m_Cells; CSG_Grid *m_pGrid, *m_pMean, *m_pDiff, *m_pStdDev, *m_pRange, *m_pMin, *m_pMax, *m_pDevMean, *m_pPercent; bool Get_Statistics (int x, int y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__GSGrid_Residuals_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.cpp000066400000000000000000000362711224124640700333770ustar00rootroot00000000000000/********************************************************** * Version $Id: GSGrid_Statistics.cpp 1631 2013-03-21 17:51:44Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // GSGrid_Statistics.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GSGrid_Statistics.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGSGrid_Statistics::CGSGrid_Statistics(void) { Set_Name (_TL("Statistics for Grids")); Set_Author (SG_T("O.Conrad (c) 2005")); Set_Description (_TW( "Calculates statistical properties (arithmetic mean, minimum, maximum, " "variance, standard deviation) for each cell position for the values of " "the selected grids." )); Parameters.Add_Grid_List( NULL, "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid(NULL, "MEAN" , _TL("Arithmetic Mean") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "MIN" , _TL("Minimum") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "MAX" , _TL("Maximum") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "RANGE" , _TL("Range") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "VAR" , _TL("Variance") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "STDDEV" , _TL("Standard Deviation") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "STDDEVLO", _TL("Mean less Standard Deviation"), _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "STDDEVHI", _TL("Mean plus Standard Deviation"), _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Grid(NULL, "PCTL" , _TL("Percentile") , _TL(""), PARAMETER_OUTPUT_OPTIONAL); Parameters.Add_Value( NULL, "PCTL_VAL", _TL("Percentile"), _TL(""), PARAMETER_TYPE_Double, 50.0, 0.0, true, 100.0, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGSGrid_Statistics::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PCTL")) ) { pParameters->Get_Parameter("PCTL_VAL")->Set_Enabled(pParameter->asGrid() != NULL); } return( 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGSGrid_Statistics::On_Execute(void) { //----------------------------------------------------- CSG_Parameter_Grid_List *pGrids = Parameters("GRIDS")->asGridList(); if( pGrids->Get_Count() <= 1 ) { Error_Set(_TL("no grids in selection")); return( false ); } //----------------------------------------------------- CSG_Grid *pMean = Parameters("MEAN" )->asGrid(); CSG_Grid *pMin = Parameters("MIN" )->asGrid(); CSG_Grid *pMax = Parameters("MAX" )->asGrid(); CSG_Grid *pRange = Parameters("RANGE" )->asGrid(); CSG_Grid *pVar = Parameters("VAR" )->asGrid(); CSG_Grid *pStdDev = Parameters("STDDEV" )->asGrid(); CSG_Grid *pStdDevLo = Parameters("STDDEVLO")->asGrid(); CSG_Grid *pStdDevHi = Parameters("STDDEVHI")->asGrid(); CSG_Grid *pPercentile = Parameters("PCTL" )->asGrid(); if( !pMean && !pMin && !pMax && !pRange && !pVar && !pStdDev && !pStdDevLo && !pStdDevHi && !pPercentile ) { Error_Set(_TL("no parameter output specified")); return( false ); } double dRank = Parameters("PCTL_VAL")->asDouble() / 100.0; //----------------------------------------------------- for(int y=0; yGet_Count(); i++) { if( !pGrids->asGrid(i)->is_NoData(x, y) ) { double z = pGrids->asGrid(i)->asDouble(x, y); s.Add_Value(z); if( pPercentile ) { if( Values.Get_Field_Count() == 0 ) { Values.Add_Field("Z", SG_DATATYPE_Double); } Values.Add_Record()->Set_Value(0, z); } } } //----------------------------------------- if( s.Get_Count() <= 0 ) { if( pMean ) pMean ->Set_NoData(x, y); if( pMin ) pMin ->Set_NoData(x, y); if( pMax ) pMax ->Set_NoData(x, y); if( pRange ) pRange ->Set_NoData(x, y); if( pVar ) pVar ->Set_NoData(x, y); if( pStdDev ) pStdDev ->Set_NoData(x, y); if( pStdDevLo ) pStdDevLo ->Set_NoData(x, y); if( pStdDevHi ) pStdDevHi ->Set_NoData(x, y); if( pPercentile ) pPercentile ->Set_NoData(x, y); } else { if( pMean ) pMean ->Set_Value(x, y, s.Get_Mean()); if( pMin ) pMin ->Set_Value(x, y, s.Get_Minimum()); if( pMax ) pMax ->Set_Value(x, y, s.Get_Maximum()); if( pRange ) pRange ->Set_Value(x, y, s.Get_Range()); if( pVar ) pVar ->Set_Value(x, y, s.Get_Variance()); if( pStdDev ) pStdDev ->Set_Value(x, y, s.Get_StdDev()); if( pStdDevLo ) pStdDevLo ->Set_Value(x, y, s.Get_Mean() - s.Get_StdDev()); if( pStdDevHi ) pStdDevHi ->Set_Value(x, y, s.Get_Mean() + s.Get_StdDev()); if( pPercentile ) { Values.Set_Index(0, TABLE_INDEX_Ascending); pPercentile->Set_Value(x, y, Values.Get_Record_byIndex((int)(dRank * s.Get_Count()))->asDouble(0)); } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGSGrid_Statistics_To_Table::CGSGrid_Statistics_To_Table(void) { Set_Name (_TL("Save Grid Statistics to Table")); Set_Author (SG_T("O.Conrad (c) 2013")); Set_Description (_TW( "Calculates statistical properties (arithmetic mean, minimum, maximum, " "variance, standard deviation) for each of the given grids and saves " "it to a table." )); Parameters.Add_Grid_List( NULL, "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL, "STATS" , _TL("Statistics for Grids"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value(NULL, "DATA_CELLS" , _TL("Number of Data Cells") , _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(NULL, "NODATA_CELLS", _TL("Number of No-Data Cells") , _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(NULL, "CELLSIZE" , _TL("Cellsize") , _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(NULL, "MEAN" , _TL("Arithmetic Mean") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(NULL, "MIN" , _TL("Minimum") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(NULL, "MAX" , _TL("Maximum") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(NULL, "RANGE" , _TL("Range") , _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(NULL, "VAR" , _TL("Variance") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(NULL, "STDDEV" , _TL("Standard Deviation") , _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(NULL, "STDDEVLO" , _TL("Mean less Standard Deviation"), _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(NULL, "STDDEVHI" , _TL("Mean plus Standard Deviation"), _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(NULL, "PCTL" , _TL("Percentile") , _TL(""), PARAMETER_TYPE_Bool, false); Parameters.Add_Value( NULL, "PCTL_VAL", _TL("Percentile"), _TL(""), PARAMETER_TYPE_Double, 50.0, 0.0, true, 100.0, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGSGrid_Statistics_To_Table::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PCTL")) ) { pParameters->Get_Parameter("PCTL_VAL")->Set_Enabled(pParameter->asBool()); } return( 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGSGrid_Statistics_To_Table::On_Execute(void) { //----------------------------------------------------- CSG_Parameter_Grid_List *pGrids = Parameters("GRIDS")->asGridList(); if( pGrids->Get_Count() < 1 ) { Error_Set(_TL("no grids in selection")); return( false ); } //----------------------------------------------------- CSG_Table *pTable = Parameters("STATS")->asTable(); pTable->Destroy(); pTable->Set_Name(_TL("Statistics for Grids")); pTable->Add_Field(_TL("NAME"), SG_DATATYPE_String); if( Parameters("DATA_CELLS" )->asBool() ) pTable->Add_Field(_TL("DATA_CELLS" ), SG_DATATYPE_Int); if( Parameters("NODATA_CELLS")->asBool() ) pTable->Add_Field(_TL("NODATA_CELLS"), SG_DATATYPE_Int); if( Parameters("CELLSIZE" )->asBool() ) pTable->Add_Field(_TL("CELLSIZE" ), SG_DATATYPE_Double); if( Parameters("MEAN" )->asBool() ) pTable->Add_Field(_TL("MEAN" ), SG_DATATYPE_Double); if( Parameters("MIN" )->asBool() ) pTable->Add_Field(_TL("MIN" ), SG_DATATYPE_Double); if( Parameters("MAX" )->asBool() ) pTable->Add_Field(_TL("MAX" ), SG_DATATYPE_Double); if( Parameters("RANGE" )->asBool() ) pTable->Add_Field(_TL("RANGE" ), SG_DATATYPE_Double); if( Parameters("VAR" )->asBool() ) pTable->Add_Field(_TL("VAR" ), SG_DATATYPE_Double); if( Parameters("STDDEV" )->asBool() ) pTable->Add_Field(_TL("STDDEV" ), SG_DATATYPE_Double); if( Parameters("STDDEVLO" )->asBool() ) pTable->Add_Field(_TL("STDDEVLO" ), SG_DATATYPE_Double); if( Parameters("STDDEVHI" )->asBool() ) pTable->Add_Field(_TL("STDDEVHI" ), SG_DATATYPE_Double); if( Parameters("PCTL" )->asBool() ) pTable->Add_Field(_TL("PCTL" ), SG_DATATYPE_Double); if( pTable->Get_Field_Count() <= 1 ) { Error_Set(_TL("no parameter output specified")); return( false ); } double dRank = Parameters("PCTL")->asBool() ? Parameters("PCTL_VAL")->asDouble() : -1.0; //----------------------------------------------------- for(int i=0; iGet_Count() && Process_Get_Okay(); i++) { CSG_Grid *pGrid = pGrids->asGrid(i); CSG_Table_Record *pRecord = pTable->Add_Record(); pRecord->Set_Value("NAME" , pGrid->Get_Name()); pRecord->Set_Value("DATA_CELLS" , pGrid->Get_NCells() - pGrid->Get_NoData_Count()); pRecord->Set_Value("NODATA_CELLS", pGrid->Get_NoData_Count()); pRecord->Set_Value("CELLSIZE" , pGrid->Get_Cellsize()); pRecord->Set_Value("MEAN" , pGrid->Get_ArithMean()); pRecord->Set_Value("MIN" , pGrid->Get_ZMin()); pRecord->Set_Value("MAX" , pGrid->Get_ZMax()); pRecord->Set_Value("RANGE" , pGrid->Get_ZRange()); pRecord->Set_Value("VAR" , pGrid->Get_Variance()); pRecord->Set_Value("STDDEV" , pGrid->Get_StdDev()); pRecord->Set_Value("STDDEVLO" , pGrid->Get_ArithMean() - pGrid->Get_StdDev()); pRecord->Set_Value("STDDEVHI" , pGrid->Get_ArithMean() + pGrid->Get_StdDev()); if( dRank > 0.0 && dRank < 100.0 ) { pRecord->Set_Value("PCTL", pGrid->Get_Percentile(dRank)); // this is a time consuming operation } } if( dRank > 0.0 && dRank < 100.0 ) { pTable->Set_Field_Name(pTable->Get_Field_Count() - 1, CSG_String::Format(SG_T("%s%02d"), _TL("PCTL"), (int)dRank)); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Statistics.h000066400000000000000000000116351224124640700330410ustar00rootroot00000000000000/********************************************************** * Version $Id: GSGrid_Statistics.h 1598 2013-01-29 08:53:46Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // GSGrid_Statistics.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GSGrid_Statistics_H #define HEADER_INCLUDED__GSGrid_Statistics_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGSGrid_Statistics : public CSG_Module_Grid { public: CGSGrid_Statistics(void); protected: virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGSGrid_Statistics_To_Table : public CSG_Module_Grid { public: CGSGrid_Statistics_To_Table(void); protected: virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__GSGrid_Statistics_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance.cpp000066400000000000000000000226011224124640700327650ustar00rootroot00000000000000/********************************************************** * Version $Id: GSGrid_Variance.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // GSGrid_Variance.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GSGrid_Variance.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGSGrid_Variance::CGSGrid_Variance(void) { Set_Name (_TL("Representativeness (Grid)")); Set_Author (SG_T("(c) 2003 by O.Conrad")); Set_Description (_TW( "Representativeness - calculation of the variance within a given search radius.\n" "\n" "Reference:\n" "- Boehner, J., Koethe, R., Trachinow, C. (1997): " "'Weiterentwicklung der automatischen Reliefanalyse auf der Basis von Digitalen Gelaendemodellen', " "Goettinger Geographische Abhandlungen, Vol.100, p.3-21\n" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "RESULT" , _TL("Representativeness"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "RADIUS" , _TL("Radius (Cells)"), _TL(""), PARAMETER_TYPE_Int, 10 ); Parameters.Add_Value( NULL , "EXPONENT", _TL("Exponent"), _TL(""), PARAMETER_TYPE_Double, 1 ); } //--------------------------------------------------------- CGSGrid_Variance::~CGSGrid_Variance(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGSGrid_Variance::On_Execute(void) { int x, y; //----------------------------------------------------- pInput = Parameters("INPUT" )->asGrid(); pOutput = Parameters("RESULT" )->asGrid(); maxRadius = Parameters("RADIUS" )->asInt(); Exponent = Parameters("EXPONENT" )->asDouble(); //----------------------------------------------------- Initialize(); //----------------------------------------------------- for(y=0; ySet_Value(x,y, Get_Laenge(x,y) ); } } //----------------------------------------------------- Finalize(); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGSGrid_Variance::Initialize(void) { pOutput->Assign_NoData(); V = (double *)malloc((maxRadius + 2) * sizeof(double)); Z = (int *)malloc((maxRadius + 2) * sizeof(int )); g = (double *)malloc((maxRadius + 2) * sizeof(double)); m = (double *)malloc((maxRadius + 2) * sizeof(double)); rLength = (int *)malloc((maxRadius + 2) * sizeof(int )); Init_Radius(); } //--------------------------------------------------------- void CGSGrid_Variance::Init_Radius(void) { int k, maxZ; long i, j, iijj, rr, r1r1, z; maxZ = z = 0; rLength[0] = 0; x_diff = y_diff = NULL; for(k=1; k<=maxRadius; k++) { rr = k*k; r1r1 = (k - 1) * (k - 1); for(i=-k; i<=k; i++) { for(j=-k; j<=k; j++) { iijj = i*i + j*j; if( iijj<=rr && iijj>r1r1 ) { if( maxZ<=z ) { maxZ += 1000; x_diff = (int *)realloc(x_diff,maxZ*sizeof(int)); y_diff = (int *)realloc(y_diff,maxZ*sizeof(int)); } x_diff[z] = j; y_diff[z] = i; z++; } } } rLength[k] = z; } } //--------------------------------------------------------- void CGSGrid_Variance::Finalize(void) { free(V); free(Z); free(rLength); free(g); free(m); free(x_diff); free(y_diff); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- double CGSGrid_Variance::Get_Laenge(int x, int y) { int iRadius, Count; double d; //----------------------------------------------------- V[0] = Get_GSGrid_Variance(x,y,1,Count); Z[0] = Count; for(iRadius=1; iRadiusasDouble(x,y); for(i=rLength[iRadius-1], Count=0; i= Get_NX() ) ix = Get_NX() - 1; iy = y + y_diff[i]; if( iy < 0 ) iy = 0; else if( iy >= Get_NY() ) iy = Get_NY() - 1; d = z - pInput->asDouble(ix,iy); Variance += d * d; } return( Variance ); } //--------------------------------------------------------- double CGSGrid_Variance::Get_Steigung(void) { int i; double summe_mg, summe_g; //----------------------------------------------------- // Steigungen berechnen... m[0] = V[0] / Get_Cellsize(); for(i=1; iasDouble()); maxRadius = Parameters("RADIUS") ->asInt(); bWriteGridsize = Parameters("OUTPUT") ->asInt() == 0; pGrid = Parameters("INPUT") ->asGrid(); pResult = Parameters("RESULT") ->asGrid(); pResult->Set_Name(CSG_String::Format(SG_T("%s >= %f"), _TL("Radius with Variance"), stopVariance)); //----------------------------------------------------- Initialize(); for(y=0; ySet_Value(x, y, Get_Radius(x, y)); } } Finalize(); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGSGrid_Variance_Radius::Initialize(void) { int x, y; double d; //----------------------------------------------------- pInput = SG_Create_Grid(pGrid); pInputQ = SG_Create_Grid(pGrid); for(y=0; yasDouble(x,y); pInput ->Set_Value(x, y, d ); pInputQ ->Set_Value(x, y, d*d); } } //----------------------------------------------------- // Radius Check-Matrix erstellen... Check = (int **)malloc((maxRadius + 1) * sizeof(int *)); for(y=0; y<=maxRadius; y++) { Check[y] = (int *)malloc((maxRadius + 1) * sizeof(int)); for(x=0; x<=maxRadius; x++) { // Check[y][x] = (int)sqrt(x*x + y*y); Check[y][x] = (int)sqrt((x + 0.5) * (x + 0.5) + (y + 0.5) * (y + 0.5)); } } } //--------------------------------------------------------- void CGSGrid_Variance_Radius::Finalize(void) { if( pInput ) { delete(pInput); pInput = NULL; } if( pInputQ ) { delete(pInputQ); pInputQ = NULL; } if( Check ) { for(int y=0; y<=maxRadius; y++) { free(Check[y]); } free(Check); Check = NULL; maxRadius = 0; } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- double CGSGrid_Variance_Radius::Get_Radius(int xPoint, int yPoint) { const double sqrt2 = 1.0 / sqrt(2.0); int x, y, dx, dy, sRadius, Radius = 0, nValues = 0; double ArithMean, Variance, Sum = 0.0, SumQ = 0.0; do { sRadius = (int)(sqrt2 * (double)Radius - 4.0); if( sRadius < 0 ) sRadius = 0; //------------------------------------------------- for(dy=sRadius; dy<=Radius; dy++) { for(dx=sRadius; dx<=Radius; dx++) { if(Check[dy][dx] == Radius) { y = yPoint - dy; if(y>=0) { x = xPoint - dx; if(x>=0) { Sum += pInput->asDouble(x,y); SumQ += pInputQ->asDouble(x,y); nValues++; } x = xPoint + dx; if(xasDouble(x,y); SumQ += pInputQ->asDouble(x,y); nValues++; } } y = yPoint + dy; if(y=0) { Sum += pInput->asDouble(x,y); SumQ += pInputQ->asDouble(x,y); nValues++; } x = xPoint + dx; if(xasDouble(x,y); SumQ += pInputQ->asDouble(x,y); nValues++; } } } } } //------------------------------------------------- if(nValues) { ArithMean = Sum / nValues; Variance = SumQ / nValues - ArithMean * ArithMean; // Andre, das ist die Formel aus deinem Buch... // Variance = (SumQ - nValues * ArithMean * ArithMean) / nValues; } else Variance = 0; Radius++; } while(Variance < stopVariance && Radius <= maxRadius); return( bWriteGridsize ? Radius : Radius * Get_Cellsize() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Variance_Radius.h000066400000000000000000000112141224124640700337370ustar00rootroot00000000000000/********************************************************** * Version $Id: GSGrid_Variance_Radius.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // GSGrid_Variance_Radius.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GSGrid_Variance_Radius_H #define HEADER_INCLUDED__GSGrid_Variance_Radius_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGSGrid_Variance_Radius : public CSG_Module_Grid { public: CGSGrid_Variance_Radius(void); virtual ~CGSGrid_Variance_Radius(void); protected: virtual bool On_Execute (void); private: bool bWriteGridsize; int **Check, maxRadius; double stopVariance; CSG_Grid *pGrid, *pResult, *pInput, *pInputQ; void Initialize (void); void Finalize (void); double Get_Radius (int xPoint, int yPoint); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__GSGrid_Variance_Radius_H GSGrid_Zonal_Statistics.cpp000066400000000000000000000502201224124640700344510ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/********************************************************** * Version $Id: GSGrid_Zonal_Statistics.cpp 1584 2013-01-03 18:33:38Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // GSGrid_Zonal_Statistics.cpp // // // // Copyright (C) 2005-9 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: reklovw@web.de // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GSGrid_Zonal_Statistics.h" /////////////////////////////////////////////////////////// // // // Construction/Destruction // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGSGrid_Zonal_Statistics::CGSGrid_Zonal_Statistics(void) { //----------------------------------------------------- // Place information about your module here... Set_Name (_TL("{STATZONAL_NAME} Zonal Grid Statistics")); Set_Author (_TL("Copyrights (c) 2005 by Volker Wichmann")); Set_Description (_TW("{STATZONAL_DESC} " "The module calculates zonal statistics and reports these in a table. " "The module can be used to create a contingency table of unique condition units (UCUs). These " "units are delineated from a zonal grid (e.g. sub catchments) and optional categorical grids (e.g. " "landcover, soil, ...). It is possible to calculate descriptive statistics (n, min, max, mean, standard " "deviation and sum) for each UCU from optional grids with continious data (e.g. slope; aspect must be " "handled specially, please use the \"Aspect\" input parameter for such a grid). The number " "of input grids is only limited by available memory.\n\n" "The module has four different modes of operation:\n" "(1) only a zonal grid is used as input. This results in a simple contingency table with " "the number of grid cells in each zone.\n" "(2) a zonal grid and additional categorical grids are used as " "input. This results in a contingency table with the number of cells in each UCU.\n" "(3) a zonal grid " "and additional grids with continuous data are used as input. This results in a contingency table " "with the number of cells in each zone and some simple statistics for each zone. The statistics are " "calculated for each continuous grid.\n" "(4) a zonal grid, additional categorical grids and additional " "grids with continuous data are used as input. This results in a contingency table with the number " "of cells in each UCU and the corresponding statistics for each continuous grid.\n" "\n" "Depending on the mode of operation, the output table contains information about the categorical " "combination of each UCU, the number of cells in each UCU and the statistics for each UCU. A " "typical output table may look like this:\n" "" "" "" "" "
ID ZoneID 1stCatID 2ndCatCount UCUN 1stContMIN 1stContMAX 1stContMEAN 1stContSTDDEV 1stContSUM 1stCont
0 2 6 6 6 708.5 862.0 734.5 62.5 4406.8
0 3 4 106 106 829.1 910.1 848.8 28.5 89969.0
" )); Parameters.Add_Grid( NULL, "ZONES" , _TL("Zone Grid"), _TL("Grid defining the zones to analyse. This grid also acts as a mask. Coding: NoData / categorial values."), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL, "CATLIST" , _TL("Categorical Grids"), _TL("Grids used to delineate the UCUs. Coding: NoData / categorical values."), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid_List( NULL, "STATLIST" , _TL("Grids to analyse"), _TL("Grids with continuous data, statistics are calculated for each grid. Coding: NoData / continuous values."), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "ASPECT" , _TL("Aspect"), _TL("Aspect grid, in radians."), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Table( NULL, "OUTTAB" , _TL("Zonal Statistics"), _TL("Summary table."), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL, "SHORTNAMES" , _TL("Short Field Names"), _TL(""), PARAMETER_TYPE_Bool, true ); } //--------------------------------------------------------- CGSGrid_Zonal_Statistics::~CGSGrid_Zonal_Statistics(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGSGrid_Zonal_Statistics::On_Execute(void) { bool bShortNames; int x, y, nCatGrids, nStatGrids, iGrid, zoneID, catID, NDcount, catLevel, NDcountStat; double statID; CSG_Grid *pZones, *pGrid, *pAspect; CSG_Parameter_Grid_List *pCatList; CSG_Parameter_Grid_List *pStatList; CList_Conti *newZone, *startList, *runList, *newSub, *parent, *runSub, *subList; CList_Stat *runStats; CSG_Table *pOutTab; CSG_Table_Record *pRecord; CSG_String fieldName, tmpName; pZones = Parameters("ZONES") ->asGrid(); pCatList = Parameters("CATLIST") ->asGridList(); pStatList = Parameters("STATLIST") ->asGridList(); pAspect = Parameters("ASPECT") ->asGrid(); pOutTab = Parameters("OUTTAB") ->asTable(); bShortNames = Parameters("SHORTNAMES") ->asBool(); nCatGrids = pCatList ->Get_Count(); nStatGrids = pStatList ->Get_Count(); NDcount = 0; // NoData Counter (ZoneGrid) NDcountStat = 0; // NoData Counter (StatGrids) CSG_String sTabName = Parameters("OUTTAB")->asString(); if (pOutTab != NULL) { pOutTab->Destroy(); pOutTab->Set_Name(sTabName); } newZone = new CList_Conti(); // create first list entry (dummy) startList = newZone; for(y=0; yasInt(x, y); // get zone ID while( runList->next != NULL && runList->cat < zoneID ) // search for last entry in list or insert point { runList = runList->next; } if( runList->dummy == true ) { runList->cat = zoneID; // first list entry, write and runList->dummy = false; // setup } else if( runList->cat == zoneID ) runList = runList; // zoneID found else if( runList->next == NULL && runList->cat < zoneID ) // append zoneID { newZone = new CList_Conti(); newZone->previous = runList; runList->next = newZone; newZone->cat = zoneID; // ... and write info newZone->dummy = false; runList = newZone; } else // insert new entry { newZone = new CList_Conti(); newZone->next = runList; if( runList->previous != NULL ) { newZone->previous = runList->previous; runList->previous->next = newZone; } runList->previous = newZone; if( runList == startList ) startList = newZone; // if new entry is first element, update startList pointer newZone->cat = zoneID; // ... and write info newZone->dummy = false; runList = newZone; } for(iGrid=0; iGridsub == NULL ) // no sub class found { newSub = new CList_Conti(); runList->sub = newSub; } runList = runList->sub; pGrid = pCatList->asGrid(iGrid); if( !pGrid->is_NoData(x, y) ) catID = pGrid->asInt(x, y); else catID = (int)pGrid->Get_NoData_Value(); while( runList->next != NULL && runList->cat < catID ) // search for last entry in list or insert point { runList = runList->next; } if( runList->dummy == true ) { runList->cat = catID; // first list entry, write and runList->dummy = false; // setup runList->parent = parent; } else if( runList->cat == catID ) runList = runList; // zoneID found, all infos already written else if( runList->next == NULL && runList->cat < catID) // append zoneID { newSub = new CList_Conti(); newSub->cat = catID; // ... and write info newSub->previous = runList; newSub->parent = parent; newSub->dummy = false; runList->next = newSub; runList = newSub; } else // insert new entry { newSub = new CList_Conti(); newSub->cat = catID; // ... and write info newSub->next = runList; newSub->parent = parent; newSub->dummy = false; if( runList->previous != NULL ) { newSub->previous = runList->previous; runList->previous->next = newSub; } else parent->sub = newSub; runList->previous = newSub; runList = newSub; } } for(iGrid=0; iGridstats == NULL ) runList->stats = new CList_Stat(); runStats = runList->stats; } else { if( runStats->next == NULL ) runStats->next = new CList_Stat(); runStats = runStats->next; } if( !pStatList->asGrid(iGrid)->is_NoData(x, y) ) { statID = pStatList->asGrid(iGrid)->asDouble(x, y); if( runStats->dummy == true ) { runStats->min = statID; runStats->max = statID; runStats->dummy = false; } if( runStats->min > statID ) runStats->min = statID; if( runStats->max < statID ) runStats->max = statID; runStats->n += 1; runStats->sum += statID; runStats->dev += pow(statID, 2); } else NDcountStat += 1; } if( pAspect != NULL ) { for( int i=0; i<2; i++ ) { if( nStatGrids == 0 && i == 0 ) { if( runList->stats == NULL ) runList->stats = new CList_Stat(); runStats = runList->stats; } else { if( runStats->next == NULL ) runStats->next = new CList_Stat(); runStats = runStats->next; } if( !pAspect->is_NoData(x, y) ) { statID = pAspect->asDouble(x, y); if( i == 0 ) { if( runStats->dummy == true ) { runStats->min = statID; runStats->max = statID; runStats->dummy = false; } if( runStats->min > statID ) runStats->min = statID; if( runStats->max < statID ) runStats->max = statID; statID = sin(statID); } else statID = cos(statID); runStats->n += 1; runStats->sum += statID; } else NDcountStat += 1; } } runList->count += 1; // sum up unique condition area } } // Create fields in output table (1st = Zone, 2nd = Catgrid1, 3rd = Catgrid 2, ...) fieldName = CSG_String::Format(SG_T("%s"),pZones->Get_Name()).BeforeFirst(SG_Char('.')); if (bShortNames && fieldName.Length() > 10) fieldName.Remove(10, fieldName.Length()-10); pOutTab->Add_Field(fieldName, SG_DATATYPE_Int); for(iGrid=0; iGridasGrid(iGrid)->Get_Name()).BeforeFirst(SG_Char('.')); if (bShortNames && fieldName.Length() > 10) fieldName.Remove(10, fieldName.Length()-10); pOutTab->Add_Field(fieldName, SG_DATATYPE_Int); } pOutTab->Add_Field("Count UCU", SG_DATATYPE_Int); for( iGrid=0; iGridasGrid(iGrid)->Get_Name()).BeforeFirst(SG_Char('.')); fieldName = tmpName; if (bShortNames && fieldName.Length()+1 > 10) fieldName.Remove(9, fieldName.Length()-9); pOutTab->Add_Field(CSG_String::Format(SG_T("%sN") , fieldName.c_str()), SG_DATATYPE_Int); fieldName = tmpName; if (bShortNames && fieldName.Length()+3 > 10) fieldName.Remove(7, fieldName.Length()-7); pOutTab->Add_Field(CSG_String::Format(SG_T("%sMIN") , fieldName.c_str()), SG_DATATYPE_Double); pOutTab->Add_Field(CSG_String::Format(SG_T("%sMAX") , fieldName.c_str()), SG_DATATYPE_Double); fieldName = tmpName; if (bShortNames && fieldName.Length()+4 > 10) fieldName.Remove(6, fieldName.Length()-6); pOutTab->Add_Field(CSG_String::Format(SG_T("%sMEAN") , fieldName.c_str()), SG_DATATYPE_Double); fieldName = tmpName; if (bShortNames && fieldName.Length()+6 > 10) fieldName.Remove(4, fieldName.Length()-4); pOutTab->Add_Field(CSG_String::Format(SG_T("%sSTDDEV"), fieldName.c_str()), SG_DATATYPE_Double); fieldName = tmpName; if (bShortNames && fieldName.Length()+3 > 10) fieldName.Remove(7, fieldName.Length()-7); pOutTab->Add_Field(CSG_String::Format(SG_T("%sSUM") , fieldName.c_str()), SG_DATATYPE_Double); } if( pAspect != NULL ) { tmpName = CSG_String::Format(SG_T("%s"),pAspect->Get_Name()).BeforeFirst(SG_Char('.')); fieldName = tmpName; if (bShortNames && fieldName.Length()+1 > 10) fieldName.Remove(9, fieldName.Length()-9); pOutTab->Add_Field(CSG_String::Format(SG_T("%sN") , fieldName.c_str()), SG_DATATYPE_Int); fieldName = tmpName; if (bShortNames && fieldName.Length()+3 > 10) fieldName.Remove(7, fieldName.Length()-7); pOutTab->Add_Field(CSG_String::Format(SG_T("%sMIN") , fieldName.c_str()), SG_DATATYPE_Double); pOutTab->Add_Field(CSG_String::Format(SG_T("%sMAX") , fieldName.c_str()), SG_DATATYPE_Double); fieldName = tmpName; if (bShortNames && fieldName.Length()+4 > 10) fieldName.Remove(6, fieldName.Length()-6); pOutTab->Add_Field(CSG_String::Format(SG_T("%sMEAN") , fieldName.c_str()), SG_DATATYPE_Double); } int iStatFields = 6; // number of table fields: n, min, max, mean, stddev, sum while( startList != NULL ) // scan zone layer list and write cat values in table { runList = startList; while( runList->sub != NULL ) // fall down to lowest layer runList = runList->sub; subList = runList; // use pointer to scan horizontal while( subList != NULL ) // move forward and read all categories of this layer (including the parent layers) { runSub = subList; catLevel = nCatGrids; pRecord = pOutTab->Add_Record(); // create new record in table pRecord->Set_Value((catLevel+1), runSub->count); // read/write field count for(iGrid=0; iGridstats; else runStats = runStats->next; pRecord->Set_Value(catLevel+2+iGrid*iStatFields, runStats->n); pRecord->Set_Value(catLevel+3+iGrid*iStatFields, runStats->min); pRecord->Set_Value(catLevel+4+iGrid*iStatFields, runStats->max); pRecord->Set_Value(catLevel+5+iGrid*iStatFields, runStats->sum/runStats->n); pRecord->Set_Value(catLevel+6+iGrid*iStatFields, sqrt((runStats->dev - runStats->n*pow(runStats->sum/runStats->n, 2)) / (runStats->n - 1))); // sample //pRecord->Set_Value(catLevel+6+iGrid*iStatFields, sqrt((runStats->dev - pow(runStats->sum/runStats->n, 2)) / runStats->n)); // population pRecord->Set_Value(catLevel+7+iGrid*iStatFields, runStats->sum); } if( pAspect != NULL ) { iGrid = nStatGrids * iStatFields; int n; double min, max, sumYcomp, sumXcomp, val, valYcomp, valXcomp; if( nStatGrids == 0 ) runStats = runSub->stats; else runStats = runStats->next; n = runStats->n; min = runStats->min; max = runStats->max; sumXcomp = runStats->sum; runStats = runStats->next; sumYcomp = runStats->sum; pRecord ->Set_Value(catLevel+2+iGrid, n); pRecord ->Set_Value(catLevel+3+iGrid, min*M_RAD_TO_DEG); pRecord ->Set_Value(catLevel+4+iGrid, max*M_RAD_TO_DEG); valXcomp = sumXcomp / n; valYcomp = sumYcomp / n; val = valXcomp ? fmod(M_PI_270 + atan2(valYcomp, valXcomp), M_PI_360) : (valYcomp > 0 ? M_PI_270 : (valYcomp < 0 ? M_PI_090 : -1)); val = fmod(M_PI_360 - val, M_PI_360); pRecord ->Set_Value(catLevel+5+iGrid, val*M_RAD_TO_DEG); } while( runSub != NULL ) // read/write categories { pRecord->Set_Value(catLevel, runSub->cat); runSub = runSub->parent; catLevel -= 1; } subList = subList->next; } while( runList->parent != NULL && runList->parent->next == NULL ) // move up to next 'Caterory with -> next' runList = runList->parent; if( runList->parent != NULL ) // if not upper layer (zones) { runList = runList->parent; // move to parent of next 'Caterory with -> next' if( runList->next != NULL && runList->parent != NULL ) runList->parent->sub = runList->next; // redirect pointer to category which is next 'Categora with -> next' next else if (runList->parent == NULL && runList->next != NULL ) startList = runList->next; // when upper layer (zones) is reached, move to next zone else startList = NULL; // reading finished if( runList->parent == NULL ) startList = runList->next; // ?? when upper layer is reached, move to next zone else runList->sub = runList->sub->next; // on sub layers redirect pointer to ->next } else { if( nCatGrids == 0 ) startList = NULL; else startList = runList->next; // ?? upper layer is reached, move to next zone } runList->next = NULL; delete (runList); // delete disconneted part of the list } if( NDcountStat > 0 ) { Message_Add(CSG_String::Format(SG_T("\n\n\n%s: %d %s\n\n\n"), _TL("WARNING"), NDcountStat, _TL("NoData value(s) in statistic grid(s)!"))); } return (true); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/GSGrid_Zonal_Statistics.h000066400000000000000000000125061224124640700342020ustar00rootroot00000000000000/********************************************************** * Version $Id: GSGrid_Zonal_Statistics.h 1359 2012-03-29 09:06:28Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // GSGrid_Zonal_Statistics.h // // // // Copyright (C) 2005-9 by // // Volker Wichmann // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: volkerwichmann@web.de // // // // contact: Volker Wichmann // // Research Associate // // Chair of Physical Geography // // KU Eichstaett-Ingolstadt // // Ostenstr. 18 // // 85072 Eichstaett // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GSGrid_Zonal_Statistics_H #define HEADER_INCLUDED__GSGrid_Zonal_Statistics_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CList_Stat { public: CList_Stat(void) { n = 0; min = max = 0.0; sum = dev = 0.0; next = NULL; dummy = true; }; ~CList_Stat(void) { if( next != NULL ) delete(next); next = NULL; }; int n; double min, max, sum, dev; bool dummy; CList_Stat *next; }; //--------------------------------------------------------- class CList_Conti { public: CList_Conti(void) { cat = NULL; count = 0; next = NULL; previous = NULL; parent = NULL; sub = NULL; stats = NULL; dummy = true; }; ~CList_Conti(void) { if( stats != NULL ) delete(stats); if( sub != NULL ) delete(sub); sub = NULL; if( next != NULL ) delete(next); next = NULL; }; int cat, count; bool dummy; CList_Conti *next, *previous, *parent, *sub; CList_Stat *stats; }; //--------------------------------------------------------- class CGSGrid_Zonal_Statistics : public CSG_Module_Grid { public: CGSGrid_Zonal_Statistics(void); virtual ~CGSGrid_Zonal_Statistics(void); protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__GSGrid_Zonal_Statistics_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.cpp000066400000000000000000000130231224124640700324260ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1598 2013-01-29 08:53:46Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Spatial and Geostatistics - Grids") ); case MLB_INFO_Author: return( SG_T("O.Conrad, V.Wichmann (c) 2002-10" )); case MLB_INFO_Description: return( _TL("Tools for spatial and geostatistical analyses.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Spatial and Geostatistics|Grids") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "fast_representativeness.h" #include "GSGrid_Residuals.h" #include "GSGrid_Variance.h" #include "GSGrid_Variance_Radius.h" #include "GSGrid_Statistics.h" #include "GSGrid_Zonal_Statistics.h" #include "GSGrid_Directional_Statistics.h" #include "grid_autocorrelation.h" #include "grid_pca.h" #include "multiband_variation.h" #include "grid_latlon_statistics.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CFast_Representativeness ); case 1: return( new CGSGrid_Residuals ); case 2: return( new CGSGrid_Variance ); case 3: return( new CGSGrid_Variance_Radius ); case 4: return( new CGSGrid_Statistics ); case 5: return( new CGSGrid_Zonal_Statistics ); case 6: return( new CGSGrid_Directional_Statistics ); case 7: return( new CGrid_Autocorrelation ); case 8: return( new CGrid_PCA ); case 9: return( new CMultiBand_Variation ); case 10: return( new CGrid_PCA_Inverse ); case 11: return( new CGrid_Statistics_Latitudinal ); case 12: return( new CGrid_Statistics_Meridional ); case 13: return( new CGSGrid_Statistics_To_Table ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/MLB_Interface.h000066400000000000000000000077671224124640700321150ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__geostatistics_grid_H #define HEADER_INCLUDED__geostatistics_grid_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef geostatistics_grid_EXPORTS #define geostatistics_grid_EXPORT _SAGA_DLL_EXPORT #else #define geostatistics_grid_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__geostatistics_grid_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile.am000066400000000000000000000021671224124640700313730ustar00rootroot00000000000000# # $Id: Makefile.am 1554 2012-12-05 18:29:04Z oconrad $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgeostatistics_grid.la libgeostatistics_grid_la_SOURCES =\ fast_representativeness.cpp\ grid_autocorrelation.cpp\ grid_latlon_statistics.cpp\ grid_pca.cpp\ multiband_variation.cpp\ GSGrid_Directional_Statistics.cpp\ GSGrid_Residuals.cpp\ GSGrid_Statistics.cpp\ GSGrid_Variance.cpp\ GSGrid_Variance_Radius.cpp\ GSGrid_Zonal_Statistics.cpp\ MLB_Interface.cpp\ fast_representativeness.h\ grid_autocorrelation.h\ grid_latlon_statistics.h\ grid_pca.h\ multiband_variation.h\ GSGrid_Directional_Statistics.h\ GSGrid_Residuals.h\ GSGrid_Statistics.h\ GSGrid_Variance.h\ GSGrid_Variance_Radius.h\ GSGrid_Zonal_Statistics.h\ MLB_Interface.h libgeostatistics_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile.in000066400000000000000000000475751224124640700314200ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_geostatistics/geostatistics/geostatistics_grid DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgeostatistics_grid_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgeostatistics_grid_la_OBJECTS = fast_representativeness.lo \ grid_autocorrelation.lo grid_latlon_statistics.lo grid_pca.lo \ multiband_variation.lo GSGrid_Directional_Statistics.lo \ GSGrid_Residuals.lo GSGrid_Statistics.lo GSGrid_Variance.lo \ GSGrid_Variance_Radius.lo GSGrid_Zonal_Statistics.lo \ MLB_Interface.lo libgeostatistics_grid_la_OBJECTS = \ $(am_libgeostatistics_grid_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgeostatistics_grid_la_SOURCES) DIST_SOURCES = $(libgeostatistics_grid_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1554 2012-12-05 18:29:04Z oconrad $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgeostatistics_grid.la libgeostatistics_grid_la_SOURCES = \ fast_representativeness.cpp\ grid_autocorrelation.cpp\ grid_latlon_statistics.cpp\ grid_pca.cpp\ multiband_variation.cpp\ GSGrid_Directional_Statistics.cpp\ GSGrid_Residuals.cpp\ GSGrid_Statistics.cpp\ GSGrid_Variance.cpp\ GSGrid_Variance_Radius.cpp\ GSGrid_Zonal_Statistics.cpp\ MLB_Interface.cpp\ fast_representativeness.h\ grid_autocorrelation.h\ grid_latlon_statistics.h\ grid_pca.h\ multiband_variation.h\ GSGrid_Directional_Statistics.h\ GSGrid_Residuals.h\ GSGrid_Statistics.h\ GSGrid_Variance.h\ GSGrid_Variance_Radius.h\ GSGrid_Zonal_Statistics.h\ MLB_Interface.h libgeostatistics_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_geostatistics/geostatistics/geostatistics_grid/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgeostatistics_grid.la: $(libgeostatistics_grid_la_OBJECTS) $(libgeostatistics_grid_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgeostatistics_grid_la_OBJECTS) $(libgeostatistics_grid_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSGrid_Directional_Statistics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSGrid_Residuals.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSGrid_Statistics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSGrid_Variance.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSGrid_Variance_Radius.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSGrid_Zonal_Statistics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fast_representativeness.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_autocorrelation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_latlon_statistics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_pca.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multiband_variation.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: fast_representativeness.cpp000066400000000000000000000352201224124640700347260ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/********************************************************** * Version $Id: fast_representativeness.cpp 1084 2011-06-08 08:10:42Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // imagery_segmentation // // // //-------------------------------------------------------// // // // fast_representativeness.cpp // // // // Copyright (C) 2009 // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@saga-gis.org // // // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "fast_representativeness.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define eps 1.0e-6 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFast_Representativeness::CFast_Representativeness(void) { Set_Name (_TL("Fast Representativeness")); Set_Author (SG_T("A.Ringeler (c) 2009")); Set_Description (_TW( "A fast representativeness algorithm. Resulting seeds might be used with 'Fast Region Growing'.\n" "\n" "References:\n" "Boehner, J., Selige, T., Ringeler, A. (2006): Image segmentation using representativeness analysis and region growing. " "In: Boehner, J., McCloy, K.R., Strobl, J. [Eds.]: SAGA Analysis and Modelling Applications. " "Goettinger Geographische Abhandlungen, Vol.115, " "pdf\n" )); Parameters.Add_Grid( NULL, "INPUT" , _TL("Input"), _TL("Input for module calculations."), PARAMETER_INPUT, true, SG_DATATYPE_Float ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Output"), _TL("Output of module calculations."), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL, "RESULT_LOD", _TL("Output Lod"), _TL("Output of module calculations."), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL, "SEEDS" , _TL("Output Seeds"), _TL("Output of module calculations."), PARAMETER_OUTPUT, true, SG_DATATYPE_Char ); Parameters.Add_Value( NULL, "LOD" , _TL("Level of Generalisation"), _TL(""), PARAMETER_TYPE_Double, 16, 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFast_Representativeness::On_Execute(void) { double Lod; CSG_Grid *Lod_Grid, *Seeds_Grid; pOrgInput = Parameters("INPUT")->asGrid(); pOutput = Parameters("RESULT")->asGrid(); Lod_Grid = Parameters("RESULT_LOD")->asGrid(); Seeds_Grid = Parameters("SEEDS")->asGrid(); Seeds_Grid ->Set_NoData_Value(0); Seeds_Grid ->Assign(0.0); Process_Set_Text(_TL("Init Fast Representativeness")); FastRep_Initialize(); Process_Set_Text(_TL("Fast Representativeness")); FastRep_Execute(); Process_Set_Text(_TL("Clear Fast Representativeness")); FastRep_Finalize(); Lod = Parameters("LOD")->asDouble(); CSG_Grid * GenLevel = (CSG_Grid *) new CSG_Grid( SG_DATATYPE_Float, (int)(pOrgInput->Get_NX()/Lod+1), (int)(pOrgInput->Get_NY()/Lod+1), pOrgInput->Get_Cellsize()*Lod, pOrgInput->Get_XMin(), pOrgInput->Get_YMin() ) ; CSG_Grid * GenLevelRep = (CSG_Grid *) new CSG_Grid( SG_DATATYPE_Float, (int)(pOrgInput->Get_NX()/Lod+1), (int)(pOrgInput->Get_NY()/Lod+1), pOrgInput->Get_Cellsize()*Lod, pOrgInput->Get_XMin(), pOrgInput->Get_YMin() ) ; GenLevel->Assign(pOrgInput); pOrgInput = GenLevel; pOutput = GenLevelRep; Process_Set_Text(_TL("Init Generalisation")); FastRep_Initialize(); Process_Set_Text(_TL("Generalisation")); FastRep_Execute(); Process_Set_Text(_TL("Clear Generalisation")); FastRep_Finalize(); smooth_rep(pOutput,GenLevel ); Lod_Grid->Assign(GenLevel); Find_Local_Maxima_Minima(Lod_Grid, Seeds_Grid); return( true ); } //--------------------------------------------------------- // Repraesentanz stuff //--------------------------------------------------------- //--------------------------------------------------------- void CFast_Representativeness::FastRep_Local_Sum(CSG_Grid *pInput, CSG_Grid **pOutput) { *pOutput = (CSG_Grid *) new CSG_Grid(SG_DATATYPE_Float, pInput->Get_NX()/2, pInput->Get_NY()/2, pInput->Get_Cellsize()*2, pInput->Get_Cellsize()*2); for (int y = 0; y < pInput->Get_NY() - 1; y += 2) for (int x = 0; x < pInput->Get_NX() - 1; x += 2) { float val; if( pInput->is_NoData(x,y) || pInput->is_NoData(x + 1, y) || pInput->is_NoData(x, y + 1) || pInput->is_NoData(x + 1, y + 1)) { (*pOutput)->Set_NoData(x/2, y/2); } else { val = pInput->asFloat(x, y) + pInput->asFloat(x + 1, y) + pInput->asFloat(x, y + 1) + pInput->asFloat(x + 1, y + 1); (*pOutput)->Set_Value(x/2, y/2, val); } } } //--------------------------------------------------------- void CFast_Representativeness::FastRep_Execute(void) { int x, y; for (y = 0; y < pOutput->Get_NY()&&Set_Progress(y,pOutput->Get_NY()); y++) { for (x = 0; x < pOutput->Get_NX(); x++) { if( ! pOrgInput->is_NoData(x,y )) pOutput->Set_Value(x, y, FastRep_Get_Laenge(x, y)); } } } //--------------------------------------------------------- void CFast_Representativeness::FastRep_Initialize(void) { double logNx2,logNy2; int pow2y, pow2x; int x,y; long i; long size; logNx2 = log((double)pOrgInput->Get_NX())/log(2.0f); pow2x = (int) logNx2; if (fabs(logNx2 - pow2x) > eps) pow2x++; logNy2 = log((double)pOrgInput->Get_NY())/log(2.0f); pow2y = (int) logNy2; if (fabs(logNy2 - pow2y) > eps) pow2y++; Pow2Grid = (CSG_Grid *) new CSG_Grid(SG_DATATYPE_Double, 1 << pow2x, 1 << pow2y); for ( y = 0; y < Pow2Grid->Get_NY(); y++) { Set_Progress(y, Pow2Grid->Get_NY()); for ( x = 0; x < Pow2Grid->Get_NX(); x++) { if (yGet_NY() && x < pOrgInput->Get_NX()) Pow2Grid->Set_Value(x, y, pOrgInput->asFloat(x, y)); else { if(x >= pOrgInput->Get_NX()&&yGet_NY()) Pow2Grid->Set_Value(x, y,pOrgInput->asFloat(2*pOrgInput->Get_NX()-x-1, y)); if(y >= pOrgInput->Get_NY()&& xGet_NX()) Pow2Grid->Set_Value(x, y, pOrgInput->asFloat(x, 2* pOrgInput->Get_NY()-y-1)); if(y >= pOrgInput->Get_NY()&& x >= pOrgInput->Get_NX()) { Pow2Grid->Set_Value(x, y, pOrgInput->asFloat(2*pOrgInput->Get_NX()-x-1, 2* pOrgInput->Get_NY()-y-1)); } } } } Pow2Grid->Standardise(); pOutput->Assign_NoData(); size = (int)(log((double)Pow2Grid->Get_NX())/log(2.0)) - 1; m_deep = size; Sum[0] = Pow2Grid; for ( i = 0; i < size - 1; i++) { FastRep_Local_Sum(Sum[i], &Sum[i + 1]); } QSum[0] = (CSG_Grid *)new CSG_Grid(Pow2Grid, SG_DATATYPE_Double); // datas QSum[0]->Assign(Pow2Grid); for ( i = 0; i < Pow2Grid->Get_NCells() ; i++) { if (!QSum[0]->is_NoData(i)) QSum[0]->Set_Value(i,QSum[0]->asDouble(i)*Pow2Grid->asDouble(i)); } for (i = 0; i < size - 1; i++) { Set_Progress(i,size - 1); FastRep_Local_Sum(QSum[i], &QSum[i + 1]); } V =(double *) malloc((m_deep + 12) * sizeof(double)); Z =(int *) malloc((m_deep + 12) * sizeof(int)); g =(double *) malloc((m_deep + 12) * sizeof(double)); m =(double *) malloc((m_deep + 12) * sizeof(double)); maxRadius = 12; rLength =(int *)malloc((maxRadius + 12) * sizeof(int)); for (i = 0; i < m_deep; i++) { g[i] = 1.0 / (Get_Cellsize() * (1 <<(i))); } FastRep_Init_Radius(); } //--------------------------------------------------------- void CFast_Representativeness::FastRep_Finalize(void) { free(V); free(Z); free(rLength); free(g); free(m); free(x_diff); free(y_diff); delete Pow2Grid; int i; for (i = 0; i < m_deep ; i++) delete QSum[i]; for (i = 1; i < m_deep ; i++) delete Sum[i]; } //--------------------------------------------------------- void CFast_Representativeness::FastRep_Init_Radius(void) { int k, maxZ; long i, j, iijj, rr, r1r1, z; maxZ = z = 0; rLength[0] = 0; x_diff = y_diff = NULL; for (k = 1; k <= maxRadius; k++) { rr = k*k; r1r1 =(k - 1) * (k - 1); for (i=-k; i <= k; i++) { for (j=-k; j <= k; j++) { iijj = i*i + j*j; if (iijj <= rr && iijj >= r1r1) { if (maxZ <= z) { maxZ += 1000; x_diff =(int *)realloc(x_diff, maxZ*sizeof(int)); y_diff =(int *)realloc(y_diff, maxZ*sizeof(int)); } x_diff[z] = j; y_diff[z] = i; z++; } } } rLength[k] = z; } } //--------------------------------------------------------- double CFast_Representativeness::FastRep_Get_Laenge(int x, int y) { int Count; double d; V[0] = FastRep_Get_Variance(x, y, 1, 0, Count); Z[0] = Count; int ideep; for (ideep = 1; ideep < m_deep; ideep++) { V[ideep] = V[ideep - 1] + FastRep_Get_Variance(x, y, 4, ideep - 1, Count); Z[ideep] = Z[ideep - 1] + Count; } for (ideep = 0; ideep < m_deep; ideep++) { V[ideep] =sqrt(V[ideep]/ (double)(Z[ideep]+1)); } d = FastRep_Get_Steigung(); if ( d == 0.0 ) return ( pOutput->Get_NoData_Value()); else return ( V[m_deep - 1] / d / 2.0 ); } //--------------------------------------------------------- double CFast_Representativeness::FastRep_Get_Variance(int x, int y, int iRadius, int deep, int &Count) { int i, ix, iy; double Variance; double q = 0; double s = 0; int lnr = 0; Variance = 0; int size = (1 << deep) * (1 << deep); double z = Sum[0]->asDouble(x, y); for (i = rLength[iRadius - 1], Count = 0; i < rLength[iRadius]; i++) { ix = x/ (1 << deep) + x_diff[i]; if (ix < 0) continue; else if (ix >= Sum[deep]->Get_NX()) continue; iy = y/ (1 << deep) + y_diff[i]; if (iy < 0) continue; else if (iy >= Sum[deep]->Get_NY()) continue; if( !QSum[deep]->is_NoData(ix, iy)) { Count += size; lnr += size; q += QSum[deep]->asDouble(ix, iy); s += Sum[deep]->asDouble(ix, iy); } } Variance = q + z* (-s - s +lnr*z); if ( Variance < 0.0 ) Variance = 0.0; return ( Variance ); } //--------------------------------------------------------- double CFast_Representativeness::FastRep_Get_Steigung() { int i; double summe_mg, summe_g; m[0] = V[0] / Get_Cellsize(); for (i = 1; i < m_deep; i++) { m[i] =( V[i] - V[i-1] ) / ( Get_Cellsize()* (1 << (i) ) ); } summe_mg = summe_g = 0; for (i = 0; i < m_deep; i++) { summe_mg += m[i] * g[i]; summe_g += g[i]; } return ( summe_mg / summe_g ); } //--------------------------------------------------------- void CFast_Representativeness::smooth_rep(CSG_Grid * in, CSG_Grid * out) { int x,y; int i,j; int xpos, ypos; double val; int count; for (y = 0; y < in->Get_NY(); y++) for (x = 0; x < in->Get_NX(); x++) { val = 0.0; count = 0; for (i=-3; i<= 3; i++) for (j=-3; j<= 3; j++) { xpos = x + j; ypos = y + i; if( in->is_InGrid(xpos,ypos)) { val += in->asDouble(xpos , ypos); count ++; } } out ->Set_Value(x,y, val/(double) count ); } } //--------------------------------------------------------- void CFast_Representativeness::Find_Local_Maxima_Minima(CSG_Grid * in, CSG_Grid * out) { int x,y; int i,j; int xpos, ypos; double max, min; bool ismax ,ismin; bool hasmax; for (y = 2; y < in->Get_NY()-2; y++) for (x = 2; x < in->Get_NX()-2; x++) { ismax = true; ismin = true; hasmax =false; max =min = in->asDouble(x , y); for (i=-2; i<= 2; i++) for (j=-2; j<= 2; j++) { xpos = x + j; ypos = y + i; if (max < in->asDouble(xpos , ypos)) ismax= false; if (min > in->asDouble(xpos , ypos)) ismin= false; if(out ->asInt(xpos, ypos)) hasmax=true; } if (hasmax) { ismin = ismax =false; } if( ismax||ismin ) { out ->Set_Value(x,y, 1); } else { out ->Set_NoData(x,y); } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/fast_representativeness.h000066400000000000000000000106211224124640700344500ustar00rootroot00000000000000/********************************************************** * Version $Id: fast_representativeness.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // imagery_segmentation // // // //-------------------------------------------------------// // // // fast_representativeness.h // // // // Copyright (C) 2009 // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@saga-gis.org // // // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Fast_Representativeness_H #define HEADER_INCLUDED__Fast_Representativeness_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFast_Representativeness : public CSG_Module_Grid { public: CFast_Representativeness(void); protected: virtual bool On_Execute(void); private: void FastRep_Local_Sum(CSG_Grid *pInput, CSG_Grid **pOutput); void FastRep_Execute(void); void FastRep_Initialize(void); void FastRep_Init_Radius(void); void FastRep_Finalize(void); double FastRep_Get_Laenge(int x, int y); double FastRep_Get_Variance(int x, int y, int iRadius, int deep, int &Count); double FastRep_Get_Steigung(); void smooth_rep(CSG_Grid * in, CSG_Grid * out); void Find_Local_Maxima_Minima(CSG_Grid * in, CSG_Grid * out); CSG_Grid *pOrgInput, *Pow2Grid, *pOutput; int *Z, *x_diff, *y_diff, *rLength; CSG_Grid *Sum[16]; CSG_Grid *QSum[16]; double *V, *m, *g; int m_deep; int maxRadius; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Fast_Representativeness_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.cpp000066400000000000000000000163561224124640700342670ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_autocorrelation.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // grid_autocorrelastion.cpp // // // // Copyright (C) 2010 by // // Jan Papmeier // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_autocorrelation.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Autocorrelation::CGrid_Autocorrelation(void) { //----------------------------------------------------- Set_Name (_TL("Global Moran's I for Grids")); Set_Author (SG_T("Jan Papmeier (c) 2010")); Set_Description (_TW( "Global spatial autocorrelation for grids calculated as Moran's I.\n" "\n" "References:\n" "- Lloyd, C.D. (2010): Spatial data analysis - An introduction for GIS users. Oxford. 206p.\n" )); //----------------------------------------------------- Parameters.Add_Grid( NULL, "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL, "RESULT" , _TL("Result"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL, "CONTIGUITY" , _TL("Case of contiguity"), _TL("Choose case: Rook's case contiguity compares only cell wich share an edge. Queen's case contiguity compares also cells which share just corners."), CSG_String::Format(SG_T("%s|%s|"), _TL("Rook"), _TL("Queen") ), 1 ); Parameters.Add_Value( NULL, "DIALOG" , _TL("Show Result in Dialog"), _TL(""), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Autocorrelation::On_Execute(void) { int nContiguity, nNeighbours; double Sum; CSG_Grid *pGrid; CSG_Table *pResult; //----------------------------------------------------- pGrid = Parameters("GRID") ->asGrid(); pResult = Parameters("RESULT") ->asTable(); switch( Parameters("CONTIGUITY")->asInt() ) { case 0: nContiguity = 2; break; // Rook's case case 1: default: nContiguity = 1; break; // Queen's case } //----------------------------------------------------- nNeighbours = 0; Sum = 0.0; for(int y=0; yis_NoData(x, y) ) { double dz = pGrid->asDouble(x, y) - pGrid->Get_ArithMean(); for(int i=0; i<8; i+=nContiguity) { int ix = Get_xTo(i, x); int iy = Get_yTo(i, y); if( pGrid->is_InGrid(ix, iy) ) { nNeighbours ++; Sum += dz * (pGrid->asDouble(ix, iy) - pGrid->Get_ArithMean()); } } } } } //----------------------------------------------------- if( nNeighbours <= 1 ) { Message_Add(_TL("not enough neighbours")); return( false ); } //----------------------------------------------------- double Moran_I = (pGrid->Get_NCells() * Sum) / (pGrid->Get_Variance() * pGrid->Get_NCells() * nNeighbours); if( pResult->Get_Field_Count() != 8 || SG_STR_CMP(_TL("Moran's I"), pResult->Get_Name()) ) { pResult->Destroy(); pResult->Set_Name(_TL("Moran's I")); pResult->Add_Field(_TL("GRID") , SG_DATATYPE_String); pResult->Add_Field(_TL("CONTIGUITY"), SG_DATATYPE_String); pResult->Add_Field(_TL("MORAN_I") , SG_DATATYPE_Double); pResult->Add_Field(_TL("NEIGHBORS") , SG_DATATYPE_Int); pResult->Add_Field(_TL("NCELLS") , SG_DATATYPE_Int); pResult->Add_Field(_TL("MEAN") , SG_DATATYPE_Double); pResult->Add_Field(_TL("VARIATION") , SG_DATATYPE_Double); pResult->Add_Field(_TL("SUM") , SG_DATATYPE_Double); } CSG_Table_Record *pRecord = pResult->Add_Record(); pRecord->Set_Value(0, pGrid->Get_Name()); pRecord->Set_Value(1, nContiguity == 2 ? _TL("Rook's case") : _TL("Queen's case")); pRecord->Set_Value(2, Moran_I); pRecord->Set_Value(3, nNeighbours); pRecord->Set_Value(4, pGrid->Get_NCells()); pRecord->Set_Value(5, pGrid->Get_ArithMean()); pRecord->Set_Value(6, pGrid->Get_Variance() * pGrid->Get_NCells()); pRecord->Set_Value(7, Sum); Message_Add(CSG_String::Format(SG_T("\n%s (%s): %f\n"), _TL("Moran's I"), pGrid->Get_Name(), Moran_I), false); if( Parameters("DIALOG")->asBool() ) { Message_Dlg(CSG_String::Format(SG_T("%s: %f"), _TL("Moran's I"), Moran_I), pGrid->Get_Name()); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_autocorrelation.h000066400000000000000000000100571224124640700337240ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_autocorrelation.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // grid_autocorrelation.h // // // // Copyright (C) 2010 by // // Jan Papmeier // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_autocorrelation_H #define HEADER_INCLUDED__grid_autocorrelation_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Autocorrelation : public CSG_Module_Grid { public: CGrid_Autocorrelation(void); protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_autocorrelation_H grid_latlon_statistics.cpp000066400000000000000000000167001224124640700345320ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/********************************************************** * Version $Id: grid_latlon_statistics.cpp 1252 2011-12-15 15:43:13Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // grid_latlon_statistics.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_latlon_statistics.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Statistics_Latitudinal::CGrid_Statistics_Latitudinal(void) { //----------------------------------------------------- Set_Name (_TL("Longitudinal Grid Statistics")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL , "STATS" , _TL("Latitudinal Statistics"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Statistics_Latitudinal::On_Execute(void) { CSG_Grid *pGrid = Parameters("GRID" )->asGrid(); CSG_Table *pTable = Parameters("STATS")->asTable(); pTable->Destroy(); pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Latitudinal Statistics"), pGrid->Get_Name())); pTable->Add_Field(SG_T("Y" ), SG_DATATYPE_Double); pTable->Add_Field(SG_T("MEAN" ), SG_DATATYPE_Double); pTable->Add_Field(SG_T("MIN" ), SG_DATATYPE_Double); pTable->Add_Field(SG_T("MAX" ), SG_DATATYPE_Double); pTable->Add_Field(SG_T("STDDEV"), SG_DATATYPE_Double); for(int y=0; yasDouble(x, y); } CSG_Table_Record *pRecord = pTable->Add_Record(); pRecord->Set_Value(0, pGrid->Get_System().Get_yGrid_to_World(y)); pRecord->Set_Value(1, Statistics.Get_Mean ()); pRecord->Set_Value(2, Statistics.Get_Minimum()); pRecord->Set_Value(3, Statistics.Get_Maximum()); pRecord->Set_Value(4, Statistics.Get_StdDev ()); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Statistics_Meridional::CGrid_Statistics_Meridional(void) { //----------------------------------------------------- Set_Name (_TL("Meridional Grid Statistics")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL , "STATS" , _TL("Meridional Statistics"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Statistics_Meridional::On_Execute(void) { CSG_Grid *pGrid = Parameters("GRID" )->asGrid(); CSG_Table *pTable = Parameters("STATS")->asTable(); pTable->Destroy(); pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Meridional Statistics"), pGrid->Get_Name())); pTable->Add_Field(SG_T("X" ), SG_DATATYPE_Double); pTable->Add_Field(SG_T("MEAN" ), SG_DATATYPE_Double); pTable->Add_Field(SG_T("MIN" ), SG_DATATYPE_Double); pTable->Add_Field(SG_T("MAX" ), SG_DATATYPE_Double); pTable->Add_Field(SG_T("STDDEV"), SG_DATATYPE_Double); for(int x=0; xasDouble(x, y); } CSG_Table_Record *pRecord = pTable->Add_Record(); pRecord->Set_Value(0, pGrid->Get_System().Get_xGrid_to_World(x)); pRecord->Set_Value(1, Statistics.Get_Mean ()); pRecord->Set_Value(2, Statistics.Get_Minimum()); pRecord->Set_Value(3, Statistics.Get_Maximum()); pRecord->Set_Value(4, Statistics.Get_StdDev ()); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_latlon_statistics.h000066400000000000000000000114201224124640700342500ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_latlon_statistics.h 1252 2011-12-15 15:43:13Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // grid_latlon_statistics.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_latlon_statistics_H #define HEADER_INCLUDED__grid_latlon_statistics_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Statistics_Latitudinal : public CSG_Module_Grid { public: CGrid_Statistics_Latitudinal(void); protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Statistics_Meridional : public CSG_Module_Grid { public: CGrid_Statistics_Meridional(void); protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_latlon_statistics_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.cpp000066400000000000000000000371731224124640700316200ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_pca.cpp 1612 2013-02-18 12:09:26Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // grid_pca.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_pca.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_PCA::CGrid_PCA(void) { //----------------------------------------------------- Set_Name (_TL("Principle Components Analysis")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Principle Components Analysis (PCA) for grids. " "Implementation based on F. Murtagh's " "code " "as provided by the " "StatLib web site.\n" "\n" "References:\n" "Bahrenberg, G., Giese, E., Nipper, J. (1992): Statistische Methoden in der Geographie 2 - Multivariate Statistik. pp.198-277.\n" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "PCA" , _TL("Principle Components"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Table( NULL , "EIGEN" , _TL("Eigen Vectors"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("correlation matrix"), _TL("variance-covariance matrix"), _TL("sums-of-squares-and-cross-products matrix") ), 1 ); Parameters.Add_Value( NULL , "NFIRST" , _TL("Number of Components"), _TL("maximum number of calculated first components; set to zero to get all"), PARAMETER_TYPE_Int, 3, 0, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_PCA::On_Execute(void) { CSG_Vector Eigen_Values; CSG_Matrix Eigen_Vectors, Matrix; //----------------------------------------------------- m_pGrids = Parameters("GRIDS" )->asGridList(); m_Method = Parameters("METHOD")->asInt(); m_nFeatures = m_pGrids->Get_Count(); //----------------------------------------------------- if( !Get_Matrix(Matrix) ) { Error_Set(_TL("matrix initialisation failed")); return( false ); } //----------------------------------------------------- if( !SG_Matrix_Eigen_Reduction(Matrix, Eigen_Vectors, Eigen_Values) ) { Error_Set(_TL("Eigen reduction failed")); return( false ); } //----------------------------------------------------- Print_Eigen_Values (Eigen_Values ); Print_Eigen_Vectors(Eigen_Vectors); Get_Components(Eigen_Vectors); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline bool CGrid_PCA::is_NoData(int iCell) { for(int iFeature=0; iFeatureasGrid(iFeature)->is_NoData(iCell) ) { return( true ); } } return( false ); } //--------------------------------------------------------- inline double CGrid_PCA::Get_Value(int iCell, int iFeature) { CSG_Grid *pGrid = m_pGrids->asGrid(iFeature); switch( m_Method ) { default: case 0: // Correlation matrix: Center and reduce the column vectors. return( (pGrid->asDouble(iCell) - pGrid->Get_ArithMean()) / (sqrt(Get_NCells() * pGrid->Get_Variance())) ); case 1: // Variance-covariance matrix: Center the column vectors. return( (pGrid->asDouble(iCell) - pGrid->Get_ArithMean()) ); case 2: // Sums-of-squares-and-cross-products matrix return( (pGrid->asDouble(iCell)) ); } } //--------------------------------------------------------- bool CGrid_PCA::Get_Matrix(CSG_Matrix &Matrix) { int j1, j2; long iCell; Matrix.Create(m_nFeatures, m_nFeatures); Matrix.Set_Zero(); switch( m_Method ) { //----------------------------------------------------- default: case 0: // Correlation matrix: Center and reduce the column vectors. for(j1=0; j1 0.0 ? 100.0 / Sum : 0.0; Message_Add(CSG_String::Format(SG_T("\n%s, %s, %s\n"), _TL("explained variance"), _TL("explained cumulative variance"), _TL("Eigenvalue")), false); for(i=m_nFeatures-1; i>=0; i--) { Cum += Eigen_Values[i]; Message_Add(CSG_String::Format(SG_T("%d.\t%.2f\t%.2f\t%f\n"), m_nFeatures - i, Sum * Eigen_Values[i], Sum * Cum, Eigen_Values[i] ), false ); } } //--------------------------------------------------------- void CGrid_PCA::Print_Eigen_Vectors(CSG_Matrix &Eigen_Vectors) { Message_Add(CSG_String::Format(SG_T("\n%s:\n"), _TL("Eigenvectors")), false); for(int i=0; i=0; j--) { Message_Add(CSG_String::Format(SG_T("%.4f\t"), Eigen_Vectors[i][j]), false); } Message_Add(m_pGrids->asGrid(i)->Get_Name(), false); Message_Add(SG_T("\n"), false); } } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_PCA::Get_Components(CSG_Matrix &Eigen_Vectors) { int i; /////////////////////////////////////////////////////// //----------------------------------------------------- CSG_Matrix E(m_nFeatures, m_nFeatures); for(i=0; iasTable(); if( pEigen ) { pEigen->Destroy(); pEigen->Set_Name(_TL("PCA Eigen Vectors")); for(i=0; iAdd_Field(m_pGrids->asGrid(i)->Get_Name(), SG_DATATYPE_Double); } for(i=0; iAdd_Record(); for(int j=0; jSet_Value(j, E[j][i]); } } } /////////////////////////////////////////////////////// //----------------------------------------------------- int nComponents = Parameters("NFIRST")->asInt(); if( nComponents <= 0 || nComponents > m_nFeatures ) { nComponents = m_nFeatures; } //----------------------------------------------------- CSG_Parameter_Grid_List *pPCA = Parameters("PCA")->asGridList(); pPCA->Del_Items(); for(i=0; iAdd_Item(SG_Create_Grid(*Get_System())); pPCA->asGrid(i)->Set_Name(CSG_String::Format(SG_T("%s %d"), _TL("Component"), i + 1)); } //----------------------------------------------------- for(int y=0; yasGrid(i)->is_NoData(x, y) ) { bNoData = true; } else { X[i] = m_pGrids->asGrid(i)->asDouble(x, y); } } if( bNoData ) { for(i=0; iasGrid(i)->Set_NoData(x, y); } } else { CSG_Vector Y = E * X; for(i=0; iasGrid(i)->Set_Value(x, y, Y[i]); } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_PCA_Inverse::CGrid_PCA_Inverse(void) { //----------------------------------------------------- Set_Name (_TL("Inverse Principle Components Rotation")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Inverse principle components rotation for grids. " "\n" "References:\n" "Bahrenberg, G., Giese, E., Nipper, J. (1992): Statistische Methoden in der Geographie 2 - Multivariate Statistik. pp.198-277.\n" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "PCA" , _TL("Principle Components"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL , "EIGEN" , _TL("Eigen Vectors"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_PCA_Inverse::On_Execute(void) { int i, nFeatures; CSG_Table *pEigen; //----------------------------------------------------- CSG_Parameter_Grid_List *pPCA, *pGrids; pPCA = Parameters("PCA" )->asGridList(); pGrids = Parameters("GRIDS")->asGridList(); pEigen = Parameters("EIGEN")->asTable(); //----------------------------------------------------- nFeatures = pEigen->Get_Count(); if( nFeatures != pEigen->Get_Field_Count() ) { Error_Set(_TL("warning: number of Eigen vectors and components differs.")); if( nFeatures > pEigen->Get_Field_Count() ) { nFeatures = pEigen->Get_Field_Count(); } } if( nFeatures != pPCA->Get_Count() ) { Error_Set(_TL("warning: number of component grids and components differs.")); if( nFeatures > pPCA->Get_Count() ) { nFeatures = pPCA->Get_Count(); } } if( nFeatures < 2 ) { Error_Set(_TL("nothing to do. transformation needs at least two components.")); return( false ); } //----------------------------------------------------- CSG_Matrix E(nFeatures, nFeatures); for(i=0; iGet_Record(i); for(int j=0; jasDouble(j); } } if( !E.Set_Inverse() ) { Error_Set(_TL("matrix inversion failed")); return( false ); } //----------------------------------------------------- pGrids->Del_Items(); for(i=0; iAdd_Item(SG_Create_Grid(*Get_System())); pGrids->asGrid(i)->Set_Name(CSG_String::Format(SG_T("%s %d"), _TL("Feature"), i + 1)); } //----------------------------------------------------- for(int y=0; yasGrid(i)->is_NoData(x, y) ) { bNoData = true; } else { Y[i] = pPCA->asGrid(i)->asDouble(x, y); } } if( bNoData ) { for(i=0; iasGrid(i)->Set_NoData(x, y); } } else { CSG_Vector X = E * Y; for(i=0; iasGrid(i)->Set_Value(x, y, X[i]); } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/grid_pca.h000066400000000000000000000123111224124640700312500ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_pca.h 1252 2011-12-15 15:43:13Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // grid_pca.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_pca_H #define HEADER_INCLUDED__grid_pca_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_PCA : public CSG_Module_Grid { public: CGrid_PCA(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Principle Components") ); } protected: virtual bool On_Execute (void); private: int m_Method, m_nFeatures; CSG_Parameter_Grid_List *m_pGrids; bool is_NoData (int iCell); double Get_Value (int iCell, int iFeature); bool Get_Matrix (CSG_Matrix &Matrix); void Print_Eigen_Values (CSG_Vector &Eigen_Values); void Print_Eigen_Vectors (CSG_Matrix &Eigen_Vectors); bool Get_Components (CSG_Matrix &Eigen_Vectors); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_PCA_Inverse : public CSG_Module_Grid { public: CGrid_PCA_Inverse(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Principle Components") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_pca_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.cpp000066400000000000000000000206511224124640700340740ustar00rootroot00000000000000/********************************************************** * Version $Id: multiband_variation.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // multiband_variation.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "multiband_variation.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CMultiBand_Variation::CMultiBand_Variation(void) { Set_Name (_TL("Multi-Band Variation")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Calculates for each cell the spectral variation based on feature space distances " "to the centroid for all cells in specified neighbourhood. " "The average distance has been used for Spectral Variation Hypothesis (SVH).\n" "References:\n" "- Palmer, M.W., Earls, P., Hoagland, B.W., White, P.S., Wohlgemuth, T. (2002): " "Quantitative tools for perfecting species lists. Environmetrics 13, 121137.\n" "- " )); Parameters.Add_Grid_List( NULL , "BANDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "MEAN" , _TL("Mean Distance"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "STDDEV" , _TL("Standard Deviation"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "DIFF" , _TL("Distance"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "RADIUS" , _TL("Radius [Cells]"), _TL(""), PARAMETER_TYPE_Int, 1.0, 1.0, true ); Parameters.Add_Parameters( NULL , "WEIGHTING" , _TL("Weighting"), _TL("") )->asParameters()->Assign(m_Cells.Get_Weighting().Get_Parameters()); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CMultiBand_Variation::On_Execute(void) { int x, y, Radius; //----------------------------------------------------- m_pBands = Parameters("BANDS") ->asGridList(); m_pMean = Parameters("MEAN") ->asGrid(); m_pStdDev = Parameters("STDDEV") ->asGrid(); m_pDiff = Parameters("DIFF") ->asGrid(); //----------------------------------------------------- if( m_pBands->Get_Count() < 1 ) { Error_Set(_TL("no input")); return( false ); } //----------------------------------------------------- Radius = Parameters("RADIUS") ->asInt(); m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters()); if( !m_Cells.Set_Radius(Radius) ) { return( false ); } //----------------------------------------------------- m_Mask.Create(*Get_System(), SG_DATATYPE_Byte); m_Mask.Set_NoData_Value(0); for(y=0; yGet_Count() && !bNoData; iBand++) { if( m_pBands->asGrid(iBand)->is_NoData(x, y) ) { bNoData = true; } } m_Mask.Set_Value(x, y, bNoData ? 0 : 1); } } //----------------------------------------------------- for(y=0; yGet_Count()); //------------------------------------------------- for(iCell=0, Weights=0.0; iCellGet_Count(); iBand++) { Centroid[iBand] += iWeight * m_pBands->asGrid(iBand)->asDouble(ix, iy); } Weights += iWeight; } } //------------------------------------------------- if( Weights > 0.0 ) { CSG_Simple_Statistics s; Centroid *= 1.0 / Weights; for(iCell=0; iCellGet_Count(); iBand++) { Distance += SG_Get_Square(Centroid[iBand] - m_pBands->asGrid(iBand)->asDouble(ix, iy)); } s.Add_Value(sqrt(Distance), iWeight); if( ix == x && iy == y ) { if( m_pDiff ) m_pDiff->Set_Value(x, y, sqrt(Distance)); } } } if( m_pMean ) m_pMean ->Set_Value(x, y, s.Get_Mean()); if( m_pStdDev ) m_pStdDev->Set_Value(x, y, s.Get_StdDev()); return( true ); } } //----------------------------------------------------- if( m_pMean ) m_pMean ->Set_NoData(x, y); if( m_pStdDev ) m_pStdDev ->Set_NoData(x, y); if( m_pDiff ) m_pDiff ->Set_NoData(x, y); return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_grid/multiband_variation.h000066400000000000000000000106641224124640700335440ustar00rootroot00000000000000/********************************************************** * Version $Id: multiband_variation.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // multiband_variation.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__multiband_variation_H #define HEADER_INCLUDED__multiband_variation_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CMultiBand_Variation : public CSG_Module_Grid { public: CMultiBand_Variation(void); protected: virtual bool On_Execute (void); private: CSG_Grid_Cell_Addressor m_Cells; CSG_Parameter_Grid_List *m_pBands; CSG_Grid m_Mask, *m_pMean, *m_pStdDev, *m_pDiff; bool Get_Variation (int x, int y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__multiband_variation_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/000077500000000000000000000000001224124640700300365ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.cpp000066400000000000000000000124041224124640700331350ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1363 2012-03-30 14:19:21Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Kriging // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Spatial and Geostatistics - Kriging") ); case MLB_INFO_Author: return( SG_T("O.Conrad (c) 2003-10") ); case MLB_INFO_Description: return( _TL("Kriging - geostatistical procedures for the gridding of irregular distributed point data." )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Spatial and Geostatistics|Kriging" )); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "kriging_ordinary.h" #include "kriging_ordinary_global.h" #include "kriging_universal.h" #include "kriging_universal_global.h" #include "semivariogram.h" #include "_kriging_ordinary.h" #include "_kriging_ordinary_global.h" #include "_kriging_universal.h" #include "_kriging_universal_global.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CKriging_Ordinary ); case 1: return( new CKriging_Ordinary_Global ); case 2: return( new CKriging_Universal ); case 3: return( new CKriging_Universal_Global ); case 4: return( new CSemiVariogram ); case 5: return( new C_Kriging_Ordinary ); case 6: return( new C_Kriging_Ordinary_Global ); case 7: return( new C_Kriging_Universal ); case 8: return( new C_Kriging_Universal_Global ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/MLB_Interface.h000066400000000000000000000100111224124640700325720ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Kriging // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__geostatistics_kriging_H #define HEADER_INCLUDED__geostatistics_kriging_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef geostatistics_kriging_EXPORTS #define geostatistics_kriging_EXPORT _SAGA_DLL_EXPORT #else #define geostatistics_kriging_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__geostatistics_kriging_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile.am000066400000000000000000000026571224124640700321040ustar00rootroot00000000000000if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` else DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libgeostatistics_kriging.la libgeostatistics_kriging_la_SOURCES =\ _kriging_base.cpp\ _kriging_ordinary.cpp\ _kriging_ordinary_global.cpp\ _kriging_universal.cpp\ _kriging_universal_global.cpp\ kriging_base.cpp\ kriging_ordinary.cpp\ kriging_ordinary_global.cpp\ kriging_universal.cpp\ kriging_universal_global.cpp\ MLB_Interface.cpp\ semivariogram.cpp\ variogram_dialog.cpp\ _kriging_base.h\ _kriging_ordinary.h\ _kriging_ordinary_global.h\ _kriging_universal.h\ _kriging_universal_global.h\ kriging_base.h\ kriging_ordinary.h\ kriging_ordinary_global.h\ kriging_universal.h\ kriging_universal_global.h\ MLB_Interface.h\ semivariogram.h\ variogram_dialog.h libgeostatistics_kriging_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS) saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile.in000066400000000000000000000506351224124640700321140ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = \ src/modules_geostatistics/geostatistics/geostatistics_kriging DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgeostatistics_kriging_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la \ $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la am_libgeostatistics_kriging_la_OBJECTS = _kriging_base.lo \ _kriging_ordinary.lo _kriging_ordinary_global.lo \ _kriging_universal.lo _kriging_universal_global.lo \ kriging_base.lo kriging_ordinary.lo kriging_ordinary_global.lo \ kriging_universal.lo kriging_universal_global.lo \ MLB_Interface.lo semivariogram.lo variogram_dialog.lo libgeostatistics_kriging_la_OBJECTS = \ $(am_libgeostatistics_kriging_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgeostatistics_kriging_la_SOURCES) DIST_SOURCES = $(libgeostatistics_kriging_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_FALSE@DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) @SAGA_UNICODE_TRUE@DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) @SAGA_UNICODE_FALSE@DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` @SAGA_UNICODE_TRUE@DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libgeostatistics_kriging.la libgeostatistics_kriging_la_SOURCES = \ _kriging_base.cpp\ _kriging_ordinary.cpp\ _kriging_ordinary_global.cpp\ _kriging_universal.cpp\ _kriging_universal_global.cpp\ kriging_base.cpp\ kriging_ordinary.cpp\ kriging_ordinary_global.cpp\ kriging_universal.cpp\ kriging_universal_global.cpp\ MLB_Interface.cpp\ semivariogram.cpp\ variogram_dialog.cpp\ _kriging_base.h\ _kriging_ordinary.h\ _kriging_ordinary_global.h\ _kriging_universal.h\ _kriging_universal_global.h\ kriging_base.h\ kriging_ordinary.h\ kriging_ordinary_global.h\ kriging_universal.h\ kriging_universal_global.h\ MLB_Interface.h\ semivariogram.h\ variogram_dialog.h libgeostatistics_kriging_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_gdi/libsaga_gdi.la $(ADD_MLBS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_geostatistics/geostatistics/geostatistics_kriging/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgeostatistics_kriging.la: $(libgeostatistics_kriging_la_OBJECTS) $(libgeostatistics_kriging_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgeostatistics_kriging_la_OBJECTS) $(libgeostatistics_kriging_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_kriging_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_kriging_ordinary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_kriging_ordinary_global.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_kriging_universal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_kriging_universal_global.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kriging_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kriging_ordinary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kriging_ordinary_global.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kriging_universal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kriging_universal_global.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semivariogram.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/variogram_dialog.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.cpp000066400000000000000000000342251224124640700333330ustar00rootroot00000000000000/********************************************************** * Version $Id: _kriging_base.cpp 1633 2013-03-22 13:35:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Kriging // // // //-------------------------------------------------------// // // // _Kriging_Base.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "_kriging_base.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- C_Kriging_Base::C_Kriging_Base(void) { CSG_Parameter *pNode; CSG_Parameters *pParameters; //----------------------------------------------------- Parameters.Add_Grid_Output( NULL , "GRID" , _TL("Grid"), _TL("") ); Parameters.Add_Grid_Output( NULL , "VARIANCE" , _TL("Variance"), _TL("") ); pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Points"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("") ); Parameters.Add_Value( NULL , "BVARIANCE" , _TL("Create Variance Grid"), _TL(""), PARAMETER_TYPE_Bool , true ); Parameters.Add_Choice( NULL , "TARGET" , _TL("Target Grid"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("user defined"), _TL("grid system"), _TL("grid") ), 0 ); Parameters.Add_Choice( NULL , "MODEL" , _TL("Variogram Model"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"), _TL("Spherical Model"), _TL("Exponential Model"), _TL("Gaussian Model"), _TL("Linear Regression"), _TL("Exponential Regression"), _TL("Power Function Regression") ), 3 ); Parameters.Add_Value( NULL , "BLOCK" , _TL("Block Kriging"), _TL(""), PARAMETER_TYPE_Bool , false ); Parameters.Add_Value( NULL , "DBLOCK" , _TL("Block Size"), _TL(""), PARAMETER_TYPE_Double , 100.0, 0.0, true ); Parameters.Add_Value( NULL , "BLOG" , _TL("Logarithmic Transformation"), _TL(""), PARAMETER_TYPE_Bool ); Parameters.Add_Value( NULL , "NUGGET" , _TL("Nugget"), _TL(""), PARAMETER_TYPE_Double, 0.0, 0.0, true ); Parameters.Add_Value( NULL , "SILL" , _TL("Sill"), _TL(""), PARAMETER_TYPE_Double, 10.0, 0.0, true ); Parameters.Add_Value( NULL , "RANGE" , _TL("Range"), _TL(""), PARAMETER_TYPE_Double, 100.0, 0.0, true ); pNode = Parameters.Add_Node( NULL , "PARMS" , _TL("Additional Parameters"), _TL("") ); Parameters.Add_Value( pNode , "LIN_B" , _TL("Linear Regression"), _TL("Parameter B for Linear Regression:\n y = Nugget + B * x"), PARAMETER_TYPE_Double, 1.0 ); Parameters.Add_Value( pNode , "EXP_B" , _TL("Exponential Regression"), _TL("Parameter B for Exponential Regression:\n y = Nugget * e ^ (B * x)"), PARAMETER_TYPE_Double, 0.1 ); Parameters.Add_Value( pNode , "POW_A" , _TL("Power Function - A"), _TL("Parameter A for Power Function Regression:\n y = A * x ^ B"), PARAMETER_TYPE_Double, 1.0 ); Parameters.Add_Value( pNode , "POW_B" , _TL("Power Function - B"), _TL("Parameter B for Power Function Regression:\n y = A * x ^ B"), PARAMETER_TYPE_Double, 0.5 ); //----------------------------------------------------- pParameters = Add_Parameters(SG_T("USER") , _TL("User defined grid") , _TL("")); pParameters->Add_Value( NULL , "CELL_SIZE" , _TL("Grid Size"), _TL(""), PARAMETER_TYPE_Double, 100.0, 0.0, true ); pNode = pParameters->Add_Value( NULL , "FIT_EXTENT" , _TL("Fit Extent"), _TL("Automatically fits the grid to the shapes layers extent."), PARAMETER_TYPE_Bool , true ); pParameters->Add_Range( pNode , "X_EXTENT" , _TL("X-Extent"), _TL("") ); pParameters->Add_Range( pNode , "Y_EXTENT" , _TL("Y-Extent"), _TL("") ); //----------------------------------------------------- pParameters = Add_Parameters(SG_T("SYSTEM") , _TL("Choose Grid System") , _TL("")); pParameters->Add_Grid_System( NULL , "SYSTEM" , _TL("Grid System"), _TL("") ); //----------------------------------------------------- pParameters = Add_Parameters(SG_T("GRID") , _TL("Choose Grid") , _TL("")); pNode = pParameters->Add_Grid_System( NULL , "SYSTEM" , _TL("Grid System"), _TL("") ); pParameters->Add_Grid( pNode , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT , false ); pParameters->Add_Grid( pNode , "VARIANCE" , _TL("Variance"), _TL(""), PARAMETER_INPUT_OPTIONAL, false ); } //--------------------------------------------------------- C_Kriging_Base::~C_Kriging_Base(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool C_Kriging_Base::On_Execute(void) { bool bResult = false; m_pShapes = NULL; m_bLog = Parameters("BLOG") ->asBool(); m_Model = Parameters("MODEL") ->asInt(); m_Nugget = Parameters("NUGGET") ->asDouble(); m_Sill = Parameters("SILL") ->asDouble() - m_Nugget; m_Range = Parameters("RANGE") ->asDouble(); m_Block = Parameters("DBLOCK") ->asDouble() / 2.0; m_bBlock = Parameters("BLOCK") ->asBool() && m_Block > 0.0; m_BLIN = Parameters("LIN_B") ->asDouble(); m_BEXP = Parameters("EXP_B") ->asDouble(); m_APOW = Parameters("POW_A") ->asDouble(); m_BPOW = Parameters("POW_B") ->asDouble(); //----------------------------------------------------- if( _Get_Grid() && _Get_Points() && On_Initialise() ) { int ix, iy; double x, y, z, v; for(iy=0, y=m_pGrid->Get_YMin(); iyGet_NY() && Set_Progress(iy, m_pGrid->Get_NY()); iy++, y+=m_pGrid->Get_Cellsize()) { for(ix=0, x=m_pGrid->Get_XMin(); ixGet_NX(); ix++, x+=m_pGrid->Get_Cellsize()) { if( Get_Value(x, y, z, v) ) { m_pGrid->Set_Value(ix, iy, m_bLog ? exp(z) : z); if( m_pVariance ) { m_pVariance->Set_Value(ix, iy, v); } } else { m_pGrid->Set_NoData(ix, iy); if( m_pVariance ) { m_pVariance->Set_NoData(ix, iy); } } } } bResult = true; } //----------------------------------------------------- m_Points.Clear(); m_Search.Destroy(); m_G .Destroy(); m_W .Destroy(); if( m_pShapes && m_pShapes != Parameters("SHAPES")->asShapes() ) { delete(m_pShapes); } return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- double C_Kriging_Base::Get_Weight(double d) { if( d > 0.0 ) { switch( m_Model ) { case 0: return( // Spherical Model d >= m_Range ? m_Nugget + m_Sill : m_Nugget + m_Sill * (3.0 * d / (2.0 * m_Range) - d*d*d / (2.0 * m_Range*m_Range*m_Range)) ); case 1: return( // Exponential Model m_Nugget + m_Sill * (1.0 - exp(-3.0 * d / m_Range)) ); case 2: return( // Gaussian Model m_Nugget + m_Sill * SG_Get_Square(1.0 - exp(-3.0 * d / (m_Range*m_Range))) ); case 3: default: return( // Linear Regression m_Nugget + d * m_BLIN ); case 4: return( // Exponential Regression m_Nugget * exp(d * m_BEXP) ); case 5: return( // Power Function Regression m_Nugget + m_APOW * pow(d, m_BPOW) ); } } return( m_Nugget > 0.0 ? m_Nugget : 0.00001 ); } //--------------------------------------------------------- double C_Kriging_Base::Get_Weight(double dx, double dy) { return( Get_Weight(sqrt(dx*dx + dy*dy)) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool C_Kriging_Base::_Get_Points(void) { int iShape, iPart, iPoint; CSG_Shape *pShape , *pPoint; CSG_Shapes *pPoints; m_pShapes = Parameters("SHAPES") ->asShapes(); m_zField = Parameters("FIELD") ->asInt(); if( m_pShapes->Get_Type() != SHAPE_TYPE_Point ) { pPoints = SG_Create_Shapes(SHAPE_TYPE_Point, SG_T(""), m_pShapes); for(iShape=0; iShapeGet_Count() && Set_Progress(iShape, m_pShapes->Get_Count()); iShape++) { pShape = m_pShapes->Get_Shape(iShape); if( !pShape->is_NoData(m_zField) ) { for(iPart=0; iPartGet_Part_Count(); iPart++) { for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { pPoint = pPoints->Add_Shape(pShape, SHAPE_COPY_ATTR); pPoint->Add_Point(pShape->Get_Point(iPoint, iPart)); } } } } m_pShapes = pPoints; } return( m_pShapes->Get_Count() > 1 ); } //--------------------------------------------------------- bool C_Kriging_Base::_Get_Grid(void) { CSG_Shapes *pShapes = Parameters("SHAPES")->asShapes(); m_pGrid = NULL; m_pVariance = NULL; //------------------------------------------------- switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... if( Dlg_Parameters("USER") ) { m_pGrid = _Get_Grid(pShapes->Get_Extent()); } break; case 1: // grid system... if( Dlg_Parameters("SYSTEM") ) { m_pGrid = SG_Create_Grid(*Get_Parameters("SYSTEM")->Get_Parameter("SYSTEM")->asGrid_System(), SG_DATATYPE_Float); } break; case 2: // grid... if( Dlg_Parameters("GRID") ) { m_pGrid = Get_Parameters("GRID")->Get_Parameter("GRID") ->asGrid(); m_pVariance = Get_Parameters("GRID")->Get_Parameter("VARIANCE") ->asGrid(); } break; } //------------------------------------------------- if( m_pGrid ) { if( !m_pVariance && Parameters("BVARIANCE")->asBool() ) { m_pVariance = SG_Create_Grid(m_pGrid, SG_DATATYPE_Float); } m_pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("FIELD")->asString(), Get_Name().c_str())); Parameters("GRID")->Set_Value(m_pGrid); if( m_pVariance ) { m_pVariance->Set_Name(CSG_String::Format(SG_T("%s [%s %s]"), Parameters("FIELD")->asString(), Get_Name().c_str(), _TL("Variance"))); Parameters("VARIANCE")->Set_Value(m_pVariance); } if( Parameters("TARGET")->asInt() == 2 ) { Get_Parameters("GRID")->Get_Parameter("VARIANCE")->Set_Value(m_pVariance); } } //----------------------------------------------------- return( m_pGrid != NULL ); } //--------------------------------------------------------- CSG_Grid * C_Kriging_Base::_Get_Grid(TSG_Rect Extent) { CSG_Parameters *P = Get_Parameters("USER"); if( !P->Get_Parameter("FIT_EXTENT")->asBool() ) { Extent.xMin = P->Get_Parameter("X_EXTENT")->asRange()->Get_LoVal(); Extent.yMin = P->Get_Parameter("Y_EXTENT")->asRange()->Get_LoVal(); Extent.xMax = P->Get_Parameter("X_EXTENT")->asRange()->Get_HiVal(); Extent.yMax = P->Get_Parameter("Y_EXTENT")->asRange()->Get_HiVal(); } double d = P->Get_Parameter("CELL_SIZE")->asDouble(); int nx = 1 + (int)((Extent.xMax - Extent.xMin) / d); int ny = 1 + (int)((Extent.yMax - Extent.yMin) / d); return( nx > 1 && ny > 1 ? SG_Create_Grid(SG_DATATYPE_Float, nx, ny, d, Extent.xMin, Extent.yMin) : NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_base.h000066400000000000000000000116711224124640700330000ustar00rootroot00000000000000/********************************************************** * Version $Id: _kriging_base.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Kriging // // // //-------------------------------------------------------// // // // _Kriging_Base.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED___Kriging_Base_H #define HEADER_INCLUDED___Kriging_Base_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class geostatistics_kriging_EXPORT C_Kriging_Base : public CSG_Module { public: C_Kriging_Base(void); virtual ~C_Kriging_Base(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Without Variogram Fit") ); } protected: virtual bool On_Execute (void); bool m_bBlock; int m_zField; double m_Block; CSG_Points_Z m_Points; CSG_Vector m_G; CSG_Matrix m_W; CSG_PRQuadTree m_Search; CSG_Grid *m_pGrid, *m_pVariance; CSG_Shapes *m_pShapes; virtual bool On_Initialise (void) { return( true ); } virtual bool Get_Value (double x, double y, double &z, double &Variance) = 0; double Get_Weight (double Distance); double Get_Weight (double dx, double dy); private: bool m_bLog; int m_Model; double m_Nugget, m_Sill, m_Range, m_BLIN, m_BEXP, m_APOW, m_BPOW; bool _Get_Points (void); bool _Get_Grid (void); CSG_Grid * _Get_Grid (TSG_Rect Extent); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED___Kriging_Base_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_ordinary.cpp000066400000000000000000000170301224124640700342430ustar00rootroot00000000000000/********************************************************** * Version $Id: _kriging_ordinary.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Kriging // // // //-------------------------------------------------------// // // // _Kriging_Ordinary.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "_kriging_ordinary.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- C_Kriging_Ordinary::C_Kriging_Ordinary(void) : C_Kriging_Ordinary_Global() { Set_Name (_TL("Ordinary Kriging")); Set_Author (SG_T("(c) 2008 by O.Conrad")); Set_Description (_TW( "Ordinary Kriging for grid interpolation from irregular sample points." )); //----------------------------------------------------- Parameters.Add_Value( NULL , "MAXRADIUS" , _TL("Maximum Search Radius (map units)"), _TL(""), PARAMETER_TYPE_Double , 1000.0, 0, true ); Parameters.Add_Range( NULL , "NPOINTS" , _TL("Min./Max. Number of m_Points"), _TL(""), 4, 20, 1, true ); } //--------------------------------------------------------- C_Kriging_Ordinary::~C_Kriging_Ordinary(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool C_Kriging_Ordinary::On_Initialise(void) { m_Radius = Parameters("MAXRADIUS")->asDouble(); m_nPoints_Min = (int)Parameters("NPOINTS")->asRange()->Get_LoVal(); m_nPoints_Max = (int)Parameters("NPOINTS")->asRange()->Get_HiVal(); //----------------------------------------------------- if( m_Search.Create(m_pShapes, m_zField) ) { m_Points.Set_Count (m_nPoints_Max); m_G .Create (m_nPoints_Max + 1); m_W .Create (m_nPoints_Max + 1, m_nPoints_Max + 1); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool C_Kriging_Ordinary::Get_Value(double x, double y, double &z, double &v) { int i, j, n; double Lambda; //----------------------------------------------------- if( (n = Get_Weights(x, y)) > 0 ) { for(i=0; i= m_nPoints_Min ) { for(i=0; i 0 ) { for(i=0; iGet_Count(); iShape++) { CSG_Shape *pShape = m_pShapes->Get_Shape(iShape); if( !pShape->is_NoData(m_zField) ) { for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { m_Points.Add( pShape->Get_Point(iPoint, iPart).x, pShape->Get_Point(iPoint, iPart).y, pShape->asDouble(m_zField) ); } } } } //----------------------------------------------------- if( (n = m_Points.Get_Count()) > 4 ) { m_G .Create(n + 1); m_W .Create(n + 1, n + 1); for(i=0; iasGridList(); m_Interpolation = Parameters("INTERPOL") ->asInt(); m_Radius = Parameters("MAXRADIUS") ->asDouble(); m_nPoints_Min = (int)Parameters("NPOINTS")->asRange()->Get_LoVal(); m_nPoints_Max = (int)Parameters("NPOINTS")->asRange()->Get_HiVal(); //----------------------------------------------------- if( m_Search.Create(m_pShapes, m_zField) ) { m_Points.Set_Count (m_nPoints_Max); m_G .Create (m_nPoints_Max + 1 + m_pGrids->Get_Count()); m_W .Create (m_nPoints_Max + 1 + m_pGrids->Get_Count(), m_nPoints_Max + 1 + m_pGrids->Get_Count()); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool C_Kriging_Universal::Get_Value(double x, double y, double &z, double &v) { int i, j, n, nGrids; double Lambda; //----------------------------------------------------- if( (n = Get_Weights(x, y)) > 0 && (nGrids = m_pGrids->Get_Count()) > 0 ) { for(i=0; iasGrid(i)->Get_Value(x, y, m_G[j], m_Interpolation) ) { return( false ); } } //------------------------------------------------- for(i=0, z=0.0, v=0.0; i= m_nPoints_Min && (nGrids = m_pGrids->Get_Count()) > 0 ) { for(i=0; iasGrid(iGrid)->Get_Value( m_Points[i].x, m_Points[i].y, m_Interpolation ); } } for(i=n; i<=n+nGrids; i++) { for(j=n; j<=n+nGrids; j++) { m_W[i][j] = 0.0; } } if( m_W.Set_Inverse(true, n + 1 + nGrids) ) { return( n ); } } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/_kriging_universal.h000066400000000000000000000112251224124640700340710ustar00rootroot00000000000000/********************************************************** * Version $Id: _kriging_universal.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Kriging // // // //-------------------------------------------------------// // // // _Kriging_Universal.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED___Kriging_UNIVERSAL_H #define HEADER_INCLUDED___Kriging_UNIVERSAL_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "_kriging_universal_global.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class geostatistics_kriging_EXPORT C_Kriging_Universal : public C_Kriging_Universal_Global { public: C_Kriging_Universal(void); virtual ~C_Kriging_Universal(void); protected: virtual bool On_Initialise (void); virtual bool Get_Value (double x, double y, double &z, double &Variance); private: int m_nPoints_Min, m_nPoints_Max; double m_Radius; int Get_Weights (double x, double y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED___Kriging_UNIVERSAL_H _kriging_universal_global.cpp000066400000000000000000000212011224124640700356600ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/********************************************************** * Version $Id: _kriging_universal_global.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Kriging // // // //-------------------------------------------------------// // // // _Kriging_Universal_Global.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "_kriging_universal_global.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- C_Kriging_Universal_Global::C_Kriging_Universal_Global(void) : C_Kriging_Base() { Set_Name (_TL("Universal Kriging (Global)")); Set_Author (SG_T("(c) 2003 by O.Conrad")); Set_Description (_TW( "Universal Kriging for grid interpolation from irregular sample points.\n" "This implementation does not use a maximum search radius. The weighting " "matrix is generated globally for all points." )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Choice( NULL ,"INTERPOL" , _TL("Grid Interpolation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 4 ); } //--------------------------------------------------------- C_Kriging_Universal_Global::~C_Kriging_Universal_Global(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool C_Kriging_Universal_Global::On_Initialise(void) { m_pGrids = Parameters("GRIDS") ->asGridList(); m_Interpolation = Parameters("INTERPOL") ->asInt(); return( Get_Weights() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool C_Kriging_Universal_Global::Get_Value(double x, double y, double &z, double &v) { int i, j, n, nGrids; double Lambda; //----------------------------------------------------- if( (n = m_Points.Get_Count()) > 1 && (nGrids = m_pGrids->Get_Count()) > 0 ) { for(i=0; iasGrid(i)->Get_Value(x, y, m_G[j], m_Interpolation, true) ) { return( false ); } } //------------------------------------------------- for(i=0, z=0.0, v=0.0; iGet_Count()) > 0 ) { for(int iShape=0; iShapeGet_Count(); iShape++) { CSG_Shape *pShape = m_pShapes->Get_Shape(iShape); if( !pShape->is_NoData(m_zField) ) { for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { bool bAdd; CSG_Point p(pShape->Get_Point(iPoint, iPart)); for(j=0, bAdd=true; jasGrid(j)->is_InGrid_byPos(p) ) { bAdd = false; } } if( bAdd ) { m_Points.Add(p.Get_X(), p.Get_Y(), pShape->asDouble(m_zField)); } } } } } //------------------------------------------------- if( (n = m_Points.Get_Count()) > 1 ) { m_G.Create(n + 1 + nGrids); m_W.Create(n + 1 + nGrids, n + 1 + nGrids); for(i=0; iasGrid(iGrid)->Get_Value( m_Points[i].x, m_Points[i].y, m_Interpolation ); } } for(i=n; i<=n+nGrids; i++) { for(j=n; j<=n+nGrids; j++) { m_W[i][j] = 0.0; } } return( m_W.Set_Inverse() ); } } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- _kriging_universal_global.h000066400000000000000000000112411224124640700353300ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/********************************************************** * Version $Id: _kriging_universal_global.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Kriging // // // //-------------------------------------------------------// // // // _Kriging_Universal_Global.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED___Kriging_Universal_Global_H #define HEADER_INCLUDED___Kriging_Universal_Global_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "_kriging_base.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class geostatistics_kriging_EXPORT C_Kriging_Universal_Global : public C_Kriging_Base { public: C_Kriging_Universal_Global(void); virtual ~C_Kriging_Universal_Global(void); protected: int m_Interpolation; CSG_Parameter_Grid_List *m_pGrids; virtual bool On_Initialise (void); virtual bool Get_Value (double x, double y, double &z, double &Variance); private: bool Get_Weights (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED___Kriging_Universal_Global_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.cpp000066400000000000000000000263621224124640700331770ustar00rootroot00000000000000/********************************************************** * Version $Id: kriging_base.cpp 1633 2013-03-22 13:35:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_kriging_variogram // // // //-------------------------------------------------------// // // // kriging_base.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "variogram_dialog.h" #include "kriging_base.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CKriging_Base::CKriging_Base(void) { CSG_Parameter *pNode; CSG_Parameters *pParameters; //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "ZFIELD" , _TL("Attribute"), _TL("") ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TARGET" , _TL("Target Grid"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("user defined"), _TL("grid") ), 0 ); Parameters.Add_Choice( NULL , "TQUALITY" , _TL("Type of Quality Measure"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("standard deviation"), _TL("variance") ), 0 ); //----------------------------------------------------- Parameters.Add_Value( NULL , "LOG" , _TL("Logarithmic Transformation"), _TL(""), PARAMETER_TYPE_Bool ); pNode = Parameters.Add_Value( NULL , "BLOCK" , _TL("Block Kriging"), _TL(""), PARAMETER_TYPE_Bool , false ); Parameters.Add_Value( pNode , "DBLOCK" , _TL("Block Size"), _TL(""), PARAMETER_TYPE_Double , 100.0, 0.0, true ); /////////////////////////////////////////////////////// //----------------------------------------------------- if( !SG_UI_Get_Window_Main() ) { Parameters.Add_Value( NULL , "VAR_MAXDIST" , _TL("Maximum Distance"), _TL(""), PARAMETER_TYPE_Double , -1.0 ); Parameters.Add_Value( NULL , "VAR_NCLASSES" , _TL("Lag Distance Classes"), _TL("initial number of lag distance classes"), PARAMETER_TYPE_Int , 100, 1, true ); Parameters.Add_Value( NULL , "VAR_NSKIP" , _TL("Skip"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); Parameters.Add_String( NULL , "VAR_MODEL" , _TL("Model"), _TL(""), SG_T("a + b * x") ); } /////////////////////////////////////////////////////// //----------------------------------------------------- pParameters = Add_Parameters("USER", _TL("User Defined Grid") , _TL("")); pParameters->Add_Value( NULL , "BVARIANCE" , _TL("Create Quality Grid"), _TL(""), PARAMETER_TYPE_Bool, true ); m_Grid_Target.Add_Parameters_User(pParameters); //----------------------------------------------------- pParameters = Add_Parameters("GRID", _TL("Choose Grid") , _TL("")); m_Grid_Target.Add_Parameters_Grid(pParameters); //----------------------------------------------------- m_Grid_Target.Add_Grid_Parameter(SG_T("VARIANCE"), _TL("Quality Measure"), true); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CKriging_Base::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 ); } //--------------------------------------------------------- int CKriging_Base::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) ) { pParameters->Get_Parameter("SEARCH_RADIUS" )->Set_Enabled(pParameter->asInt() == 0); // local } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) ) { pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0); // maximum number of points pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0); // maximum number of points per quadrant } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("BLOCK")) ) { pParameters->Get_Parameter("DBLOCK") ->Set_Enabled(pParameter->asBool()); // block size } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CKriging_Base::On_Execute(void) { bool bResult = false; //----------------------------------------------------- m_Block = Parameters("BLOCK" )->asBool() ? Parameters("DBLOCK")->asDouble() / 2.0 : 0.0; m_bStdDev = Parameters("TQUALITY")->asInt() == 0; m_bLog = Parameters("LOG" )->asBool(); m_pPoints = Parameters("POINTS" )->asShapes(); m_zField = Parameters("ZFIELD" )->asInt(); if( m_pPoints->Get_Count() <= 1 ) { SG_UI_Msg_Add(_TL("not enough points for interpolation"), true); return( false ); } //----------------------------------------------------- CSG_Table Variogram; if( SG_UI_Get_Window_Main() ) { static CVariogram_Dialog dlg; if( dlg.Execute(m_pPoints, m_zField, m_bLog, &Variogram, &m_Model) ) { bResult = true; } } else { int nSkip = Parameters("VAR_NSKIP" )->asInt(); int nClasses = Parameters("VAR_NCLASSES")->asInt(); double maxDistance = Parameters("VAR_MAXDIST" )->asDouble(); m_Model.Set_Formula(Parameters("VAR_MODEL")->asString()); if( CSG_Variogram::Calculate(m_pPoints, m_zField, m_bLog, &Variogram, nClasses, maxDistance, nSkip) ) { m_Model.Clr_Data(); for(int i=0; iasDouble(CSG_Variogram::FIELD_DISTANCE), pRecord->asDouble(CSG_Variogram::FIELD_VAR_EXP)); } bResult = m_Model.Get_Trend() || m_Model.Get_Parameter_Count() == 0; } } //----------------------------------------------------- if( bResult && (bResult = _Initialise_Grids() && On_Initialize()) ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("variogram model"), m_Model.Get_Formula(SG_TREND_STRING_Formula_Parameters).c_str()), false); for(int y=0; yGet_NY() && Set_Progress(y, m_pGrid->Get_NY()); y++) { #pragma omp parallel for for(int x=0; xGet_NX(); x++) { double z, v; if( Get_Value(m_pGrid->Get_System().Get_Grid_to_World(x, y), z, v) ) { Set_Value(x, y, z, v); } else { Set_NoData(x, y); } } } } //----------------------------------------------------- m_Model.Clr_Data(); On_Finalize(); return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CKriging_Base::_Initialise_Grids(void) { m_pGrid = NULL; m_pVariance = NULL; //----------------------------------------------------- switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... if( m_Grid_Target.Init_User(m_pPoints->Get_Extent()) && Dlg_Parameters("USER") ) { m_pGrid = m_Grid_Target.Get_User(); if( Get_Parameters("USER")->Get_Parameter("BVARIANCE")->asBool() ) { m_pVariance = m_Grid_Target.Get_User(SG_T("VARIANCE")); } } break; case 1: // grid... if( Dlg_Parameters("GRID") ) { m_pGrid = m_Grid_Target.Get_Grid(); m_pVariance = m_Grid_Target.Get_Grid(SG_T("VARIANCE")); } break; } if( !m_pGrid ) { return( false ); } //----------------------------------------------------- m_pGrid->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("ZFIELD")->asString(), Get_Name().c_str())); if( m_pVariance ) { m_pVariance->Set_Name(CSG_String::Format(SG_T("%s [%s %s]"), Parameters("ZFIELD")->asString(), Get_Name().c_str(), m_bStdDev ? _TL("Standard Deviation") : _TL("Variance"))); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_base.h000066400000000000000000000140721224124640700326370ustar00rootroot00000000000000/********************************************************** * Version $Id: kriging_base.h 1339 2012-02-28 16:31:17Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_kriging_variogram // // // //-------------------------------------------------------// // // // kriging_base.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__kriging_base_H #define HEADER_INCLUDED__kriging_base_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CKriging_Base : public CSG_Module { public: CKriging_Base(void); protected: bool m_bLog; int m_zField; CSG_Shapes *m_pPoints; virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Initialize (void) { return( true ); } virtual bool On_Finalize (void) { return( true ); } virtual bool Get_Value (const TSG_Point &p, double &z, double &v) = 0; double Get_Weight (double d) { return( m_Model.Get_Value(d) ); } double Get_Weight (double dx, double dy) { return( Get_Weight(sqrt(dx*dx + dy*dy)) ); } double Get_Weight (const TSG_Point_Z &a, const TSG_Point_Z &b) { return( Get_Weight(a.x - b.x, a.y - b.y) ); } double Get_Weight (double ax, double ay, double bx, double by) { if( m_Block > 0.0 ) { return( ( Get_Weight( ax - bx, ay - by) + Get_Weight((ax + m_Block) - bx, (ay + m_Block) - by) + Get_Weight((ax + m_Block) - bx, (ay - m_Block) - by) + Get_Weight((ax - m_Block) - bx, (ay + m_Block) - by) + Get_Weight((ax - m_Block) - bx, (ay - m_Block) - by) ) / 5.0 ); } return( Get_Weight(ax - bx, ay - by) ); } void Set_Value (int x, int y, double z, double v) { if( m_pGrid ) m_pGrid ->Set_Value(x, y, m_bLog ? exp (z) : z); if( m_pVariance ) m_pVariance->Set_Value(x, y, m_bStdDev ? sqrt(v) : v); } void Set_NoData (int x, int y) { if( m_pGrid ) m_pGrid ->Set_NoData(x, y); if( m_pVariance ) m_pVariance->Set_NoData(x, y); } private: bool m_bStdDev; double m_Block; CSG_Parameters_Grid_Target m_Grid_Target; CSG_Trend m_Model; CSG_Grid *m_pGrid, *m_pVariance; bool _Initialise_Grids (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__kriging_base_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/kriging_ordinary.cpp000066400000000000000000000212361224124640700341070ustar00rootroot00000000000000/********************************************************** * Version $Id: kriging_ordinary.cpp 1633 2013-03-22 13:35:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Kriging // // // //-------------------------------------------------------// // // // Kriging_Ordinary.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "kriging_ordinary.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CKriging_Ordinary::CKriging_Ordinary(void) : CKriging_Ordinary_Global() { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Ordinary Kriging")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "Ordinary Kriging for grid interpolation from irregular sample points." )); //----------------------------------------------------- CSG_Parameter *pSearch = Parameters.Add_Node( NULL , "NODE_SEARCH" , _TL("Search Options"), _TL("") ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_RANGE" , _TL("Search Range"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("local"), _TL("global") ) ); Parameters.Add_Value( pNode , "SEARCH_RADIUS" , _TL("Maximum Search Distance"), _TL("local maximum search distance given in map units"), PARAMETER_TYPE_Double , 1000.0, 0, true ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_POINTS_ALL" , _TL("Number of Points"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("maximum number of nearest points"), _TL("all points within search distance") ) ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MIN" , _TL("Minimum"), _TL("minimum number of points to use"), PARAMETER_TYPE_Int, 4, 1, true ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MAX" , _TL("Maximum"), _TL("maximum number of nearest points"), PARAMETER_TYPE_Int, 20, 1, true ); Parameters.Add_Choice( pNode , "SEARCH_DIRECTION" , _TL("Search Direction"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("all directions"), _TL("quadrants") ) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CKriging_Ordinary::On_Initialize(void) { m_nPoints_Min = Parameters("SEARCH_POINTS_MIN")->asInt (); m_nPoints_Max = Parameters("SEARCH_POINTS_ALL")->asInt () == 0 ? Parameters("SEARCH_POINTS_MAX")->asInt () : 0; m_Radius = Parameters("SEARCH_RANGE" )->asInt () == 0 ? Parameters("SEARCH_RADIUS" )->asDouble() : 0.0; m_Direction = Parameters("SEARCH_DIRECTION" )->asInt () == 0 ? -1 : 4; //----------------------------------------------------- if( m_nPoints_Max <= 0 && m_Radius <= 0 ) // global { return( CKriging_Ordinary_Global::On_Execute() ); } //----------------------------------------------------- m_Search.Create(m_pPoints->Get_Extent()); for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, m_pPoints->Get_Count()); iPoint++) { CSG_Shape *pPoint = m_pPoints->Get_Shape(iPoint); if( !pPoint->is_NoData(m_zField) ) { m_Search.Add_Point(pPoint->Get_Point(0).x, pPoint->Get_Point(0).y, m_bLog ? log(pPoint->asDouble(m_zField)) : pPoint->asDouble(m_zField)); } } if( !m_Search.is_Okay() ) { SG_UI_Msg_Add(_TL("could not initialize point search engine"), true); return( false ); } //----------------------------------------------------- return( true ); } //--------------------------------------------------------- bool CKriging_Ordinary::On_Finalize(void) { m_Search.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CKriging_Ordinary::Get_Weights(const TSG_Point &p, CSG_Matrix &W, CSG_Points_Z &Points) { int n = m_Search.Get_Nearest_Points(Points, p, m_nPoints_Max, m_Radius, m_Direction); if( n >= m_nPoints_Min ) { W.Create(n + 1, n + 1); for(int i=0; i 0 ) { CSG_Vector G(n + 1); for(i=0; iGet_Count(); i++) { CSG_Shape *pPoint = m_pPoints->Get_Shape(i); if( !pPoint->is_NoData(m_zField) ) { m_Points.Add(pPoint->Get_Point(0).x, pPoint->Get_Point(0).y, m_bLog ? log(pPoint->asDouble(m_zField)) : pPoint->asDouble(m_zField)); } } //----------------------------------------------------- if( (n = m_Points.Get_Count()) > 1 ) { m_W.Create(n + 1, n + 1); for(i=0; i 0 ) { CSG_Vector G(n + 1); for(i=0; iasGridList(); m_Interpolation = Parameters("INTERPOL" )->asInt(); m_nPoints_Min = Parameters("SEARCH_POINTS_MIN")->asInt (); m_nPoints_Max = Parameters("SEARCH_POINTS_ALL")->asInt () == 0 ? Parameters("SEARCH_POINTS_MAX")->asInt () : 0; m_Radius = Parameters("SEARCH_RANGE" )->asInt () == 0 ? Parameters("SEARCH_RADIUS" )->asDouble() : 0.0; m_Direction = Parameters("SEARCH_DIRECTION" )->asInt () == 0 ? -1 : 4; //----------------------------------------------------- if( m_nPoints_Max <= 0 && m_Radius <= 0 ) // global { return( CKriging_Universal_Global::On_Execute() ); } //----------------------------------------------------- m_Search.Create(m_pPoints->Get_Extent()); for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, m_pPoints->Get_Count()); iPoint++) { CSG_Shape *pPoint = m_pPoints->Get_Shape(iPoint); if( !pPoint->is_NoData(m_zField) ) { bool bAdd = true; for(int iGrid=0; iGridGet_Count(); iGrid++) { if( !m_pGrids->asGrid(iGrid)->is_InGrid_byPos(pPoint->Get_Point(0)) ) { bAdd = false; } } if( bAdd ) { m_Search.Add_Point(pPoint->Get_Point(0).x, pPoint->Get_Point(0).y, m_bLog ? log(pPoint->asDouble(m_zField)) : pPoint->asDouble(m_zField)); } } } if( !m_Search.is_Okay() ) { SG_UI_Msg_Add(_TL("could not initialize point search engine"), true); return( false ); } //----------------------------------------------------- return( true ); } //--------------------------------------------------------- bool CKriging_Universal::On_Finalize(void) { m_Search.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CKriging_Universal::Get_Weights(const TSG_Point &p, CSG_Matrix &W, CSG_Points_Z &Points) { //----------------------------------------------------- int n = m_Search.Get_Nearest_Points(Points, p, m_nPoints_Max, m_Radius, m_Direction); if( n >= m_nPoints_Min ) { int i, j, k; int nCoords = m_bCoords ? 2 : 0; int nGrids = m_pGrids->Get_Count(); W.Create(n + 1 + nGrids + nCoords, n + 1 + nGrids + nCoords); //------------------------------------------------- for(i=0; iasGrid(k)->Get_Value(Points[i].x, Points[i].y, m_Interpolation); } for(k=0, j=n+nGrids+1; k 1 ) { nCoords = m_bCoords ? 2 : 0; nGrids = m_pGrids->Get_Count(); CSG_Vector G(n + 1 + nGrids + nCoords); for(i=0; iasGrid(i)->Get_Value(p, G[j], m_Interpolation) ) { return( false ); } } if( m_bCoords ) { G[n + 1 + nGrids] = p.x; G[n + 2 + nGrids] = p.y; } //------------------------------------------------- for(i=0, z=0.0, v=0.0; iasGridList(); m_Interpolation = Parameters("INTERPOL")->asInt(); m_bCoords = Parameters("COORDS" )->asBool(); //----------------------------------------------------- int i, j, k, n, nGrids, nCoords; nCoords = m_bCoords ? 2 : 0; nGrids = m_pGrids->Get_Count(); //----------------------------------------------------- m_Points.Clear(); for(i=0; iGet_Count(); i++) { CSG_Shape *pPoint = m_pPoints->Get_Shape(i); if( !pPoint->is_NoData(m_zField) ) { bool bAdd; for(j=0, bAdd=true; jasGrid(j)->is_InGrid_byPos(pPoint->Get_Point(0)) ) { bAdd = false; } } if( bAdd ) { m_Points.Add(pPoint->Get_Point(0).x, pPoint->Get_Point(0).y, m_bLog ? log(pPoint->asDouble(m_zField)) : pPoint->asDouble(m_zField)); } } } //----------------------------------------------------- if( (n = m_Points.Get_Count()) > 1 ) { m_W.Create(n + 1 + nGrids + nCoords, n + 1 + nGrids + nCoords); for(i=0; iasGrid(k)->Get_Value(m_Points[i].x, m_Points[i].y, m_Interpolation); } for(k=0, j=n+nGrids+1; k 1 ) { nCoords = m_bCoords ? 2 : 0; nGrids = m_pGrids->Get_Count(); CSG_Vector G(n + 1 + nGrids + nCoords); for(i=0; iasGrid(i)->Get_Value(p, G[j], m_Interpolation, true) ) { return( false ); } } if( m_bCoords ) { G[n + 1 + nGrids] = p.x; G[n + 2 + nGrids] = p.y; } //------------------------------------------------- for(i=0, z=0.0, v=0.0; iasShapes(); Attribute = Parameters("ATTRIBUTE") ->asInt(); bLog = Parameters("LOG") ->asBool(); pVariogram = Parameters("VARIOGRAM") ->asTable(); //----------------------------------------------------- if( SG_UI_Get_Window_Main() ) { static CVariogram_Dialog dlg; if( dlg.Execute(pPoints, Attribute, bLog, pVariogram, &Model) ) { bResult = true; } } //----------------------------------------------------- else { int nSkip = Parameters("VAR_NSKIP") ->asInt(); int nClasses = Parameters("VAR_NCLASSES") ->asInt(); double maxDistance = Parameters("VAR_MAXDIST") ->asDouble(); Model.Set_Formula(Parameters("VAR_MODEL")->asString()); if( CSG_Variogram::Calculate(pPoints, Attribute, bLog, pVariogram, nClasses, maxDistance, nSkip) ) { Model.Clr_Data(); for(int i=0; iGet_Count(); i++) { CSG_Table_Record *pRecord = pVariogram->Get_Record(i); Model.Add_Data(pRecord->asDouble(CSG_Variogram::FIELD_DISTANCE), pRecord->asDouble(CSG_Variogram::FIELD_VAR_EXP)); } bResult = Model.Get_Trend() || Model.Get_Parameter_Count() == 0; } } //----------------------------------------------------- if( bResult ) { Message_Add(Model.Get_Formula(), false); for(int i=0; iGet_Count(); i++) { CSG_Table_Record *pRecord = pVariogram->Get_Record(i); pRecord->Set_Value(CSG_Variogram::FIELD_VAR_MODEL, Model.Get_Value(pRecord->asDouble(CSG_Variogram::FIELD_DISTANCE))); } } return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/semivariogram.h000066400000000000000000000102111224124640700330470ustar00rootroot00000000000000/********************************************************** * Version $Id: semivariogram.h 1366 2012-04-05 08:36:05Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // semivariogram.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__semivariogram_H #define HEADER_INCLUDED__semivariogram_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSemiVariogram : public CSG_Module { public: CSemiVariogram(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Spatial and Geostatistics|Points") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__semivariogram_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.cpp000066400000000000000000000433651224124640700340630ustar00rootroot00000000000000/********************************************************** * Version $Id: variogram_dialog.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_kriging_variogram // // // //-------------------------------------------------------// // // // Variogram_Dialog.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Bundesstr. 55 // // 20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "variogram_dialog.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Variogram::CSG_Variogram(void) {} //--------------------------------------------------------- bool CSG_Variogram::Calculate(CSG_Shapes *pPoints, int Attribute, bool bLog, CSG_Table *pVariogram, int nClasses, double maxDistance, int nSkip) { int i, j, k, n; double z, lagDistance; TSG_Point p; CSG_Vector Count, Variance; CSG_Table_Record *pRecord; CSG_Shape *pPoint; //----------------------------------------------------- if( nSkip < 1 ) { nSkip = 1; } if( maxDistance <= 0.0 || maxDistance > SG_Get_Length(pPoints->Get_Extent().Get_XRange(), pPoints->Get_Extent().Get_YRange()) ) { maxDistance = SG_Get_Length(pPoints->Get_Extent().Get_XRange(), pPoints->Get_Extent().Get_YRange()); // bounding box' diagonal } lagDistance = maxDistance / nClasses; Count .Create(nClasses); Variance .Create(nClasses); //----------------------------------------------------- for(i=0, n=0; iGet_Count()-nSkip && SG_UI_Process_Set_Progress(n, SG_Get_Square(pPoints->Get_Count()/nSkip)/2); i+=nSkip) { pPoint = pPoints->Get_Shape(i); if( !pPoint->is_NoData(Attribute) ) { p = pPoint->Get_Point(0); z = bLog ? log(pPoint->asDouble(Attribute)) : pPoint->asDouble(Attribute); for(j=i+nSkip; jGet_Count(); j+=nSkip, n++) { pPoint = pPoints->Get_Shape(j); if( !pPoint->is_NoData(Attribute) ) { k = (int)(SG_Get_Distance(p, pPoint->Get_Point(0)) / lagDistance); if( k < nClasses ) { Count [k] ++; Variance[k] += SG_Get_Square((bLog ? log(pPoint->asDouble(Attribute)) : pPoint->asDouble(Attribute)) - z); } } } } } //----------------------------------------------------- pVariogram->Destroy(); pVariogram->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Variogram"), pPoints->Get_Name())); pVariogram->Add_Field(_TL("Class") , SG_DATATYPE_Int); // FIELD_CLASS pVariogram->Add_Field(_TL("Distance") , SG_DATATYPE_Double); // FIELD_DISTANCE pVariogram->Add_Field(_TL("Count") , SG_DATATYPE_Int); // FIELD_COUNT pVariogram->Add_Field(_TL("Variance") , SG_DATATYPE_Double); // FIELD_VAR_EXP pVariogram->Add_Field(_TL("Var.cum.") , SG_DATATYPE_Double); // FIELD_VAR_CUM pVariogram->Add_Field(_TL("Model") , SG_DATATYPE_Double); // FIELD_VAR_MODEL for(i=0, z=0.0, n=0; i 0 ) { n += (int)Count[i]; z += Variance[i]; pRecord = pVariogram->Add_Record(); pRecord->Set_Value(FIELD_CLASS , (i + 1)); pRecord->Set_Value(FIELD_DISTANCE , (i + 1) * lagDistance); pRecord->Set_Value(FIELD_COUNT , Count[i]); pRecord->Set_Value(FIELD_VAR_EXP , 0.5 * Variance[i] / Count[i]); pRecord->Set_Value(FIELD_VAR_CUM , 0.5 * z / n); } } //----------------------------------------------------- return( SG_UI_Process_Get_Okay() ); } //--------------------------------------------------------- double CSG_Variogram::Get_Lag_Distance(CSG_Shapes *pPoints, int Method, int nSkip) { if( Method == 0 ) { CSG_PRQuadTree QT(pPoints, 0); CSG_Simple_Statistics s; double x, y, z; if( nSkip < 1 ) { nSkip = 1; } for(int iPoint=0; iPointGet_Count() && ::SG_UI_Process_Set_Progress(iPoint, pPoints->Get_Count()); iPoint+=nSkip) { TSG_Point p = pPoints->Get_Shape(iPoint)->Get_Point(0); if( QT.Select_Nearest_Points(p.x, p.y, 2) && QT.Get_Selected_Point(1, x, y, z) && (x != p.x || y != p.y) ) { s.Add_Value(SG_Get_Distance(x, y, p.x, p.y)); } } if( s.Get_Count() > 0 && s.Get_Mean() > 0.0 ) { return( s.Get_Mean() ); } } return( 0.25 * sqrt((pPoints->Get_Extent().Get_XRange() * pPoints->Get_Extent().Get_YRange()) / pPoints->Get_Count()) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CVariogram_Diagram : public CSGDI_Diagram { public: CVariogram_Diagram(wxWindow *pParent); bool m_bPairs; void Initialize (CSG_Trend *pModel, CSG_Table *pVariogram); void Set_Variogram (void); private: CSG_Table *m_pVariogram; CSG_Trend *m_pModel; virtual void On_Draw (wxDC &dc, wxRect rDraw); }; //--------------------------------------------------------- CVariogram_Diagram::CVariogram_Diagram(wxWindow *pParent) : CSGDI_Diagram(pParent) { m_xName = _TL("Distance"); m_yName = _TL("Variance"); m_pModel = NULL; m_pVariogram = NULL; m_bPairs = false; } //--------------------------------------------------------- void CVariogram_Diagram::Initialize(CSG_Trend *pModel, CSG_Table *pVariogram) { m_pModel = pModel; m_pVariogram = pVariogram; } //--------------------------------------------------------- void CVariogram_Diagram::Set_Variogram(void) { m_xMin = m_yMin = 0.0; m_xMax = (1.0 + 0.00) * m_pVariogram->Get_Maximum(CSG_Variogram::FIELD_DISTANCE); m_yMax = (1.0 + 0.02) * m_pVariogram->Get_Maximum(CSG_Variogram::FIELD_VAR_EXP ); } //--------------------------------------------------------- void CVariogram_Diagram::On_Draw(wxDC &dc, wxRect rDraw) { if( m_pVariogram->Get_Count() > 0 ) { int i, ix, iy, jx, jy; double x, dx; //------------------------------------------------- if( m_pModel->Get_Data_Count() > 0 ) { ix = Get_xToScreen(m_pModel->Get_Data_XMax()); dc.SetPen (wxPen(wxColour( 0, 127, 0), 2)); dc.DrawLine(ix, Get_yToScreen(m_yMin), ix, Get_yToScreen(m_yMax)); } //------------------------------------------------- if( m_bPairs && m_pVariogram->Get_Maximum(CSG_Variogram::FIELD_COUNT) > 0 ) { double dScale = m_yMax / m_pVariogram->Get_Maximum(CSG_Variogram::FIELD_COUNT); dc.SetPen (wxColour(191, 191, 191)); dc.SetBrush(wxColour(191, 191, 191)); for(i=0; iGet_Count(); i++) { CSG_Table_Record *pRecord = m_pVariogram->Get_Record(i); ix = Get_xToScreen(pRecord->asDouble(CSG_Variogram::FIELD_DISTANCE)); iy = Get_yToScreen(pRecord->asDouble(CSG_Variogram::FIELD_COUNT ) * dScale); dc.DrawCircle(ix, iy, 3); } } //------------------------------------------------- dc.SetPen (wxColour(127, 127, 127)); dc.SetBrush(wxColour( 0, 0, 0)); for(i=0; iGet_Count(); i++) { CSG_Table_Record *pRecord = m_pVariogram->Get_Record(i); ix = Get_xToScreen(pRecord->asDouble(CSG_Variogram::FIELD_DISTANCE)); iy = Get_yToScreen(pRecord->asDouble(CSG_Variogram::FIELD_VAR_EXP )); dc.DrawCircle(ix, iy, 3); } //------------------------------------------------- if( m_pModel->is_Okay() ) { dc.SetPen(wxPen(*wxRED, 2)); dx = (m_xMax - m_xMin) / (double)rDraw.GetWidth(); ix = Get_xToScreen(m_xMin); iy = Get_yToScreen(m_pModel->Get_Value(m_xMin)); for(x=m_xMin+dx; x<=m_xMax; x+=dx) { jx = ix; jy = iy; ix = Get_xToScreen(x); iy = Get_yToScreen(m_pModel->Get_Value(x)); dc.DrawLine(jx, jy, ix, iy); } } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- BEGIN_EVENT_TABLE(CVariogram_Dialog, CSGDI_Dialog) EVT_BUTTON (wxID_ANY , CVariogram_Dialog::On_Button) EVT_CHECKBOX (wxID_ANY , CVariogram_Dialog::On_Update_Control) EVT_TEXT_ENTER (wxID_ANY , CVariogram_Dialog::On_Update_Control) EVT_SLIDER (wxID_ANY , CVariogram_Dialog::On_Update_Control) EVT_CHOICE (wxID_ANY , CVariogram_Dialog::On_Update_Choices) END_EVENT_TABLE() //--------------------------------------------------------- CVariogram_Dialog::CVariogram_Dialog(void) : CSGDI_Dialog(_TL("Variogram")) { m_pPoints = NULL; m_Attribute = 0; m_pVariogram = NULL; m_pModel = NULL; m_Distance = -1; //----------------------------------------------------- wxArrayString Formulas; Formulas.Empty(); Formulas.Add(SG_T("a + b * x")); // 1st order polynom (linear) Formulas.Add(SG_T("a + b * x + c * x^2")); // 2nd order polynom (quadric) Formulas.Add(SG_T("a + b * x + c * x^2 + d * x^3")); // 3rd order polynom (cubic) Formulas.Add(SG_T("a + b * x + c * x^2 + d * x^3 + e * x^4")); // 4th order polynom Formulas.Add(SG_T("a + b * sqrt(c + x)")); // square root Formulas.Add(SG_T("a + b * ln(x)")); // logarithmic Formulas.Add(SG_T("a + b * x^c")); // exponential Formulas.Add(SG_T("a + b * (1 - exp(-(x / b)^2))")); // gaussian Formulas.Add(SG_T("a + b * ifelse(x > c, 1, 1.5 * x / c - 0.5 * x^3 / c^3)")); // spherical //----------------------------------------------------- Add_Button(_TL("Ok") , wxID_OK); Add_Button(_TL("Cancel") , wxID_CANCEL); Add_Spacer(); m_pSettings = Add_Button (_TL("Settings"), wxID_ANY); Add_Spacer(); m_pPairs = Add_CheckBox (_TL("Number of Pairs"), false); Add_Spacer(); m_pFormulas = Add_Choice (_TL("Predefined Functions"), Formulas, 0); Add_Spacer(); m_pDistance = Add_Slider (_TL("Function Fitting Range"), 1, 0, 1); Add_Spacer(); m_pParameters = Add_TextCtrl (_TL("Function Parameters"), wxTE_MULTILINE|wxTE_READONLY); //----------------------------------------------------- Add_Output( m_pDiagram = new CVariogram_Diagram(this), m_pFormula = new wxTextCtrl(this, wxID_ANY, SG_T("a + b * x"), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER), 1, 0 ); //----------------------------------------------------- m_Settings.Set_Name(_TL("Variogram Settings")); m_Settings.Add_Value (NULL, "SKIP" , _TL("Skip") , _TL(""), PARAMETER_TYPE_Int , 1, 1, true); m_Settings.Add_Value (NULL, "LAGDIST" , _TL("Lag Distance") , _TL(""), PARAMETER_TYPE_Double, 1, 0.0, true); m_Settings.Add_Value (NULL, "MAXDIST" , _TL("Maximum Distance") , _TL(""), PARAMETER_TYPE_Double, 1, 0.0, true); m_Settings.Add_String(NULL, "MODEL" , _TL("Model") , _TL(""), SG_T("a + b * x")); } //--------------------------------------------------------- bool CVariogram_Dialog::Execute(CSG_Shapes *pPoints, int Attribute, bool bLog, CSG_Table *pVariogram, CSG_Trend *pModel) { if( m_pPoints != pPoints ) { m_pPoints = pPoints; m_Distance = -1; int nSkip = 1 + m_pPoints->Get_Count() / 10000; m_Settings("SKIP" )->Set_Value(nSkip); m_Settings("LAGDIST")->Set_Value(CSG_Variogram::Get_Lag_Distance(m_pPoints, 0, nSkip)); m_Settings("MAXDIST")->Set_Value(0.5 * sqrt(SG_Get_Square(m_pPoints->Get_Extent().Get_XRange()) + SG_Get_Square(m_pPoints->Get_Extent().Get_YRange()))); } m_Attribute = Attribute; m_bLog = bLog; m_pVariogram = pVariogram; m_pModel = pModel; m_pDiagram->Initialize(m_pModel, m_pVariogram); //----------------------------------------------------- Set_Variogram(); return( ShowModal() == wxID_OK && m_pModel && m_pModel->is_Okay() ); } //--------------------------------------------------------- void CVariogram_Dialog::On_Update_Control(wxCommandEvent &WXUNUSED(event)) { Set_Model(); } void CVariogram_Dialog::On_Update_Choices(wxCommandEvent &WXUNUSED(event)) { m_pFormula->SetValue(m_pFormulas->GetStringSelection().c_str()); Set_Model(); } //--------------------------------------------------------- void CVariogram_Dialog::On_Button(wxCommandEvent &event) { if( event.GetEventObject() == m_pSettings ) { if( SG_UI_Dlg_Parameters(&m_Settings, m_Settings.Get_Name()) ) { m_pFormula ->SetValue (m_Settings("MODEL") ->asString()); Set_Variogram(); } } else { event.Skip(); } } //--------------------------------------------------------- void CVariogram_Dialog::Set_Variogram(void) { double lagDist = m_Settings("LAGDIST")->asDouble(); double maxDist = m_Settings("MAXDIST")->asDouble(); if( lagDist > 0.0 ) { double Diagonal = SG_Get_Length(m_pPoints->Get_Extent().Get_XRange(), m_pPoints->Get_Extent().Get_YRange()); // bounding box's diagonal if( maxDist <= 0.0 || maxDist > Diagonal ) { m_Settings("MAXDIST")->Set_Value(maxDist = Diagonal); } CSG_Variogram::Calculate(m_pPoints, m_Attribute, m_bLog, m_pVariogram, 1 + (int)(0.5 + maxDist / lagDist), maxDist, m_Settings("SKIP")->asInt() ); m_pDistance->Set_Range(0.0, m_pVariogram->Get_Maximum(CSG_Variogram::FIELD_DISTANCE)); m_pDistance->Set_Value(m_pVariogram->Get_Maximum(CSG_Variogram::FIELD_DISTANCE)); m_pDiagram->Set_Variogram(); Set_Model(); } } //--------------------------------------------------------- void CVariogram_Dialog::Set_Model(void) { //----------------------------------------------------- if( m_Distance < 0 || m_Distance != m_pDistance->Get_Value() ) { m_Distance = m_pDistance->Get_Value(); m_pModel->Clr_Data(); for(int i=0; iGet_Count(); i++) { CSG_Table_Record *pRecord = m_pVariogram->Get_Record(i); if( pRecord->asDouble(CSG_Variogram::FIELD_DISTANCE) <= m_Distance ) { m_pModel->Add_Data(pRecord->asDouble(CSG_Variogram::FIELD_DISTANCE), pRecord->asDouble(CSG_Variogram::FIELD_VAR_EXP)); } } m_pModel->Get_Trend(); } //----------------------------------------------------- wxString s; if( !m_pModel->Set_Formula(m_pFormula->GetValue().c_str()) ) { s += m_pModel->Get_Error().w_str(); } else if( !m_pModel->Get_Trend() ) { s += _TL("function fitting failed !"); } else { s += m_pModel->Get_Formula(SG_TREND_STRING_Function).w_str(); s += wxString::Format(wxT("\n%s:\t%.2f%%"), _TL("Determination") , m_pModel->Get_R2() * 100.0); s += wxString::Format(wxT("\n%s:\t%.*f") , _TL("Fitting range") , SG_Get_Significant_Decimals(m_pDistance->Get_Value()), m_pDistance->Get_Value()); s += wxString::Format(wxT("\n%s:\t%d") , _TL("Samples in range") , m_pModel->Get_Data_Count()); s += wxString::Format(wxT("\n%s:\t%d") , _TL("Lag Classes") , m_pVariogram->Get_Count()); s += wxString::Format(wxT("\n%s:\t%.2f") , _TL("Lag Distance") , m_Settings("LAGDIST")->asDouble()); s += wxString::Format(wxT("\n%s:\t%.2f") , _TL("Maximum Distance") , m_Settings("MAXDIST")->asDouble()); m_Settings("MODEL")->Set_Value(m_pModel->Get_Formula(SG_TREND_STRING_Formula)); } m_pParameters->SetValue(s); m_pDiagram->m_bPairs = m_pPairs->GetValue(); m_pDiagram->Refresh(true); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_kriging/variogram_dialog.h000066400000000000000000000137071224124640700335250ustar00rootroot00000000000000/********************************************************** * Version $Id: variogram_dialog.h 1206 2011-10-28 11:54:29Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // image_io // // // //-------------------------------------------------------// // // // Variogram_Dialog.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Variogram_Dialog_H #define HEADER_INCLUDED__Variogram_Dialog_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSG_Variogram { public: enum ESG_Variogram_Field { FIELD_CLASS = 0, FIELD_DISTANCE, FIELD_COUNT, FIELD_VAR_EXP, FIELD_VAR_CUM, FIELD_VAR_MODEL }; CSG_Variogram(void); static bool Calculate (CSG_Shapes *pPoints, int Attribute, bool bLog, CSG_Table *pVariogram, int nClasses = 25, double maxDistance = 0.0, int nSkip = 1); static double Get_Lag_Distance (CSG_Shapes *pPoints, int Method, int nSkip = 1); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CVariogram_Dialog : public CSGDI_Dialog { public: CVariogram_Dialog(void); bool Execute (CSG_Shapes *pPoints, int Attribute, bool bLog, CSG_Table *pVariogram, CSG_Trend *pModel); private: wxButton *m_pSettings; wxCheckBox *m_pPairs; wxChoice *m_pFormulas; wxTextCtrl *m_pFormula, *m_pParameters; CSGDI_Slider *m_pDistance; class CVariogram_Diagram *m_pDiagram; CSG_Parameters m_Settings; CSG_Trend *m_pModel; CSG_Table *m_pVariogram; CSG_Shapes *m_pPoints; bool m_bLog; int m_Attribute; double m_Distance; void On_Update_Control (wxCommandEvent &event); void On_Update_Choices (wxCommandEvent &event); void On_Button (wxCommandEvent &event); void Set_Variogram (void); void Set_Model (void); DECLARE_EVENT_TABLE() }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Variogram_Dialog_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/000077500000000000000000000000001224124640700277205ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.cpp000066400000000000000000000141021224124640700341250ustar00rootroot00000000000000/********************************************************** * Version $Id: GSPoints_Distances.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // GSPoints_Distances.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GSPoints_Distances.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGSPoints_Distances::CGSPoints_Distances(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Minimum Distance Analysis")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description( _TL("") ); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table( NULL , "TABLE" , _TL("Minimum Distance Analysis"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define SET_VALUE(s, v) { pRecord = pTable->Add_Record(); pRecord->Set_Value(0, s); pRecord->Set_Value(1, v); } //--------------------------------------------------------- bool CGSPoints_Distances::On_Execute(void) { //----------------------------------------------------- CSG_Shapes *pPoints = Parameters("POINTS") ->asShapes(); CSG_Table *pTable = Parameters("TABLE") ->asTable(); //----------------------------------------------------- CSG_PRQuadTree QT(pPoints, 0); CSG_Simple_Statistics s; double x, y, z; for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { TSG_Point p = pPoints->Get_Shape(iPoint)->Get_Point(0); if( QT.Select_Nearest_Points(p.x, p.y, 2) && QT.Get_Selected_Point(1, x, y, z) && (x != p.x || y != p.y) ) { s.Add_Value(SG_Get_Distance(x, y, p.x, p.y)); } } //----------------------------------------------------- if( s.Get_Count() > 0 ) { CSG_Table_Record *pRecord; pTable->Destroy(); pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Minimum Distance Analysis"), pPoints->Get_Name())); pTable->Add_Field(SG_T("NAME") , SG_DATATYPE_String); pTable->Add_Field(SG_T("VALUE") , SG_DATATYPE_Double); SET_VALUE(_TL("Mean Average") , s.Get_Mean()); SET_VALUE(_TL("Minimum") , s.Get_Minimum()); SET_VALUE(_TL("Maximum") , s.Get_Maximum()); SET_VALUE(_TL("Standard Deviation") , s.Get_StdDev()); SET_VALUE(_TL("Duplicates") , pPoints->Get_Count() - s.Get_Count()); DataObject_Update(pTable, SG_UI_DATAOBJECT_SHOW); return( true ); } Message_Dlg(_TL("not enough observations")); return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/GSPoints_Distances.h000066400000000000000000000101131224124640700335700ustar00rootroot00000000000000/********************************************************** * Version $Id: GSPoints_Distances.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // GSPoints_Distances.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GSPoints_Distances_H #define HEADER_INCLUDED__GSPoints_Distances_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGSPoints_Distances : public CSG_Module { public: CGSPoints_Distances(void); protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__GSPoints_Distances_H GSPoints_Pattern_Analysis.cpp000066400000000000000000000212131224124640700354120ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/********************************************************** * Version $Id: GSPoints_Pattern_Analysis.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // GSPoints_Pattern_Analysis.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GSPoints_Pattern_Analysis.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGSPoints_Pattern_Analysis::CGSPoints_Pattern_Analysis(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Spatial Point Pattern Analysis")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description( _TL("Basic measures for spatial point patterns.") ); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Shapes( NULL , "CENTRE" , _TL("Mean Centre"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); pNode = Parameters.Add_Shapes( NULL , "STDDIST" , _TL("Standard Distance"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Value( pNode , "STEP" , _TL("Vertex Distance [Degree]"), _TL(""), PARAMETER_TYPE_Double, 5.0, 0.1, true, 20.0, true ); Parameters.Add_Shapes( NULL , "BBOX" , _TL("Bounding Box"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGSPoints_Pattern_Analysis::On_Execute(void) { int iPoint; double StdDist; CSG_Shape *pShape; CSG_Shapes *pPoints, *pShapes; CSG_Simple_Statistics X, Y, D; //----------------------------------------------------- pPoints = Parameters("POINTS") ->asShapes(); if( pPoints->Get_Count() <= 1 ) { Error_Set(_TL("not enough points to perform pattern analysis")); return( false ); } //----------------------------------------------------- for(iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { TSG_Point p = pPoints->Get_Shape(iPoint)->Get_Point(0); X.Add_Value(p.x); Y.Add_Value(p.y); } if( X.Get_Range() == 0.0 && Y.Get_Range() == 0.0 ) { Error_Set(_TL("no variation in point pattern")); return( false ); } //----------------------------------------------------- StdDist = 0.0; for(iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { TSG_Point p = pPoints->Get_Shape(iPoint)->Get_Point(0); D.Add_Value(SG_Get_Distance(X.Get_Mean(), Y.Get_Mean(), p.x, p.y)); StdDist += SG_Get_Square(p.x - X.Get_Mean()) + SG_Get_Square(p.y - Y.Get_Mean()); } StdDist = sqrt(StdDist / D.Get_Count()); //----------------------------------------------------- pShapes = Parameters("CENTRE") ->asShapes(); pShapes ->Create(SHAPE_TYPE_Point , CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Centre"))); pShapes ->Add_Field(SG_T("X_CENTRE"), SG_DATATYPE_Double); pShapes ->Add_Field(SG_T("Y_CENTRE"), SG_DATATYPE_Double); pShapes ->Add_Field(SG_T("N_POINTS"), SG_DATATYPE_Double); pShapes ->Add_Field(SG_T("STDDIST" ), SG_DATATYPE_Double); pShapes ->Add_Field(SG_T("MEANDIST"), SG_DATATYPE_Double); pShape = pShapes->Add_Shape(); pShape ->Set_Value(0, X.Get_Mean()); pShape ->Set_Value(1, Y.Get_Mean()); pShape ->Set_Value(2, D.Get_Count()); pShape ->Set_Value(3, StdDist); pShape ->Set_Value(4, D.Get_StdDev()); pShape ->Add_Point(X.Get_Mean(), Y.Get_Mean()); //----------------------------------------------------- pShapes = Parameters("STDDIST") ->asShapes(); pShapes ->Create(SHAPE_TYPE_Polygon , CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Standard Distance"))); pShapes ->Add_Field(SG_T("X_CENTRE"), SG_DATATYPE_Double); pShapes ->Add_Field(SG_T("Y_CENTRE"), SG_DATATYPE_Double); pShapes ->Add_Field(SG_T("N_POINTS"), SG_DATATYPE_Double); pShapes ->Add_Field(SG_T("STDDIST") , SG_DATATYPE_Double); pShape = pShapes->Add_Shape(); pShape ->Set_Value(0, X.Get_Mean()); pShape ->Set_Value(1, Y.Get_Mean()); pShape ->Set_Value(2, X.Get_Count()); pShape ->Set_Value(3, StdDist); double dTheta = Parameters("STEP")->asDouble() * M_DEG_TO_RAD; for(double Theta=0.0; Theta<=M_PI_360; Theta+=dTheta) { pShape ->Add_Point( X.Get_Mean() + StdDist * cos(Theta), Y.Get_Mean() + StdDist * sin(Theta) ); } //----------------------------------------------------- pShapes = Parameters("BBOX") ->asShapes(); pShapes ->Create(SHAPE_TYPE_Polygon , CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Bounding Box"))); pShapes ->Add_Field(SG_T("XMIN") , SG_DATATYPE_Double); pShapes ->Add_Field(SG_T("XMAX") , SG_DATATYPE_Double); pShapes ->Add_Field(SG_T("YMIN") , SG_DATATYPE_Double); pShapes ->Add_Field(SG_T("YMAX") , SG_DATATYPE_Double); pShape = pShapes->Add_Shape(); pShape ->Set_Value(0, X.Get_Minimum()); pShape ->Set_Value(1, X.Get_Maximum()); pShape ->Set_Value(2, Y.Get_Minimum()); pShape ->Set_Value(3, Y.Get_Maximum()); pShape ->Add_Point(X.Get_Minimum(), Y.Get_Minimum()); pShape ->Add_Point(X.Get_Minimum(), Y.Get_Maximum()); pShape ->Add_Point(X.Get_Maximum(), Y.Get_Maximum()); pShape ->Add_Point(X.Get_Maximum(), Y.Get_Minimum()); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- GSPoints_Pattern_Analysis.h000066400000000000000000000101651224124640700350630ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/********************************************************** * Version $Id: GSPoints_Pattern_Analysis.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // GSPoints_Pattern_Analysis.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GSPoints_Pattern_Analysis_H #define HEADER_INCLUDED__GSPoints_Pattern_Analysis_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGSPoints_Pattern_Analysis : public CSG_Module { public: CGSPoints_Pattern_Analysis(void); protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__GSPoints_Pattern_Analysis_H GSPoints_Semi_Variances.cpp000066400000000000000000000210251224124640700350230ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/********************************************************** * Version $Id: GSPoints_Semi_Variances.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // GSPoints_Semi_Variances.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GSPoints_Semi_Variances.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { FIELD_CLASSNR = 0, FIELD_DISTANCE, FIELD_COUNT, FIELD_VARIANCE, FIELD_VARCUMUL, FIELD_COVARIANCE, FIELD_COVARCUMUL }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGSPoints_Semi_Variances::CGSPoints_Semi_Variances(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Variogram")); Set_Author (SG_T("O.Conrad (c) 2003")); Set_Description( _TL("") ); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("") ); //----------------------------------------------------- Parameters.Add_Table( NULL , "RESULT" , _TL("Sample Variogram"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "DISTCOUNT" , _TL("Initial Number of Distance Classes"), _TL(""), PARAMETER_TYPE_Int , 100, 1, true ); Parameters.Add_Value( NULL , "DISTMAX" , _TL("Maximum Distance"), _TL(""), PARAMETER_TYPE_Double , 0.0, 0.0, true ); Parameters.Add_Value( NULL , "NSKIP" , _TL("Skip Number"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGSPoints_Semi_Variances::On_Execute(void) { int i, j, k, n, nDistances, nSkip, Attribute; double zi, zj, zMean, v, c, maxDistance, lagDistance; TSG_Point Pt_i, Pt_j; CSG_Vector Count, Variance, Covariance; CSG_Table_Record *pRecord; CSG_Table *pTable; CSG_Shape *pPoint; CSG_Shapes *pPoints; //----------------------------------------------------- pPoints = Parameters("POINTS") ->asShapes(); pTable = Parameters("RESULT") ->asTable(); Attribute = Parameters("FIELD") ->asInt(); nSkip = Parameters("NSKIP") ->asInt(); maxDistance = Parameters("DISTMAX") ->asDouble(); nDistances = Parameters("DISTCOUNT") ->asInt(); if( maxDistance <= 0.0 ) { maxDistance = SG_Get_Length(pPoints->Get_Extent().Get_XRange(), pPoints->Get_Extent().Get_YRange()); } lagDistance = maxDistance / nDistances; zMean = pPoints->Get_Mean(Attribute); Count .Create(nDistances); Variance .Create(nDistances); Covariance .Create(nDistances); //----------------------------------------------------- for(i=0, n=0; iGet_Count() && Set_Progress(n, SG_Get_Square(pPoints->Get_Count()/nSkip)/2); i+=nSkip) { pPoint = pPoints->Get_Shape(i); if( !pPoint->is_NoData(Attribute) ) { Pt_i = pPoint->Get_Point(0); zi = pPoint->asDouble(Attribute); for(j=i+nSkip; jGet_Count(); j+=nSkip, n++) { pPoint = pPoints->Get_Shape(j); if( !pPoint->is_NoData(Attribute) ) { Pt_j = pPoint->Get_Point(0); k = (int)(SG_Get_Distance(Pt_i, Pt_j) / lagDistance); if( k < nDistances ) { zj = pPoint->asDouble(Attribute); v = SG_Get_Square(zi - zj); c = (zi - zMean) * (zj - zMean); Count [k] ++; Variance [k] += v; Covariance[k] += c; } } } } } //----------------------------------------------------- pTable->Destroy(); pTable->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("Variogram"), pPoints->Get_Field_Name(Attribute))); pTable->Add_Field(_TL("Class") , SG_DATATYPE_Int); // FIELD_CLASSNR pTable->Add_Field(_TL("Distance") , SG_DATATYPE_Double); // FIELD_DISTANCE pTable->Add_Field(_TL("Count") , SG_DATATYPE_Int); // FIELD_COUNT pTable->Add_Field(_TL("Variance") , SG_DATATYPE_Double); // FIELD_VARIANCE pTable->Add_Field(_TL("Cum.Var.") , SG_DATATYPE_Double); // FIELD_VARCUMUL pTable->Add_Field(_TL("Covariance") , SG_DATATYPE_Double); // FIELD_COVARIANCE pTable->Add_Field(_TL("Cum.Covar.") , SG_DATATYPE_Double); // FIELD_COVARCUMUL for(i=0, v=0.0, c=0.0, n=0; i 0 ) { n += (int)Count[i]; v += Variance [i]; c += Covariance[i]; pRecord = pTable->Add_Record(); pRecord->Set_Value(FIELD_CLASSNR , (i + 1)); pRecord->Set_Value(FIELD_DISTANCE , (i + 1) * lagDistance); pRecord->Set_Value(FIELD_COUNT , Count[i]); pRecord->Set_Value(FIELD_VARIANCE , 0.5 * Variance [i] / Count[i]); pRecord->Set_Value(FIELD_VARCUMUL , 0.5 * v / n); pRecord->Set_Value(FIELD_COVARIANCE , 1.0 * Covariance[i] / Count[i]); pRecord->Set_Value(FIELD_COVARCUMUL , 1.0 * c / n); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- GSPoints_Semi_Variances.h000066400000000000000000000106131224124640700344710ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/********************************************************** * Version $Id: GSPoints_Semi_Variances.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // GSPoints_Semi_Variances.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GSPoints_Semi_Variances_H #define HEADER_INCLUDED__GSPoints_Semi_Variances_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGSPoints_Semi_Variances : public CSG_Module { public: CGSPoints_Semi_Variances(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__GSPoints_Semi_Variances_H GSPoints_Variogram_Cloud.cpp000066400000000000000000000173111224124640700352130ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/********************************************************** * Version $Id: GSPoints_Variogram_Cloud.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // GSPoints_Variogram_Cloud.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GSPoints_Variogram_Cloud.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { DIF_FIELD_DISTANCE = 0, DIF_FIELD_DIRECTION, DIF_FIELD_DIFFERENCE, DIF_FIELD_VARIANCE, DIF_FIELD_SEMIVARIANCE, DIF_FIELD_COVARIANCE }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGSPoints_Variogram_Cloud::CGSPoints_Variogram_Cloud(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Variogram Cloud")); Set_Author (SG_T("O.Conrad (c) 2003")); Set_Description( _TL("") ); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("") ); //----------------------------------------------------- Parameters.Add_Table( NULL , "RESULT" , _TL("Variogram Cloud"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "DISTMAX" , _TL("Maximum Distance"), _TL(""), PARAMETER_TYPE_Double , 0.0, 0.0, true ); Parameters.Add_Value( NULL , "NSKIP" , _TL("Skip Number"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGSPoints_Variogram_Cloud::On_Execute(void) { int nSkip, Attribute; double zi, zj, zMean, d, maxDistance; TSG_Point Pt_i, Pt_j; CSG_Table *pTable; CSG_Shape *pPoint; CSG_Shapes *pPoints; //----------------------------------------------------- pPoints = Parameters("POINTS") ->asShapes(); pTable = Parameters("RESULT") ->asTable(); Attribute = Parameters("FIELD") ->asInt(); nSkip = Parameters("NSKIP") ->asInt(); maxDistance = Parameters("DISTMAX") ->asDouble(); if( maxDistance <= 0.0 ) { maxDistance = SG_Get_Length(pPoints->Get_Extent().Get_XRange(), pPoints->Get_Extent().Get_YRange()); } zMean = pPoints->Get_Mean(Attribute); //----------------------------------------------------- pTable->Destroy(); pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Variogram Cloud"))); pTable->Add_Field(_TL("Distance") , SG_DATATYPE_Double); // DIF_FIELD_DISTANCE pTable->Add_Field(_TL("Direction") , SG_DATATYPE_Double); // DIF_FIELD_DIRECTION pTable->Add_Field(_TL("Difference") , SG_DATATYPE_Double); // DIF_FIELD_DIFFERENCE pTable->Add_Field(_TL("Variance") , SG_DATATYPE_Double); // DIF_FIELD_VARIANCE pTable->Add_Field(_TL("Semivariance") , SG_DATATYPE_Double); // DIF_FIELD_SEMIVARIANCE pTable->Add_Field(_TL("Covariance") , SG_DATATYPE_Double); // DIF_FIELD_COVARIANCE //----------------------------------------------------- for(int i=0; iGet_Count()-nSkip && Set_Progress(i, pPoints->Get_Count()-nSkip); i+=nSkip) { pPoint = pPoints->Get_Shape(i); if( !pPoint->is_NoData(Attribute) ) { Pt_i = pPoint->Get_Point(0); zi = pPoint->asDouble(Attribute); for(int j=i; jGet_Count() && Process_Get_Okay(); j+=nSkip) { pPoint = pPoints->Get_Shape(j); if( !pPoint->is_NoData(Attribute) ) { Pt_j = pPoint->Get_Point(0); if( (d = SG_Get_Distance(Pt_i, Pt_j)) <= maxDistance ) { CSG_Table_Record *pRecord = pTable->Add_Record(); zj = pPoint->asDouble(Attribute); pRecord->Set_Value(DIF_FIELD_DISTANCE , d); pRecord->Set_Value(DIF_FIELD_DIRECTION , SG_Get_Angle_Of_Direction(Pt_i, Pt_j) * M_RAD_TO_DEG); pRecord->Set_Value(DIF_FIELD_DIFFERENCE , fabs(d = zi - zj)); pRecord->Set_Value(DIF_FIELD_VARIANCE , d = d*d); pRecord->Set_Value(DIF_FIELD_SEMIVARIANCE , 0.5*d); pRecord->Set_Value(DIF_FIELD_COVARIANCE , (zi - zMean) * (zj - zMean)); } } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- GSPoints_Variogram_Cloud.h000066400000000000000000000104311224124640700346540ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/********************************************************** * Version $Id: GSPoints_Variogram_Cloud.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // GSPoints_Variogram_Cloud.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GSPoints_Variogram_Cloud_H #define HEADER_INCLUDED__GSPoints_Variogram_Cloud_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGSPoints_Variogram_Cloud : public CSG_Module { public: CGSPoints_Variogram_Cloud(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__GSPoints_Variogram_Cloud_H GSPoints_Variogram_Surface.cpp000066400000000000000000000203431224124640700355340ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/********************************************************** * Version $Id: GSPoints_Variogram_Surface.cpp 1084 2011-06-08 08:10:42Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // GSPoints_Variogram_Surface.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "GSPoints_Variogram_Surface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGSPoints_Variogram_Surface::CGSPoints_Variogram_Surface(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Variogram Surface")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description( _TL("") ); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "FIELD" , _TL("Attribute"), _TL("") ); //----------------------------------------------------- Parameters.Add_Grid_Output( NULL , "COUNT" , _TL("Number of Pairs"), _TL("") ); Parameters.Add_Grid_Output( NULL , "VARIANCE" , _TL("Variogram Surface"), _TL("") ); Parameters.Add_Grid_Output( NULL , "COVARIANCE" , _TL("Covariance Surface"), _TL("") ); Parameters.Add_Value( NULL , "DISTCOUNT" , _TL("Number of Distance Classes"), _TL(""), PARAMETER_TYPE_Int , 10, 1, true ); Parameters.Add_Value( NULL , "NSKIP" , _TL("Skip Number"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGSPoints_Variogram_Surface::On_Execute(void) { long i; int j, x, y, n, nx, ny, nSkip, Attribute, nDistances; double zi, zj, zMean, v, c, lagDistance; TSG_Point Pt_i, Pt_j; CSG_Shape *pPoint; CSG_Shapes *pPoints; CSG_Grid *pVariance, *pCovariance, *pCount; //----------------------------------------------------- pPoints = Parameters("POINTS") ->asShapes(); Attribute = Parameters("FIELD") ->asInt(); nSkip = Parameters("NSKIP") ->asInt(); nDistances = Parameters("DISTCOUNT") ->asInt(); lagDistance = pPoints->Get_Extent().Get_XRange() < pPoints->Get_Extent().Get_YRange() ? pPoints->Get_Extent().Get_XRange() / nDistances : pPoints->Get_Extent().Get_YRange() / nDistances; nx = 1 + (int)(pPoints->Get_Extent().Get_XRange() / lagDistance); ny = 1 + (int)(pPoints->Get_Extent().Get_YRange() / lagDistance); zMean = pPoints->Get_Mean(Attribute); pCount = SG_Create_Grid(SG_DATATYPE_Int , 1 + 2 * nx, 1 + 2 * ny, lagDistance, -nx * lagDistance, -ny * lagDistance); pVariance = SG_Create_Grid(SG_DATATYPE_Float, 1 + 2 * nx, 1 + 2 * ny, lagDistance, -nx * lagDistance, -ny * lagDistance); pCovariance = SG_Create_Grid(SG_DATATYPE_Float, 1 + 2 * nx, 1 + 2 * ny, lagDistance, -nx * lagDistance, -ny * lagDistance); pCount ->Set_Name(CSG_String::Format(SG_T("%s [%s]") , pPoints->Get_Name(), _TL("Count"))); pVariance ->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("Variogram Surface") , pPoints->Get_Field_Name(Attribute))); pCovariance ->Set_Name(CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("Covariance Surface"), pPoints->Get_Field_Name(Attribute))); //----------------------------------------------------- for(i=0, n=0; iGet_Count() && Set_Progress(n, SG_Get_Square(pPoints->Get_Count()/nSkip)/2); i+=nSkip) { pPoint = pPoints->Get_Shape(i); if( !pPoint->is_NoData(Attribute) ) { Pt_i = pPoint->Get_Point(0); zi = pPoint->asDouble(Attribute); for(j=i+nSkip; jGet_Count(); j+=nSkip, n++) { pPoint = pPoints->Get_Shape(j); if( !pPoint->is_NoData(Attribute) ) { Pt_j = pPoint->Get_Point(0); zj = pPoint->asDouble(Attribute); v = SG_Get_Square(zi - zj); c = (zi - zMean) * (zj - zMean); Pt_j.x = (Pt_i.x - Pt_j.x) / lagDistance; Pt_j.y = (Pt_i.y - Pt_j.y) / lagDistance; x = (int)(Pt_j.x + (Pt_j.x > 0.0 ? 0.5 : -0.5)); y = (int)(Pt_j.y + (Pt_j.y > 0.0 ? 0.5 : -0.5)); pCount ->Add_Value(nx + x, ny + y, 1); pCount ->Add_Value(nx - x, ny - y, 1); pVariance ->Add_Value(nx + x, ny + y, v); pVariance ->Add_Value(nx - x, ny - y, v); pCovariance->Add_Value(nx + x, ny + y, c); pCovariance->Add_Value(nx - x, ny - y, c); } } } } //----------------------------------------------------- for(i=0; iGet_NCells(); i++) { if( pCount->asInt(i) > 0 ) { pVariance ->Mul_Value(i, 0.5 / pCount->asInt(i)); pCovariance->Mul_Value(i, 1.0 / pCount->asInt(i)); } else { pVariance ->Set_NoData(i); pCovariance->Set_NoData(i); } } DataObject_Add(pCount); DataObject_Add(pVariance); DataObject_Add(pCovariance); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- GSPoints_Variogram_Surface.h000066400000000000000000000104451224124640700352030ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/********************************************************** * Version $Id: GSPoints_Variogram_Surface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // GSPoints_Variogram_Surface.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GSPoints_Variogram_Surface_H #define HEADER_INCLUDED__GSPoints_Variogram_Surface_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGSPoints_Variogram_Surface : public CSG_Module { public: CGSPoints_Variogram_Surface(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__GSPoints_Variogram_Surface_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.cpp000066400000000000000000000116711224124640700330240ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1363 2012-03-30 14:19:21Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Spatial and Geostatistics - Points") ); case MLB_INFO_Author: return( SG_T("O.Conrad (c) 2002-10") ); case MLB_INFO_Description: return( _TL("Spatial and geostatistical analyses of point data.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Spatial and Geostatistics|Points") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "GSPoints_Semi_Variances.h" #include "GSPoints_Variogram_Cloud.h" #include "GSPoints_Variogram_Surface.h" #include "GSPoints_Distances.h" #include "GSPoints_Pattern_Analysis.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CGSPoints_Semi_Variances ); case 1: return( new CGSPoints_Variogram_Cloud ); case 2: return( new CGSPoints_Variogram_Surface ); case 3: return( new CGSPoints_Distances ); case 4: return( new CGSPoints_Pattern_Analysis ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/MLB_Interface.h000066400000000000000000000100031224124640700324550ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Points // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__geostatistics_points_H #define HEADER_INCLUDED__geostatistics_points_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef geostatistics_points_EXPORTS #define geostatistics_points_EXPORT _SAGA_DLL_EXPORT #else #define geostatistics_points_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__geostatistics_points_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/Makefile.am000066400000000000000000000015751224124640700317640ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgeostatistics_points.la libgeostatistics_points_la_SOURCES =\ GSPoints_Distances.cpp\ GSPoints_Pattern_Analysis.cpp\ GSPoints_Semi_Variances.cpp\ GSPoints_Variogram_Cloud.cpp\ GSPoints_Variogram_Surface.cpp\ MLB_Interface.cpp\ GSPoints_Distances.h\ GSPoints_Pattern_Analysis.h\ GSPoints_Semi_Variances.h\ GSPoints_Variogram_Cloud.h\ GSPoints_Variogram_Surface.h\ MLB_Interface.h libgeostatistics_points_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_points/Makefile.in000066400000000000000000000460671224124640700320020ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_geostatistics/geostatistics/geostatistics_points DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgeostatistics_points_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgeostatistics_points_la_OBJECTS = GSPoints_Distances.lo \ GSPoints_Pattern_Analysis.lo GSPoints_Semi_Variances.lo \ GSPoints_Variogram_Cloud.lo GSPoints_Variogram_Surface.lo \ MLB_Interface.lo libgeostatistics_points_la_OBJECTS = \ $(am_libgeostatistics_points_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgeostatistics_points_la_SOURCES) DIST_SOURCES = $(libgeostatistics_points_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgeostatistics_points.la libgeostatistics_points_la_SOURCES = \ GSPoints_Distances.cpp\ GSPoints_Pattern_Analysis.cpp\ GSPoints_Semi_Variances.cpp\ GSPoints_Variogram_Cloud.cpp\ GSPoints_Variogram_Surface.cpp\ MLB_Interface.cpp\ GSPoints_Distances.h\ GSPoints_Pattern_Analysis.h\ GSPoints_Semi_Variances.h\ GSPoints_Variogram_Cloud.h\ GSPoints_Variogram_Surface.h\ MLB_Interface.h libgeostatistics_points_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_geostatistics/geostatistics/geostatistics_points/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_geostatistics/geostatistics/geostatistics_points/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgeostatistics_points.la: $(libgeostatistics_points_la_OBJECTS) $(libgeostatistics_points_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgeostatistics_points_la_OBJECTS) $(libgeostatistics_points_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSPoints_Distances.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSPoints_Pattern_Analysis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSPoints_Semi_Variances.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSPoints_Variogram_Cloud.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSPoints_Variogram_Surface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/000077500000000000000000000000001224124640700305645ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.cpp000066400000000000000000000132011224124640700336570ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1735 2013-06-19 10:12:32Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Spatial and Geostatistics - Regression") ); case MLB_INFO_Author: return( _TL("O.Conrad (c) 2010" )); case MLB_INFO_Description: return( _TL("Tools for regression analyses.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Spatial and Geostatistics|Regression") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "point_grid_regression.h" #include "point_multi_grid_regression.h" #include "point_trend_surface.h" #include "gw_regression.h" #include "gw_regression_grid.h" #include "gw_multi_regression.h" #include "gw_multi_regression_grid.h" #include "gw_multi_regression_points.h" #include "gwr_grid_downscaling.h" #include "grid_multi_grid_regression.h" #include "grids_trend_polynom.h" #include "table_trend.h" #include "table_regression_multiple.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CPoint_Grid_Regression ); case 1: return( new CPoint_Multi_Grid_Regression ); case 2: return( new CPoint_Trend_Surface ); case 3: return( new CGW_Regression ); case 4: return( new CGW_Regression_Grid ); case 5: return( new CGW_Multi_Regression ); case 6: return( new CGW_Multi_Regression_Grid ); case 7: return( new CGW_Multi_Regression_Points ); case 14: return( new CGWR_Grid_Downscaling ); case 8: return( new CGrid_Multi_Grid_Regression ); case 9: return( new CGrids_Trend ); case 10: return( new CTable_Trend ); case 11: return( new CTable_Trend_Shapes ); case 12: return( new CTable_Regression_Multiple ); case 13: return( new CTable_Regression_Multiple_Shapes ); //----------------------------------------------------- case 19: return( NULL ); default: return( MLB_INTERFACE_SKIP_MODULE ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/MLB_Interface.h000066400000000000000000000100331224124640700333240ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__geostatistics_regression_H #define HEADER_INCLUDED__geostatistics_regression_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef geostatistics_regression_EXPORTS #define geostatistics_regression_EXPORT _SAGA_DLL_EXPORT #else #define geostatistics_regression_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__geostatistics_regression_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.am000066400000000000000000000024121224124640700326170ustar00rootroot00000000000000# # $Id: Makefile.am 1738 2013-06-20 11:15:45Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgeostatistics_regression.la libgeostatistics_regression_la_SOURCES =\ grid_multi_grid_regression.cpp\ gw_multi_regression.cpp\ gw_multi_regression_grid.cpp\ gw_multi_regression_points.cpp\ gw_regression.cpp\ gw_regression_grid.cpp\ gwr_grid_downscaling.cpp\ grids_trend_polynom.cpp\ MLB_Interface.cpp\ point_grid_regression.cpp\ point_multi_grid_regression.cpp\ point_trend_surface.cpp\ table_regression_multiple.cpp\ table_trend.cpp\ grid_multi_grid_regression.h\ gw_multi_regression.h\ gw_multi_regression_grid.h\ gw_multi_regression_points.h\ gw_regression.h\ gw_regression_grid.h\ gwr_grid_downscaling.h\ grids_trend_polynom.h\ MLB_Interface.h\ point_grid_regression.h\ point_multi_grid_regression.h\ point_trend_surface.h\ table_regression_multiple.h\ table_trend.h libgeostatistics_regression_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile.in000066400000000000000000000505411224124640700326360ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_geostatistics/geostatistics/geostatistics_regression DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libgeostatistics_regression_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libgeostatistics_regression_la_OBJECTS = \ grid_multi_grid_regression.lo gw_multi_regression.lo \ gw_multi_regression_grid.lo gw_multi_regression_points.lo \ gw_regression.lo gw_regression_grid.lo gwr_grid_downscaling.lo \ grids_trend_polynom.lo MLB_Interface.lo \ point_grid_regression.lo point_multi_grid_regression.lo \ point_trend_surface.lo table_regression_multiple.lo \ table_trend.lo libgeostatistics_regression_la_OBJECTS = \ $(am_libgeostatistics_regression_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgeostatistics_regression_la_SOURCES) DIST_SOURCES = $(libgeostatistics_regression_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1738 2013-06-20 11:15:45Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libgeostatistics_regression.la libgeostatistics_regression_la_SOURCES = \ grid_multi_grid_regression.cpp\ gw_multi_regression.cpp\ gw_multi_regression_grid.cpp\ gw_multi_regression_points.cpp\ gw_regression.cpp\ gw_regression_grid.cpp\ gwr_grid_downscaling.cpp\ grids_trend_polynom.cpp\ MLB_Interface.cpp\ point_grid_regression.cpp\ point_multi_grid_regression.cpp\ point_trend_surface.cpp\ table_regression_multiple.cpp\ table_trend.cpp\ grid_multi_grid_regression.h\ gw_multi_regression.h\ gw_multi_regression_grid.h\ gw_multi_regression_points.h\ gw_regression.h\ gw_regression_grid.h\ gwr_grid_downscaling.h\ grids_trend_polynom.h\ MLB_Interface.h\ point_grid_regression.h\ point_multi_grid_regression.h\ point_trend_surface.h\ table_regression_multiple.h\ table_trend.h libgeostatistics_regression_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_geostatistics/geostatistics/geostatistics_regression/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgeostatistics_regression.la: $(libgeostatistics_regression_la_OBJECTS) $(libgeostatistics_regression_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libgeostatistics_regression_la_OBJECTS) $(libgeostatistics_regression_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_multi_grid_regression.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grids_trend_polynom.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gw_multi_regression.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gw_multi_regression_grid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gw_multi_regression_points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gw_regression.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gw_regression_grid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gwr_grid_downscaling.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/point_grid_regression.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/point_multi_grid_regression.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/point_trend_surface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table_regression_multiple.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table_trend.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: grid_multi_grid_regression.cpp000066400000000000000000000325771224124640700366330ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: grid_multi_grid_regression.cpp 1160 2011-09-14 15:11:54Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // grid_multi_grid_regression.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_multi_grid_regression.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Multi_Grid_Regression::CGrid_Multi_Grid_Regression(void) { //----------------------------------------------------- Set_Name (_TL("Multiple Regression Analysis (Grid/Grids)")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Linear regression analysis of one grid as dependent and multiple grids as indepentent (predictor) variables. " "Details of the regression/correlation analysis will be saved to a table. " "Optionally the regression model is used to create a new grid with regression based values. " "The multiple regression analysis uses a forward selection procedure. \n" "\n" "Reference:\n" "- Bahrenberg, G., Giese, E., Nipper, J. (1992): " "'Statistische Methoden in der Geographie 2 - Multivariate Statistik', " "Stuttgart, 415p.\n" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "DEPENDENT" , _TL("Dependent"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT, false ); Parameters.Add_Grid( NULL , "REGRESSION" , _TL("Regression"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "RESIDUALS" , _TL("Residuals"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Table( NULL , "INFO_COEFF" , _TL("Details: Coefficients"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Table( NULL , "INFO_MODEL" , _TL("Details: Model"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Table( NULL , "INFO_STEPS" , _TL("Details: Steps"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL ,"INTERPOL" , _TL("Grid Interpolation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 4 ); Parameters.Add_Value( NULL , "COORD_X" , _TL("Include X Coordinate"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "COORD_Y" , _TL("Include Y Coordinate"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Choice( NULL ,"METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("include all"), _TL("forward"), _TL("backward"), _TL("stepwise") ), 3 ); Parameters.Add_Value( NULL , "P_IN" , _TL("P in"), _TL("Level of significance for automated predictor selection, given as percentage"), PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true ); Parameters.Add_Value( NULL , "P_OUT" , _TL("P out"), _TL("Level of significance for automated predictor selection, given as percentage"), PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Multi_Grid_Regression::On_Execute(void) { bool bResult; double P_in, P_out; CSG_Strings Names; CSG_Matrix Samples; CSG_Grid *pDependent, *pRegression, *pResiduals; CSG_Parameter_Grid_List *pGrids; //----------------------------------------------------- pDependent = Parameters("DEPENDENT") ->asGrid(); pGrids = Parameters("GRIDS") ->asGridList(); pRegression = Parameters("REGRESSION") ->asGrid(); pResiduals = Parameters("RESIDUALS") ->asGrid(); P_in = Parameters("P_IN") ->asDouble() / 100.0; P_out = Parameters("P_OUT") ->asDouble() / 100.0; //----------------------------------------------------- if( !Get_Samples(pGrids, pDependent, Samples, Names) ) { return( false ); } //----------------------------------------------------- switch( Parameters("METHOD")->asInt() ) { default: case 0: bResult = m_Regression.Get_Model (Samples , &Names); break; case 1: bResult = m_Regression.Get_Model_Forward (Samples, P_in , &Names); break; case 2: bResult = m_Regression.Get_Model_Backward(Samples, P_out, &Names); break; case 3: bResult = m_Regression.Get_Model_Stepwise(Samples, P_in, P_out, &Names); break; } if( bResult == false ) { return( false ); } Message_Add(m_Regression.Get_Info(), false); //----------------------------------------------------- Set_Regression(pGrids, pDependent, pRegression, pResiduals, CSG_String::Format(SG_T("%s [%s]"), pDependent->Get_Name(), _TL("Regression Model"))); //----------------------------------------------------- if( Parameters("INFO_COEFF")->asTable() ) { Parameters("INFO_COEFF")->asTable()->Assign(m_Regression.Get_Info_Regression()); Parameters("INFO_COEFF")->asTable()->Set_Name(_TL("MLRA Coefficients")); } if( Parameters("INFO_MODEL")->asTable() ) { Parameters("INFO_MODEL")->asTable()->Assign(m_Regression.Get_Info_Model()); Parameters("INFO_MODEL")->asTable()->Set_Name(_TL("MLRA Model")); } if( Parameters("INFO_STEPS")->asTable() ) { Parameters("INFO_STEPS")->asTable()->Assign(m_Regression.Get_Info_Steps()); Parameters("INFO_STEPS")->asTable()->Set_Name(_TL("MLRA Steps")); } //----------------------------------------------------- m_Regression.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Multi_Grid_Regression::Get_Samples(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Matrix &Samples, CSG_Strings &Names) { int iGrid, x, y; double zGrid; TSG_Point p; CSG_Vector Sample; //----------------------------------------------------- int Interpolation = Parameters("INTERPOL") ->asInt(); bool bCoord_X = Parameters("COORD_X") ->asBool(); bool bCoord_Y = Parameters("COORD_Y") ->asBool(); Names += pDependent->Get_Name(); // Dependent Variable for(iGrid=0; iGridGet_Count(); iGrid++) // Independent Variables { Names += pGrids->asGrid(iGrid)->Get_Name(); } if( bCoord_X ) { Names += SG_T("X"); } if( bCoord_Y ) { Names += SG_T("Y"); } Sample.Create(1 + pGrids->Get_Count() + (bCoord_X ? 1 : 0) + (bCoord_Y ? 1 : 0)); //----------------------------------------------------- for(y=0, p.y=Get_YMin(); yis_NoData(x, y) ) { bool bAdd = true; for(iGrid=0; iGridGet_Count() && bAdd; iGrid++) { if( pGrids->asGrid(iGrid)->Get_Value(p, zGrid, Interpolation) ) { Sample[1 + iGrid] = zGrid; } else { bAdd = false; } } if( bAdd ) { Sample[0] = pDependent->asDouble(x, y); if( bCoord_X ) { Sample[1 + iGrid++] = p.x; } if( bCoord_Y ) { Sample[1 + iGrid++] = p.y; } Samples.Add_Row(Sample); } } } } //----------------------------------------------------- return( Samples.Get_NRows() >= pGrids->Get_Count() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Multi_Grid_Regression::Set_Regression(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Grid *pRegression, CSG_Grid *pResiduals, const CSG_String &Name) { //----------------------------------------------------- int iGrid, nGrids, x, y; TSG_Point p; int Interpolation = Parameters("INTERPOL")->asInt(); CSG_Grid **ppGrids = (CSG_Grid **)SG_Malloc(m_Regression.Get_nPredictors() * sizeof(CSG_Grid *)); bool bCoord_X = false; bool bCoord_Y = false; for(iGrid=0, nGrids=0; iGridGet_Count() ) { ppGrids[nGrids++] = pGrids->asGrid(m_Regression.Get_Predictor(iGrid)); } else if( m_Regression.Get_Predictor(iGrid) == pGrids->Get_Count() && Parameters("COORD_X")->asBool() ) { bCoord_X = true; } else // if( m_Regression.Get_Predictor(iGrid) > pGrids->Get_Count() || Parameters("COORD_X")->asBool() == false ) { bCoord_Y = true; } } pRegression->Set_Name(Name); if( pDependent && pResiduals ) { pResiduals->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Name.c_str(), _TL("Residuals"))); } else { pResiduals = NULL; } //----------------------------------------------------- for(y=0, p.y=Get_YMin(); yGet_Value(p, zGrid, Interpolation) ) { z += m_Regression.Get_RCoeff(iGrid) * zGrid; } else { bOkay = false; } } //--------------------------------------------- if( bOkay ) { if( bCoord_X ) { z += m_Regression.Get_RCoeff(iGrid++) * Get_System()->Get_xGrid_to_World(x); } if( bCoord_Y ) { z += m_Regression.Get_RCoeff(iGrid++) * Get_System()->Get_yGrid_to_World(y); } pRegression->Set_Value (x, y, z); if( pResiduals ) { pResiduals->Set_Value(x, y, pDependent->asDouble(x, y) - z); } } else { pRegression->Set_NoData(x, y); if( pResiduals ) { pResiduals->Set_NoData(x, y); } } } } //----------------------------------------------------- SG_Free(ppGrids); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- grid_multi_grid_regression.h000066400000000000000000000110201224124640700362540ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: grid_multi_grid_regression.h 1160 2011-09-14 15:11:54Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // grid_multi_grid_regression.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_multi_grid_regression_H #define HEADER_INCLUDED__grid_multi_grid_regression_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Multi_Grid_Regression : public CSG_Module_Grid { public: CGrid_Multi_Grid_Regression(void); protected: virtual bool On_Execute (void); private: CSG_Regression_Multiple m_Regression; bool Get_Samples (CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Matrix &Samples, CSG_Strings &Names); bool Set_Regression (CSG_Parameter_Grid_List *pGrids, CSG_Grid *pDependent, CSG_Grid *pRegression, CSG_Grid *pResiduals, const CSG_String &Name); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_multi_grid_regression_H grids_trend_polynom.cpp000066400000000000000000000232131224124640700352730ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: grids_trend_polynom.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // grids_trend_polynom.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grids_trend_polynom.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrids_Trend::CGrids_Trend(void) { //----------------------------------------------------- Set_Name (_TL("Polynomial Trend from Grids")); Set_Author (SG_T("O. Conrad (c) 2011")); Set_Description (_TW( "Fits for each cell a polynomial trend function. " "Outputs are the polynomial coefficients for the " "polynomial trend function of chosen order. " )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "Y_GRIDS" , _TL("Dependent Variables"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "COEFF" , _TL("Polynomial Coefficients"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "R2" , _TL("Coefficient of Determination"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Value( NULL , "ORDER" , _TL("Polynomial Order"), _TL(""), PARAMETER_TYPE_Int, 1, 1, true ); Parameters.Add_Choice( NULL , "XSOURCE" , _TL("Get Independent Variable from ..."), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("list order"), _TL("table"), _TL("grid list") ), 0 ); Parameters.Add_FixedTable( NULL , "X_TABLE" , _TL("Independent Variable (per Grid)"), _TL("") )->asTable()->Add_Field(_TL("Value"), SG_DATATYPE_Double); Parameters.Add_Grid_List( NULL , "X_GRIDS" , _TL("Independent Variable (per Grid and Cell)"), _TL(""), PARAMETER_INPUT_OPTIONAL ); //----------------------------------------------------- CSG_Table *pTable = Parameters("X_TABLE")->asTable(); pTable->Add_Record()->Set_Value(0, 1000.0); pTable->Add_Record()->Set_Value(0, 925.0); pTable->Add_Record()->Set_Value(0, 850.0); pTable->Add_Record()->Set_Value(0, 700.0); pTable->Add_Record()->Set_Value(0, 600.0); pTable->Add_Record()->Set_Value(0, 500.0); pTable->Add_Record()->Set_Value(0, 400.0); pTable->Add_Record()->Set_Value(0, 300.0); pTable->Add_Record()->Set_Value(0, 250.0); pTable->Add_Record()->Set_Value(0, 200.0); pTable->Add_Record()->Set_Value(0, 150.0); pTable->Add_Record()->Set_Value(0, 100.0); pTable->Add_Record()->Set_Value(0, 70.0); pTable->Add_Record()->Set_Value(0, 50.0); pTable->Add_Record()->Set_Value(0, 30.0); pTable->Add_Record()->Set_Value(0, 20.0); pTable->Add_Record()->Set_Value(0, 10.0); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGrids_Trend::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("XSOURCE")) ) { pParameters->Get_Parameter("X_TABLE")->Set_Enabled(pParameter->asInt() == 1); // table pParameters->Get_Parameter("X_GRIDS")->Set_Enabled(pParameter->asInt() == 2); // grid list } return( 1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrids_Trend::On_Execute(void) { int Order, xSource, nGrids; CSG_Table *pXTable; CSG_Grid *pR2; CSG_Parameter_Grid_List *pYGrids, *pCoeff, *pXGrids; //----------------------------------------------------- pYGrids = Parameters("Y_GRIDS")->asGridList(); pCoeff = Parameters("COEFF" )->asGridList(); pR2 = Parameters("R2" )->asGrid(); pXGrids = Parameters("X_GRIDS")->asGridList(); pXTable = Parameters("X_TABLE")->asTable(); Order = Parameters("ORDER" )->asInt(); xSource = Parameters("XSOURCE")->asInt(); //----------------------------------------------------- nGrids = pYGrids->Get_Count(); if( nGrids <= Order ) { Error_Set(_TL("fitting a polynom of ith order needs at least i + 1 samples")); return( false ); } //----------------------------------------------------- switch( xSource ) { case 0: nGrids = pYGrids->Get_Count(); break; // list order case 1: nGrids = pXTable->Get_Count(); break; // table case 2: nGrids = pXGrids->Get_Count(); break; // grid list } if( nGrids < pXGrids->Get_Count() ) { Error_Set(_TL("There are less predictor variables then dependent ones.")); return( false ); } if( nGrids > pXGrids->Get_Count() ) { Message_Add(_TL("Warning: there are more predictor variables then dependent ones, surplus will be ignored.")); nGrids = pYGrids->Get_Count(); } //----------------------------------------------------- pCoeff->Del_Items(); for(int i=0; i<=Order; i++) { pCoeff->Add_Item(SG_Create_Grid(*Get_System())); pCoeff->asGrid(i)->Set_Name(CSG_String::Format(SG_T("%s [%d]"), _TL("Polynomial Coefficient"), i + 1)); } if( pR2 ) { pR2->Set_Name(CSG_String::Format(SG_T("%s"), _TL("Determination Coefficients"))); } //----------------------------------------------------- for(int y=0; yasGrid(i)->is_NoData(x, y) ) { switch( xSource ) { case 0: // list order Trend.Add_Data(i, pYGrids->asGrid(i)->asDouble(x, y)); break; case 1: // table Trend.Add_Data(pXTable->Get_Record(i)->asDouble(0), pYGrids->asGrid(i)->asDouble(x, y)); break; case 2: // grid list if( !pXGrids->asGrid(i)->is_NoData(x, y) ) { Trend.Add_Data(pXGrids->asGrid(i)->asDouble(x, y), pYGrids->asGrid(i)->asDouble(x, y)); } break; } } } if( Trend.Get_Trend() ) { for(int iOrder=0; iOrderasGrid(iOrder)->Set_Value(x, y, Trend.Get_Coefficient(iOrder)); } if( pR2 ) pR2->Set_Value(x, y, Trend.Get_R2()); } else { for(int iOrder=0; iOrderasGrid(iOrder)->Set_NoData(x, y); } if( pR2 ) pR2->Set_NoData(x, y); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- grids_trend_polynom.h000066400000000000000000000107151224124640700347430ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: grids_trend_polynom.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // grids_trend_polynom.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grids_trend_polynom_H #define HEADER_INCLUDED__grids_trend_polynom_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrids_Trend : public CSG_Module_Grid { public: CGrids_Trend(void); protected: virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grids_trend_polynom_H gw_multi_regression.cpp000066400000000000000000000414131224124640700353030ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: gw_multi_regression.cpp 1633 2013-03-22 13:35:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // gw_multi_regression.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gw_multi_regression.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define SG_ARRAY_DELETE(A) if( A ) { delete[](A); A = NULL; } #define SG_ARRAY_FREE(A) if( A ) { SG_Free (A); A = NULL; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGW_Multi_Regression::CGW_Multi_Regression(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Geographically Weighted Multiple Regression")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Reference:\n" " - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "DEPENDENT" , _TL("Dependent Variable"), _TL("") ); Parameters.Add_Parameters( pNode , "PREDICTORS" , _TL("Predictors"), _TL("") ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TARGET" , _TL("Target Grids"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("user defined"), _TL("grid") ), 0 ); m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid") , _TL("")), false); m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid") , _TL("")), false); m_Grid_Target.Add_Grid_Parameter(SG_T("QUALITY") , _TL("Quality") , false); m_Grid_Target.Add_Grid_Parameter(SG_T("INTERCEPT") , _TL("Intercept"), false); //----------------------------------------------------- Parameters.Add_Parameters( NULL , "WEIGHTING" , _TL("Weighting"), _TL("") ); m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS); m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters()); //----------------------------------------------------- CSG_Parameter *pSearch = Parameters.Add_Node( NULL , "NODE_SEARCH" , _TL("Search Options"), _TL("") ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_RANGE" , _TL("Search Range"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("local"), _TL("global") ) ); Parameters.Add_Value( pNode , "SEARCH_RADIUS" , _TL("Maximum Search Distance"), _TL("local maximum search distance given in map units"), PARAMETER_TYPE_Double , 1000.0, 0, true ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_POINTS_ALL" , _TL("Number of Points"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("maximum number of nearest points"), _TL("all points within search distance") ) ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MIN" , _TL("Minimum"), _TL("minimum number of points to use"), PARAMETER_TYPE_Int, 4, 1, true ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MAX" , _TL("Maximum"), _TL("maximum number of nearest points"), PARAMETER_TYPE_Int, 20, 1, true ); Parameters.Add_Choice( pNode , "SEARCH_DIRECTION" , _TL("Search Direction"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("all directions"), _TL("quadrants") ) ); //----------------------------------------------------- m_iPredictor = NULL; m_pSlopes = NULL; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGW_Multi_Regression::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( m_Grid_Target.On_User_Changed(pParameters, pParameter) ) { return( true ); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("POINTS")) ) { CSG_Shapes *pPoints = pParameters->Get_Parameter("POINTS" )->asShapes(); CSG_Parameters *pAttributes = pParameters->Get_Parameter("PREDICTORS")->asParameters(); pAttributes->Destroy(); pAttributes->Set_Name(_TL("Predictors")); for(int i=0; pPoints && iGet_Field_Count(); i++) { switch( pPoints->Get_Field_Type(i) ) { default: // not numeric break; case SG_DATATYPE_Byte: case SG_DATATYPE_Char: case SG_DATATYPE_Word: case SG_DATATYPE_Short: case SG_DATATYPE_DWord: case SG_DATATYPE_Int: case SG_DATATYPE_ULong: case SG_DATATYPE_Long: case SG_DATATYPE_Float: case SG_DATATYPE_Double: pAttributes->Add_Value( NULL, SG_Get_String(i, 0), pPoints->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false ); break; } } return( true ); } return( false ); } //--------------------------------------------------------- int CGW_Multi_Regression::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) ) { pParameters->Get_Parameter("SEARCH_RADIUS" )->Set_Enabled(pParameter->asInt() == 0); // local } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) ) { pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0); // maximum number of points pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0); // maximum number of points per quadrant } m_Weighting.Enable_Parameters(pParameters); return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGW_Multi_Regression::Get_Predictors(void) { int i; CSG_Shapes *pPoints = Parameters("POINTS") ->asShapes(); CSG_Parameters *pAttributes = Parameters("PREDICTORS") ->asParameters(); m_nPredictors = 0; m_iPredictor = new int[pPoints->Get_Field_Count()]; for(i=0; iGet_Count(); i++) { if( pAttributes->Get_Parameter(i)->asBool() ) { m_iPredictor[m_nPredictors++] = CSG_String(pAttributes->Get_Parameter(i)->Get_Identifier()).asInt(); } } CSG_Parameters *pGrids = Get_Parameters("GRID"), Tmp; Tmp.Assign(pGrids); pGrids->Create(this, Tmp.Get_Name(), Tmp.Get_Description(), Tmp.Get_Identifier(), false); m_Grid_Target.Add_Grid_Parameter(SG_T("QUALITY") , _TL("Quality") , false); m_Grid_Target.Add_Grid_Parameter(SG_T("INTERCEPT") , _TL("Intercept"), false); pGrids->Get_Parameter("QUALITY")->Get_Parent()->asGrid_System()->Assign(*Tmp("QUALITY")->Get_Parent()->asGrid_System()); pGrids->Get_Parameter("QUALITY") ->Set_Value(Tmp("QUALITY") ->asGrid()); pGrids->Get_Parameter("INTERCEPT")->Set_Value(Tmp("INTERCEPT")->asGrid()); for(i=0; iGet_Field_Name(m_iPredictor[i])), false ); if( Tmp(SG_Get_String(i, 0)) ) { pGrids->Get_Parameter(SG_Get_String(i, 0))->Set_Value(Tmp(SG_Get_String(i, 0))->asGrid()); } } return( m_nPredictors > 0 ); } //--------------------------------------------------------- void CGW_Multi_Regression::Finalize(void) { SG_ARRAY_DELETE(m_iPredictor); SG_ARRAY_FREE (m_pSlopes); m_Search.Destroy(); m_y.Destroy(); m_z.Destroy(); m_w.Destroy(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGW_Multi_Regression::On_Execute(void) { //----------------------------------------------------- m_pPoints = Parameters("POINTS" )->asShapes(); m_iDependent = Parameters("DEPENDENT" )->asInt (); m_nPoints_Min = Parameters("SEARCH_POINTS_MIN")->asInt (); m_nPoints_Max = Parameters("SEARCH_POINTS_ALL")->asInt () == 0 ? Parameters("SEARCH_POINTS_MAX")->asInt () : 0; m_Radius = Parameters("SEARCH_RANGE" )->asInt () == 0 ? Parameters("SEARCH_RADIUS" )->asDouble() : 0.0; m_Direction = Parameters("SEARCH_DIRECTION" )->asInt () == 0 ? -1 : 4; m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters()); //----------------------------------------------------- if( !Get_Predictors() ) { Finalize(); return( false ); } if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) ) { Finalize(); return( false ); } //----------------------------------------------------- int i; m_pQuality = NULL; m_pIntercept = NULL; m_pSlopes = (CSG_Grid **)SG_Calloc(m_nPredictors, sizeof(CSG_Grid *)); switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... if( m_Grid_Target.Init_User(m_pPoints->Get_Extent()) && Dlg_Parameters("USER") ) { m_pQuality = m_Grid_Target.Get_User(SG_T("QUALITY" )); m_pIntercept = m_Grid_Target.Get_User(SG_T("INTERCEPT")); for(i=0; iSet_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Quality"))); m_pIntercept->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Intercept"))); for(i=0; iSet_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), m_pPoints->Get_Field_Name(m_iPredictor[i]))); } //----------------------------------------------------- int nPoints_Max = m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count(); m_y.Create(1 + m_nPredictors, nPoints_Max); m_z.Create(nPoints_Max); m_w.Create(nPoints_Max); //----------------------------------------------------- for(int y=0; yGet_NY() && Set_Progress(y, m_pIntercept->Get_NY()); y++) { for(int x=0; xGet_NX(); x++) { if( !Get_Regression(x, y) ) { m_pQuality ->Set_NoData(x, y); m_pIntercept->Set_NoData(x, y); for(i=0; iSet_NoData(x, y); } } } } //----------------------------------------------------- Finalize(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGW_Multi_Regression::Set_Variables(int x, int y) { int iPoint, jPoint, nPoints, iPredictor; TSG_Point Point; CSG_Shape *pPoint; Point = m_pIntercept->Get_System().Get_Grid_to_World(x, y); nPoints = m_Search.is_Okay() ? m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count(); for(iPoint=0, jPoint=0; iPointGet_Shape((int)iz); } else { pPoint = m_pPoints->Get_Shape(iPoint); } if( !pPoint->is_NoData(m_iDependent) ) { m_z[jPoint] = pPoint->asDouble(m_iDependent); m_w[jPoint] = m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0))); for(iPredictor=0; iPredictoris_NoData(m_iPredictor[iPredictor]) ) { m_y[jPoint][iPredictor] = pPoint->asDouble(m_iPredictor[iPredictor]); } else { iPredictor = m_nPredictors + 1; } } if( iPredictor == m_nPredictors ) { jPoint++; } } } return( jPoint ); } //--------------------------------------------------------- bool CGW_Multi_Regression::Get_Regression(int x, int y) { int nPoints = Set_Variables(x, y); if( nPoints < m_nPoints_Min ) { return( false ); } //----------------------------------------------------- int i; double zMean, rss, tss; CSG_Vector b, z; CSG_Matrix Y, YtW; //----------------------------------------------------- z .Create(nPoints); Y .Create(1 + m_nPredictors, nPoints); YtW.Create(nPoints, 1 + m_nPredictors); for(i=0, zMean=0.0; iSet_Value(x, y, tss > 0.0 ? (tss - rss) / tss : 0.0); m_pIntercept->Set_Value(x, y, b[0]); for(i=0; iSet_Value(x, y, b[i + 1]); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- gw_multi_regression.h000066400000000000000000000115511224124640700347500ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: gw_multi_regression.h 1549 2012-11-29 16:38:50Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // gw_multi_regression.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gw_multi_regression_H #define HEADER_INCLUDED__gw_multi_regression_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGW_Multi_Regression : public CSG_Module { public: CGW_Multi_Regression(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:GWR") ); } protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_iDependent, *m_iPredictor, m_nPredictors, m_nPoints_Min, m_nPoints_Max, m_Direction; double m_Radius; CSG_Parameters_Grid_Target m_Grid_Target; CSG_Distance_Weighting m_Weighting; CSG_PRQuadTree m_Search; CSG_Vector m_z, m_w; CSG_Matrix m_y; CSG_Shapes *m_pPoints; CSG_Grid *m_pQuality, *m_pIntercept, **m_pSlopes; void Finalize (void); bool Get_Predictors (void); int Set_Variables (int x, int y); bool Get_Regression (int x, int y); bool Set_Residuals (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gw_multi_regression_H gw_multi_regression_grid.cpp000066400000000000000000000422711224124640700363130ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: gw_multi_regression_grid.cpp 1633 2013-03-22 13:35:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // gw_multi_regression_grid.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gw_multi_regression_grid.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define GRID_SET_NODATA(g, x, y) if( g ) { g->Set_NoData(x, y); } #define GRID_SET_VALUE(g, x, y, z) if( g ) { g->Set_Value(x, y, z); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGW_Multi_Regression_Grid::CGW_Multi_Regression_Grid(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Geographically Weighted Multiple Regression (Points/Grids)")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Reference:\n" " - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "PREDICTORS" , _TL("Predictors"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "REGRESSION" , _TL("Regression"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "QUALITY" , _TL("Coefficient of Determination"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid_List( NULL , "SLOPES" , _TL("Regression Parameters"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, false ); Parameters.Add_Value( NULL , "PARAMETERS" , _TL("Output of Regression Parameters"), _TL(""), PARAMETER_TYPE_Bool, false ); pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "DEPENDENT" , _TL("Dependent Variable"), _TL("") ); Parameters.Add_Shapes( NULL , "RESIDUALS" , _TL("Residuals"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); //----------------------------------------------------- Parameters.Add_Parameters( NULL , "WEIGHTING" , _TL("Weighting"), _TL("") ); m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS); m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters()); //----------------------------------------------------- CSG_Parameter *pSearch = Parameters.Add_Node( NULL , "NODE_SEARCH" , _TL("Search Options"), _TL("") ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_RANGE" , _TL("Search Range"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("local"), _TL("global") ) ); Parameters.Add_Value( pNode , "SEARCH_RADIUS" , _TL("Maximum Search Distance"), _TL("local maximum search distance given in map units"), PARAMETER_TYPE_Double , 1000.0, 0, true ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_POINTS_ALL" , _TL("Number of Points"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("maximum number of nearest points"), _TL("all points within search distance") ) ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MIN" , _TL("Minimum"), _TL("minimum number of points to use"), PARAMETER_TYPE_Int, 4, 1, true ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MAX" , _TL("Maximum"), _TL("maximum number of nearest points"), PARAMETER_TYPE_Int, 20, 1, true ); Parameters.Add_Choice( pNode , "SEARCH_DIRECTION" , _TL("Search Direction"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("all directions"), _TL("quadrants") ) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGW_Multi_Regression_Grid::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) ) { pParameters->Get_Parameter("SEARCH_RADIUS" )->Set_Enabled(pParameter->asInt() == 0); // local } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) ) { pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0); // maximum number of points pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0); // maximum number of points per quadrant } m_Weighting.Enable_Parameters(pParameters); return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGW_Multi_Regression_Grid::Initialize(void) { bool bAdd; int iPoint, iPredictor, iDependent, Interpolation; CSG_Vector z; TSG_Point Point; CSG_Shape *pPoint; CSG_Shapes *pPoints; //----------------------------------------------------- if( m_pPredictors->Get_Count() < 1 ) { return( false ); } //----------------------------------------------------- pPoints = Parameters("POINTS") ->asShapes(); iDependent = Parameters("DEPENDENT") ->asInt(); Interpolation = GRID_INTERPOLATION_BSpline; //----------------------------------------------------- m_Points.Create (SHAPE_TYPE_Point); m_Points.Set_Name (Parameters("DEPENDENT")->asString()); m_Points.Add_Field(Parameters("DEPENDENT")->asString(), SG_DATATYPE_Double); for(iPredictor=0; iPredictorGet_Count(); iPredictor++) { m_Points.Add_Field(m_pPredictors->asGrid(iPredictor)->Get_Name(), SG_DATATYPE_Double); } z.Create(1 + m_pPredictors->Get_Count()); //----------------------------------------------------- for(iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pPoints->Get_Count()); iPoint++) { pPoint = pPoints->Get_Shape(iPoint); if( !pPoint->is_NoData(iDependent) ) { Point = pPoint->Get_Point(0); z[0] = pPoint->asDouble(iDependent); for(iPredictor=0, bAdd=true; bAdd && iPredictorGet_Count(); iPredictor++) { if( !m_pPredictors->asGrid(iPredictor)->Get_Value(Point, z[iPredictor + 1], Interpolation) ) { bAdd = false; } } if( bAdd ) { pPoint = m_Points.Add_Shape(); pPoint->Add_Point(Point); for(iPredictor=0; iPredictor<=m_pPredictors->Get_Count(); iPredictor++) { pPoint->Set_Value(iPredictor, z[iPredictor]); } } } } //----------------------------------------------------- return( m_Points.Get_Count() > 1 ); } //--------------------------------------------------------- void CGW_Multi_Regression_Grid::Finalize(void) { m_Points.Destroy(); m_Search.Destroy(); m_y.Destroy(); m_z.Destroy(); m_w.Destroy(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGW_Multi_Regression_Grid::On_Execute(void) { int i; //----------------------------------------------------- m_pPredictors = Parameters("PREDICTORS")->asGridList(); m_pRegression = Parameters("REGRESSION")->asGrid (); m_pQuality = Parameters("QUALITY" )->asGrid (); m_pSlopes = Parameters("SLOPES" )->asGridList(); m_nPoints_Min = Parameters("SEARCH_POINTS_MIN")->asInt (); m_nPoints_Max = Parameters("SEARCH_POINTS_ALL")->asInt () == 0 ? Parameters("SEARCH_POINTS_MAX")->asInt () : 0; m_Radius = Parameters("SEARCH_RANGE" )->asInt () == 0 ? Parameters("SEARCH_RADIUS" )->asDouble() : 0.0; m_Direction = Parameters("SEARCH_DIRECTION" )->asInt () == 0 ? -1 : 4; m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters()); //----------------------------------------------------- if( !Initialize() ) { Finalize(); return( false ); } if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(&m_Points, -1) ) { Finalize(); return( false ); } //----------------------------------------------------- m_pRegression->Set_Name(CSG_String::Format(SG_T("%s (%s)"), m_Points.Get_Name(), _TL("GWR Regression"))); m_pQuality ->Set_Name(CSG_String::Format(SG_T("%s (%s)"), m_Points.Get_Name(), _TL("GWR Quality"))); m_pSlopes->Del_Items(); if( Parameters("PARAMETERS")->asBool() ) { CSG_Grid *pGrid; m_pSlopes->Add_Item(pGrid = SG_Create_Grid(*Get_System())); pGrid->Set_Name(CSG_String::Format(SG_T("%s (%s)"), m_Points.Get_Name(), _TL("Intercept"))); for(i=0; iGet_Count(); i++) { m_pSlopes->Add_Item(pGrid = SG_Create_Grid(*Get_System())); pGrid->Set_Name(CSG_String::Format(SG_T("%s (%s)"), m_Points.Get_Name(), m_pPredictors->asGrid(i)->Get_Name())); } } //----------------------------------------------------- int nPoints_Max = m_nPoints_Max > 0 ? m_nPoints_Max : m_Points.Get_Count(); m_y.Create(1 + m_pPredictors->Get_Count(), nPoints_Max); m_z.Create(nPoints_Max); m_w.Create(nPoints_Max); //----------------------------------------------------- for(int y=0; yGet_Count(); i++) { if( m_pPredictors->asGrid(i)->is_NoData(x, y) ) { bNoData = true; } } if( bNoData || !Get_Regression(x, y) ) { m_pRegression->Set_NoData(x, y); m_pQuality ->Set_NoData(x, y); for(i=0; iGet_Count(); i++) { m_pSlopes->asGrid(i)->Set_NoData(x, y); } } } } //----------------------------------------------------- Set_Residuals(); Finalize(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGW_Multi_Regression_Grid::Set_Variables(int x, int y) { int nPoints; TSG_Point Point; CSG_Shape *pPoint; Point = Get_System()->Get_Grid_to_World(x, y); nPoints = m_Search.is_Okay() ? m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_Points.Get_Count(); for(int iPoint=0; iPointasDouble(0); m_w[iPoint] = m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0))); for(int iPredictor=0; iPredictorGet_Count(); iPredictor++) { m_y[iPoint][iPredictor] = pPoint->asDouble(1 + iPredictor); } } return( nPoints ); } //--------------------------------------------------------- bool CGW_Multi_Regression_Grid::Get_Regression(int x, int y) { int nPoints = Set_Variables(x, y); if( nPoints < m_nPoints_Min ) { return( false ); } //----------------------------------------------------- int i; double zMean, zr, rss, tss; CSG_Vector b, z; CSG_Matrix Y, YtW; //----------------------------------------------------- z .Create(nPoints); Y .Create(1 + m_pPredictors->Get_Count(), nPoints); YtW.Create(nPoints, 1 + m_pPredictors->Get_Count()); for(i=0, zMean=0.0; iGet_Count(); j++) { Y [i][j + 1] = m_y[i][j]; YtW[j + 1][i] = m_y[i][j] * m_w[i]; } zMean += (z[i] = m_z[i]); } //----------------------------------------------------- b = (YtW * Y).Get_Inverse() * (YtW * z); zMean /= nPoints; for(i=0, rss=0.0, tss=0.0; iGet_Count(); j++) { zr += b[j + 1] * m_y[i][j]; } rss += m_w[i] * SG_Get_Square(m_z[i] - zr); tss += m_w[i] * SG_Get_Square(m_z[i] - zMean); } m_pQuality ->Set_Value(x, y, tss > 0.0 ? (tss - rss) / tss : 0.0); for(i=0; iGet_Count(); i++) { m_pSlopes->asGrid(i)->Set_Value(x, y, b[i]); } //----------------------------------------------------- zr = b[0]; for(i=0; iGet_Count(); i++) { zr += b[i + 1] * m_pPredictors->asGrid(i)->asDouble(x, y); } m_pRegression->Set_Value(x, y, zr); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGW_Multi_Regression_Grid::Set_Residuals(void) { CSG_Shapes *pResiduals = Parameters("RESIDUALS")->asShapes(); if( !pResiduals || !m_pRegression ) { return( false ); } //----------------------------------------------------- pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_Points.Get_Name(), _TL("Residuals"))); pResiduals->Add_Field(m_Points.Get_Field_Name(0), SG_DATATYPE_Double); pResiduals->Add_Field("TREND" , SG_DATATYPE_Double); pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double); //------------------------------------------------- for(int iShape=0; iShapeasDouble(0); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { double zRegression; TSG_Point Point = pShape->Get_Point(iPoint, iPart); if( m_pRegression->Get_Value(Point, zRegression) ) { CSG_Shape *pResidual = pResiduals->Add_Shape(); pResidual->Add_Point(Point); pResidual->Set_Value(0, zShape); pResidual->Set_Value(1, zRegression); pResidual->Set_Value(2, zShape - zRegression); } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- gw_multi_regression_grid.h000066400000000000000000000113721224124640700357560ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: gw_multi_regression_grid.h 1549 2012-11-29 16:38:50Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // gw_multi_regression_grid.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gw_multi_regression_grid_H #define HEADER_INCLUDED__gw_multi_regression_grid_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGW_Multi_Regression_Grid : public CSG_Module_Grid { public: CGW_Multi_Regression_Grid(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:GWR") ); } protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_nPoints_Min, m_nPoints_Max, m_Direction; double m_Radius; CSG_Distance_Weighting m_Weighting; CSG_PRQuadTree m_Search; CSG_Vector m_z, m_w; CSG_Matrix m_y; CSG_Shapes m_Points; CSG_Grid *m_pRegression, *m_pQuality; CSG_Parameter_Grid_List *m_pPredictors, *m_pSlopes; bool Initialize (void); void Finalize (void); int Set_Variables (int x, int y); bool Get_Regression (int x, int y); bool Set_Residuals (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gw_multi_regression_grid_H gw_multi_regression_points.cpp000066400000000000000000000362371224124640700367070ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: gw_multi_regression_points.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // gw_multi_regression_points.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gw_multi_regression_points.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define SG_ARRAY_FREE(A) if( A ) { SG_Free (A); A = NULL; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGW_Multi_Regression_Points::CGW_Multi_Regression_Points(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Geographically Weighted Multiple Regression (Points)")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Reference:\n" " - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "DEPENDENT" , _TL("Dependent Variable"), _TL("") ); Parameters.Add_Parameters( pNode , "PREDICTORS" , _TL("Predictors"), _TL("") ); Parameters.Add_Shapes( NULL , "REGRESSION" , _TL("Regression"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); //----------------------------------------------------- Parameters.Add_Parameters( NULL , "WEIGHTING" , _TL("Weighting"), _TL("") ); m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS); m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters()); //----------------------------------------------------- CSG_Parameter *pSearch = Parameters.Add_Node( NULL , "NODE_SEARCH" , _TL("Search Options"), _TL("") ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_RANGE" , _TL("Search Range"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("local"), _TL("global") ) ); Parameters.Add_Value( pNode , "SEARCH_RADIUS" , _TL("Maximum Search Distance"), _TL("local maximum search distance given in map units"), PARAMETER_TYPE_Double , 1000.0, 0, true ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_POINTS_ALL" , _TL("Number of Points"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("maximum number of nearest points"), _TL("all points within search distance") ) ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MIN" , _TL("Minimum"), _TL("minimum number of points to use"), PARAMETER_TYPE_Int, 4, 1, true ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MAX" , _TL("Maximum"), _TL("maximum number of nearest points"), PARAMETER_TYPE_Int, 20, 1, true ); Parameters.Add_Choice( pNode , "SEARCH_DIRECTION" , _TL("Search Direction"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("all directions"), _TL("quadrants") ) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGW_Multi_Regression_Points::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("POINTS")) ) { CSG_Shapes *pPoints = pParameters->Get_Parameter("POINTS") ->asShapes(); CSG_Parameters *pAttributes = pParameters->Get_Parameter("PREDICTORS") ->asParameters(); pAttributes->Destroy(); pAttributes->Set_Name(_TL("Predictors")); for(int i=0; pPoints && iGet_Field_Count(); i++) { if( SG_Data_Type_is_Numeric(pPoints->Get_Field_Type(i)) ) { pAttributes->Add_Value( NULL, SG_Get_String(i, 0), pPoints->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false ); } } return( true ); } return( false ); } //--------------------------------------------------------- int CGW_Multi_Regression_Points::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) ) { pParameters->Get_Parameter("SEARCH_RADIUS" )->Set_Enabled(pParameter->asInt() == 0); // local } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) ) { pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0); // maximum number of points pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0); // maximum number of points per quadrant } m_Weighting.Enable_Parameters(pParameters); return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGW_Multi_Regression_Points::Get_Predictors(void) { int i, iDependent, *Predictor; CSG_Shapes *pPoints; CSG_Parameters *pAttributes; //----------------------------------------------------- m_pPoints = Parameters("REGRESSION" )->asShapes(); m_nPoints_Min = Parameters("SEARCH_POINTS_MIN")->asInt (); m_nPoints_Max = Parameters("SEARCH_POINTS_ALL")->asInt () == 0 ? Parameters("SEARCH_POINTS_MAX")->asInt () : 0; m_Radius = Parameters("SEARCH_RANGE" )->asInt () == 0 ? Parameters("SEARCH_RADIUS" )->asDouble() : 0.0; m_Direction = Parameters("SEARCH_DIRECTION" )->asInt () == 0 ? -1 : 4; m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters()); //----------------------------------------------------- iDependent = Parameters("DEPENDENT" )->asInt(); pPoints = Parameters("POINTS" )->asShapes();; pAttributes = Parameters("PREDICTORS")->asParameters(); m_pPoints->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s: %s]"), pPoints->Get_Name(), _TL("GWR"), pPoints->Get_Field_Name(iDependent))); m_pPoints->Add_Field(pPoints->Get_Field_Name(iDependent), SG_DATATYPE_Double); m_nPredictors = 0; Predictor = new int[pPoints->Get_Field_Count()]; for(i=0; iGet_Count(); i++) { CSG_Parameter *pAttribute = pAttributes->Get_Parameter(i); if( pAttribute->asBool() ) { Predictor[m_nPredictors++] = CSG_String(pAttribute->Get_Identifier()).asInt(); m_pPoints->Add_Field(CSG_String::Format(SG_T("P%d %s"), m_nPredictors, pAttribute->Get_Name()), SG_DATATYPE_Double); } } if( m_nPredictors == 0 ) { delete[](Predictor); Error_Set(_TL("no predictors have been selected")); return( false ); } //----------------------------------------------------- m_pPoints->Add_Field(SG_T("R2") , SG_DATATYPE_Double); m_pPoints->Add_Field(SG_T("REGRESSION") , SG_DATATYPE_Double); m_pPoints->Add_Field(SG_T("RESIDUAL") , SG_DATATYPE_Double); m_pPoints->Add_Field(SG_T("INTERCEPT") , SG_DATATYPE_Double); for(i=0; iAdd_Field(CSG_String::Format(SG_T("R%d"), 1 + i), SG_DATATYPE_Double); } for(int iPoint=0; iPointGet_Count(); iPoint++) { CSG_Shape *pPoint = pPoints->Get_Shape(iPoint); bool bAdd = !pPoint->is_NoData(iDependent); for(i=0; bAdd && iis_NoData(Predictor[i]) ) { bAdd = false; } } if( bAdd ) { CSG_Shape *pAdd = m_pPoints->Add_Shape(); pAdd->Add_Point(pPoint->Get_Point(0)); pAdd->Set_Value(0, pPoint->asDouble(iDependent)); for(i=0; iSet_Value(1 + i, pPoint->asDouble(Predictor[i])); } } } delete[](Predictor); //----------------------------------------------------- if( m_pPoints->Get_Count() == 0 ) { Error_Set(_TL("invalid data")); return( false ); } if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) ) { Error_Set(_TL("failed to create searche engine")); return( false ); } //----------------------------------------------------- int nPoints_Max = m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count(); m_y.Create(1 + m_nPredictors, nPoints_Max); m_z.Create(nPoints_Max); m_w.Create(nPoints_Max); return( true ); } //--------------------------------------------------------- void CGW_Multi_Regression_Points::Finalize(void) { m_Search.Destroy(); m_y.Destroy(); m_z.Destroy(); m_w.Destroy(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGW_Multi_Regression_Points::On_Execute(void) { //----------------------------------------------------- if( !Get_Predictors() ) { Finalize(); return( false ); } //----------------------------------------------------- for(int iPoint=0; iPointGet_Count() && Set_Progress(iPoint, m_pPoints->Get_Count()); iPoint++) { if( !Get_Regression(m_pPoints->Get_Shape(iPoint)) ) { } } //----------------------------------------------------- Finalize(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGW_Multi_Regression_Points::Set_Variables(const TSG_Point &Point) { int iPoint, jPoint, nPoints, iPredictor; CSG_Shape *pPoint; nPoints = m_Search.is_Okay() ? m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count(); for(iPoint=0, jPoint=0; iPointGet_Shape((int)iz); } else { pPoint = m_pPoints->Get_Shape(iPoint); } m_z[iPoint] = pPoint->asDouble(0); m_w[iPoint] = m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0))); for(iPredictor=0; iPredictorasDouble(1 + iPredictor); } } return( nPoints ); } //--------------------------------------------------------- bool CGW_Multi_Regression_Points::Get_Regression(CSG_Shape *pPoint) { int nPoints = Set_Variables(pPoint->Get_Point(0)); if( nPoints < m_nPoints_Min ) { return( false ); } //----------------------------------------------------- int i; double zMean, rss, tss; CSG_Vector b, z; CSG_Matrix Y, YtW; //----------------------------------------------------- z .Create(nPoints); Y .Create(1 + m_nPredictors, nPoints); YtW.Create(nPoints, 1 + m_nPredictors); for(i=0, zMean=0.0; iasDouble(i); } //----------------------------------------------------- pPoint->Set_Value(1 + m_nPredictors, tss > 0.0 ? (tss - rss) / tss : 0.0); // R2 pPoint->Set_Value(2 + m_nPredictors, Regression); // Regression pPoint->Set_Value(3 + m_nPredictors, pPoint->asDouble(0) - Regression); // Residual for(i=0; i<=m_nPredictors; i++) { pPoint->Set_Value(4 + m_nPredictors + i, b[i]); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- gw_multi_regression_points.h000066400000000000000000000114411224124640700363420ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: gw_multi_regression_points.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // gw_multi_regression_points.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gw_multi_regression_points_H #define HEADER_INCLUDED__gw_multi_regression_points_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGW_Multi_Regression_Points : public CSG_Module { public: CGW_Multi_Regression_Points(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:GWR") ); } protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_nPredictors, m_nPoints_Min, m_nPoints_Max, m_Direction; double m_Radius; CSG_Distance_Weighting m_Weighting; CSG_PRQuadTree m_Search; CSG_Vector m_z, m_w; CSG_Matrix m_y; CSG_Shapes *m_pPoints; void Finalize (void); bool Get_Predictors (void); int Set_Variables (const TSG_Point &Point); bool Get_Regression (CSG_Shape *pPoint); bool Set_Residuals (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gw_multi_regression_points_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.cpp000066400000000000000000000315541224124640700341550ustar00rootroot00000000000000/********************************************************** * Version $Id: gw_regression.cpp 1633 2013-03-22 13:35:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // gw_regression.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gw_regression.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGW_Regression::CGW_Regression(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Geographically Weighted Regression")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Reference:\n" " - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "DEPENDENT" , _TL("Dependent Variable"), _TL("") ); Parameters.Add_Table_Field( pNode , "PREDICTOR" , _TL("Predictor"), _TL("") ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TARGET" , _TL("Target Grids"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("user defined"), _TL("grid") ), 0 ); m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid") , _TL(""))); m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid") , _TL("")), false); m_Grid_Target.Add_Grid_Parameter(SG_T("QUALITY") , _TL("Quality") , false); m_Grid_Target.Add_Grid_Parameter(SG_T("INTERCEPT") , _TL("Intercept"), false); m_Grid_Target.Add_Grid_Parameter(SG_T("SLOPE") , _TL("Slope") , false); //----------------------------------------------------- Parameters.Add_Parameters( NULL , "WEIGHTING" , _TL("Weighting"), _TL("") ); m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS); m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters()); //----------------------------------------------------- CSG_Parameter *pSearch = Parameters.Add_Node( NULL , "NODE_SEARCH" , _TL("Search Options"), _TL("") ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_RANGE" , _TL("Search Range"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("local"), _TL("global") ) ); Parameters.Add_Value( pNode , "SEARCH_RADIUS" , _TL("Maximum Search Distance"), _TL("local maximum search distance given in map units"), PARAMETER_TYPE_Double , 1000.0, 0, true ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_POINTS_ALL" , _TL("Number of Points"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("maximum number of nearest points"), _TL("all points within search distance") ) ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MIN" , _TL("Minimum"), _TL("minimum number of points to use"), PARAMETER_TYPE_Int, 4, 1, true ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MAX" , _TL("Maximum"), _TL("maximum number of nearest points"), PARAMETER_TYPE_Int, 20, 1, true ); Parameters.Add_Choice( pNode , "SEARCH_DIRECTION" , _TL("Search Direction"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("all directions"), _TL("quadrants") ) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGW_Regression::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 ); } //--------------------------------------------------------- int CGW_Regression::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) ) { pParameters->Get_Parameter("SEARCH_RADIUS" )->Set_Enabled(pParameter->asInt() == 0); // local } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) ) { pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0); // maximum number of points pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0); // maximum number of points per quadrant } m_Weighting.Enable_Parameters(pParameters); return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGW_Regression::On_Execute(void) { //----------------------------------------------------- m_pPoints = Parameters("POINTS" )->asShapes(); m_iDependent = Parameters("DEPENDENT")->asInt (); m_iPredictor = Parameters("PREDICTOR")->asInt (); m_nPoints_Min = Parameters("SEARCH_POINTS_MIN")->asInt (); m_nPoints_Max = Parameters("SEARCH_POINTS_ALL")->asInt () == 0 ? Parameters("SEARCH_POINTS_MAX")->asInt () : 0; m_Radius = Parameters("SEARCH_RANGE" )->asInt () == 0 ? Parameters("SEARCH_RADIUS" )->asDouble() : 0.0; m_Direction = Parameters("SEARCH_DIRECTION" )->asInt () == 0 ? -1 : 4; m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters()); //----------------------------------------------------- if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) ) { return( false ); } //----------------------------------------------------- m_pIntercept = NULL; m_pSlope = NULL; m_pQuality = NULL; switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... if( m_Grid_Target.Init_User(m_pPoints->Get_Extent()) && Dlg_Parameters("USER") ) { m_pIntercept = m_Grid_Target.Get_User(SG_T("INTERCEPT")); m_pSlope = m_Grid_Target.Get_User(SG_T("SLOPE")); m_pQuality = m_Grid_Target.Get_User(SG_T("QUALITY")); } break; case 1: // grid... if( Dlg_Parameters("GRID") ) { m_pIntercept = m_Grid_Target.Get_Grid(SG_T("INTERCEPT")); m_pSlope = m_Grid_Target.Get_Grid(SG_T("SLOPE")); m_pQuality = m_Grid_Target.Get_Grid(SG_T("QUALITY")); } break; } if( m_pIntercept == NULL ) { m_Search.Destroy(); return( false ); } m_pIntercept->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Intercept"))); m_pSlope ->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Slope"))); m_pQuality ->Set_Name(CSG_String::Format(SG_T("%s (%s)"), Parameters("DEPENDENT")->asString(), _TL("GWR Quality"))); //----------------------------------------------------- int nPoints_Max = m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count(); m_y.Create(nPoints_Max); m_z.Create(nPoints_Max); m_w.Create(nPoints_Max); //----------------------------------------------------- for(int y=0; yGet_NY() && Set_Progress(y, m_pIntercept->Get_NY()); y++) { for(int x=0; xGet_NX(); x++) { if( !Get_Regression(x, y) ) { m_pIntercept->Set_NoData(x, y); m_pSlope ->Set_NoData(x, y); m_pQuality ->Set_NoData(x, y); } } } //----------------------------------------------------- m_y.Destroy(); m_z.Destroy(); m_w.Destroy(); m_Search.Destroy(); DataObject_Update(m_pIntercept); DataObject_Update(m_pSlope); DataObject_Update(m_pQuality); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGW_Regression::Set_Variables(int x, int y) { int iPoint, jPoint, nPoints; TSG_Point Point; CSG_Shape *pPoint; Point = m_pIntercept->Get_System().Get_Grid_to_World(x, y); nPoints = m_Search.is_Okay() ? m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count(); for(iPoint=0, jPoint=0; iPointGet_Shape((int)iz); } else { pPoint = m_pPoints->Get_Shape(iPoint); } if( !pPoint->is_NoData(m_iDependent) && !pPoint->is_NoData(m_iPredictor) ) { m_z[jPoint] = pPoint->asDouble(m_iDependent); m_y[jPoint] = pPoint->asDouble(m_iPredictor); m_w[jPoint] = m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0))); jPoint++; } } return( jPoint ); } //--------------------------------------------------------- bool CGW_Regression::Get_Regression(int x, int y) { int nPoints = Set_Variables(x, y); if( nPoints < m_nPoints_Min ) { return( false ); } //----------------------------------------------------- int i; double zMean, rss, tss; CSG_Vector b, z; CSG_Matrix Y, YtW; //----------------------------------------------------- z .Create(nPoints); Y .Create(2, nPoints); YtW.Create(nPoints, 2); for(i=0, zMean=0.0; iSet_Value(x, y, b[0]); m_pSlope ->Set_Value(x, y, b[1]); m_pQuality ->Set_Value(x, y, (tss - rss) / tss); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/gw_regression.h000066400000000000000000000113351224124640700336150ustar00rootroot00000000000000/********************************************************** * Version $Id: gw_regression.h 1549 2012-11-29 16:38:50Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // gw_regression.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GW_Regression_H #define HEADER_INCLUDED__GW_Regression_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGW_Regression : public CSG_Module { public: CGW_Regression(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:GWR") ); } protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_iDependent, m_iPredictor, m_nPoints_Min, m_nPoints_Max, m_Direction; double m_Radius; CSG_Parameters_Grid_Target m_Grid_Target; CSG_Distance_Weighting m_Weighting; CSG_PRQuadTree m_Search; CSG_Vector m_y, m_z, m_w; CSG_Shapes *m_pPoints; CSG_Grid *m_pIntercept, *m_pSlope, *m_pQuality; int Set_Variables (int x, int y); bool Get_Regression (int x, int y); bool Set_Residuals (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__GW_Regression_H gw_regression_grid.cpp000066400000000000000000000343511224124640700351010ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: gw_regression_grid.cpp 1633 2013-03-22 13:35:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // gw_regression_grid.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gw_regression_grid.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define GRID_INIT(g, s) if( g ) { g->Set_Name(CSG_String::Format(SG_T("%s (%s - %s)"), Parameters("DEPENDENT")->asString(), s, m_pPredictor->Get_Name())); } #define GRID_SET_NODATA(g, x, y) if( g ) { g->Set_NoData(x, y); } #define GRID_SET_VALUE(g, x, y, z) if( g ) { g->Set_Value(x, y, z); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGW_Regression_Grid::CGW_Regression_Grid(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Geographically Weighted Regression (Points/Grid)")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Reference:\n" " - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "PREDICTOR" , _TL("Predictor"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "REGRESSION" , _TL("Regression"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "QUALITY" , _TL("Coefficient of Determination"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL , "INTERCEPT" , _TL("Intercept"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL , "SLOPE" , _TL("Slope"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "DEPENDENT" , _TL("Dependent Variable"), _TL("") ); Parameters.Add_Shapes( NULL , "RESIDUALS" , _TL("Residuals"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); //----------------------------------------------------- Parameters.Add_Parameters( NULL , "WEIGHTING" , _TL("Weighting"), _TL("") ); m_Weighting.Set_Weighting(SG_DISTWGHT_GAUSS); m_Weighting.Create_Parameters(Parameters("WEIGHTING")->asParameters()); //----------------------------------------------------- CSG_Parameter *pSearch = Parameters.Add_Node( NULL , "NODE_SEARCH" , _TL("Search Options"), _TL("") ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_RANGE" , _TL("Search Range"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("local"), _TL("global") ) ); Parameters.Add_Value( pNode , "SEARCH_RADIUS" , _TL("Maximum Search Distance"), _TL("local maximum search distance given in map units"), PARAMETER_TYPE_Double , 1000.0, 0, true ); pNode = Parameters.Add_Choice( pSearch , "SEARCH_POINTS_ALL" , _TL("Number of Points"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("maximum number of nearest points"), _TL("all points within search distance") ) ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MIN" , _TL("Minimum"), _TL("minimum number of points to use"), PARAMETER_TYPE_Int, 4, 1, true ); Parameters.Add_Value( pNode , "SEARCH_POINTS_MAX" , _TL("Maximum"), _TL("maximum number of nearest points"), PARAMETER_TYPE_Int, 20, 1, true ); Parameters.Add_Choice( pNode , "SEARCH_DIRECTION" , _TL("Search Direction"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("all directions"), _TL("quadrants") ) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGW_Regression_Grid::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) ) { pParameters->Get_Parameter("SEARCH_RADIUS" )->Set_Enabled(pParameter->asInt() == 0); // local } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_POINTS_ALL")) ) { pParameters->Get_Parameter("SEARCH_POINTS_MAX")->Set_Enabled(pParameter->asInt() == 0); // maximum number of points pParameters->Get_Parameter("SEARCH_DIRECTION" )->Set_Enabled(pParameter->asInt() == 0); // maximum number of points per quadrant } m_Weighting.Enable_Parameters(pParameters); return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGW_Regression_Grid::On_Execute(void) { //----------------------------------------------------- m_pPredictor = Parameters("PREDICTOR" )->asGrid (); m_pRegression = Parameters("REGRESSION")->asGrid (); m_pQuality = Parameters("QUALITY" )->asGrid (); m_pIntercept = Parameters("INTERCEPT" )->asGrid (); m_pSlope = Parameters("SLOPE" )->asGrid (); m_pPoints = Parameters("POINTS" )->asShapes(); m_iDependent = Parameters("DEPENDENT" )->asInt (); m_nPoints_Min = Parameters("SEARCH_POINTS_MIN")->asInt (); m_nPoints_Max = Parameters("SEARCH_POINTS_ALL")->asInt () == 0 ? Parameters("SEARCH_POINTS_MAX")->asInt () : 0; m_Radius = Parameters("SEARCH_RANGE" )->asInt () == 0 ? Parameters("SEARCH_RADIUS" )->asDouble() : 0.0; m_Direction = Parameters("SEARCH_DIRECTION" )->asInt () == 0 ? -1 : 4; m_Weighting.Set_Parameters(Parameters("WEIGHTING")->asParameters()); //----------------------------------------------------- if( (m_nPoints_Max > 0 || m_Radius > 0.0) && !m_Search.Create(m_pPoints, -1) ) { return( false ); } //----------------------------------------------------- GRID_INIT(m_pRegression, _TL("GWR Regression")); GRID_INIT(m_pQuality , _TL("GWR Quality")); GRID_INIT(m_pIntercept , _TL("GWR Intercept")); GRID_INIT(m_pSlope , _TL("GWR Slope")); //----------------------------------------------------- int nPoints_Max = m_nPoints_Max > 0 ? m_nPoints_Max : m_pPoints->Get_Count(); m_y.Create(nPoints_Max); m_z.Create(nPoints_Max); m_w.Create(nPoints_Max); //----------------------------------------------------- for(int y=0; yis_NoData(x, y) || !Get_Regression(x, y) ) { GRID_SET_NODATA(m_pRegression , x, y); GRID_SET_NODATA(m_pIntercept , x, y); GRID_SET_NODATA(m_pSlope , x, y); GRID_SET_NODATA(m_pQuality , x, y); } } } //----------------------------------------------------- Set_Residuals(); m_y.Destroy(); m_z.Destroy(); m_w.Destroy(); m_Search.Destroy(); DataObject_Update(m_pIntercept); DataObject_Update(m_pSlope); DataObject_Update(m_pQuality); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGW_Regression_Grid::Set_Variables(int x, int y) { int iPoint, jPoint, nPoints; double z; TSG_Point Point; CSG_Shape *pPoint; Point = Get_System()->Get_Grid_to_World(x, y); nPoints = m_Search.is_Okay() ? m_Search.Select_Nearest_Points(Point.x, Point.y, m_nPoints_Max, m_Radius, m_Direction) : m_pPoints->Get_Count(); for(iPoint=0, jPoint=0; iPointGet_Shape((int)iz); } else { pPoint = m_pPoints->Get_Shape(iPoint); } if( !pPoint->is_NoData(m_iDependent) && m_pPredictor->Get_Value(pPoint->Get_Point(0), z) ) { m_w[jPoint] = m_Weighting.Get_Weight(SG_Get_Distance(Point, pPoint->Get_Point(0))); m_z[jPoint] = pPoint->asDouble(m_iDependent); m_y[jPoint] = z; jPoint++; } } return( jPoint ); } //--------------------------------------------------------- bool CGW_Regression_Grid::Get_Regression(int x, int y) { int nPoints = Set_Variables(x, y); if( nPoints < m_nPoints_Min ) { return( false ); } //----------------------------------------------------- int i; double zMean, rss, tss; CSG_Vector b, z; CSG_Matrix Y, YtW; //----------------------------------------------------- z .Create(nPoints); Y .Create(2, nPoints); YtW.Create(nPoints, 2); for(i=0, zMean=0.0; iasDouble(x, y)); GRID_SET_VALUE(m_pIntercept , x, y, b[0]); GRID_SET_VALUE(m_pSlope , x, y, b[1]); GRID_SET_VALUE(m_pQuality , x, y, (tss - rss) / tss); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGW_Regression_Grid::Set_Residuals(void) { CSG_Shapes *pResiduals = Parameters("RESIDUALS")->asShapes(); if( !pResiduals || !m_pPoints || !m_pRegression ) { return( false ); } //----------------------------------------------------- pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_pPoints->Get_Name(), _TL("Residuals"))); pResiduals->Add_Field(m_pPoints->Get_Field_Name(m_iDependent), SG_DATATYPE_Double); pResiduals->Add_Field("TREND" , SG_DATATYPE_Double); pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double); //------------------------------------------------- for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, m_pPoints->Get_Count()); iShape++) { CSG_Shape *pShape = m_pPoints->Get_Shape(iShape); double zShape = pShape->asDouble(m_iDependent); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { double zRegression; TSG_Point Point = pShape->Get_Point(iPoint, iPart); if( m_pRegression->Get_Value(Point, zRegression) ) { CSG_Shape *pResidual = pResiduals->Add_Shape(); pResidual->Add_Point(Point); pResidual->Set_Value(0, zShape); pResidual->Set_Value(1, zRegression); pResidual->Set_Value(2, zShape - zRegression); } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- gw_regression_grid.h000066400000000000000000000112051224124640700345370ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: gw_regression_grid.h 1549 2012-11-29 16:38:50Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // gw_regression_grid.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gw_regression_grid_H #define HEADER_INCLUDED__gw_regression_grid_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGW_Regression_Grid : public CSG_Module_Grid { public: CGW_Regression_Grid(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:GWR") ); } protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_iDependent, m_nPoints_Min, m_nPoints_Max, m_Direction; double m_Radius; CSG_Distance_Weighting m_Weighting; CSG_PRQuadTree m_Search; CSG_Vector m_y, m_z, m_w; CSG_Shapes *m_pPoints; CSG_Grid *m_pPredictor, *m_pRegression, *m_pQuality, *m_pIntercept, *m_pSlope; int Set_Variables (int x, int y); bool Get_Regression (int x, int y); bool Set_Residuals (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gw_regression_grid_H gwr_grid_downscaling.cpp000066400000000000000000000367001224124640700354130ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: gwr_grid_downscaling.cpp 1633 2013-03-22 13:35:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // gwr_grid_downscaling.cpp // // // // Copyright (C) 2013 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gwr_grid_downscaling.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGWR_Grid_Downscaling::CGWR_Grid_Downscaling(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("GWR Grid Downscaling")); Set_Author (SG_T("O.Conrad (c) 2013")); Set_Description (_TW( "Reference:\n" "- Fotheringham, S.A., Brunsdon, C., Charlton, M. (2002):" " Geographically Weighted Regression: the analysis of spatially varying relationships. John Wiley & Sons." " online.\n" "\n" "- Fotheringham, S.A., Charlton, M., Brunsdon, C. (1998):" " Geographically weighted regression: a natural evolution of the expansion method for spatial data analysis." " Environment and Planning A 30(11), 19051927." " online.\n" "\n" "- Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "PREDICTORS" , _TL("Predictors"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "REGRESSION" , _TL("Regression"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "REG_RESCORR" , _TL("Regression with Residual Correction"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); //----------------------------------------------------- pNode = Parameters.Add_Grid_System( NULL , "GRID_SYSTEM" , _TL("Grid System"), _TL("") ); Parameters.Add_Grid( pNode , "DEPENDENT" , _TL("Dependent Variable"), _TL(""), PARAMETER_INPUT, false ); Parameters.Add_Grid( pNode , "QUALITY" , _TL("Coefficient of Determination"), _TL(""), PARAMETER_OUTPUT, false ); Parameters.Add_Grid( pNode , "RESIDUALS" , _TL("Residuals"), _TL(""), PARAMETER_OUTPUT, false ); Parameters.Add_Grid_List( pNode , "MODEL" , _TL("Regression Parameters"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, false ); Parameters.Add_Value( NULL , "MODEL_OUT" , _TL("Output of Model Parameters"), _TL(""), PARAMETER_TYPE_Bool, false ); //----------------------------------------------------- pNode = Parameters.Add_Choice( NULL , "SEARCH_RANGE" , _TL("Search Range"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("local"), _TL("global") ) ); Parameters.Add_Value( pNode , "SEARCH_RADIUS" , _TL("Search Distance [Cells]"), _TL(""), PARAMETER_TYPE_Int, 10, 1, true ); m_Search.Get_Weighting().Set_Weighting(SG_DISTWGHT_GAUSS); m_Search.Get_Weighting().Set_BandWidth(7.0); m_Search.Get_Weighting().Create_Parameters(&Parameters, false); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGWR_Grid_Downscaling::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SEARCH_RANGE")) ) { pParameters->Get_Parameter("SEARCH_RADIUS")->Set_Enabled(pParameter->asInt() == 0); // local } m_Search.Get_Weighting().Enable_Parameters(pParameters); return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGWR_Grid_Downscaling::On_Execute(void) { //----------------------------------------------------- CSG_Parameter_Grid_List *pPredictors = Parameters("PREDICTORS")->asGridList(); if( (m_nPredictors = pPredictors->Get_Count()) <= 0 ) { return( false ); } m_pDependent = Parameters("DEPENDENT")->asGrid(); if( !m_pDependent->Get_Extent().Intersects(Get_System()->Get_Extent()) ) { return( false ); } //----------------------------------------------------- int i; Process_Set_Text(_TL("upscaling of predictors")); m_pPredictors = (CSG_Grid **)SG_Calloc(m_nPredictors , sizeof(CSG_Grid *)); m_pModel = (CSG_Grid **)SG_Calloc(m_nPredictors + 1, sizeof(CSG_Grid *)); for(i=0; iGet_System()); m_pPredictors[i] ->Assign(pPredictors->asGrid(i), GRID_INTERPOLATION_NearestNeighbour); // GRID_INTERPOLATION_Mean_Cells m_pModel [i] = SG_Create_Grid(m_pDependent->Get_System()); m_pModel [i] ->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pPredictors->asGrid(i)->Get_Name(), _TL("Factor"))); } m_pModel[m_nPredictors] = SG_Create_Grid(m_pDependent->Get_System()); m_pModel[m_nPredictors] ->Set_Name(_TL("Intercept")); //----------------------------------------------------- Process_Set_Text(_TL("model creation")); bool bResult = Get_Model(); //----------------------------------------------------- for(i=0; iasGrid(i); } //----------------------------------------------------- if( bResult ) { Process_Set_Text(_TL("downscaling")); bResult = Set_Model(); } //----------------------------------------------------- if( Parameters("MODEL_OUT")->asBool() ) { CSG_Parameter_Grid_List *pModel = Parameters("MODEL")->asGridList(); pModel->Del_Items(); pModel->Add_Item(m_pModel[m_nPredictors]); for(i=0; iAdd_Item(m_pModel[i]); } } else { for(i=0; iGet_Value(x, y, Value, GRID_INTERPOLATION_BSpline) ) { return( false ); } double Model, Predictor; for(int i=0; iGet_Value(x, y, Model , GRID_INTERPOLATION_BSpline) || !m_pPredictors[i]->Get_Value(x, y, Predictor, GRID_INTERPOLATION_NearestNeighbour) ) { return( false ); } Value += Model * Predictor; } if( !m_pResiduals->Get_Value(x, y, Residual, GRID_INTERPOLATION_BSpline) ) { Residual = 0.0; } return( true ); } //--------------------------------------------------------- bool CGWR_Grid_Downscaling::Set_Model(void) { CSG_Grid *pRegression = Parameters("REGRESSION" )->asGrid(); CSG_Grid *pReg_ResCorr = Parameters("REG_RESCORR")->asGrid(); pRegression->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pDependent->Get_Name(), _TL("GWR"))); if( pReg_ResCorr ) { pReg_ResCorr->Set_Name(CSG_String::Format(SG_T("%s [%s, %s]"), m_pDependent->Get_Name(), _TL("GWR"), _TL("Residual Correction"))); } for(int y=0; ySet_Value(x, y, Value); if( pReg_ResCorr ) { pReg_ResCorr->Set_Value(x, y, Value + Residual); } } else { pRegression->Set_NoData(x, y); if( pReg_ResCorr ) { pReg_ResCorr->Set_NoData(x, y); } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGWR_Grid_Downscaling::Get_Model(void) { //----------------------------------------------------- m_pQuality = Parameters("QUALITY" )->asGrid(); m_pQuality ->Set_Name(CSG_String::Format(SG_T("%s [%s, %s]"), m_pDependent->Get_Name(), _TL("GWR"), _TL("Quality"))); m_pResiduals = Parameters("RESIDUALS")->asGrid(); m_pResiduals ->Set_Name(CSG_String::Format(SG_T("%s [%s, %s]"), m_pDependent->Get_Name(), _TL("GWR"), _TL("Residuals"))); //----------------------------------------------------- m_Search.Get_Weighting().Set_Parameters(&Parameters); m_Search.Set_Radius(Parameters("SEARCH_RANGE")->asInt() == 0 ? Parameters("SEARCH_RADIUS")->asInt() : 1 + (int)(SG_Get_Length(m_pDependent->Get_NX(), m_pDependent->Get_NY())) ); //----------------------------------------------------- CSG_Grid_System System(m_pDependent->Get_System()); for(int y=0; ySet_NoData(x, y); m_pResiduals->Set_NoData(x, y); for(int i=0; i<=m_nPredictors; i++) { m_pModel[i]->Set_NoData(x, y); } } } } //----------------------------------------------------- m_Search.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGWR_Grid_Downscaling::Get_Variables(int x, int y, CSG_Vector &z, CSG_Vector &w, CSG_Matrix &Y) { int n = 0; z.Create(m_Search.Get_Count()); w.Create(m_Search.Get_Count()); Y.Create(1 + m_nPredictors, m_Search.Get_Count()); //----------------------------------------------------- for(int i=0, ix, iy; iis_InGrid(ix, iy) ) { z[n] = m_pDependent->asDouble(ix, iy); w[n] = iw; Y[n][0] = 1.0; for(int j=0; j0.0; j++) { if( !m_pPredictors[j]->is_NoData(ix, iy) ) { Y[n][j + 1] = m_pPredictors[j]->asDouble(ix, iy); } else { iw = 0.0; } } if( iw > 0.0 ) { n++; } } } //----------------------------------------------------- z.Set_Rows(n); w.Set_Rows(n); Y.Set_Rows(n); return( n ); } //--------------------------------------------------------- bool CGWR_Grid_Downscaling::Get_Regression(int x, int y) { //----------------------------------------------------- int i, nPoints; double zMean, zr, rss, tss; CSG_Vector b, z, w; CSG_Matrix Y, YtW; if( (nPoints = Get_Variables(x, y, z, w, Y)) <= m_nPredictors ) { return( false ); } //----------------------------------------------------- YtW.Create(nPoints, 1 + m_nPredictors); for(i=0, zMean=0.0; iSet_Value(x, y, tss > 0.0 ? (tss - rss) / tss : 0.0); for(i=0; iSet_Value(x, y, b[i + 1]); } m_pModel[m_nPredictors]->Set_Value(x, y, b[0]); //----------------------------------------------------- if( m_pDependent->is_NoData(x, y) ) { m_pResiduals->Set_NoData(x, y); } else { zr = b[0]; for(i=0; iis_NoData(x, y) ) { m_pResiduals->Set_NoData(x, y); return( true ); } zr += b[i + 1] * m_pPredictors[i]->asDouble(x, y); } m_pResiduals->Set_Value(x, y, m_pDependent->asDouble(x, y) - zr); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- gwr_grid_downscaling.h000066400000000000000000000112151224124640700350520ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: gwr_grid_downscaling.h 1549 2012-11-29 16:38:50Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // gwr_grid_downscaling.h // // // // Copyright (C) 2013 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gwr_grid_downscaling_H #define HEADER_INCLUDED__gwr_grid_downscaling_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGWR_Grid_Downscaling : public CSG_Module_Grid { public: CGWR_Grid_Downscaling(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:GWR") ); } protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_nPredictors; CSG_Grid_Cell_Addressor m_Search; CSG_Grid *m_pDependent, **m_pPredictors, **m_pModel, *m_pQuality, *m_pResiduals; bool Set_Model (double x, double y, double &Value, double &Residual); bool Set_Model (void); bool Get_Model (void); int Get_Variables (int x, int y, CSG_Vector &z, CSG_Vector &w, CSG_Matrix &Y); bool Get_Regression (int x, int y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gwr_grid_downscaling_H point_grid_regression.cpp000066400000000000000000000251241224124640700356130ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: point_grid_regression.cpp 1633 2013-03-22 13:35:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // point_grid_regression.cpp // // // // Copyright (C) 2004 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "point_grid_regression.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define GRID_ZFACTOR true /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoint_Grid_Regression::CPoint_Grid_Regression(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Regression Analysis (Points/Grid)")); Set_Author (SG_T("O.Conrad (c) 2004")); Set_Description (_TW( "Regression analysis of point attributes with grid values. " "The regression function is used to create a new grid with regression based values. \n" "\n" "Reference:\n" "- Bahrenberg, G., Giese, E., Nipper, J. (1990): " "'Statistische Methoden in der Geographie 1 - Univariate und bivariate Statistik', " "Stuttgart, 233p.\n" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "ATTRIBUTE" , _TL("Attribute"), _TL("") ); Parameters.Add_Grid( NULL , "REGRESSION" , _TL("Regression"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Shapes( NULL , "RESIDUAL" , _TL("Residuals"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); Parameters.Add_Choice( NULL ,"INTERPOL" , _TL("Grid Interpolation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 4 ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Regression Function"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"), _TL("Y = a + b * X (linear)"), _TL("Y = a + b / X"), _TL("Y = a / (b - X)"), _TL("Y = a * X^b (power)"), _TL("Y = a e^(b * X) (exponential)"), _TL("Y = a + b * ln(X) (logarithmic)") ), 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoint_Grid_Regression::On_Execute(void) { int iAttribute; TSG_Regression_Type Type; CSG_Shapes *pShapes, *pResiduals; CSG_Grid *pGrid, *pRegression; //----------------------------------------------------- pGrid = Parameters("GRID") ->asGrid(); pRegression = Parameters("REGRESSION") ->asGrid(); pShapes = Parameters("SHAPES") ->asShapes(); pResiduals = Parameters("RESIDUAL") ->asShapes(); iAttribute = Parameters("ATTRIBUTE") ->asInt(); m_Interpolation = Parameters("INTERPOL") ->asInt(); switch( Parameters("METHOD")->asInt() ) { default: case 0: Type = REGRESSION_Linear; break; // Y = a + b * X case 1: Type = REGRESSION_Rez_X; break; // Y = a + b / X case 2: Type = REGRESSION_Rez_Y; break; // Y = a / (b - X) case 3: Type = REGRESSION_Pow; break; // Y = a * X^b case 4: Type = REGRESSION_Exp; break; // Y = a e^(b * X) case 5: Type = REGRESSION_Log; break; // Y = a + b * ln(X) } //----------------------------------------------------- if( Get_Regression(pGrid, pShapes, pResiduals, iAttribute, Type) ) { pRegression->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Regression Model"))); Set_Regression(pGrid, pRegression); Set_Residuals(pResiduals); Message_Add(m_Regression.asString()); m_Regression.Destroy(); return( true ); } //----------------------------------------------------- m_Regression.Destroy(); return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoint_Grid_Regression::Get_Regression(CSG_Grid *pGrid, CSG_Shapes *pShapes, CSG_Shapes *pResiduals, int iAttribute, TSG_Regression_Type Type) { int iShape, iPart, iPoint; double zShape, zGrid; TSG_Point Point; CSG_Shape *pShape, *pResidual; //----------------------------------------------------- if( pResiduals ) { pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Residuals"))); pResiduals->Add_Field("ID" , SG_DATATYPE_Int); pResiduals->Add_Field("Y" , SG_DATATYPE_Double); pResiduals->Add_Field("X" , SG_DATATYPE_Double); pResiduals->Add_Field("Y_GUESS" , SG_DATATYPE_Double); pResiduals->Add_Field("Y_RESIDUAL" , SG_DATATYPE_Double); pResiduals->Add_Field("Y_RES_VAR" , SG_DATATYPE_Double); } m_Regression.Destroy(); //----------------------------------------------------- for(iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { pShape = pShapes->Get_Shape(iShape); if( !pShape->is_NoData(iAttribute) ) { zShape = pShape->asDouble(iAttribute); for(iPart=0; iPartGet_Part_Count(); iPart++) { for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { if( pGrid->Get_Value(Point = pShape->Get_Point(iPoint, iPart), zGrid, m_Interpolation, GRID_ZFACTOR) ) { m_Regression.Add_Values(zGrid, zShape); if( pResiduals ) { pResidual = pResiduals->Add_Shape(); pResidual->Add_Point(Point); pResidual->Set_Value(0, m_Regression.Get_Count()); pResidual->Set_Value(1, zShape); pResidual->Set_Value(2, zGrid); } } } } } } //----------------------------------------------------- return( m_Regression.Calculate(Type) ); } //--------------------------------------------------------- bool CPoint_Grid_Regression::Set_Regression(CSG_Grid *pGrid, CSG_Grid *pRegression) { for(int y=0; yis_NoData(x, y) ) pRegression->Set_NoData(x, y); else pRegression->Set_Value (x, y, m_Regression.Get_y(pGrid->asDouble(x, y, GRID_ZFACTOR))); } } return( true ); } //--------------------------------------------------------- bool CPoint_Grid_Regression::Set_Residuals(CSG_Shapes *pResiduals) { int iPoint; double m, b, v, y; CSG_Shape *pPoint; if( pResiduals ) { m = m_Regression.Get_Coefficient(); b = m_Regression.Get_Constant(); v = 100.0 / m_Regression.Get_yVariance(); for(iPoint=0; iPointGet_Count() && Set_Progress(iPoint, pResiduals->Get_Count()); iPoint++) { pPoint = pResiduals->Get_Shape(iPoint); pPoint->Set_Value(3, y = pPoint->asDouble(2) * m + b); pPoint->Set_Value(4, y = pPoint->asDouble(1) - y); pPoint->Set_Value(5, y * v); } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- point_grid_regression.h000066400000000000000000000107531224124640700352620ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: point_grid_regression.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Geostatistics_Grid // // // //-------------------------------------------------------// // // // point_grid_regression.h // // // // Copyright (C) 2004 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__point_grid_regression_H #define HEADER_INCLUDED__point_grid_regression_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoint_Grid_Regression : public CSG_Module_Grid { public: CPoint_Grid_Regression(void); protected: virtual bool On_Execute (void); private: int m_Interpolation; CSG_Regression m_Regression; bool Get_Regression (CSG_Grid *pGrid, CSG_Shapes *pShapes, CSG_Shapes *pResiduals, int iAttribute, TSG_Regression_Type Type); bool Set_Regression (CSG_Grid *pGrid, CSG_Grid *pRegression); bool Set_Residuals (CSG_Shapes *pResiduals); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__point_grid_regression_H point_multi_grid_regression.cpp000066400000000000000000000446531224124640700370350ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: point_multi_grid_regression.cpp 1633 2013-03-22 13:35:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // point_multi_grid_regression.cpp // // // // Copyright (C) 2004 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "point_multi_grid_regression.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoint_Multi_Grid_Regression::CPoint_Multi_Grid_Regression(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Multiple Regression Analysis (Points/Grids)")); Set_Author (SG_T("O.Conrad (c) 2004")); Set_Description (_TW( "Linear regression analysis of point attributes with multiple grids. " "Details of the regression/correlation analysis will be saved to a table. " "The regression function is used to create a new grid with regression based values. " "The multiple regression analysis uses a forward selection procedure. \n" "\n" "Reference:\n" "- Bahrenberg, G., Giese, E., Nipper, J. (1992): " "'Statistische Methoden in der Geographie 2 - Multivariate Statistik', " "Stuttgart, 415p.\n" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT, true ); pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "ATTRIBUTE" , _TL("Attribute"), _TL("") ); Parameters.Add_Table( NULL , "INFO_COEFF" , _TL("Details: Coefficients"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Table( NULL , "INFO_MODEL" , _TL("Details: Model"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Table( NULL , "INFO_STEPS" , _TL("Details: Steps"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Shapes( NULL , "RESIDUALS" , _TL("Residuals"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); Parameters.Add_Grid( NULL , "REGRESSION" , _TL("Regression"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL ,"INTERPOL" , _TL("Grid Interpolation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 4 ); Parameters.Add_Value( NULL , "COORD_X" , _TL("Include X Coordinate"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "COORD_Y" , _TL("Include Y Coordinate"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "INTERCEPT" , _TL("Intercept"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Choice( NULL ,"METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("include all"), _TL("forward"), _TL("backward"), _TL("stepwise") ), 3 ); Parameters.Add_Value( NULL , "P_IN" , _TL("P in"), _TL("Level of significance for automated predictor selection, given as percentage"), PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true ); Parameters.Add_Value( NULL , "P_OUT" , _TL("P out"), _TL("Level of significance for automated predictor selection, given as percentage"), PARAMETER_TYPE_Double, 5.0, 0.0, true, 100.0, true ); Parameters.Add_Choice( NULL ,"CROSSVAL" , _TL("Cross Validation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("none"), _TL("leave one out"), _TL("2-fold"), _TL("k-fold") ), 0 ); Parameters.Add_Value( NULL , "CROSSVAL_K" , _TL("Cross Validation Subsamples"), _TL("number of subsamples for k-fold cross validation"), PARAMETER_TYPE_Int, 10, 2, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CPoint_Multi_Grid_Regression::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CROSSVAL")) ) { pParameters->Get_Parameter("CROSSVAL_K")->Set_Enabled(pParameter->asInt() == 3); // k-fold } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoint_Multi_Grid_Regression::On_Execute(void) { bool bResult; int iAttribute; double P_in, P_out; CSG_Strings Names; CSG_Matrix Samples; CSG_Shapes *pShapes; CSG_Grid *pRegression; CSG_Parameter_Grid_List *pGrids; //----------------------------------------------------- pGrids = Parameters("GRIDS") ->asGridList(); pRegression = Parameters("REGRESSION") ->asGrid(); pShapes = Parameters("SHAPES") ->asShapes(); iAttribute = Parameters("ATTRIBUTE") ->asInt(); P_in = Parameters("P_IN") ->asDouble() / 100.0; P_out = Parameters("P_OUT") ->asDouble() / 100.0; //----------------------------------------------------- if( !Get_Samples(pGrids, pShapes, iAttribute, Samples, Names) ) { return( false ); } //----------------------------------------------------- m_Regression.Set_With_Intercept(Parameters("INTERCEPT")->asBool()); switch( Parameters("METHOD")->asInt() ) { default: case 0: bResult = m_Regression.Get_Model (Samples , &Names); break; case 1: bResult = m_Regression.Get_Model_Forward (Samples, P_in , &Names); break; case 2: bResult = m_Regression.Get_Model_Backward(Samples, P_out, &Names); break; case 3: bResult = m_Regression.Get_Model_Stepwise(Samples, P_in, P_out, &Names); break; } if( bResult == false ) { return( false ); } //----------------------------------------------------- Message_Add(m_Regression.Get_Info(), false); //----------------------------------------------------- int CrossVal; switch( Parameters("CROSSVAL")->asInt() ) { default: CrossVal = 0; break; // none case 1: CrossVal = 1; break; // leave one out (LOOVC) case 2: CrossVal = 2; break; // 2-fold case 3: CrossVal = Parameters("CROSSVAL_K")->asInt(); break; // k-fold } if( CrossVal > 0 && m_Regression.Get_CrossValidation(CrossVal) ) { Message_Add(CSG_String::Format(SG_T("\n%s:\n" ), _TL("Cross Validation")), false); Message_Add(CSG_String::Format(SG_T("\t%s:\t%s\n" ), _TL("Type" ), Parameters("CROSSVAL")->asString() ), false); Message_Add(CSG_String::Format(SG_T("\t%s:\t%d\n" ), _TL("Samples"), m_Regression.Get_CV_nSamples() ), false); Message_Add(CSG_String::Format(SG_T("\t%s:\t%f\n" ), _TL("RMSE" ), m_Regression.Get_CV_RMSE() ), false); Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("NRMSE" ), m_Regression.Get_CV_NRMSE() * 100.0), false); Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("R2" ), m_Regression.Get_CV_R2() * 100.0), false); } //----------------------------------------------------- Set_Regression(pGrids, pRegression, CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Regression Model"))); Set_Residuals(pShapes, iAttribute, pRegression); //----------------------------------------------------- if( Parameters("INFO_COEFF")->asTable() ) { Parameters("INFO_COEFF")->asTable()->Assign(m_Regression.Get_Info_Regression()); Parameters("INFO_COEFF")->asTable()->Set_Name(_TL("MLRA Coefficients")); } if( Parameters("INFO_MODEL")->asTable() ) { Parameters("INFO_MODEL")->asTable()->Assign(m_Regression.Get_Info_Model()); Parameters("INFO_MODEL")->asTable()->Set_Name(_TL("MLRA Model")); } if( Parameters("INFO_STEPS")->asTable() ) { Parameters("INFO_STEPS")->asTable()->Assign(m_Regression.Get_Info_Steps()); Parameters("INFO_STEPS")->asTable()->Set_Name(_TL("MLRA Steps")); } //----------------------------------------------------- m_Regression.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoint_Multi_Grid_Regression::Get_Samples(CSG_Parameter_Grid_List *pGrids, CSG_Shapes *pShapes, int iAttribute, CSG_Matrix &Samples, CSG_Strings &Names) { int iGrid; double zGrid; CSG_Vector Sample; //----------------------------------------------------- int Interpolation = Parameters("INTERPOL") ->asInt(); bool bCoord_X = Parameters("COORD_X") ->asBool(); bool bCoord_Y = Parameters("COORD_Y") ->asBool(); Names += pShapes->Get_Field_Name(iAttribute); // Dependent Variable for(iGrid=0; iGridGet_Count(); iGrid++) // Independent Variables { Names += pGrids->asGrid(iGrid)->Get_Name(); } if( bCoord_X ) { Names += SG_T("X"); } if( bCoord_Y ) { Names += SG_T("Y"); } Sample.Create(1 + pGrids->Get_Count() + (bCoord_X ? 1 : 0) + (bCoord_Y ? 1 : 0)); //----------------------------------------------------- for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); if( !pShape->is_NoData(iAttribute) ) { Sample[0] = pShape->asDouble(iAttribute); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { bool bAdd = true; TSG_Point Point = pShape->Get_Point(iPoint, iPart); for(iGrid=0; iGridGet_Count() && bAdd; iGrid++) { if( pGrids->asGrid(iGrid)->Get_Value(Point, zGrid, Interpolation) ) { Sample[1 + iGrid] = zGrid; } else { bAdd = false; } } if( bAdd ) { if( bCoord_X ) { Sample[1 + iGrid++] = Point.x; } if( bCoord_Y ) { Sample[1 + iGrid++] = Point.y; } Samples.Add_Row(Sample); } } } } } //----------------------------------------------------- return( Samples.Get_NRows() >= pGrids->Get_Count() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoint_Multi_Grid_Regression::Set_Regression(CSG_Parameter_Grid_List *pGrids, CSG_Grid *pRegression, const CSG_String &Name) { if( !pRegression ) { return( false ); } //----------------------------------------------------- int iGrid, nGrids, x, y; TSG_Point p; int Interpolation = Parameters("INTERPOL") ->asInt(); CSG_Grid **ppGrids = (CSG_Grid **)SG_Malloc(m_Regression.Get_nPredictors() * sizeof(CSG_Grid *)); int iCoord_X = -1; int iCoord_Y = -1; for(iGrid=0, nGrids=0; iGridGet_Count() ) { ppGrids[nGrids++] = pGrids->asGrid(m_Regression.Get_Predictor(iGrid)); } else if( m_Regression.Get_Predictor(iGrid) == pGrids->Get_Count() && Parameters("COORD_X")->asBool() ) { iCoord_X = iGrid; } else // if( m_Regression.Get_Predictor(iGrid) > pGrids->Get_Count() || Parameters("COORD_X")->asBool() == false ) { iCoord_Y = iGrid; } } pRegression->Set_Name(Name); //----------------------------------------------------- for(y=0, p.y=Get_YMin(); yGet_Value(p, zGrid, Interpolation) ) { z += m_Regression.Get_RCoeff(iGrid) * zGrid; } else { bOkay = false; } } //--------------------------------------------- if( bOkay ) { if( iCoord_X >= 0 ) { z += m_Regression.Get_RCoeff(iCoord_X) * p.x; } if( iCoord_Y >= 0 ) { z += m_Regression.Get_RCoeff(iCoord_Y) * p.y; } pRegression->Set_Value (x, y, z); } else { pRegression->Set_NoData(x, y); } } } //----------------------------------------------------- SG_Free(ppGrids); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoint_Multi_Grid_Regression::Set_Residuals(CSG_Shapes *pShapes, int iAttribute, CSG_Grid *pRegression) { CSG_Shapes *pResiduals = Parameters("RESIDUALS")->asShapes(); if( !pRegression || !pResiduals ) { return( false ); } //----------------------------------------------------- pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Residuals"))); pResiduals->Add_Field(pShapes->Get_Field_Name(iAttribute), SG_DATATYPE_Double); pResiduals->Add_Field("TREND" , SG_DATATYPE_Double); pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double); int Interpolation = Parameters("INTERPOL")->asInt(); //------------------------------------------------- for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); if( !pShape->is_NoData(iAttribute) ) { double zShape = pShape->asDouble(iAttribute); for(int iPart=0; iPartGet_Part_Count(); iPart++) { for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { double zGrid; TSG_Point Point = pShape->Get_Point(iPoint, iPart); if( pRegression->Get_Value(Point, zGrid, Interpolation) ) { CSG_Shape *pResidual = pResiduals->Add_Shape(); pResidual->Add_Point(Point); pResidual->Set_Value(0, zShape); pResidual->Set_Value(1, zGrid); pResidual->Set_Value(2, zShape - zGrid); } } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // //----------------------------------------------------- // Parameters.Add_Choice( // NULL ,"CORRECTION" , _TL("Adjustment"), // _TL(""), // CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"), // _TL("Smith"), // _TL("Wherry 1"), // _TL("Wherry 2"), // _TL("Olkin & Pratt"), // _TL("Pratt"), // _TL("Claudy 3") // ), 1 // ); // // TSG_Regression_Correction m_Correction; // // switch( Parameters("CORRECTION")->asInt() ) // { // case 0: m_Correction = REGRESSION_CORR_Smith; break; // case 1: m_Correction = REGRESSION_CORR_Wherry_1; break; // case 2: m_Correction = REGRESSION_CORR_Wherry_2; break; // case 3: m_Correction = REGRESSION_CORR_Olkin_Pratt; break; // case 4: m_Correction = REGRESSION_CORR_Pratt; break; // case 5: m_Correction = REGRESSION_CORR_Claudy_3; break; // } // /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- point_multi_grid_regression.h000066400000000000000000000112641224124640700364720ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: point_multi_grid_regression.h 1349 2012-03-12 16:17:35Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // point_multi_grid_regression.h // // // // Copyright (C) 2004 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__point_multi_grid_regression_H #define HEADER_INCLUDED__point_multi_grid_regression_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoint_Multi_Grid_Regression : public CSG_Module_Grid { public: CPoint_Multi_Grid_Regression(void); protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: CSG_Regression_Multiple m_Regression; bool Get_Samples (CSG_Parameter_Grid_List *pGrids, CSG_Shapes *pShapes, int iAttribute, CSG_Matrix &Samples, CSG_Strings &Names); bool Set_Regression (CSG_Parameter_Grid_List *pGrids, CSG_Grid *pRegression, const CSG_String &Name); bool Set_Residuals (CSG_Shapes *pShapes, int iAttribute, CSG_Grid *pRegression); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__point_multi_grid_regression_H point_trend_surface.cpp000066400000000000000000000336161224124640700352570ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: point_trend_surface.cpp 1633 2013-03-22 13:35:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // point_trend_surface.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "point_trend_surface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoint_Trend_Surface::CPoint_Trend_Surface(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Polynomial Regression")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Reference:\n" " - Lloyd, C. (2010): Spatial Data Analysis - An Introduction for GIS Users. Oxford, 206p.\n" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); Parameters.Add_Table_Field( pNode , "ATTRIBUTE" , _TL("Attribute"), _TL("") ); Parameters.Add_Shapes( NULL , "RESIDUALS" , _TL("Residuals"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, SHAPE_TYPE_Point ); Parameters.Add_Choice( NULL , "POLYNOM" , _TL("Polynom"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("simple planar surface"), // a + bx + cy _TL("bi-linear saddle"), // a + bx + cy + dxy _TL("quadratic surface"), // a + bx + cy + dxy + ex2 + fy2 _TL("cubic surface"), // a + bx + cy + dxy + ex2 + fy2 + gx2y + hxy2 + ix3 + iy3 _TL("user defined") ), 0 ); pNode = Parameters.Add_Node( NULL , "NODE_USER" , _TL("User Defined Polynomial"), _TL("") ); Parameters.Add_Value( pNode , "XORDER" , _TL("Maximum X Order"), _TL(""), PARAMETER_TYPE_Int, 4, 1, true ); Parameters.Add_Value( pNode , "YORDER" , _TL("Maximum Y Order"), _TL(""), PARAMETER_TYPE_Int, 4, 1, true ); Parameters.Add_Value( pNode , "TORDER" , _TL("Maximum Total Order"), _TL(""), PARAMETER_TYPE_Int, 4, 0, true ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "TARGET" , _TL("Trend Surface"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("user defined"), _TL("grid") ), 0 ); m_Grid_Target.Add_Parameters_User(Add_Parameters("USER", _TL("User Defined Grid") , _TL(""))); m_Grid_Target.Add_Parameters_Grid(Add_Parameters("GRID", _TL("Choose Grid") , _TL(""))); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CPoint_Trend_Surface::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { return( m_Grid_Target.On_User_Changed(pParameters, pParameter) ? 1 : 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoint_Trend_Surface::On_Execute(void) { int iAttribute; CSG_Shapes *pPoints, *pResiduals; CSG_Grid *pRegression; //----------------------------------------------------- pPoints = Parameters("POINTS") ->asShapes(); pResiduals = Parameters("RESIDUALS") ->asShapes(); iAttribute = Parameters("ATTRIBUTE") ->asInt(); switch( Parameters("POLYNOM")->asInt() ) { case 0: m_xOrder = 1; m_yOrder = 1; m_tOrder = 1; break; // simple planar surface // a + bx + cy case 1: m_xOrder = 1; m_yOrder = 1; m_tOrder = 2; break; // bi-linear saddle"), // a + bx + cy + dxy case 2: m_xOrder = 2; m_yOrder = 2; m_tOrder = 2; break; // quadratic surface"), // a + bx + cy + dxy + ex2 + fy2 case 3: m_xOrder = 3; m_yOrder = 3; m_tOrder = 3; break; // cubic surface"), // a + bx + cy + dxy + ex2 + fy2 + gx2y + hxy2 + ix3 + iy3 case 4: m_xOrder = Parameters("XORDER")->asInt(); m_yOrder = Parameters("YORDER")->asInt(); m_tOrder = Parameters("TORDER")->asInt(); break; } //----------------------------------------------------- if( !Get_Regression(pPoints, iAttribute) ) { return( false ); } Set_Message(); //----------------------------------------------------- pRegression = NULL; switch( Parameters("TARGET")->asInt() ) { case 0: // user defined... if( m_Grid_Target.Init_User(pPoints->Get_Extent()) && Dlg_Parameters("USER") ) { pRegression = m_Grid_Target.Get_User(); } break; case 1: // grid... if( Dlg_Parameters("GRID") ) { pRegression = m_Grid_Target.Get_Grid(); } break; } if( pRegression == NULL ) { return( false ); } //----------------------------------------------------- pRegression->Set_Name(CSG_String::Format(SG_T("%s [%s]"), Parameters("ATTRIBUTE")->asString(), _TL("Trend Surface"))); Set_Regression(pRegression); Set_Residuals(pPoints, iAttribute, pResiduals, pRegression); m_Coefficients.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_String CPoint_Trend_Surface::Get_Power(const SG_Char *Value, int Power) { if( Power > 0 ) { if( Power > 1 ) { return( CSG_String::Format(SG_T("%s%d"), Value, Power) ); } return( Value ); } return( SG_T("") ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPoint_Trend_Surface::Get_Regression(CSG_Shapes *pPoints, int iAttribute) { //----------------------------------------------------- int i, j, Field; m_Names.Clear(); m_Names += pPoints->Get_Name(); for(i=1; i<=m_xOrder; i++) { m_Names += Get_Power(SG_T("x"), i); } for(i=1; i<=m_yOrder; i++) { m_Names += Get_Power(SG_T("y"), i); for(j=1; j<=m_xOrder && iGet_Count()); X.Create(m_Names.Get_Count(), pPoints->Get_Count()); xPow.Create(m_xOrder + 1); yPow.Create(m_yOrder + 1); xPow[0] = 1.0; yPow[0] = 1.0; //----------------------------------------------------- for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pPoints->Get_Count()); iShape++) { CSG_Shape *pShape = pPoints->Get_Shape(iShape); if( !pShape->is_NoData(iAttribute) ) { double zShape = pShape->asDouble(iAttribute); TSG_Point Point = pShape->Get_Point(0); Y[iShape] = zShape; X[iShape][0] = 1.0; for(i=1, Field=1; i<=m_xOrder; i++) { X[iShape][Field++] = xPow[i] = xPow[i - 1] * Point.x; } for(i=1; i<=m_yOrder; i++) { X[iShape][Field++] = yPow[i] = yPow[i - 1] * Point.y; for(j=1; j<=m_xOrder && iGet_YMin(); yGet_NY() && Set_Progress(y, pRegression->Get_NY()); y++, Point.y+=pRegression->Get_Cellsize()) { for(x=0, Point.x=pRegression->Get_XMin(); xGet_NX(); x++, Point.x+=pRegression->Get_Cellsize()) { z = m_Coefficients[0]; for(i=1, Field=1; i<=m_xOrder; i++) { z += m_Coefficients[Field++] * (xPow[i] = xPow[i - 1] * Point.x); } for(i=1; i<=m_yOrder; i++) { z += m_Coefficients[Field++] * (yPow[i] = yPow[i - 1] * Point.y); for(j=1; j<=m_xOrder && iSet_Value(x, y, z); } } DataObject_Update(pRegression); return( true ); } //--------------------------------------------------------- bool CPoint_Trend_Surface::Set_Residuals(CSG_Shapes *pPoints, int iAttribute, CSG_Shapes *pResiduals, CSG_Grid *pRegression) { int iPoint, iPart, iShape; double zShape, zGrid; TSG_Point Point; CSG_Shape *pShape, *pResidual; //----------------------------------------------------- if( pResiduals ) { pResiduals->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), pPoints->Get_Name(), _TL("Residuals"))); pResiduals->Add_Field(pPoints->Get_Field_Name(iAttribute), SG_DATATYPE_Double); pResiduals->Add_Field("POLYNOM" , SG_DATATYPE_Double); pResiduals->Add_Field("RESIDUAL", SG_DATATYPE_Double); //------------------------------------------------- for(iShape=0; iShapeGet_Count() && Set_Progress(iShape, pPoints->Get_Count()); iShape++) { pShape = pPoints->Get_Shape(iShape); if( !pShape->is_NoData(iAttribute) ) { zShape = pShape->asDouble(iAttribute); for(iPart=0; iPartGet_Part_Count(); iPart++) { for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { Point = pShape->Get_Point(iPoint, iPart); if( pRegression->Get_Value(Point, zGrid) ) { pResidual = pResiduals->Add_Shape(); pResidual->Add_Point(Point); pResidual->Set_Value(0, zShape); pResidual->Set_Value(1, zGrid); pResidual->Set_Value(2, zShape - zGrid); } } } } } } //----------------------------------------------------- return( true ); } //--------------------------------------------------------- void CPoint_Trend_Surface::Set_Message(void) { int i; CSG_String s; //----------------------------------------------------- s += CSG_String::Format(SG_T("\n%s:"), _TL("Regression")); //----------------------------------------------------- s += CSG_String::Format(SG_T("\n z = A")); for(i=1; iGet_Identifier(), SG_T("TABLE")) ) { CSG_Table *pTable = pParameter->asTable(); CSG_Parameters *pPredictors = pParameters->Get_Parameter("PREDICTORS")->asParameters(); pPredictors->Del_Parameters(); if( pTable ) { for(int i=0; iGet_Field_Count(); i++) { if( SG_Data_Type_is_Numeric(pTable->Get_Field_Type(i)) ) { pPredictors->Add_Value(NULL, SG_Get_String(i, 0), pTable->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false); } } } } return( true ); } //--------------------------------------------------------- int CTable_Regression_Multiple_Base::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) ) { pParameters->Get_Parameter("P_IN" )->Set_Enabled(pParameter->asInt() == 1 || pParameter->asInt() == 3); // forward or stepwise pParameters->Get_Parameter("P_OUT")->Set_Enabled(pParameter->asInt() == 2 || pParameter->asInt() == 3); // backward or stepwise } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CROSSVAL")) ) { pParameters->Get_Parameter("CROSSVAL_K")->Set_Enabled(pParameter->asInt() == 3); // k-fold } return( 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTable_Regression_Multiple_Base::On_Execute(void) { //----------------------------------------------------- CSG_Parameters *pPredictors = Parameters("PREDICTORS")->asParameters(); if( pPredictors->Get_Count() <= 0 ) { Message_Add(_TL("no predictors available")); return( false ); } //----------------------------------------------------- int Dependent, iPredictor, nPredictors, *Predictors, iSample; CSG_Strings Names; CSG_Table *pTable; Dependent = Parameters("DEPENDENT")->asInt(); Predictors = new int[pPredictors->Get_Count()]; pTable = Parameters("TABLE")->asTable(); Names += pTable->Get_Field_Name(Dependent); for(iPredictor=0, nPredictors=0; iPredictorGet_Count(); iPredictor++) // Independent Variables { if( pPredictors->Get_Parameter(iPredictor)->asBool() ) { Names += pTable->Get_Field_Name( Predictors[nPredictors++] = CSG_String(pPredictors->Get_Parameter(iPredictor)->Get_Identifier()).asInt() ); } } if( nPredictors <= 0 ) { Message_Add(_TL("no predictors in selection")); delete[](Predictors); return( false ); } //----------------------------------------------------- CSG_Vector Sample(1 + nPredictors); CSG_Matrix Samples; for(iSample=0; iSampleGet_Count(); iSample++) { CSG_Table_Record *pRecord = pTable->Get_Record(iSample); if( !pRecord->is_NoData(Dependent) ) { bool bOkay = true; Sample[0] = pRecord->asDouble(Dependent); for(iPredictor=0; iPredictoris_NoData(Predictors[iPredictor]) ) { Sample[1 + iPredictor] = pRecord->asDouble(Predictors[iPredictor]); } else { bOkay = false; } } if( bOkay ) { Samples.Add_Row(Sample); } } } if( Samples.Get_NRows() <= 0 ) { Message_Add(_TL("no valid samples in data set")); delete[](Predictors); return( false ); } //----------------------------------------------------- CSG_Regression_Multiple Regression; double P_in = Parameters("P_IN" )->asDouble(); double P_out = Parameters("P_OUT")->asDouble(); switch( Parameters("METHOD")->asInt() ) { default: case 0: if( !Regression.Get_Model (Samples , &Names) ) return( false ); break; case 1: if( !Regression.Get_Model_Forward (Samples, P_in , &Names) ) return( false ); break; case 2: if( !Regression.Get_Model_Backward(Samples, P_out, &Names) ) return( false ); break; case 3: if( !Regression.Get_Model_Stepwise(Samples, P_in, P_out, &Names) ) return( false ); break; } Message_Add(Regression.Get_Info(), false); //----------------------------------------------------- int CrossVal; switch( Parameters("CROSSVAL")->asInt() ) { default: CrossVal = 0; break; // none case 1: CrossVal = 1; break; // leave one out (LOOVC) case 2: CrossVal = 2; break; // 2-fold case 3: CrossVal = Parameters("CROSSVAL_K")->asInt(); break; // k-fold } if( CrossVal > 0 && Regression.Get_CrossValidation(CrossVal) ) { Message_Add(CSG_String::Format(SG_T("\n%s:\n" ), _TL("Cross Validation")), false); Message_Add(CSG_String::Format(SG_T("\t%s:\t%s\n" ), _TL("Type" ), Parameters("CROSSVAL")->asString()), false); Message_Add(CSG_String::Format(SG_T("\t%s:\t%d\n" ), _TL("Samples"), Regression.Get_CV_nSamples() ), false); Message_Add(CSG_String::Format(SG_T("\t%s:\t%f\n" ), _TL("RMSE" ), Regression.Get_CV_RMSE() ), false); Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("NRMSE" ), Regression.Get_CV_NRMSE() * 100.0), false); Message_Add(CSG_String::Format(SG_T("\t%s:\t%.2f\n"), _TL("R2" ), Regression.Get_CV_R2() * 100.0), false); } //----------------------------------------------------- if( Parameters("INFO_COEFF")->asTable() ) { Parameters("INFO_COEFF")->asTable()->Assign(Regression.Get_Info_Regression()); Parameters("INFO_COEFF")->asTable()->Set_Name(_TL("MLRA Coefficients")); } if( Parameters("INFO_MODEL")->asTable() ) { Parameters("INFO_MODEL")->asTable()->Assign(Regression.Get_Info_Model()); Parameters("INFO_MODEL")->asTable()->Set_Name(_TL("MLRA Model")); } if( Parameters("INFO_STEPS")->asTable() ) { Parameters("INFO_STEPS")->asTable()->Assign(Regression.Get_Info_Steps()); Parameters("INFO_STEPS")->asTable()->Set_Name(_TL("MLRA Steps")); } //----------------------------------------------------- CSG_Table *pResults = Parameters("RESULTS")->asTable(); if( pResults != NULL && pResults != pTable ) { if( pResults->Get_ObjectType() == DATAOBJECT_TYPE_Shapes && pTable ->Get_ObjectType() == DATAOBJECT_TYPE_Shapes ) { ((CSG_Shapes *)pResults)->Create(*((CSG_Shapes *)pTable)); } else { pResults->Create(*pTable); } pResults->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pTable->Get_Name(), _TL("Regression"))); pTable = pResults; } //----------------------------------------------------- int Offset = pTable->Get_Field_Count(); pTable->Add_Field(_TL("PREDICTED"), SG_DATATYPE_Double); pTable->Add_Field(_TL("RESIDUAL" ), SG_DATATYPE_Double); for(iSample=0; iSampleGet_Count(); iSample++) { CSG_Table_Record *pRecord = pTable->Get_Record(iSample); bool bOkay = false; double z = Regression.Get_RConst(); if( !pRecord->is_NoData(Dependent) ) { for(iPredictor=0, bOkay=true; iPredictoris_NoData(Predictors[iPredictor]) ) { z += Regression.Get_RCoeff(Regression.Get_Predictor(iPredictor)) * pRecord->asDouble(Predictors[iPredictor]); } else { bOkay = false; } } } if( bOkay ) { pRecord->Set_Value(Offset + 0, z); pRecord->Set_Value(Offset + 1, z - pRecord->asDouble(Dependent)); } else { pRecord->Set_NoData(Offset + 0); pRecord->Set_NoData(Offset + 1); } } if( pTable != Parameters("RESULTS")->asTable() ) { DataObject_Update(pTable); } //----------------------------------------------------- delete[](Predictors); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Regression_Multiple::CTable_Regression_Multiple(void) : CTable_Regression_Multiple_Base() { Set_Name (_TL("Multiple Linear Regression Analysis")); Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL , "RESULTS" , _TL("Results"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Initialise(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Regression_Multiple_Shapes::CTable_Regression_Multiple_Shapes(void) : CTable_Regression_Multiple_Base() { Set_Name (_TL("Multiple Linear Regression Analysis (Shapes)")); Parameters.Add_Shapes( NULL , "TABLE" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "RESULTS" , _TL("Results"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Initialise(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- table_regression_multiple.h000066400000000000000000000114231224124640700361210ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/********************************************************** * Version $Id: table_regression_multiple.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // table_regression_multiple.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__table_regression_multiple_H #define HEADER_INCLUDED__table_regression_multiple_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Regression_Multiple_Base : public CSG_Module { protected: void Initialise (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); }; //--------------------------------------------------------- class CTable_Regression_Multiple : public CTable_Regression_Multiple_Base { public: CTable_Regression_Multiple(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Table") ); } }; //--------------------------------------------------------- class CTable_Regression_Multiple_Shapes : public CTable_Regression_Multiple_Base { public: CTable_Regression_Multiple_Shapes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Shapes") ); } }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__table_regression_multiple_H saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/table_trend.cpp000066400000000000000000000212711224124640700335560ustar00rootroot00000000000000/********************************************************** * Version $Id: Table_Trend.cpp 1098 2011-06-16 16:06:32Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // table_trend.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "table_trend.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CTable_Trend_Base::Initialise(void) { //----------------------------------------------------- Set_Author (SG_T("O.Conrad (c) 2006")); Set_Description (_TW( "" )); //----------------------------------------------------- CSG_Parameter *pNode = Parameters("TABLE"); Parameters.Add_Table_Field( pNode , "FIELD_X" , _TL("X Values"), _TL("") ); Parameters.Add_Table_Field( pNode , "FIELD_Y" , _TL("Y Values"), _TL("") ); Parameters.Add_String( NULL , "FORMULA" , _TL("Formula"), _TL(""), SG_T("m * x + b") ); Parameters.Add_Choice( NULL , "FORMULAS" , _TL("Pre-defined Formulas"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|"), _TL("Linear: a + b * x"), _TL("Quadric: a + b * x + c * x^2"), _TL("Cubic: a + b * x + c * x^2 + d * x^3"), _TL("Logarithmic: a + b * ln(x)"), _TL("Power: a + b * x^c"), _TL("a + b / x"), _TL("a + b * (1 - exp(-x / c))"), _TL("a + b * (1 - exp(-(x / c)^2))") ), 0 ); Parameters.Add_Table( NULL , "TREND" , _TL("Table (with Trend)"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); } //--------------------------------------------------------- int CTable_Trend_Base::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FORMULAS")) ) { const SG_Char *Formula; switch( pParameter->asInt() ) { default: return( false ); case 0: Formula = SG_T("a + b * x"); break; case 1: Formula = SG_T("a + b * x + c * x^2"); break; case 2: Formula = SG_T("a + b * x + c * x^2 + d * x^3"); break; case 3: Formula = SG_T("a + b * ln(x)"); break; case 4: Formula = SG_T("a + b * x^c"); break; case 5: Formula = SG_T("a + b / x"); break; case 6: Formula = SG_T("a + b * (1 - exp(-x / c))"); break; case 7: Formula = SG_T("a + b * (1 - exp(-(x / c)^2))"); break; } pParameters->Get_Parameter("FORMULA")->Set_Value(Formula); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FORMULA")) ) { if( !m_Trend.Set_Formula(pParameter->asString()) ) { Message_Dlg(m_Trend.Get_Error(), _TL("Error in Formula")); return( false ); } } return( true ); } //--------------------------------------------------------- bool CTable_Trend_Base::On_Execute(void) { int i, j, xField, yField; CSG_String Name; CSG_Table_Record *pRecord; CSG_Table *pTable; pTable = Parameters("TABLE") ->asTable(); xField = Parameters("FIELD_X") ->asInt(); yField = Parameters("FIELD_Y") ->asInt(); //----------------------------------------------------- if( m_Trend.Set_Formula(Parameters("FORMULA")->asString()) ) { m_Trend.Clr_Data(); for(i=0; iGet_Record_Count(); i++) { pRecord = pTable->Get_Record(i); m_Trend.Add_Data(pRecord->asDouble(xField), pRecord->asDouble(yField)); } //------------------------------------------------- if( m_Trend.Get_Trend() ) { Message_Add(SG_T("\n"), false); Message_Add(m_Trend.Get_Formula(), false); Message_Add(SG_T("\n"), false); Message_Add(CSG_String::Format(SG_T("R2 : %f"), 100.0 * m_Trend.Get_R2()), false); if( Parameters("TREND")->asTable() == NULL ) { pTable->Add_Field("TREND" , SG_DATATYPE_Double); for(i=0, j=pTable->Get_Field_Count()-1; iGet_Record(i); pRecord->Set_Value(j, m_Trend.Get_Value(m_Trend.Get_Data_X(i))); } } else { Name.Printf(SG_T("%s [%s]"), pTable->Get_Name(), _TL("Trend")); pTable = Parameters("TREND")->asTable(); pTable->Destroy(); pTable->Set_Name(Name); pTable->Add_Field("X" , SG_DATATYPE_Double); pTable->Add_Field("Y" , SG_DATATYPE_Double); pTable->Add_Field("Y_TREND" , SG_DATATYPE_Double); for(i=0; iAdd_Record(); pRecord->Set_Value(0, m_Trend.Get_Data_X(i)); pRecord->Set_Value(1, m_Trend.Get_Data_Y(i)); pRecord->Set_Value(2, m_Trend.Get_Value(m_Trend.Get_Data_X(i))); } } return( true ); } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Trend::CTable_Trend(void) : CTable_Trend_Base() { Set_Name (_TL("Trend Analysis")); Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Initialise(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Trend_Shapes::CTable_Trend_Shapes(void) : CTable_Trend_Base() { Set_Name (_TL("Trend Analysis (Shapes)")); Parameters.Add_Shapes( NULL , "TABLE" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Initialise(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_geostatistics/geostatistics/geostatistics_regression/table_trend.h000066400000000000000000000112651224124640700332250ustar00rootroot00000000000000/********************************************************** * Version $Id: Table_Trend.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // geostatistics_regression // // // //-------------------------------------------------------// // // // table_trend.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Table_Trend_H #define HEADER_INCLUDED__Table_Trend_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Trend_Base : public CSG_Module { protected: void Initialise (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: CSG_Trend m_Trend; }; //--------------------------------------------------------- class CTable_Trend : public CTable_Trend_Base { public: CTable_Trend(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Table") ); } }; //--------------------------------------------------------- class CTable_Trend_Shapes : public CTable_Trend_Base { public: CTable_Trend_Shapes(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Shapes") ); } }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Table_Trend_H saga-2.1.0+dfsg/src/modules_images/000077500000000000000000000000001224124640700171325ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/Makefile.am000066400000000000000000000000701224124640700211630ustar00rootroot00000000000000SUBDIRS = modules_imagery modules_opencv modules_vigra saga-2.1.0+dfsg/src/modules_images/Makefile.in000066400000000000000000000424751224124640700212130ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_images DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = modules_imagery modules_opencv modules_vigra all: all-recursive .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) --gnu src/modules_images/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_images/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_images/modules_imagery/000077500000000000000000000000001224124640700223175ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_imagery/Makefile.am000066400000000000000000000001341224124640700243510ustar00rootroot00000000000000SUBDIRS = imagery_classification imagery_rga imagery_segmentation imagery_svm imagery_tools saga-2.1.0+dfsg/src/modules_images/modules_imagery/Makefile.in000066400000000000000000000426221224124640700243720ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_images/modules_imagery DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = imagery_classification imagery_rga imagery_segmentation imagery_svm imagery_tools all: all-recursive .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) --gnu src/modules_images/modules_imagery/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_images/modules_imagery/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/000077500000000000000000000000001224124640700270275ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/MLB_Interface.cpp000066400000000000000000000115651224124640700321350ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1317 2012-01-26 13:43:10Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Imagery - Classification") ); case MLB_INFO_Author: return( SG_T("O. Conrad (c) 2002-11") ); case MLB_INFO_Description: return( _TL("Classification tools for grids.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Imagery|Classification") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "classify_supervised.h" #include "classify_cluster_analysis.h" #include "change_detection.h" #include "decision_tree.h" #include "classify_supervised_polygons.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CGrid_Classify_Supervised ); case 1: return( new CGrid_Cluster_Analysis ); case 2: return( new CChange_Detection ); case 3: return( new CDecision_Tree ); case 4: return( new CPolygon_Classify_Supervised ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/MLB_Interface.h000066400000000000000000000077751224124640700316120ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_discretisation_H #define HEADER_INCLUDED__grid_discretisation_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef grid_discretisation_EXPORTS #define grid_discretisation_EXPORT _SAGA_DLL_EXPORT #else #define grid_discretisation_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_discretisation_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/Makefile.am000066400000000000000000000014511224124640700310640ustar00rootroot00000000000000if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libimagery_classification.la libimagery_classification_la_SOURCES =\ change_detection.cpp\ classify_cluster_analysis.cpp\ classify_supervised.cpp\ classify_supervised_polygons.cpp\ decision_tree.cpp\ MLB_Interface.cpp\ change_detection.h\ classify_cluster_analysis.h\ classify_supervised.h\ classify_supervised_polygons.h\ decision_tree.h\ MLB_Interface.h libimagery_classification_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/Makefile.in000066400000000000000000000457211224124640700311050ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_images/modules_imagery/imagery_classification DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libimagery_classification_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libimagery_classification_la_OBJECTS = change_detection.lo \ classify_cluster_analysis.lo classify_supervised.lo \ classify_supervised_polygons.lo decision_tree.lo \ MLB_Interface.lo libimagery_classification_la_OBJECTS = \ $(am_libimagery_classification_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libimagery_classification_la_SOURCES) DIST_SOURCES = $(libimagery_classification_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libimagery_classification.la libimagery_classification_la_SOURCES = \ change_detection.cpp\ classify_cluster_analysis.cpp\ classify_supervised.cpp\ classify_supervised_polygons.cpp\ decision_tree.cpp\ MLB_Interface.cpp\ change_detection.h\ classify_cluster_analysis.h\ classify_supervised.h\ classify_supervised_polygons.h\ decision_tree.h\ MLB_Interface.h libimagery_classification_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_images/modules_imagery/imagery_classification/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_images/modules_imagery/imagery_classification/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libimagery_classification.la: $(libimagery_classification_la_OBJECTS) $(libimagery_classification_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libimagery_classification_la_OBJECTS) $(libimagery_classification_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/change_detection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/classify_cluster_analysis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/classify_supervised.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/classify_supervised_polygons.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decision_tree.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/change_detection.cpp000066400000000000000000000365101224124640700330230ustar00rootroot00000000000000/********************************************************** * Version $Id: change_detection.cpp 1128 2011-07-07 08:22:51Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // change_detection.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "change_detection.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CChange_Detection::CChange_Detection(void) { CSG_Parameter *pNode, *pTable; //----------------------------------------------------- Set_Name (_TL("Change Detection")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Change detection for classified grids." )); //----------------------------------------------------- pNode = Parameters.Add_Grid( NULL , "INITIAL" , _TL("Initial State"), _TL(""), PARAMETER_INPUT ); pTable = Parameters.Add_Table(pNode, "INI_LUT" , _TL("Look-up Table") , _TL(""), PARAMETER_INPUT_OPTIONAL); Parameters.Add_Table_Field(pTable, "INI_LUT_MIN", _TL("Value") , _TL(""), false); Parameters.Add_Table_Field(pTable, "INI_LUT_MAX", _TL("Value (Maximum)"), _TL(""), true ); Parameters.Add_Table_Field(pTable, "INI_LUT_NAM", _TL("Name") , _TL(""), true); pNode = Parameters.Add_Grid( NULL , "FINAL" , _TL("Final State"), _TL(""), PARAMETER_INPUT ); pTable = Parameters.Add_Table(pNode, "FIN_LUT" , _TL("Look-up Table") , _TL(""), PARAMETER_INPUT_OPTIONAL); Parameters.Add_Table_Field(pTable, "FIN_LUT_MIN", _TL("Value") , _TL(""), false); Parameters.Add_Table_Field(pTable, "FIN_LUT_MAX", _TL("Value (Maximum)"), _TL(""), true ); Parameters.Add_Table_Field(pTable, "FIN_LUT_NAM", _TL("Name") , _TL(""), true); Parameters.Add_Grid( NULL , "CHANGE" , _TL("Changes"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "NOCHANGE" , _TL("Report Unchanged Classes"), _TL(""), PARAMETER_TYPE_Bool, true ); pNode = Parameters.Add_Table( NULL , "CHANGES" , _TL("Changes"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( pNode , "OUTPUT" , _TL("Output as..."), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("cells"), _TL("percent"), _TL("area") ), 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CChange_Detection::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("INI_LUT")) ) { pParameters->Get_Parameter("INI_LUT_MIN")->Set_Enabled(pParameter->asTable() != NULL); pParameters->Get_Parameter("INI_LUT_MAX")->Set_Enabled(pParameter->asTable() != NULL); pParameters->Get_Parameter("INI_LUT_NAM")->Set_Enabled(pParameter->asTable() != NULL); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("FIN_LUT")) ) { pParameters->Get_Parameter("FIN_LUT_MIN")->Set_Enabled(pParameter->asTable() != NULL); pParameters->Get_Parameter("FIN_LUT_MAX")->Set_Enabled(pParameter->asTable() != NULL); pParameters->Get_Parameter("FIN_LUT_NAM")->Set_Enabled(pParameter->asTable() != NULL); } return( 1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CChange_Detection::On_Execute(void) { bool bNoChange; int iInitial, iFinal; CSG_Matrix Identity; CSG_Table Initial, Final, *pChanges; CSG_Grid *pInitial, *pFinal, *pChange; //----------------------------------------------------- pInitial = Parameters("INITIAL") ->asGrid(); pFinal = Parameters("FINAL") ->asGrid(); pChange = Parameters("CHANGE") ->asGrid(); pChanges = Parameters("CHANGES") ->asTable(); bNoChange = Parameters("NOCHANGE")->asBool(); if( !Get_Classes(Initial, pInitial, true) ) { Error_Set(_TL("no class definitions for initial state")); return( false ); } if( !Get_Classes(Final, pFinal, false) ) { Error_Set(_TL("no class definitions for final state")); return( false ); } if( !Get_Changes(Initial, Final, pChanges, Identity) ) { return( false ); } //----------------------------------------------------- for(int y=0; yasDouble(x, y)); iFinal = Get_Class(Final , pFinal ->asDouble(x, y)); if( bNoChange || !Identity[iInitial][iFinal] ) { pChanges->Get_Record(iInitial)->Add_Value(1 + iFinal, 1); pChange->Set_Value(x, y, (pChanges->Get_Field_Count() - 1) * iInitial + iFinal); } else { pChange->Set_Value(x, y, -1); } } } //----------------------------------------------------- CSG_Parameters P; if( DataObject_Get_Parameters(pChange, P) && P("COLORS_TYPE") && P("LUT") ) { CSG_Table *pLUT = P("LUT")->asTable(); CSG_Colors cRandom(pChanges->Get_Count()); cRandom.Random(); pLUT->Del_Records(); for(iInitial=0; iInitialGet_Count(); iInitial++) { CSG_Colors cRamp(pChanges->Get_Field_Count() - 1); cRamp.Set_Ramp(cRandom[iInitial], cRandom[iInitial]); cRamp.Set_Ramp_Brighness(225, 50); for(iFinal=0; iFinalGet_Field_Count()-1; iFinal++) { if( pChanges->Get_Record(iInitial)->asInt(1 + iFinal) > 0 ) { CSG_Table_Record *pClass = pLUT->Add_Record(); pClass->Set_Value(0, cRamp.Get_Color(iFinal)); pClass->Set_Value(1, CSG_String::Format(SG_T("%s >> %s"), pChanges->Get_Record(iInitial)->asString(0), pChanges->Get_Field_Name(1 + iFinal))); pClass->Set_Value(3, (pChanges->Get_Field_Count() - 1) * iInitial + iFinal); pClass->Set_Value(4, (pChanges->Get_Field_Count() - 1) * iInitial + iFinal); } } } P("COLORS_TYPE")->Set_Value(1); // Color Classification Type: Lookup Table DataObject_Set_Parameters(pChange, P); } //----------------------------------------------------- double Factor; switch( Parameters("OUTPUT")->asInt() ) { default: Factor = 1.0; break; // cells case 1: Factor = 100.0 / Get_NCells(); break; // percent case 2: Factor = M_SQR(Get_Cellsize()); break; // area } if( Factor != 1.0 ) { for(iInitial=0; iInitialGet_Count(); iInitial++) { for(iFinal=0; iFinalGet_Field_Count()-1; iFinal++) { pChanges->Get_Record(iInitial)->Mul_Value(1 + iFinal, Factor); } } } //----------------------------------------------------- pChanges ->Set_Name(CSG_String::Format(SG_T("%s [%s >> %s]"), _TL("Changes"), pInitial->Get_Name(), pFinal->Get_Name())); pChange ->Set_Name(CSG_String::Format(SG_T("%s [%s >> %s]"), _TL("Changes"), pInitial->Get_Name(), pFinal->Get_Name())); pChange ->Set_NoData_Value(-1); return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { CLASS_NAM = 0, CLASS_MIN, CLASS_MAX }; //--------------------------------------------------------- bool CChange_Detection::Get_Classes(CSG_Table &Classes, CSG_Grid *pGrid, bool bInitial) { CSG_Table *pClasses; Classes.Destroy(); Classes.Add_Field(_TL("NAME") , SG_DATATYPE_String); Classes.Add_Field(_TL("MIN") , SG_DATATYPE_Double); Classes.Add_Field(_TL("MAX") , SG_DATATYPE_Double); //----------------------------------------------------- if( (pClasses = Parameters(bInitial ? "INI_LUT" : "FIN_LUT")->asTable()) != NULL ) { int fNam = Parameters(bInitial ? "INI_LUT_NAM" : "FIN_LUT_NAM")->asInt(); int fMin = Parameters(bInitial ? "INI_LUT_MIN" : "FIN_LUT_MIN")->asInt(); int fMax = Parameters(bInitial ? "INI_LUT_MAX" : "FIN_LUT_MAX")->asInt(); if( fNam < 0 || fNam >= pClasses->Get_Field_Count() ) { fNam = fMin; } if( fMax < 0 || fMax >= pClasses->Get_Field_Count() ) { fMax = fMin; } for(int iClass=0; iClassGet_Count(); iClass++) { CSG_Table_Record *pClass = Classes.Add_Record(); pClass->Set_Value(CLASS_NAM, pClasses->Get_Record(iClass)->asString(fNam)); pClass->Set_Value(CLASS_MIN, pClasses->Get_Record(iClass)->asDouble(fMin)); pClass->Set_Value(CLASS_MAX, pClasses->Get_Record(iClass)->asDouble(fMax)); } } //----------------------------------------------------- else if( DataObject_Get_Parameter(pGrid, "LUT") ) { pClasses = DataObject_Get_Parameter(pGrid, "LUT")->asTable(); for(int iClass=0; iClassGet_Count(); iClass++) { CSG_Table_Record *pClass = Classes.Add_Record(); pClass->Set_Value(CLASS_NAM, pClasses->Get_Record(iClass)->asString(1)); pClass->Set_Value(CLASS_MIN, pClasses->Get_Record(iClass)->asDouble(3)); pClass->Set_Value(CLASS_MAX, pClasses->Get_Record(iClass)->asDouble(4)); } } //----------------------------------------------------- else { double z; for(long i=0; iasDouble(pGrid->Get_Sorted(i, false, false)); if( i == 0 || iz != z ) { CSG_Table_Record *pClass = Classes.Add_Record(); pClass->Set_Value(CLASS_NAM, z = iz); pClass->Set_Value(CLASS_MIN, z); pClass->Set_Value(CLASS_MAX, z); } } } //----------------------------------------------------- return( Classes.Get_Count() > 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CChange_Detection::Get_Changes(CSG_Table &Initial, CSG_Table &Final, CSG_Table *pChanges, CSG_Matrix &Identity) { int iInitial, iFinal; //----------------------------------------------------- Identity.Create(Final.Get_Count() + 1, Initial.Get_Count() + 1); for(iInitial=0; iInitialDestroy(); pChanges->Add_Field(_TL("Name"), SG_DATATYPE_String); for(iFinal=0; iFinalAdd_Field(Final[iFinal].asString(CLASS_NAM), SG_DATATYPE_Double); } pChanges->Add_Field(_TL("Unclassified"), SG_DATATYPE_Double); //----------------------------------------------------- for(iInitial=0; iInitialAdd_Record()->Set_Value(0, Initial[iInitial].asString(CLASS_NAM)); } pChanges->Add_Record()->Set_Value(0, _TL("Unclassified")); return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline int CChange_Detection::Cmp_Class(CSG_Table &Classes, double Value, int iClass) { CSG_Table_Record *pClass = Classes.Get_Record_byIndex(iClass); double min = pClass->asDouble(CLASS_MIN); if( Value < min ) { return( 1 ); } double max = pClass->asDouble(CLASS_MAX); return( min < max ? (Value < max ? 0 : -1) : (Value > min ? -1 : 0) ); } //--------------------------------------------------------- int CChange_Detection::Get_Class(CSG_Table &Classes, double Value) { int a, b, i, c; if( Classes.Get_Count() > 0 ) { if( Classes.Get_Index_Field(0) != CLASS_MIN || Classes.Get_Index_Order(0) != TABLE_INDEX_Ascending ) { Classes.Set_Index(CLASS_MIN, TABLE_INDEX_Ascending); } for(a=0, b=Classes.Get_Record_Count()-1; a < b; ) { i = a + (b - a) / 2; c = Cmp_Class(Classes, Value, i); if( c > 0 ) { b = b > i ? i : b - 1; } else if( c < 0 ) { a = a < i ? i : a + 1; } else { return( Classes.Get_Record_byIndex(i)->Get_Index() ); } } if( Cmp_Class(Classes, Value, a) == 0 ) { return( Classes.Get_Record_byIndex(a)->Get_Index() ); } if( a != b && Cmp_Class(Classes, Value, b) == 0 ) { return( Classes.Get_Record_byIndex(b)->Get_Index() ); } } return( Classes.Get_Count() ); // := unclassified } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/change_detection.h000066400000000000000000000114111224124640700324610ustar00rootroot00000000000000/********************************************************** * Version $Id: change_detection.h 1128 2011-07-07 08:22:51Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // change_detection.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__change_detection_H #define HEADER_INCLUDED__change_detection_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CChange_Detection : public CSG_Module_Grid { public: CChange_Detection(void); protected: virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: bool Get_Classes (CSG_Table &Classes, CSG_Grid *pGrid, bool bInitial); bool Get_Changes (CSG_Table &Initial, CSG_Table &Final, CSG_Table *pChanges, CSG_Matrix &Identity); int Cmp_Class (CSG_Table &Classes, double Value, int iClass); int Get_Class (CSG_Table &Classes, double Value); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__change_detection_H classify_cluster_analysis.cpp000066400000000000000000000572241224124640700347470ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/********************************************************** * Version $Id: classify_cluster_analysis.cpp 1084 2011-06-08 08:10:42Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // Grid_Cluster_Analysis.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "classify_cluster_analysis.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Cluster_Analysis::CGrid_Cluster_Analysis(void) { //----------------------------------------------------- Set_Name (_TL("Cluster Analysis for Grids")); Set_Author (SG_T("O.Conrad (c) 2001")); Set_Description (_TW( "Cluster Analysis for grids.\n\nReferences:\n\n" "Iterative Minimum Distance:\n" "- Forgy, E. (1965):\n" " 'Cluster Analysis of multivariate data: efficiency vs. interpretability of classifications',\n" " Biometrics 21:768\n\n" "Hill-Climbing:" "- Rubin, J. (1967):\n" " 'Optimal Classification into Groups: An Approach for Solving the Taxonomy Problem',\n" " J. Theoretical Biology, 15:103-144\n\n" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "CLUSTER" , _TL("Clusters"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Int ); Parameters.Add_Table( NULL , "STATISTICS" , _TL("Statistics"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Iterative Minimum Distance (Forgy 1965)"), _TL("Hill-Climbing (Rubin 1967)"), _TL("Combined Minimum Distance / Hillclimbing") ), 1 ); Parameters.Add_Value( NULL , "NCLUSTER" , _TL("Clusters"), _TL("Number of clusters"), PARAMETER_TYPE_Int, 10, 2, true ); Parameters.Add_Value( NULL , "NORMALISE" , _TL("Normalise"), _TL("Automatically normalise grids by standard deviation before clustering."), PARAMETER_TYPE_Bool, false ); //----------------------------------------------------- CSG_Parameter *pNode = Parameters.Add_Value(NULL , "OLDVERSION", _TL("Old Version"), _TL("slower but memory saving"), PARAMETER_TYPE_Bool, false); Parameters.Add_Value(pNode , "UPDATEVIEW", _TL("Update View"), _TL(""), PARAMETER_TYPE_Bool, true); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Cluster_Analysis::On_Execute(void) { if( Parameters("OLDVERSION")->asBool() ) { return( _On_Execute() ); } //----------------------------------------------------- bool bNormalize; long iFeature, iElement, nElements; CSG_Cluster_Analysis Analysis; CSG_Grid *pCluster; CSG_Parameter_Grid_List *pGrids; //----------------------------------------------------- pGrids = Parameters("GRIDS") ->asGridList(); pCluster = Parameters("CLUSTER") ->asGrid(); bNormalize = Parameters("NORMALISE") ->asBool(); if( !Analysis.Create(pGrids->Get_Count()) ) { return( false ); } //----------------------------------------------------- pCluster->Set_NoData_Value(-1.0); for(iElement=0, nElements=0; iElementGet_Count() && !bNoData; iFeature++) { if( pGrids->asGrid(iFeature)->is_NoData(iElement) ) { bNoData = true; } } if( bNoData || !Analysis.Add_Element() ) { pCluster->Set_Value(iElement, -1); } else { pCluster->Set_Value(iElement, 0); for(iFeature=0; iFeatureGet_Count(); iFeature++) { double d = pGrids->asGrid(iFeature)->asDouble(iElement); if( bNormalize ) { d = (d - pGrids->asGrid(iFeature)->Get_ArithMean()) / pGrids->asGrid(iFeature)->Get_StdDev(); } Analysis.Set_Feature(nElements, iFeature, d); } nElements++; } } if( nElements <= 1 ) { return( false ); } //----------------------------------------------------- bool bResult = Analysis.Execute(Parameters("METHOD")->asInt(), Parameters("NCLUSTER")->asInt()); for(iElement=0, nElements=0; iElementis_NoData(iElement) ) { pCluster->Set_Value(iElement, Analysis.Get_Cluster(nElements++)); } } Save_Statistics(pGrids, bNormalize, Analysis); Save_LUT(pCluster, Analysis.Get_nClusters()); return( bResult ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_Cluster_Analysis::Save_Statistics(CSG_Parameter_Grid_List *pGrids, bool bNormalize, const CSG_Cluster_Analysis &Analysis) { int iCluster, iFeature; CSG_String s; CSG_Table_Record *pRecord; CSG_Table *pTable; pTable = Parameters("STATISTICS")->asTable(); pTable->Destroy(); pTable->Set_Name(_TL("Cluster Analysis")); pTable->Add_Field(_TL("ClusterID") , SG_DATATYPE_Int); pTable->Add_Field(_TL("Elements") , SG_DATATYPE_Int); pTable->Add_Field(_TL("Std.Dev.") , SG_DATATYPE_Double); s.Printf(SG_T("\n%s:\t%ld \n%s:\t%d \n%s:\t%d \n%s:\t%f\n\n%s\t%s\t%s"), _TL("Number of Elements") , Analysis.Get_nElements(), _TL("Number of Variables") , Analysis.Get_nFeatures(), _TL("Number of Clusters") , Analysis.Get_nClusters(), _TL("Standard Deviation") , sqrt(Analysis.Get_SP()), _TL("Cluster"), _TL("Elements"), _TL("Std.Dev.") ); for(iFeature=0; iFeatureasGrid(iFeature)->Get_Name()); pTable->Add_Field(pGrids->asGrid(iFeature)->Get_Name(), SG_DATATYPE_Double); } Message_Add(s); for(iCluster=0; iClusterAdd_Record(); pRecord->Set_Value(0, iCluster); pRecord->Set_Value(1, Analysis.Get_nMembers(iCluster)); pRecord->Set_Value(2, sqrt(Analysis.Get_Variance(iCluster))); for(iFeature=0; iFeatureasGrid(iFeature)->Get_ArithMean() + Centroid * pGrids->asGrid(iFeature)->Get_StdDev(); } s += CSG_String::Format(SG_T("\t%f"), Centroid); pRecord->Set_Value(iFeature + 3, Centroid); } Message_Add(s, false); } } //--------------------------------------------------------- void CGrid_Cluster_Analysis::Save_LUT(CSG_Grid *pCluster, int nClusters) { CSG_Parameters Parms; if( DataObject_Get_Parameters(pCluster, Parms) && Parms("COLORS_TYPE") && Parms("LUT") ) { CSG_Table_Record *pClass; CSG_Table *pLUT = Parms("LUT")->asTable(); for(int iCluster=0; iClusterGet_Record(iCluster)) == NULL ) { pClass = pLUT->Add_Record(); pClass->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX)); } pClass->Set_Value(1, CSG_String::Format(SG_T("%s %d"), _TL("Class"), iCluster + 1)); pClass->Set_Value(2, CSG_String::Format(SG_T("%s %d"), _TL("Class"), iCluster + 1)); pClass->Set_Value(3, iCluster); pClass->Set_Value(4, iCluster); } while( pLUT->Get_Record_Count() > nClusters ) { pLUT->Del_Record(pLUT->Get_Record_Count() - 1); } Parms("COLORS_TYPE")->Set_Value(1); // Color Classification Type: Lookup Table DataObject_Set_Parameters(pCluster, Parms); } } /////////////////////////////////////////////////////////// // // // // // // // // // // // // /////////////////////////////////////////////////////////// // // // Deprecated Old Version // // // /////////////////////////////////////////////////////////// // // // slow, but safes memory ! // // // // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Cluster_Analysis::_On_Execute(void) { int i, j, *nMembers, nCluster, nElements; double *Variances, **Centroids, SP; CSG_Grid **Grids, *pCluster; CSG_Parameter_Grid_List *pGrids; //----------------------------------------------------- pGrids = Parameters("GRIDS") ->asGridList(); pCluster = Parameters("CLUSTER") ->asGrid(); nCluster = Parameters("NCLUSTER")->asInt(); if( pGrids->Get_Count() < 1 ) { return( false ); } //----------------------------------------------------- Grids = (CSG_Grid **)SG_Malloc(pGrids->Get_Count() * sizeof(CSG_Grid *)); if( Parameters("NORMALISE")->asBool() ) { for(i=0; iGet_Count(); i++) { Grids[i] = SG_Create_Grid(pGrids->asGrid(i), SG_DATATYPE_Float); Grids[i] ->Assign(pGrids->asGrid(i)); Grids[i] ->Standardise(); } } else { for(i=0; iGet_Count(); i++) { Grids[i] = pGrids->asGrid(i); } } pCluster->Set_NoData_Value(-1.0); pCluster->Assign_NoData(); nMembers = (int *)SG_Malloc(nCluster * sizeof(int)); Variances = (double *)SG_Malloc(nCluster * sizeof(double)); Centroids = (double **)SG_Malloc(nCluster * sizeof(double *)); for(i=0; iGet_Count() * sizeof(double)); } //------------------------------------------------- switch( Parameters("METHOD")->asInt() ) { case 0: SP = _MinimumDistance (Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells()); break; case 1: SP = _HillClimbing (Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells()); break; case 2: SP = _MinimumDistance (Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells()); SP = _HillClimbing (Grids, pGrids->Get_Count(), pCluster, nCluster, nMembers, Variances, Centroids, nElements = Get_NCells()); break; } //------------------------------------------------- if( Parameters("NORMALISE")->asBool() ) { for(i=0; iGet_Count(); i++) { delete(Grids[i]); for(j=0; jasGrid(i)->Get_StdDev() * Centroids[j][i] + pGrids->asGrid(i)->Get_ArithMean(); } } } //------------------------------------------------- Save_LUT(pCluster, nCluster); //------------------------------------------------- int iCluster, iFeature; CSG_String s; CSG_Table_Record *pRecord; CSG_Table *pTable; pTable = Parameters("STATISTICS")->asTable(); pTable->Destroy(); pTable->Set_Name(_TL("Cluster Analysis")); pTable->Add_Field(_TL("ClusterID") , SG_DATATYPE_Int); pTable->Add_Field(_TL("Elements") , SG_DATATYPE_Int); pTable->Add_Field(_TL("Std.Dev.") , SG_DATATYPE_Double); s.Printf(SG_T("\n%s:\t%ld \n%s:\t%d \n%s:\t%d \n%s:\t%f\n\n%s\t%s\t%s"), _TL("Number of Elements") , nElements, _TL("Number of Variables") , pGrids->Get_Count(), _TL("Number of Clusters") , nCluster, _TL("Standard Deviation") , sqrt(SP), _TL("Cluster"), _TL("Elements"), _TL("Std.Dev.") ); for(iFeature=0; iFeatureGet_Count(); iFeature++) { s += CSG_String::Format(SG_T("\t%s"), pGrids->asGrid(iFeature)->Get_Name()); pTable->Add_Field(pGrids->asGrid(iFeature)->Get_Name(), SG_DATATYPE_Double); } Message_Add(s); for(iCluster=0; iClusterAdd_Record(); pRecord->Set_Value(0, iCluster); pRecord->Set_Value(1, nMembers[iCluster]); pRecord->Set_Value(2, sqrt(Variances[iCluster])); for(iFeature=0; iFeatureGet_Count(); iFeature++) { double Centroid = Centroids[iCluster][iFeature]; if( Parameters("NORMALISE")->asBool() ) { Centroid = pGrids->asGrid(iFeature)->Get_ArithMean() + Centroid * pGrids->asGrid(iFeature)->Get_StdDev(); } s += CSG_String::Format(SG_T("\t%f"), Centroid); pRecord->Set_Value(iFeature + 3, Centroid); } Message_Add(s, false); } //------------------------------------------------- for(i=0; iis_NoData(iElement) ) { bContinue = false; } } if( bContinue ) { if( pCluster->asInt(iElement) < 0 || pCluster->asInt(iElement) >= nCluster ) { pCluster->Set_Value(iElement, iElement % nCluster); } nClusterElements++; } else { pCluster->Set_Value(iElement, -1); } } if( Parameters("UPDATEVIEW")->asBool() ) { DataObject_Update(pCluster, 0, nCluster, true); } //----------------------------------------------------- for(nPasses=1, bContinue=true; bContinue && Process_Get_Okay(false); nPasses++) { for(iCluster=0; iClusterasInt(iElement) >= 0 ) { iCluster = pCluster->asInt(iElement); nMembers[iCluster]++; for(iGrid=0; iGridasDouble(iElement); } } } //------------------------------------------------- for(iCluster=0; iCluster 0 ? 1.0 / (double)nMembers[iCluster] : 0; for(iGrid=0; iGridasInt(iElement) >= 0 ) { minVariance = -1; for(iCluster=0; iClusterasDouble(iElement); Variance += d * d; } if( minVariance<0 || VarianceasInt(iElement) != minCluster ) { pCluster->Set_Value(iElement, minCluster); nShifts++; } SP += minVariance; Variances[minCluster] += minVariance; } } //------------------------------------------------- if( nShifts == 0 )//|| (SP_Last >= 0 && SP >= SP_Last) ) { bContinue = false; } SP /= nElements; Process_Set_Text(CSG_String::Format(SG_T("%s: %d >> %s %f"), _TL("pass") , nPasses, _TL("change") , SP_Last < 0.0 ? SP : SP_Last - SP )); SP_Last = SP; if( Parameters("UPDATEVIEW")->asBool() ) { DataObject_Update(pCluster, 0, nCluster); // Update_Output(); } } nElements = nClusterElements; return( SP ); } //--------------------------------------------------------- double CGrid_Cluster_Analysis::_HillClimbing(CSG_Grid **Grids, int nGrids, CSG_Grid *pCluster, int nCluster, int *nMembers, double *Variances, double **Centroids, int &nElements) { bool bContinue; int iElement, iGrid, iCluster, jCluster, kCluster, nClusterElements, noShift, nPasses; double d, e, n_iK, n_jK, V, VMin, V1, V2, SP, SP_Last = -1; //----------------------------------------------------- for(iCluster=0; iClusteris_NoData(iElement) ) { bContinue = false; } } if( bContinue ) { if( pCluster->asInt(iElement) < 0 || pCluster->asInt(iElement) >= nCluster ) { pCluster->Set_Value(iElement, iElement % nCluster); } nClusterElements++; iCluster = pCluster->asInt(iElement); nMembers[iCluster]++; V = 0.0; for(iGrid=0; iGridasDouble(iElement); Centroids[iCluster][iGrid] += d; V += d * d; } Variances[iCluster] += V; } else { pCluster->Set_Value(iElement, -1); } } //----------------------------------------------------- for(iCluster=0; iClusterasBool() ) { DataObject_Update(pCluster, 0, nCluster, true); } //----------------------------------------------------- noShift = 0; for(nPasses=1, bContinue=true; bContinue && Process_Get_Okay(false); nPasses++) { for(iElement=0; iElementasInt(iElement) >= 0 ) { if( noShift++ >= nElements ) { bContinue = false; } else { //------------------------------------- iCluster = pCluster->asInt(iElement); if( nMembers[iCluster] > 1 ) { V = 0.0; for(iGrid=0; iGridasDouble(iElement); V += d * d; } n_iK = nMembers[iCluster]; V1 = V * n_iK / (n_iK - 1.0); VMin = -1.0; //--------------------------------- for(jCluster=0; jClusterasDouble(iElement); V += d * d; } n_jK = nMembers[jCluster]; V2 = V * n_jK / (n_jK + 1.0); if( VMin < 0 || V2 < VMin ) { VMin = V2; kCluster = jCluster; } } } //--------------------------------- if( VMin >= 0 && VMin < V1 ) { noShift = 0; Variances[iCluster] -= V1; Variances[kCluster] += VMin; V1 = 1.0 / (n_iK - 1.0); n_jK = nMembers[kCluster]; V2 = 1.0 / (n_jK + 1.0); for(iGrid=0; iGridasDouble(iElement); Centroids[iCluster][iGrid] = (n_iK * Centroids[iCluster][iGrid] - d) * V1; Centroids[kCluster][iGrid] = (n_jK * Centroids[kCluster][iGrid] + d) * V2; } pCluster->Set_Value(iElement, kCluster); nMembers[iCluster]--; nMembers[kCluster]++; } } } } } //------------------------------------------------- for(iCluster=0, SP=0.0; iCluster> %s %f"), _TL("pass") , nPasses, _TL("change") , SP_Last < 0.0 ? SP : SP_Last - SP )); SP_Last = SP; if( Parameters("UPDATEVIEW")->asBool() ) { DataObject_Update(pCluster, 0, nCluster); // Update_Output(); } } nElements = nClusterElements; return( SP ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- classify_cluster_analysis.h000066400000000000000000000113671224124640700344120ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/********************************************************** * Version $Id: classify_cluster_analysis.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // classify_cluster_analysis.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Cluster_Analysis_H #define HEADER_INCLUDED__Grid_Cluster_Analysis_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Cluster_Analysis : public CSG_Module_Grid { public: CGrid_Cluster_Analysis(void); protected: virtual bool On_Execute (void); private: void Save_Statistics (CSG_Parameter_Grid_List *pGrids, bool bNormalize, const CSG_Cluster_Analysis &Analysis); void Save_LUT (CSG_Grid *pCluster, int nClusters); bool _On_Execute (void); double _MinimumDistance (CSG_Grid **Grids, int nGrids, CSG_Grid *pCluster, int nCluster, int *nMembers, double *Variances, double **Centroids, int &nElements); double _HillClimbing (CSG_Grid **Grids, int nGrids, CSG_Grid *pCluster, int nCluster, int *nMembers, double *Variances, double **Centroids, int &nElements); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Cluster_Analysis_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/classify_supervised.cpp000066400000000000000000000430551224124640700336300ustar00rootroot00000000000000/********************************************************** * Version $Id: classify_supervised.cpp 1646 2013-04-10 16:29:00Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // Grid_Classify_Supervised.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "classify_supervised.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { CLASS_ID = 0, CLASS_ROI_M, CLASS_ROI_S, CLASS_TOT_N, CLASS_ROI_N }; //--------------------------------------------------------- #define CLASS_NPARMS (CLASS_ROI_S - CLASS_ROI_M + 1) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Classify_Supervised::CGrid_Classify_Supervised(void) { int i; CSG_String s; CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Supervised Classification")); Set_Author (SG_T("O.Conrad (c) 2005")); Set_Description (_TW( "Supervised Classification" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); pNode = Parameters.Add_Shapes( NULL , "ROI" , _TL("Training Areas"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Table_Field( pNode , "ROI_ID" , _TL("Class Identifier"), _TL("") ); Parameters.Add_Table( NULL , "STATS" , _TL("Class Statistics"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table( NULL , "CLASS_INFO" , _TL("Summary"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "CLASSES" , _TL("Classification"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Short ); Parameters.Add_Grid( NULL , "QUALITY" , _TL("Quality"), _TL("Dependent on chosen method, these are distances or probabilities."), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL , "STATS_SRC" , _TL("Get Class Statistics from..."), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("training areas"), _TL("table") ), 0 ); for(i=0; i<=SG_CLASSIFY_SUPERVISED_WTA; i++) { s += CSG_Classifier_Supervised::Get_Name_of_Method(i) + SG_T("|"); } Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), s, SG_CLASSIFY_SUPERVISED_MinimumDistance ); Parameters.Add_Value( NULL , "NORMALISE" , _TL("Normalise"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "THRESHOLD_DIST" , _TL("Distance Threshold"), _TL("Let pixel stay unclassified, if minimum or mahalanobis distance is greater than threshold."), PARAMETER_TYPE_Double, 0.0, 0.0, true ); Parameters.Add_Value( NULL , "THRESHOLD_PROB" , _TL("Probability Threshold (Percent)"), _TL("Let pixel stay unclassified, if maximum likelihood probability is less than threshold."), PARAMETER_TYPE_Double, 0.0, 0.0, true, 100.0, true ); Parameters.Add_Choice( NULL , "RELATIVE_PROB" , _TL("Probability Reference"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("absolute"), _TL("relative") ), 1 ); Parameters.Add_Value( NULL , "THRESHOLD_ANGLE" , _TL("Spectral Angle Threshold (Degree)"), _TL("Let pixel stay unclassified, if spectral angle distance is greater than threshold."), PARAMETER_TYPE_Double, 0.0, 0.0, true, 90.0, true ); pNode = Parameters.Add_Node( NULL , "WTA" , _TL("Winner Takes All"), _TL("") ); for(i=0; iGet_Identifier(), SG_T("STATS_SRC")) ) { int Value = pParameter->asInt(); pParameters->Get_Parameter("ROI" )->Set_Enabled(Value == 0); pParameters->Get_Parameter("STATS")->Set_Enabled(Value == 1); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) ) { int Value = pParameter->asInt(); pParameters->Get_Parameter("THRESHOLD_DIST" )->Set_Enabled(Value == SG_CLASSIFY_SUPERVISED_MinimumDistance || Value == SG_CLASSIFY_SUPERVISED_Mahalonobis); pParameters->Get_Parameter("THRESHOLD_PROB" )->Set_Enabled(Value == SG_CLASSIFY_SUPERVISED_MaximumLikelihood); pParameters->Get_Parameter("RELATIVE_PROB" )->Set_Enabled(Value == SG_CLASSIFY_SUPERVISED_MaximumLikelihood); pParameters->Get_Parameter("THRESHOLD_ANGLE")->Set_Enabled(Value == SG_CLASSIFY_SUPERVISED_SAM); pParameters->Get_Parameter("WTA" )->Set_Enabled(Value == SG_CLASSIFY_SUPERVISED_WTA); } //----------------------------------------------------- return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline double CGrid_Classify_Supervised::Get_Value(int x, int y, int iGrid) { CSG_Grid *pGrid = m_pGrids->asGrid(iGrid); return( m_bNormalise ? (pGrid->asDouble(x, y) - pGrid->Get_ArithMean()) / pGrid->Get_StdDev() : pGrid->asDouble(x, y) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Classify_Supervised::On_Execute(void) { int Method, Class, i; double Quality; //------------------------------------------------- m_pGrids = Parameters("GRIDS" )->asGridList(); m_pClasses = Parameters("CLASSES" )->asGrid(); m_pQuality = Parameters("QUALITY" )->asGrid(); m_bNormalise = Parameters("NORMALISE")->asBool(); Method = Parameters("METHOD" )->asInt(); m_Classifier.Set_Distance_Threshold (Parameters("THRESHOLD_DIST" )->asDouble()); m_Classifier.Set_Probability_Threshold(Parameters("THRESHOLD_PROB" )->asDouble() / 100.0); m_Classifier.Set_Probability_Relative (Parameters("RELATIVE_PROB" )->asBool ()); m_Classifier.Set_Angle_Threshold (Parameters("THRESHOLD_ANGLE")->asDouble() * M_DEG_TO_RAD); for(i=0; iasBool()); } //----------------------------------------------------- for(i=m_pGrids->Get_Count()-1; i>=0; i--) { if( m_pGrids->asGrid(i)->Get_ZRange() <= 0.0 ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("grid has been dropped"), m_pGrids->asGrid(i)->Get_Name())); m_pGrids->Del_Item(i); } } if( m_pGrids->Get_Count() <= 0 ) { Error_Set(_TL("no valid grid in list.")); return( false ); } //------------------------------------------------- Process_Set_Text(_TL("initializing")); if( !Initialize() ) { return( false ); } //------------------------------------------------- Process_Set_Text(_TL("running classification")); CSG_Vector Features(m_pGrids->Get_Count()); for(int y=0; yis_NoData(x, y) ) { for(i=0; iGet_Count(); i++) { Features[i] = Get_Value(x, y, i); } if( m_Classifier.Get_Class(Features, Class, Quality, Method) ) { m_pClasses->Set_Value(x, y, 1 + Class); } else { m_pClasses->Set_NoData(x, y); } if( m_pQuality ) { m_pQuality->Set_Value(x, y, Quality); } } } } return( Finalize() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Classify_Supervised::Initialize(void) { bool bNoData; int x, y, iGrid, iROI_ID; TSG_Point p; CSG_Shapes *pROIs; //----------------------------------------------------- m_pClasses->Set_NoData_Value(-1); m_pClasses->Assign(0.0); m_Classifier.Create(m_pGrids->Get_Count()); if( Parameters("STATS_SRC")->asInt() == 0 ) { pROIs = Parameters("ROI" )->asShapes(); iROI_ID = Parameters("ROI_ID")->asInt(); } else { pROIs = NULL; CSG_Table *pStats = Parameters("STATS")->asTable(); if( pStats->Get_Field_Count() < (1 + 2 * m_pGrids->Get_Count()) ) { Error_Set(_TL("not entries in statistics table.")); return( false ); } for(int iClass=0; iClassGet_Count(); iClass++) { CSG_Table_Record *pRecord = pStats->Get_Record(iClass); CSG_Simple_Statistics *pClass = m_Classifier.Get_Statistics(pRecord->asString(0)); for(iGrid=0; iGridGet_Count(); iGrid++) { pClass[iGrid].Create(pRecord->asDouble(1 + 2 * iGrid), pRecord->asDouble(2 + 2 * iGrid)); } } } //----------------------------------------------------- for(y=0, p.y=Get_YMin(); yGet_Count() && !bNoData; iGrid++) { if( m_pGrids->asGrid(iGrid)->is_NoData(x, y) ) { bNoData = true; } } if( bNoData ) { m_pClasses->Set_NoData(x, y); if( m_pQuality ) { m_pQuality->Set_NoData(x, y); } } else if( pROIs ) { for(int iROI=0; iROIGet_Count(); iROI++) { CSG_Simple_Statistics *pClass; CSG_Shape_Polygon *pROI = (CSG_Shape_Polygon *)pROIs->Get_Shape(iROI); if( pROI->Contains(p) && (pClass = m_Classifier.Get_Statistics(pROI->asString(iROI_ID))) != NULL ) { for(iGrid=0; iGridGet_Count(); iGrid++) { pClass[iGrid].Add_Value(Get_Value(x, y, iGrid)); } } } } } } //----------------------------------------------------- if( m_Classifier.Get_Class_Count() <= 0 ) { Error_Set(_TL("no training areas could be analysed.")); return( false ); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Classify_Supervised::Finalize(void) { int iClass, iGrid, iOffset, nClasses; CSG_String Name_Method, Name_Quality; CSG_Table *pTable; //----------------------------------------------------- Name_Method = CSG_Classifier_Supervised::Get_Name_of_Method (Parameters("METHOD")->asInt()); Name_Quality = CSG_Classifier_Supervised::Get_Name_of_Quality(Parameters("METHOD")->asInt()); //----------------------------------------------------- pTable = Parameters("CLASS_INFO")->asTable(); pTable->Destroy(); pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Class Information"), Name_Method.c_str())); pTable->Add_Field(_TL("ID") , SG_DATATYPE_String); // CLASS_ID for(iGrid=0; iGridGet_Count(); iGrid++) { pTable->Add_Field(CSG_String::Format(SG_T("B%02d_MEAN") , iGrid + 1), SG_DATATYPE_Double); // CLASS_ROI_M pTable->Add_Field(CSG_String::Format(SG_T("B%02d_STDDEV"), iGrid + 1), SG_DATATYPE_Double); // CLASS_ROI_S } pTable->Add_Field(_TL("TOT_N"), SG_DATATYPE_Int); // CLASS_TOT_N pTable->Add_Field(_TL("ROI_N"), SG_DATATYPE_Int); // CLASS_ROI_N for(iClass=0; iClassAdd_Record(); pRecord->Set_Value(CLASS_ID , m_Classifier.Get_Class_ID(iClass).c_str()); for(iGrid=0, iOffset=0; iGridasGrid(iGrid)->Get_ArithMean() : 0.0; double s = m_bNormalise ? m_pGrids->asGrid(iGrid)->Get_StdDev() : 1.0; pRecord->Set_Value(iOffset + CLASS_ROI_M , pStatistics->Get_Mean () * s + m); pRecord->Set_Value(iOffset + CLASS_ROI_S , pStatistics->Get_StdDev () * s); // pRecord->Set_Value(iOffset + CLASS_ROI_MIN, pStatistics->Get_Minimum() * s + m); // pRecord->Set_Value(iOffset + CLASS_ROI_MAX, pStatistics->Get_Maximum() * s + m); } pRecord->Set_Value(CLASS_NPARMS * m_Classifier.Get_Feature_Count() + 1, m_Classifier.Get_Statistics(iClass)->Get_Count()); pRecord->Set_Value(CLASS_NPARMS * m_Classifier.Get_Feature_Count() + 2, m_Classifier.Get_Element_Count(iClass)); } //----------------------------------------------------- CSG_Parameters P; if( DataObject_Get_Parameters(m_pClasses, P) && P("COLORS_TYPE") && P("LUT") ) { pTable = P("LUT")->asTable(); for(iClass=0, nClasses=0; iClass 0 ) { CSG_Table_Record *pRecord = pTable->Get_Record(nClasses++); if( pRecord == NULL ) { pRecord = pTable->Add_Record(); pRecord->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX)); } pRecord->Set_Value(1, m_Classifier.Get_Class_ID(iClass).c_str()); pRecord->Set_Value(2, m_Classifier.Get_Class_ID(iClass).c_str()); pRecord->Set_Value(3, iClass + 1); pRecord->Set_Value(4, iClass + 1); } } while( pTable->Get_Record_Count() > m_Classifier.Get_Class_Count() ) { pTable->Del_Record(pTable->Get_Record_Count() - 1); } P("COLORS_TYPE")->Set_Value(1); // Color Classification Type: Lookup Table DataObject_Set_Parameters(m_pClasses, P); } //----------------------------------------------------- m_pClasses->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Classification"), Name_Method.c_str())); if( m_pQuality ) { m_pQuality->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Classification Quality"), Name_Quality.c_str())); DataObject_Set_Colors(m_pQuality, 100, SG_COLORS_WHITE_GREEN); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/classify_supervised.h000066400000000000000000000112721224124640700332710ustar00rootroot00000000000000/********************************************************** * Version $Id: classify_supervised.h 1308 2012-01-12 15:27:56Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // Grid_Classify_Supervised.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Classify_Supervised_H #define HEADER_INCLUDED__Grid_Classify_Supervised_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Classify_Supervised : public CSG_Module_Grid { public: CGrid_Classify_Supervised(void); protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: bool m_bNormalise; CSG_Classifier_Supervised m_Classifier; CSG_Grid *m_pClasses, *m_pQuality; CSG_Parameter_Grid_List *m_pGrids; double Get_Value (int x, int y, int iGrid); bool Initialize (void); bool Finalize (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Classify_Supervised_H classify_supervised_polygons.cpp000066400000000000000000000360501224124640700355000ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/********************************************************** * Version $Id: classify_supervised.cpp 1308 2012-01-12 15:27:56Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // classify_supervised_polygons.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "classify_supervised_polygons.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { CLASS_ID = 0, CLASS_ROI_M, CLASS_ROI_S, CLASS_TOT_N, CLASS_ROI_N }; //--------------------------------------------------------- #define CLASS_NPARMS (CLASS_ROI_S - CLASS_ROI_M + 1) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPolygon_Classify_Supervised::CPolygon_Classify_Supervised(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Supervised Classification for Polygons")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "Supervised Classification" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "POLYGONS" , _TL("Polygons"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Table_Field( pNode , "CLASS_ID" , _TL("Class Identifier"), _TL("") ); Parameters.Add_Shapes( NULL , "CLASSES" , _TL("Classification"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Table( NULL , "CLASS_INFO" , _TL("Summary"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Parameters( NULL , "FEATURES" , _TL("Features"), _TL("") ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), CSG_Classifier_Supervised::Get_Name_of_Method(SG_CLASSIFY_SUPERVISED_MinimumDistance).c_str(), CSG_Classifier_Supervised::Get_Name_of_Method(SG_CLASSIFY_SUPERVISED_SAM).c_str() ), 0 ); Parameters.Add_Value( NULL , "NORMALISE" , _TL("Normalise"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "THRESHOLD_DIST" , _TL("Distance Threshold"), _TL("Let pixel stay unclassified, if minimum or mahalanobis distance is greater than threshold."), PARAMETER_TYPE_Double, 0.0, 0.0, true ); Parameters.Add_Value( NULL , "THRESHOLD_ANGLE" , _TL("Spectral Angle Threshold (Degree)"), _TL("Let pixel stay unclassified, if spectral angle distance is greater than threshold."), PARAMETER_TYPE_Double, 0.0, 0.0, true, 90.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CPolygon_Classify_Supervised::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("POLYGONS")) ) { CSG_Shapes *pShapes = pParameter->asShapes(); CSG_Parameters *pFeatures = pParameters->Get_Parameter("FEATURES")->asParameters(); pFeatures->Del_Parameters(); if( pShapes && pShapes->Get_Field_Count() > 0 ) { for(int i=0; iGet_Field_Count(); i++) { if( SG_Data_Type_is_Numeric(pShapes->Get_Field_Type(i)) ) { pFeatures->Add_Value(NULL, CSG_String::Format(SG_T("%d_FEATURE"), i), pShapes->Get_Field_Name(i), _TL(""), PARAMETER_TYPE_Bool, false); } } } } //----------------------------------------------------- return( 1 ); } //--------------------------------------------------------- int CPolygon_Classify_Supervised::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METHOD")) ) { int Value = pParameter->asInt(); pParameters->Get_Parameter("THRESHOLD_DIST" )->Set_Enabled(Value == 0); pParameters->Get_Parameter("THRESHOLD_ANGLE")->Set_Enabled(Value == 1); } //----------------------------------------------------- return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Classify_Supervised::On_Execute(void) { bool bNoData; int Method, Class, i, iPolygon; double Quality; //------------------------------------------------- m_pPolygons = Parameters("POLYGONS" )->asShapes(); m_Class_ID = Parameters("CLASS_ID" )->asInt(); m_pClasses = Parameters("CLASSES" )->asShapes(); m_bNormalise = Parameters("NORMALISE")->asBool(); Method = Parameters("METHOD" )->asInt(); m_Classifier.Set_Distance_Threshold (Parameters("THRESHOLD_DIST" )->asDouble()); m_Classifier.Set_Angle_Threshold (Parameters("THRESHOLD_ANGLE")->asDouble() * M_DEG_TO_RAD); switch( Method ) { default: case 0: Method = SG_CLASSIFY_SUPERVISED_MinimumDistance; break; case 1: Method = SG_CLASSIFY_SUPERVISED_SAM; break; } //------------------------------------------------- CSG_Parameters *pFeatures = Parameters("FEATURES")->asParameters(); m_Features = (int *)SG_Calloc(m_pPolygons->Get_Field_Count(), sizeof(int)); m_nFeatures = 0; for(i=0; iGet_Count(); i++) { if( pFeatures->Get_Parameter(i)->asBool() ) { m_Features[m_nFeatures++] = CSG_String(pFeatures->Get_Parameter(i)->Get_Identifier()).asInt(); } } if( m_nFeatures <= 0 ) { Error_Set(_TL("no features have been selected")); return( false ); } //------------------------------------------------- m_pClasses->Create(SHAPE_TYPE_Polygon, CSG_String::Format(SG_T("%s [%s]"), m_pPolygons->Get_Name(), _TL("Classified")), NULL, m_pPolygons->Get_Vertex_Type()); m_pClasses->Add_Field(_TL("CLASS_NR"), SG_DATATYPE_Int); m_pClasses->Add_Field(_TL("CLASS_ID"), SG_DATATYPE_String); m_pClasses->Add_Field(_TL("QUALITY" ), SG_DATATYPE_Double); CSG_Vector Features(m_nFeatures); m_Classifier.Create (m_nFeatures); //----------------------------------------------------- Process_Set_Text(_TL("analyzing known classes")); for(iPolygon=0; iPolygonGet_Count() && Set_Progress(iPolygon, m_pPolygons->Get_Count()); iPolygon++) { CSG_Shape *pPolygon = m_pPolygons->Get_Shape(iPolygon); if( SG_STR_LEN(pPolygon->asString(m_Class_ID)) > 0 ) { for(i=0, bNoData=false; iis_NoData(m_Features[i]) ) { bNoData = true; } else { Features[i] = pPolygon->asDouble(m_Features[i]); if( m_bNormalise ) { Features[i] = (Features[i] - m_pPolygons->Get_Mean(m_Features[i])) / m_pPolygons->Get_StdDev(m_Features[i]); } } } if( !bNoData ) { CSG_Simple_Statistics *pClass = m_Classifier.Get_Statistics(pPolygon->asString(m_Class_ID)); for(i=0; iGet_Count() && Set_Progress(iPolygon, m_pPolygons->Get_Count()); iPolygon++) { CSG_Shape *pPolygon = m_pPolygons->Get_Shape(iPolygon); for(i=0, bNoData=false; iis_NoData(m_Features[i]) ) { bNoData = true; } else { Features[i] = pPolygon->asDouble(m_Features[i]); if( m_bNormalise ) { Features[i] = (Features[i] - m_pPolygons->Get_Mean(m_Features[i])) / m_pPolygons->Get_StdDev(m_Features[i]); } } } if( !bNoData ) { if( m_Classifier.Get_Class(Features, Class, Quality, Method) ) { CSG_Shape *pClass = m_pClasses->Add_Shape(pPolygon); pClass->Set_Value(0, 1 + Class); pClass->Set_Value(1, m_Classifier.Get_Class_ID(Class)); pClass->Set_Value(2, Quality); } } } //----------------------------------------------------- Finalize(); SG_Free(m_Features); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPolygon_Classify_Supervised::Finalize(void) { int iClass, iFeature, iOffset, nClasses; CSG_String Name_Method, Name_Quality; CSG_Table *pTable; //----------------------------------------------------- Name_Method = CSG_Classifier_Supervised::Get_Name_of_Method (Parameters("METHOD")->asInt()); Name_Quality = CSG_Classifier_Supervised::Get_Name_of_Quality(Parameters("METHOD")->asInt()); //----------------------------------------------------- pTable = Parameters("CLASS_INFO")->asTable(); pTable->Destroy(); pTable->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Class Information"), Name_Method.c_str())); pTable->Add_Field(_TL("ID") , SG_DATATYPE_String); // CLASS_ID for(iFeature=0; iFeatureAdd_Field(CSG_String::Format(SG_T("B%02d_MEAN") , iFeature + 1), SG_DATATYPE_Double); // CLASS_ROI_M pTable->Add_Field(CSG_String::Format(SG_T("B%02d_STDDEV"), iFeature + 1), SG_DATATYPE_Double); // CLASS_ROI_S } pTable->Add_Field(_TL("TOT_N"), SG_DATATYPE_Int); // CLASS_TOT_N pTable->Add_Field(_TL("ROI_N"), SG_DATATYPE_Int); // CLASS_ROI_N for(iClass=0; iClassAdd_Record(); pRecord->Set_Value(CLASS_ID , m_Classifier.Get_Class_ID(iClass).c_str()); for(iFeature=0, iOffset=0; iFeatureGet_Mean (m_Features[iFeature]) : 0.0; double s = m_bNormalise ? m_pPolygons->Get_StdDev(m_Features[iFeature]) : 1.0; pRecord->Set_Value(iOffset + CLASS_ROI_M , pStatistics->Get_Mean () * s + m); pRecord->Set_Value(iOffset + CLASS_ROI_S , pStatistics->Get_StdDev () * s); // pRecord->Set_Value(iOffset + CLASS_ROI_MIN, pStatistics->Get_Minimum() * s + m); // pRecord->Set_Value(iOffset + CLASS_ROI_MAX, pStatistics->Get_Maximum() * s + m); } pRecord->Set_Value(CLASS_NPARMS * m_Classifier.Get_Feature_Count() + 1, m_Classifier.Get_Statistics(iClass)->Get_Count()); pRecord->Set_Value(CLASS_NPARMS * m_Classifier.Get_Feature_Count() + 2, m_Classifier.Get_Element_Count(iClass)); } //----------------------------------------------------- CSG_Parameters P; if( DataObject_Get_Parameters(m_pClasses, P) && P("COLORS_TYPE") && P("LUT") ) { pTable = P("LUT")->asTable(); for(iClass=0, nClasses=0; iClass 0 ) { CSG_Table_Record *pRecord = pTable->Get_Record(nClasses++); if( pRecord == NULL ) { pRecord = pTable->Add_Record(); pRecord->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX)); } pRecord->Set_Value(1, m_Classifier.Get_Class_ID(iClass).c_str()); pRecord->Set_Value(2, m_Classifier.Get_Class_ID(iClass).c_str()); pRecord->Set_Value(3, iClass + 1); pRecord->Set_Value(4, iClass + 1); } } while( pTable->Get_Record_Count() > m_Classifier.Get_Class_Count() ) { pTable->Del_Record(pTable->Get_Record_Count() - 1); } P.Set_Parameter("COLORS_TYPE", 1); // Color Classification Type: Lookup Table P.Set_Parameter("LUT_ATTRIB" , 0); // Lookup Table Attribute DataObject_Set_Parameters(m_pClasses, P); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- classify_supervised_polygons.h000066400000000000000000000111471224124640700351450ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/********************************************************** * Version $Id: classify_supervised.h 1308 2012-01-12 15:27:56Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // classify_supervised_polygons.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__classify_supervised_polygons_H #define HEADER_INCLUDED__classify_supervised_polygons_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPolygon_Classify_Supervised : public CSG_Module { public: CPolygon_Classify_Supervised(void); protected: virtual bool On_Execute (void); virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: bool m_bNormalise; int m_Class_ID, *m_Features, m_nFeatures; CSG_Classifier_Supervised m_Classifier; CSG_Shapes *m_pPolygons, *m_pClasses; bool Finalize (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__classify_supervised_polygons_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/decision_tree.cpp000066400000000000000000000251101224124640700323460ustar00rootroot00000000000000/********************************************************** * Version $Id: decision_tree.cpp 1081 2011-06-08 08:05:26Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // decision_tree.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "decision_tree.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CDecision_Tree::CDecision_Tree(void) { //----------------------------------------------------- Set_Name (_TL("Decision Tree")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Decision Tree" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "CLASSES" , _TL("Decision Tree"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Short ); //----------------------------------------------------- CSG_Parameter *pRoot = Parameters.Add_Parameters( NULL , "ROOT" , _TL("Decision"), _TL("") ); Add_Decision(pRoot->asParameters()); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CDecision_Tree::Add_Decision(CSG_Parameters *pDecision) { if( !pDecision || pDecision->Get_Count() > 0 ) { return( false ); } CSG_String ID, ID_Root = pDecision->Get_Identifier(); if( !ID_Root.Cmp(SG_T("ROOT")) ) ID_Root.Clear(); CSG_Parameter *pNode; pNode = pDecision->Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT, false ); pDecision->Add_Value( pNode , "THRESHOLD" , _TL("Threshold"), _TL(""), PARAMETER_TYPE_Double ); //----------------------------------------------------- ID = ID_Root + SG_T("A"); pNode = pDecision->Add_Node( NULL , ID + SG_T("|A") , _TL("Lower"), _TL("") ); pDecision->Add_String( pNode , ID + SG_T("|NAME"), _TL("Name"), _TL(""), ID ); pDecision->Add_Value( pNode , ID + SG_T("|NODE"), _TL("Children"), _TL(""), PARAMETER_TYPE_Bool, false ); pDecision->Add_Parameters( pNode , ID , _TL("Decision"), _TL("") )->asParameters()->Set_Name(ID); //----------------------------------------------------- ID = ID_Root + SG_T("B"); pNode = pDecision->Add_Node( NULL , ID + SG_T("|B") , _TL("Higher"), _TL("") ); pDecision->Add_String( pNode , ID + SG_T("|NAME"), _TL("Name"), _TL(""), ID ); pDecision->Add_Value( pNode , ID + SG_T("|NODE"), _TL("Children"), _TL(""), PARAMETER_TYPE_Bool, false ); pDecision->Add_Parameters( pNode , ID , _TL("Decision"), _TL("") ); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CDecision_Tree::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( CSG_String(pParameter->Get_Identifier()).Find(SG_T("NODE")) >= 0 ) { CSG_String ID = CSG_String(pParameter->Get_Identifier()).BeforeFirst(SG_T('|')); if( pParameter->asBool() ) { CSG_Parameters *pDecision = pParameters->Get_Parameter(ID)->asParameters(); pDecision->Set_Name(CSG_String::Format(SG_T("%s|%s"), pParameters->Get_Name().c_str(), pParameters->Get_Parameter(ID + SG_T("|NAME"))->asString())); Add_Decision(pDecision); } else { pParameters->Get_Parameter(ID)->asParameters()->Del_Parameters(); } } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("GRID")) ) { if( pParameter->asGrid() ) { pParameters->Get_Parameter("THRESHOLD")->Set_Value(pParameter->asGrid()->Get_ArithMean()); } } return( 0 ); } //--------------------------------------------------------- int CDecision_Tree::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( CSG_String(pParameter->Get_Identifier()).Find(SG_T("NODE")) >= 0 ) { CSG_String ID = CSG_String(pParameter->Get_Identifier()).BeforeFirst(SG_T('|')); pParameters->Get_Parameter(ID)->Set_Enabled(pParameter->asBool()); } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CDecision_Tree::On_Execute(void) { CSG_Grid *pClasses; //----------------------------------------------------- pClasses = Parameters("CLASSES") ->asGrid(); pClasses ->Set_NoData_Value(-1); //----------------------------------------------------- for(int y=0; ySet_Value(x, y, Get_Class(Parameters("ROOT")->asParameters(), Get_System()->Get_Grid_to_World(x, y))); } } //----------------------------------------------------- CSG_Parameters P; if( DataObject_Get_Parameters(pClasses, P) && P("COLORS_TYPE") && P("LUT") ) { CSG_Table *pTable = P("LUT")->asTable(); pTable->Del_Records(); Get_Class(Parameters("ROOT")->asParameters(), pTable); P("COLORS_TYPE")->Set_Value(1); // Color Classification Type: Lookup Table DataObject_Set_Parameters(pClasses, P); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CDecision_Tree::Get_Class(const CSG_String &ID) { int Class = 0; for(int i=0, j=1; iGet_Parameter("GRID")->asGrid(); if( pGrid && pGrid->Get_Value(Point, Value) ) { CSG_String ID = pDecision->Get_Identifier(); if( !ID.Cmp(SG_T("ROOT")) ) ID.Clear(); ID += Value < pDecision->Get_Parameter("THRESHOLD")->asDouble() ? SG_T("A") : SG_T("B"); if( pDecision->Get_Parameter(ID + SG_T("|NODE"))->asBool() ) { return( Get_Class(pDecision->Get_Parameter(ID)->asParameters(), Point) ); } else { return( Get_Class(ID) ); } } return( -1 ); } //--------------------------------------------------------- int CDecision_Tree::Get_Class(CSG_Parameters *pDecision, CSG_Table *pTable) { CSG_String ID_Root = pDecision->Get_Identifier(); if( !ID_Root.Cmp(SG_T("ROOT")) ) ID_Root.Clear(); for(int Child=0; Child<=1; Child++) { CSG_String ID = ID_Root + (Child == 0 ? SG_T("A") : SG_T("B")); if( pDecision->Get_Parameter(ID + SG_T("|NODE"))->asBool() ) { Get_Class(pDecision->Get_Parameter(ID)->asParameters(), pTable); } else { CSG_Table_Record *pRecord = pTable->Add_Record(); pRecord->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX)); pRecord->Set_Value(1, pDecision->Get_Parameter(ID + SG_T("|NAME"))->asString()); pRecord->Set_Value(2, pDecision->Get_Parameter(ID + SG_T("|NAME"))->asString()); pRecord->Set_Value(3, Get_Class(ID)); pRecord->Set_Value(4, Get_Class(ID)); } } return( pTable->Get_Count() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_classification/decision_tree.h000066400000000000000000000114311224124640700320140ustar00rootroot00000000000000/********************************************************** * Version $Id: decision_tree.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // decision_tree.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__decision_tree_H #define HEADER_INCLUDED__decision_tree_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CDecision_Tree : public CSG_Module_Grid { public: CDecision_Tree(void); protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: bool Add_Decision (CSG_Parameters *pDecision); int Get_Class (const CSG_String &ID); int Get_Class (CSG_Parameters *pDecision, const TSG_Point &Point); int Get_Class (CSG_Parameters *pDecision, CSG_Table *pTable); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__decision_tree_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_rga/000077500000000000000000000000001224124640700246055ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_rga/MLB_Interface.cpp000066400000000000000000000106501224124640700277050ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_rga // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2009 by // // SAGA User Group Assoc. // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: author@email.de // // // // contact: Author // // Sesame Street. 7 // // 12345 Metropolis // // Nirwana // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Imagery - Fast Region Growing Algorithm") ); case MLB_INFO_Author: return( SG_T("SAGA User Group Assoc. (c) 2009") ); case MLB_INFO_Description: return( _TL("Image segmentation algorithms.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Imagery|Segmentation") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "fast_region_growing.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CFast_Region_Growing ); default: return( NULL ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_rga/MLB_Interface.h000066400000000000000000000066771224124640700273700ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_rga // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Author // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: author@email.de // // // // contact: Author // // Sesame Street. 7 // // 12345 Metropolis // // Nirwana // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__imagery_segmentation_H #define HEADER_INCLUDED__imagery_segmentation_H //--------------------------------------------------------- #include //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__imagery_segmentation_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_rga/Makefile.am000066400000000000000000000011701224124640700266400ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libimagery_rga.la libimagery_rga_la_SOURCES =\ fast_region_growing.cpp\ MLB_Interface.cpp\ fast_region_growing.h\ MLB_Interface.h libimagery_rga_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_rga/Makefile.in000066400000000000000000000443021224124640700266550ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_images/modules_imagery/imagery_rga DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libimagery_rga_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libimagery_rga_la_OBJECTS = fast_region_growing.lo MLB_Interface.lo libimagery_rga_la_OBJECTS = $(am_libimagery_rga_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libimagery_rga_la_SOURCES) DIST_SOURCES = $(libimagery_rga_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libimagery_rga.la libimagery_rga_la_SOURCES = \ fast_region_growing.cpp\ MLB_Interface.cpp\ fast_region_growing.h\ MLB_Interface.h libimagery_rga_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_images/modules_imagery/imagery_rga/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_images/modules_imagery/imagery_rga/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libimagery_rga.la: $(libimagery_rga_la_OBJECTS) $(libimagery_rga_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libimagery_rga_la_OBJECTS) $(libimagery_rga_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fast_region_growing.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_rga/fast_region_growing.cpp000066400000000000000000000431571224124640700313570ustar00rootroot00000000000000/********************************************************** * Version $Id: fast_region_growing.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // imagery_rga // // // //-------------------------------------------------------// // // // fast_region_growing.cpp // // // // Copyright (C) 2009 // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@saga-gis.org // // // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "fast_region_growing.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int xTo[]={ 0, 1, 1, 1, 0,-1,-1,-1}; int yTo[]={ 1, 1, 0,-1,-1,-1, 0, 1}; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CPtrArray::Add(void * newElement) { if (m_size >= m_allocsize) { m_allocsize += 4; if (m_size == 0) { data = (void **) new int[4]; } // else // realloc(data,m_allocsize*sizeof(void*)); } data[m_size++] = newElement; return m_size; } //--------------------------------------------------------- void CPtrArray::RemoveAll() { if (m_allocsize) { m_size = 0; m_allocsize = 0; delete data; } }; //--------------------------------------------------------- void *** PointerMatrix(int NX, int NY) { int i; void *** ar; ar = (void ***) malloc(NY*sizeof(void **)); for (i = 0; i < NY; i++) { ar[i] = (void **) malloc(NX*sizeof(void *)); } return (ar); } //--------------------------------------------------------- void FreePointerMatrix(void *** data, int NX , int NY) { int i; for (i = 0; i < NY; i++) free(data[i]); free(data); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CCluster::CCluster() {} //--------------------------------------------------------- void CCluster::Create(int _dim) { dim = _dim; DataAscent = (TDataNodeList *) new TDataNodeList[dim]; } //--------------------------------------------------------- CCluster::~CCluster() { delete[] DataAscent; } //--------------------------------------------------------- void CCluster::Add(CDataNode ** node, int dim) { (*node)->sortdim = dim; DataAscent[dim].InsertSorted(*node); } //--------------------------------------------------------- void CCluster::Del(CDataNode * node, int dim) { DataAscent[dim].Remove(node); } //--------------------------------------------------------- CDataNode * CCluster::GetDataHead(int dim) { return DataAscent[dim].GetHead(); } //--------------------------------------------------------- float CCluster::Distance(CData *data) { float sum; int j; float val; BYTE bitmask; float max; RGADATA *vals = data->Values; max = -9999999.9f; for (bitmask = 0; bitmask < (2 <<(dim - 1)); bitmask++) { sum = 0; for (j = 0; j < dim; j++) { CDataNode * min_node = DataAscent[j].GetHead(); CDataNode * max_node = DataAscent[j].GetLast(); val = ((BYTE)(bitmask & (1 << j)) ? max_node->Data->Values[j]:min_node->Data->Values[j])- vals[j]; sum +=val*val; } if (sum > max) { max = sum; } } return max; } //--------------------------------------------------------- float CCluster::GetMaxVal(int dim) { CDataNode * head = DataAscent[dim].GetLast(); return head->Data->Values[dim]; } //--------------------------------------------------------- float CCluster::GetMinVal(int dim) { CDataNode * head = DataAscent[dim].GetHead(); return head->Data->Values[dim]; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CFast_Region_Growing::CFast_Region_Growing(void) { Set_Name (_TL("Fast Region Growing Algorithm")); Set_Author (SG_T("A.Ringeler (c) 2009")); Set_Description (_TW( "A fast region growing algorithm.\n" "\n" "References:\n" "Boehner, J., Selige, T., Ringeler, A. (2006): Image segmentation using representativeness analysis and region growing. " "In: Boehner, J., McCloy, K.R., Strobl, J. [Eds.]: SAGA Analysis and Modelling Applications. " "Goettinger Geographische Abhandlungen, Vol.115, " "pdf\n" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL, "INPUT" , _TL("Input Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "START" , _TL("Seeds Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "REP" , _TL("Smooth Rep"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Segmente"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL, "MEAN" , _TL("Mean"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CFast_Region_Growing::On_Execute(void) { pResult = Parameters("RESULT")->asGrid(); pMean = Parameters("MEAN")->asGrid(); nGrids = Parameters("INPUT")->asInt(); Grids =(CSG_Grid **)Parameters("INPUT")->asPointer(); CSG_Grid *StartGrid = Parameters("START")->asGrid(); CSG_Grid *RepGrid = Parameters("REP")->asGrid(); RepGrid = NULL; Process_Set_Text(_TL("Init RGA")); InitData((PGrid *)Grids, nGrids, StartGrid); Process_Set_Text(_TL("RGA")); RGA(); Process_Set_Text(_TL("Clear RGA")); GetClusterGrid(pResult); Get_Mean_Grid(); KillData(); return (true); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CFast_Region_Growing::Get_Mean_Grid() { int x,y; int n_seg; int *nr_elements; double *sum; n_seg = (int) pResult->Get_ZMax(); nr_elements = (int *) new int[n_seg+1]; sum = (double *) new double[n_seg+1]; for (x= 0; x <= n_seg+1; x++ ) { sum[x]=0.0; nr_elements[x] = 0; } for ( y = 0; y < NY; y++) { for ( x = 0; x < NX; x++) { int pos = pResult->asInt(x,y); if(pos >= 0) { nr_elements[pos]++; sum[pos] += Grids[0]->asDouble(x,y); } } } for ( y = 0; y < NY; y++) { for ( x = 0; x < NX; x++) { int pos = pResult->asInt(x,y); if(pos >= 0) { pMean->Set_Value(x,y,sum[pos]/nr_elements[pos]); } } } } void CFast_Region_Growing::GetClusterGrid(CSG_Grid *OutGrid) { for (int y = 0; y < NY; y++) { for (int x = 0; x < NX; x++) { OutGrid->Set_Value(x, y, pDataGrid[y][x]->ClusterNr); } } } void CFast_Region_Growing::InitData(CSG_Grid **InGrid, int dim, CSG_Grid *StartGrid) { NX = InGrid[0]->Get_NX(); NY = InGrid[0]->Get_NY(); m_dim = dim; BounderyList = (TBounderyNodeList *) new TDataNodeList(false); pClusterGrid = (PPCDataNode **) new PPCDataNode[dim]; pRandGrid = (PCBounderyArray **) PointerMatrix(NX, NY); int i; for (i = 0; i < dim; i++) { pClusterGrid[i] = (PCDataNode **) PointerMatrix(NX, NY); } pDataGrid = (PCData **) PointerMatrix(NX, NY); m_NrCluster = 0; int y; for (y = 1; y < NY - 1; y++) { for (int x = 1; x < NX - 1; x++) { if (!StartGrid->is_NoData(x, y) && StartGrid->asInt(x, y) > 0) { m_NrCluster++; } } } Cluster = (CCluster *) new CCluster[m_NrCluster + 1]; for (i = 0; i < m_NrCluster + 1; i++) { Cluster[i].Create(dim); } BounderyNodes = (CBounderyNode *) new CBounderyNode[NX*NY]; last = (float)(dim*LAST); for (y = 0; y < NY*NX; y++) { BounderyNodes[y].distance = (float)last; last += LASTINC; BounderyList->InsertSorted(&BounderyNodes[y]); } int x, k; for (y = 0; y < NY; y++) { for (x = 0; x < NX; x++) { pRandGrid[y][x] = (PCBounderyArray) new CPtrArray; RGADATA *tmp; tmp = (RGADATA *) new RGADATA[dim]; for (k = 0; k < dim; k++) { tmp[k] = InGrid[k]->asFloat(x, y)+ ((float)rand() / (float)RAND_MAX / 100.0f); } pDataGrid[y][x]= new CData(x, y, - 1, tmp); for (k = 0; k < dim; k++) { pClusterGrid[k][y][x] = (PCDataNode) new CDataNode(pDataGrid[y][x], k); } } } m_NrCluster=-1; for (y = 1; y < NY - 1; y++) { for (x = 1; x < NX - 1; x++) { if (!StartGrid->is_NoData(x, y) && StartGrid->asInt(x, y) > 0) { m_NrCluster++; AddClusterPoint(x, y, m_NrCluster); AddBounderyPoints(x, y, m_NrCluster); } } } } void CFast_Region_Growing::KillData() {int y, x, i; for (y = 0; y < NY; y++) { for (x = 0; x < NX; x++) { pRandGrid[y][x]->RemoveAll(); delete pRandGrid[y][x]; } } delete BounderyList; delete[] Cluster; for (y = 0; y < NY; y++) { for (x = 0; x < NX; x++) { delete pDataGrid[y][x]; } } delete[] BounderyNodes; FreePointerMatrix((void ***)pRandGrid, NX , NY); FreePointerMatrix((void ***)pDataGrid, NX , NY); for (i = 0; i < m_dim; i++) { FreePointerMatrix((void ***)pClusterGrid[i], NX, NY); } } inline void CFast_Region_Growing::AddBounderyNode(int x, int y, int cluster) { CBounderyNode * Bound = BounderyList->GetLast(); BounderyList->Remove(Bound); Bound->Data = pDataGrid[y][x]; Bound->ClusterNr = cluster; Bound->distance = Cluster[cluster].Distance(Bound->Data); //if(RepGrid) // Bound->distance/=(1.0+ RepGrid->asFloat(Bound->Data->x,Bound->Data->y)/1000.0); ///(1+ mRepGrid->asFloat(Bound->Data->x,Bound->Data->y)); pRandGrid[y][x]->Add(Bound); BounderyList->InsertSorted(Bound); } inline void CFast_Region_Growing::DelBounderyNode(CBounderyNode * Node) { BounderyList->Remove(Node); Node->distance = (float)(last += LASTINC); BounderyList->InsertSorted(Node); } inline void CFast_Region_Growing::DelBounderyPoints(int x, int y) { for (int i = 0; i < pRandGrid[y][x]->GetSize(); i++) { CBounderyNode * Node = (CBounderyNode *) pRandGrid[y][x]->GetAt(i); DelBounderyNode(Node); } pRandGrid[y][x]->RemoveAll(); } inline void CFast_Region_Growing::AddClusterPoint(int x, int y, int cluster) { pDataGrid[y][x]->ClusterNr = cluster; for (int k = 0; k < m_dim; k++) Cluster[cluster].Add(&pClusterGrid[k][y][x], k); } inline void CFast_Region_Growing::AddBounderyPoints(int x, int y, int cluster) { for (int i = 0; i < 8; i += 2) { int posx = x + xTo[i]; int posy = y + yTo[i]; if (pDataGrid[posy][posx]->ClusterNr == -1) { AddBounderyNode(posx, posy, cluster); } } } void CFast_Region_Growing::RGA() { int count = 0; CBounderyNode * Node= BounderyList->GetHead(); while (Node && Node->distance < m_dim*LAST) { int x = Node->Data->x; int y = Node->Data->y; if (!(x>1 && y > 1 && xGetHead(); continue; } if (pDataGrid[y][x]->ClusterNr == -1) { AddClusterPoint(x, y, Node->ClusterNr); DelBounderyPoints(x, y); AddBounderyPoints(x, y, Node->ClusterNr); Node= BounderyList->GetHead(); count ++; if (!(count%1000)) { Set_Progress(count, NX*NY); } } else { DelBounderyNode(Node); Node= BounderyList->GetHead(); } } } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CFast_Region_Growing::Histgram(char * FileName) { /* CSG_Grid Mittel(m_dim, m_NrCluster + 1, dtFloat); CSG_Grid Anzahl(m_dim, m_NrCluster + 1, dtInt); FILE * out = fopen((LPCSTR)FileName, "wt"); for (int c = 0; c < m_NrCluster; c++) { fprintf(out, "%d\t", c); for (int k = 0; k < m_dim; k++) { int hst[256]; int hstsum = 0; for (int i = 0; i < 256; i++) hst[i] = 0; float min, max; CDataNode * Data =Cluster[c].GetDataHead(k); min = max = Data->Data->Values[k]; Data = Data->Next; while (Data) { if (Data->Data->Values[k]>max) max = Data->Data->Values[k]; if (Data->Data->Values[k]Data->Values[k]; Data = Data->Next; } Data =Cluster[c].GetDataHead(k); while (Data) { hst[int((Data->Data->Values[k] - min)/ (max - min)*255)]++; Data = Data->Next; } for (i = 0; i < 256; i++) hstsum += hst[i]; int sum = 0; i = 0; while ((float)sum < 0.1* (float)hstsum) { if (i > 255) break; sum += hst[i++]; } fprintf(out, "%f ", (float)(i* (max - min))/255.0 + min); while ((float)sum < 0.5* (float)hstsum) { if (i > 255) break; sum += hst[i++]; } fprintf(out, "%f ", (float)(i* (max - min))/255.0 + min); while ((float)sum < 0.9* (float)hstsum) { if (i > 255) break; sum += hst[i++]; } fprintf(out, "%f ", (float)(i* (max - min))/255.0 + min); } fprintf(out, "\n"); } fclose(out); */ } //--------------------------------------------------------- void CFast_Region_Growing::Statistik(char * FileName) { /* CSG_Grid Mittel(dtFloat, m_dim, m_NrCluster + 1); CSG_Grid Anzahl(dtInt, m_dim, m_NrCluster + 1); CSG_Grid Var(dtFloat, m_dim, m_NrCluster + 1); float ** pVar =(float **)Var.Get_Array(); float ** pMittel = (float **)Mittel.Get_Array(); int ** pAnzahl = (int **) Anzahl.Get_Array(); for (int y = 0; y < NY; y++) { for (int x = 0; x < NX; x++) { int Clu = ((CData *) pDataGrid[y][x])->ClusterNr; if (Clu >= 0) for (int k = 0; k < m_dim; k++) { pMittel[Clu][k] = pMittel[Clu][k] + pDataGrid[y][x]->Values[k]; pVar[Clu][k] = pVar[Clu][k] + (pDataGrid[y][x]->Values[k]*pDataGrid[y][x]->Values[k]); pAnzahl[Clu][k] += 1; } } } for (int c = 0; c < m_NrCluster; c++) for (int k = 0; k < m_dim; k++) { pMittel[c][k] = pMittel[c][k]/pAnzahl[c][k]; pVar[c][k] = (pVar[c][k] - pMittel[c][k]*pMittel[c][k]*pAnzahl[c][k])/pAnzahl[c][k]; } FILE * out = fopen((LPCSTR)FileName, "wt"); for (c = 0; c < m_NrCluster; c++) { fprintf(out, "%d\t", c); for (int k = 0; k < m_dim; k++) { fprintf(out, "%d\t%f\t%f\t", pAnzahl[c][k], pMittel[c][k], pVar[c][k]); } fprintf(out, "\n"); } fclose(out); */ } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_rga/fast_region_growing.h000066400000000000000000000435531224124640700310240ustar00rootroot00000000000000/********************************************************** * Version $Id: fast_region_growing.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // imagery_rga // // // //-------------------------------------------------------// // // // fast_region_growing.h // // // // Copyright (C) 2009 // // Andre Ringeler // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: aringel@saga-gis.org // // // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Region_Growing_H #define HEADER_INCLUDED__Region_Growing_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define RGADATA float #define LAST 1.0e20f #define LASTINC 1.0e19f /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- typedef unsigned int DW; template class SListNode { public: T * Prev; T * Next; SListNode() { Prev=Next=NULL; }; virtual ~SListNode() { if (Prev || Next) Remove(); }; bool InsertThisBetween(T * before,T * after); bool Remove(T * previous=NULL); }; template inline bool SListNode::InsertThisBetween(T * before,T * after) { if (before) before->Next = (T*)this; if (after) after->Prev=(T*)this; Next=after; Prev=before; return true; }; template inline bool SListNode::Remove(T * previous) { if (Prev) Prev->Next=Next; if (Next) Next->Prev=Prev; Next=Prev=NULL; return true; }; enum QSL_SortTypes { LSort_Ascent, LSort_Ascent_Find, }; template class QTopNode : public SListNode > { public: DW SubNodesNum; QTopNode * Parent; QTopNode * Child; TBottomNode * BottomNode; QTopNode() { Child =NULL; SubNodesNum = 0; BottomNode = NULL; Parent = NULL; } virtual ~QTopNode() { if (this->Prev || this->Next || Parent || Child) Remove(); } TBottomNode * GetInsertionPoint(TBottomNode * node,QTopNode ** parent,TBottomNode ** insert_after,QSL_SortTypes sorttype); TBottomNode * GetBottomInsertionPoint(TBottomNode * start,TBottomNode * node,QTopNode ** parent,TBottomNode ** insert_after,QSL_SortTypes sorttype); bool InsertThisBetween(QTopNode * before,QTopNode * after); bool Remove(); bool SetChild(QTopNode* child); bool SetBottomNode(TBottomNode * node); QTopNode * GetChild(DW num); TBottomNode * GetBottomNode(DW num); QTopNode * GetParent(); QTopNode * GetTopNode(); bool SubNodeInserted(void * node); bool SubNodeRemoved(void * node); }; #define QTTopNode QTopNode template inline QTTopNode * QTTopNode::GetParent() { QTopNode * cur = this; while(cur) { if (cur->Parent) return cur->Parent; cur=cur->Prev; } return NULL; }; #define QTOPNODES_MIN 3 #define QTOPNODES_MAX 9 #define QBOTTOMNODES_MIN 10 #define QBOTTOMNODES_MAX 30 template inline bool QTTopNode::SubNodeInserted(void * node) { SubNodesNum++; if (!BottomNode) { BottomNode = (TBottomNode*)node; } if (!Child && ((TBottomNode*)node)->Next == BottomNode) { SetBottomNode((TBottomNode*)node); }; DW max_num = Child ? QTOPNODES_MAX : QBOTTOMNODES_MAX; if (SubNodesNum >= max_num) { QTopNode * new_node = new QTopNode; new_node->InsertThisBetween(this,this->Next); } return true; }; template inline bool QTTopNode::SubNodeRemoved(void * node) { SubNodesNum--; if (!Child && ((TBottomNode*)node) == BottomNode) { SetBottomNode(BottomNode->Next); }; if (Child == (QTTopNode*)node) { SetChild(Child->Next); } DW min_num = Child ? QTOPNODES_MIN : QBOTTOMNODES_MIN; bool top_node = !this->Prev && !Parent; if ((!top_node && SubNodesNum < min_num ) || (top_node && SubNodesNum == 1 && Child)) { if (!this->Prev) { if (this->Next) { QTTopNode * parent = GetParent(); if (parent) parent->SubNodeRemoved(this->Next); this->Next->Remove(); } else { if (Child) Remove(); } } else { QTTopNode * parent = GetParent(); if (parent) parent->SubNodeRemoved(this); Remove(); } } return true; }; template inline bool QTTopNode::Remove() { if (this->Prev) { this->Prev->SubNodesNum += SubNodesNum; } SetChild(NULL); SubNodesNum = 0; BottomNode = NULL; if (!SListNode::Remove()) return false; delete this; return true; } template inline bool QTTopNode::InsertThisBetween(QTTopNode * before,QTTopNode * after) { if (!SListNode::InsertThisBetween(before,after)) return false; SubNodesNum=this->Prev->SubNodesNum/2; this->Prev->SubNodesNum -= SubNodesNum; if (this->Prev->Child) { SetChild(this->Prev->GetChild(this->Prev->SubNodesNum)); BottomNode = Child->BottomNode; } else { BottomNode = this->Prev->GetBottomNode(this->Prev->SubNodesNum); } QTTopNode * parent = GetParent(); if (!parent) { if (!this->Prev && !this->Next) return true; parent = new QTTopNode; parent->SubNodesNum++; parent->SetChild(this->Prev); } parent->SubNodeInserted(this); return true; }; template inline QTTopNode * QTTopNode::GetChild(DW num) { QTTopNode * cur = Child; while(num--) { if (!cur) return NULL; cur = cur->Next; } return cur; }; template inline TBottomNode * QTTopNode::GetBottomNode(DW num) { TBottomNode * cur = BottomNode; while(num--) { if (!cur) return NULL; cur = cur->Next; } return cur; }; template inline bool QTTopNode::SetChild(QTopNode* child) { if (Child) { Child->Parent = NULL; Child = NULL; } if (!child) return true; if (child->Parent) child->Parent->Child = NULL; Child=child; child->Parent=this; SetBottomNode(Child->BottomNode); return true; }; template inline bool QTTopNode::SetBottomNode(TBottomNode * node) { QTTopNode * parent = this; while(parent) { parent->BottomNode=node; parent = parent->Parent; } return true; }; template inline QTTopNode * QTTopNode::GetTopNode() { QTopNode * cur = this; if (!this->Prev) { while(cur->Parent) cur = cur->Parent; } else { while(1) { QTTopNode * parent = cur->GetParent(); if (!parent) break; cur=parent; } } return cur; }; template inline TBottomNode * QTTopNode::GetInsertionPoint(TBottomNode * node,QTTopNode ** parent, TBottomNode ** insert_after, QSL_SortTypes sorttype) { QTTopNode * cur = this; TBottomNode * bottom; //------------------------------------------------------------ #define FIND_ALGORITHM(condition) \ {QTTopNode * prev=cur->Prev;\ while(1){\ bottom = cur->BottomNode;\ if (condition){\ if (!prev){ *parent = (QTTopNode *)0xFFFFFFFF; return bottom;}\ QTTopNode * child = prev->Child;\ if (child)\ return child->Next->GetInsertionPoint(node,parent,insert_after,sorttype);\ else {\ *parent = prev;\ return prev->GetBottomInsertionPoint(prev->BottomNode,node,parent,insert_after,sorttype);}\ }\ prev = cur;\ cur = cur->Next;\ if (!cur){ cur=prev; break;}\ }}\ break; //------------------------------------------------------------ switch(sorttype) { case LSort_Ascent: FIND_ALGORITHM((*node < *bottom)); case LSort_Ascent_Find: FIND_ALGORITHM((*node < *bottom)); } #undef FIND_ALGORITHM QTTopNode * child = cur->Child; if (child) return child->GetInsertionPoint(node,parent,insert_after,sorttype); else { *parent = cur; return cur->GetBottomInsertionPoint(cur->BottomNode,node,parent,insert_after,sorttype); } } template inline TBottomNode * QTTopNode::GetBottomInsertionPoint(TBottomNode * start,TBottomNode * node, QTTopNode ** parent, TBottomNode ** insert_after,QSL_SortTypes sorttype) { TBottomNode * cur = start; TBottomNode * prev = NULL; DW i = 0; //------------------------------------------------------------ #define FIND_ALGORITHM(condition) \ while(cur){\ if (condition) break;\ prev = cur; cur = cur ->Next;};\ break; //------------------------------------------------------------ switch(sorttype) { case LSort_Ascent: FIND_ALGORITHM((*node < *cur)); case LSort_Ascent_Find: FIND_ALGORITHM((*node < *cur)); } #undef FIND_ALGORITHM *insert_after = prev; if (this->Next && this->Next->BottomNode==cur) *parent=this->Next; return cur; }; template class SortList { QTopNode * TopNode; QSL_SortTypes SortType; bool AutoDelete; T * Last; T * FindInsertionPoint(T * node,QTopNode ** parent, T ** insert_after,QSL_SortTypes sorttype); public: SortList(bool autodelete=true); virtual ~SortList(); bool InsertSorted( T * node); bool Remove(T* node); T * GetHead() { return TopNode->BottomNode; }; T * GetLast() { return Last; }; T * RemoveHead(bool and_delete = false); }; template inline SortList::SortList(bool autodelete) { AutoDelete = autodelete; TopNode = new QTopNode; SortType = LSort_Ascent; Last=NULL; }; template inline SortList::~SortList() { while(RemoveHead(AutoDelete)); delete TopNode; TopNode = NULL; return; }; template inline T * SortList::FindInsertionPoint(T * node,QTopNode ** parent,T ** insert_after,QSL_SortTypes sorttype) { if (!TopNode->BottomNode) { *insert_after = NULL; *parent=TopNode; return NULL; } return (T*)TopNode->GetTopNode()->GetInsertionPoint(node,parent,(T**)insert_after,sorttype); } template inline bool SortList::InsertSorted(T * node) { QTopNode * parent=NULL; T * insert_after=NULL; T * insertion_point = FindInsertionPoint(node,&parent,&insert_after,SortType); if (parent == (QTopNode *)0xFFFFFFFF) parent = TopNode; if (!insertion_point) { node->InsertThisBetween(insert_after,NULL); } else { node->InsertThisBetween(insert_after,insertion_point); } parent->SubNodeInserted(node); if (Last==NULL) Last=node; if (*Last<*node) Last=node; return true; }; template inline bool SortList::Remove(T * node) { if(!node) return false; if (node==Last) Last=node->Prev; QSL_SortTypes sorttype = LSort_Ascent_Find; QTopNode * parent=NULL; T * prev=NULL; T * current = FindInsertionPoint(node,&parent,&prev,sorttype); if (!current) { return false; } if (parent == (QTopNode *)0xFFFFFFFF) parent = TopNode; T * next_child = parent->Next ? parent->Next->BottomNode : NULL; while(1) { if (current==node) break; prev = current; current = current->Next; if (current==next_child) { parent=parent->Next; next_child = parent->Next ? parent->Next->BottomNode : NULL; } } parent->SubNodeRemoved(current); current->Remove(prev); return true; }; template inline T * SortList::RemoveHead(bool and_delete) { T * head = TopNode->BottomNode; if (!head) return NULL; TopNode->SubNodeRemoved(head); head->Remove(NULL); if (and_delete) { delete head; return (T*)0xFFFFFFFF; } return head; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CCluster; class CRGA; //--------------------------------------------------------- class CPtrArray { public: CPtrArray() { m_size=0; m_allocsize=0; } int Add(void * newElement); int GetSize() {return m_size;}; void *GetAt(int i) {return data[i];}; void RemoveAll(); private: int m_size; int m_allocsize; void ** data; }; //--------------------------------------------------------- class CData { public: CData(int _x, int _y, int _ClusterNr, RGADATA * _Values) { x = _x; y = _y; ClusterNr= _ClusterNr; Values = _Values; } ~CData() { delete[] Values; } RGADATA * Values; short int x, y; int ClusterNr; }; //--------------------------------------------------------- class CDataNode : public SListNode { public: char sortdim; CData * Data; CDataNode(CData * _Data, int _sortdim) { Data = _Data; sortdim = _sortdim; } bool operator >(CDataNode& comp){return Data->Values[sortdim] > comp.Data->Values[sortdim];} bool operator <(CDataNode& comp){return Data->Values[sortdim] <= comp.Data->Values[sortdim];} }; //--------------------------------------------------------- class CBounderyNode : public SListNode { public: float distance; int ClusterNr; CData * Data; CBounderyNode(CData * _Data) { Data = _Data; } CBounderyNode() { distance= LAST; }; bool operator >(CBounderyNode& comp){return distance > comp.distance;} bool operator <(CBounderyNode& comp){return distance <= comp.distance;} }; //--------------------------------------------------------- typedef SortList TDataNodeList; typedef SortList TBounderyNodeList; typedef CDataNode *PCDataNode; typedef CData *PCData; typedef PCDataNode *PPCDataNode; typedef CBounderyNode *PCBounderyNode; typedef CPtrArray *PCBounderyArray; typedef RGADATA **ppRGADATA; typedef CSG_Grid *PGrid; //--------------------------------------------------------- class CCluster { public: CCluster(); ~CCluster(); void Create(int _dim); void Add(CDataNode ** node, int dim); void Del(CDataNode * node, int dim); CDataNode * GetDataHead(int dim); float Distance(CData *data); float GetMinVal(int dim); float GetMaxVal(int dim); int dim; private: TDataNodeList *DataAscent; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CFast_Region_Growing : public CSG_Module_Grid { public: CFast_Region_Growing(void); void Get_Mean_Grid(void); void RGA(); void GetClusterGrid(CSG_Grid *OutGrid); // GetValGrid(CSG_Grid *OutGrid); void Statistik(char * FileName); void Histgram(char * FileName); protected: virtual bool On_Execute(void); private: void KillData(); void InitData(CSG_Grid **InGrid, int dim, CSG_Grid *StartGrid); int nGrids; CSG_Grid **Grids; CSG_Grid *pResult, *pMean; CSG_Grid *RepGrid; int m_NrCluster; CCluster *Cluster; CSG_Grid *mRepGrid; TBounderyNodeList *BounderyList; PCBounderyArray **pRandGrid; PPCDataNode **pClusterGrid; PCData **pDataGrid; float last; int m_dim; int NX,NY; void AddBounderyNode(int x, int y, int cluster); void DelBounderyNode(CBounderyNode * Node); void DelBounderyPoints(int x, int y); void AddBounderyPoints(int x, int y, int cluster); void AddClusterPoint(int x, int y, int cluster); CBounderyNode *BounderyNodes; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Region_Growing_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/000077500000000000000000000000001224124640700265315ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/MLB_Interface.cpp000066400000000000000000000111021224124640700316220ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_segmentation // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2009 by // // SAGA User Group Assoc. // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: author@email.de // // // // contact: Author // // Sesame Street. 7 // // 12345 Metropolis // // Nirwana // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Imagery - Segmentation") ); case MLB_INFO_Author: return( SG_T("SAGA User Group Assoc. (c) 2009") ); case MLB_INFO_Description: return( _TL("Image segmentation algorithms.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Imagery|Segmentation") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "watershed_segmentation.h" #include "skeletonization.h" #include "grid_seeds.h" #include "rga_basic.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CWatershed_Segmentation ); case 1: return( new CSkeletonization ); case 2: return( new CGrid_Seeds ); case 3: return( new CRGA_Basic ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/MLB_Interface.h000066400000000000000000000066771224124640700313140ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_segmentation // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Author // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: author@email.de // // // // contact: Author // // Sesame Street. 7 // // 12345 Metropolis // // Nirwana // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__imagery_segmentation_H #define HEADER_INCLUDED__imagery_segmentation_H //--------------------------------------------------------- #include //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__imagery_segmentation_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/Makefile.am000066400000000000000000000013731224124640700305710ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libimagery_segmentation.la libimagery_segmentation_la_SOURCES =\ grid_seeds.cpp\ MLB_Interface.cpp\ rga_basic.cpp\ skeletonization.cpp\ watershed_segmentation.cpp\ grid_seeds.h\ MLB_Interface.h\ rga_basic.h\ skeletonization.h\ watershed_segmentation.h libimagery_segmentation_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/Makefile.in000066400000000000000000000453431224124640700306070ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_images/modules_imagery/imagery_segmentation DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libimagery_segmentation_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libimagery_segmentation_la_OBJECTS = grid_seeds.lo MLB_Interface.lo \ rga_basic.lo skeletonization.lo watershed_segmentation.lo libimagery_segmentation_la_OBJECTS = \ $(am_libimagery_segmentation_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libimagery_segmentation_la_SOURCES) DIST_SOURCES = $(libimagery_segmentation_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libimagery_segmentation.la libimagery_segmentation_la_SOURCES = \ grid_seeds.cpp\ MLB_Interface.cpp\ rga_basic.cpp\ skeletonization.cpp\ watershed_segmentation.cpp\ grid_seeds.h\ MLB_Interface.h\ rga_basic.h\ skeletonization.h\ watershed_segmentation.h libimagery_segmentation_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_images/modules_imagery/imagery_segmentation/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_images/modules_imagery/imagery_segmentation/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libimagery_segmentation.la: $(libimagery_segmentation_la_OBJECTS) $(libimagery_segmentation_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libimagery_segmentation_la_OBJECTS) $(libimagery_segmentation_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_seeds.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rga_basic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skeletonization.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watershed_segmentation.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/grid_seeds.cpp000066400000000000000000000267351224124640700313620ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_seeds.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_segmentation // // // //-------------------------------------------------------// // // // grid_seeds.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_seeds.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Seeds::CGrid_Seeds(void) { //----------------------------------------------------- Set_Name (_TL("Seed Generation")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Features"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "SURFACE" , _TL("Surface"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "SEEDS_GRID" , _TL("Seeds Grid"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Shapes( NULL , "SEEDS" , _TL("Seeds"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Value( NULL , "FACTOR" , _TL("Bandwidth (Cells)"), _TL(""), PARAMETER_TYPE_Double, 2.0, 1.0, true ); Parameters.Add_Choice( NULL , "TYPE_SURFACE" , _TL("Type of Surface"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("smoothed surface"), _TL("variance (a)"), _TL("variance (b)") ), 1 ); Parameters.Add_Choice( NULL , "TYPE_SEEDS" , _TL("Extraction of..."), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("minima"), _TL("maxima"), _TL("minima and maxima") ), 0 ); Parameters.Add_Choice( NULL , "TYPE_MERGE" , _TL("Feature Aggregation"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("additive"), _TL("multiplicative") ), 0 ); Parameters.Add_Value( NULL , "NORMALIZE" , _TL("Normalized"), _TL(""), PARAMETER_TYPE_Bool, false ); //----------------------------------------------------- m_Direction.Set_Count(8); for(int i=0; i<8; i++) { m_Direction[i].z = (M_PI_360 * i) / 8.0; m_Direction[i].x = sin(m_Direction[i].z); m_Direction[i].y = cos(m_Direction[i].z); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Seeds::On_Execute(void) { bool bNormalize; int Merge; double Cellsize; CSG_Grid *pSurface, Surface, *pSeeds_Grid; CSG_Shapes *pSeeds; //----------------------------------------------------- m_pGrids = Parameters("GRIDS") ->asGridList(); pSurface = Parameters("SURFACE") ->asGrid(); pSeeds_Grid = Parameters("SEEDS_GRID") ->asGrid(); pSeeds = Parameters("SEEDS") ->asShapes(); m_Method = Parameters("TYPE_SURFACE")->asInt(); Cellsize = Parameters("FACTOR") ->asDouble() * Get_Cellsize(); Merge = Parameters("TYPE_MERGE") ->asInt(); bNormalize = Parameters("NORMALIZE") ->asBool(); //----------------------------------------------------- m_Smooth.Create(SG_DATATYPE_Float, 4 + (int)(Get_System()->Get_XRange() / Cellsize), 4 + (int)(Get_System()->Get_YRange() / Cellsize), Cellsize, Get_XMin() - Cellsize, Get_YMin() - Cellsize ); if( !m_Smooth.is_Valid() ) { return( false ); } //----------------------------------------------------- if( m_pGrids->Get_Count() > 1 ) { Surface.Create(*Get_System(), pSurface->Get_Type()); } for(int i=0; iGet_Count(); i++) { m_Smooth.Assign(m_pGrids->asGrid(i), GRID_INTERPOLATION_Mean_Cells); if( i == 0 ) { Get_Surface(m_pGrids->asGrid(i), pSurface, bNormalize); } else { Get_Surface(m_pGrids->asGrid(i), &Surface, bNormalize); Add_Surface(pSurface, &Surface, Merge); } } Get_Seeds(pSurface, pSeeds, pSeeds_Grid, Parameters("TYPE_SEEDS")->asInt()); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Seeds::Get_Surface(CSG_Grid *pFeature, CSG_Grid *pSurface, bool bNormalize) { int x, y; double z, Radius; TSG_Point p; Radius = m_Method == 2 ? Get_Cellsize() : m_Smooth.Get_Cellsize(); //----------------------------------------------------- for(y=0, p.y=Get_YMin(); yis_InGrid(x, y) && m_Smooth.Get_Value(p, z) ) { switch( m_Method ) { case 0: { pSurface->Set_Value(x, y, z); } break; case 1: case 2: { CSG_Simple_Statistics s; s.Add_Value(z); for(int i=0; i<8; i++) { TSG_Point q; q.x = p.x + Radius * m_Direction[i].x; q.y = p.y + Radius * m_Direction[i].y; if( m_Smooth.Get_Value(q, z) ) { s.Add_Value(z); } } if( s.Get_Count() > 0 ) { pSurface->Set_Value(x, y, s.Get_StdDev()); } else { pSurface->Set_NoData(x, y); } } break; } } else { pSurface->Set_NoData(x, y); } } } //----------------------------------------------------- if( bNormalize && pSurface->Get_StdDev() > 0.0 ) { pSurface->Multiply(1.0 / pSurface->Get_StdDev()); } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Seeds::Add_Surface(CSG_Grid *pSurface, CSG_Grid *pAdd, int Method) { for(int y=0; yis_NoData(x, y) ) { if( pAdd->is_NoData(x, y) ) { pSurface->Set_NoData(x, y); } else switch( Method ) { case 0: pSurface->Add_Value(x, y, pAdd->asDouble(x, y)); break; case 1: pSurface->Mul_Value(x, y, pAdd->asDouble(x, y)); break; } } } } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Seeds::Get_Seeds(CSG_Grid *pSurface, CSG_Shapes *pSeeds, CSG_Grid *pGrid, int Method) { bool bMinimum, bMaximum; int x, y, i, ix, iy, id; double z; TSG_Point p; //----------------------------------------------------- pSeeds->Create(SHAPE_TYPE_Point, _TL("Seeds")); pSeeds->Add_Field(SG_T("ID"), SG_DATATYPE_Int); pSeeds->Add_Field(SG_T("X") , SG_DATATYPE_Int); pSeeds->Add_Field(SG_T("Y") , SG_DATATYPE_Int); pSeeds->Add_Field(SG_T("S") , SG_DATATYPE_Double); for(i=0; iGet_Count(); i++) { pSeeds->Add_Field(m_pGrids->asGrid(i)->Get_Name(), SG_DATATYPE_Double); } if( pGrid ) { pGrid->Assign_NoData(); } //----------------------------------------------------- for(id=0, y=0, p.y=Get_YMin(); yis_NoData(x, y) ) { for(i=0, z=pSurface->asDouble(x, y), bMinimum=true, bMaximum=true; (bMinimum || bMaximum) && i<8; i++) { ix = Get_xTo(i, x); iy = Get_yTo(i, y); if( !pSurface->is_InGrid(ix, iy) ) { bMinimum = bMaximum = false; } else if( z > pSurface->asDouble(ix, iy) ) { bMinimum = false; } else if( z < pSurface->asDouble(ix, iy) ) { bMaximum = false; } } //----------------------------------------- if( (Method == 0 && bMinimum) || (Method == 1 && bMaximum) || (Method == 2 && (bMinimum || bMaximum)) ) { CSG_Shape *pSeed = pSeeds->Add_Shape(); id++; pSeed->Add_Point(p); pSeed->Set_Value(0, id); pSeed->Set_Value(1, x); pSeed->Set_Value(2, y); pSeed->Set_Value(3, z); for(i=0; iGet_Count(); i++) { pSeed->Set_Value(3 + i, m_pGrids->asGrid(i)->asDouble(x, y)); } if( pGrid ) { pGrid->Set_Value(x, y, id); } } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/grid_seeds.h000066400000000000000000000105401224124640700310120ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_seeds.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_segmentation // // // //-------------------------------------------------------// // // // grid_seeds.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_seeds_H #define HEADER_INCLUDED__grid_seeds_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Seeds : public CSG_Module_Grid { public: CGrid_Seeds(void); protected: virtual bool On_Execute (void); private: int m_Method; CSG_Points_Z m_Direction; CSG_Grid m_Smooth; CSG_Parameter_Grid_List *m_pGrids; bool Get_Surface (CSG_Grid *pFeature, CSG_Grid *pSurface, bool bNormalize); bool Add_Surface (CSG_Grid *pSurface, CSG_Grid *pAdd, int Method); bool Get_Seeds (CSG_Grid *pSurface, CSG_Shapes *pShapes, CSG_Grid *pGrid, int Method); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_seeds_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/rga_basic.cpp000066400000000000000000000404551224124640700311570ustar00rootroot00000000000000/********************************************************** * Version $Id: rga_basic.cpp 1084 2011-06-08 08:10:42Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_segmentation // // // //-------------------------------------------------------// // // // rga_basic.cpp // // // // Copyright (C) 2008 by // // Benni Bechtel // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "rga_basic.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CCandidates::CCandidates(void) { m_Candidates = NULL; m_nCandidates = 0; m_pLow = NULL; m_pHigh = NULL; m_nMax = 256; Create(m_nMax); } //--------------------------------------------------------- CCandidates::CCandidates(int nMax) { m_Candidates = NULL; m_nCandidates = 0; m_pLow = NULL; m_pHigh = NULL; m_nMax = nMax; Create(m_nMax); } //--------------------------------------------------------- CCandidates::~CCandidates(void) { Destroy(); } //--------------------------------------------------------- void CCandidates::Create(void) { Create(m_nMax); } //--------------------------------------------------------- void CCandidates::Create(int nMax) { if( nMax <= 1 ) { Create(); return; } Destroy(); m_nMax = nMax; m_Candidates = (TCandidate *)SG_Malloc(m_nMax * sizeof(TCandidate)); } //--------------------------------------------------------- void CCandidates::Destroy(void) { m_nCandidates = 0; if( m_Candidates ) { SG_Free(m_Candidates); m_Candidates = NULL; } if( m_pLow ) { delete(m_pLow); m_pLow = NULL; } if( m_pHigh ) { delete(m_pHigh); m_pHigh = NULL; } } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CCandidates::Add(int x, int y, int Segment, double Similarity) { if( m_Candidates && m_nCandidates < m_nMax ) { int iInsert = _Find(Similarity); memmove(m_Candidates + iInsert + 1, m_Candidates + iInsert, sizeof(TCandidate) * (m_nCandidates - iInsert)); m_Candidates[iInsert].x = x; m_Candidates[iInsert].y = y; m_Candidates[iInsert].Segment = Segment; m_Candidates[iInsert].Similarity = Similarity; } else { if( !m_pLow ) { int iDivide = m_nMax / 2; m_pLow = new CCandidates(m_nMax); m_pHigh = new CCandidates(m_nMax); m_pLow ->m_nCandidates = iDivide; m_pHigh->m_nCandidates = m_nMax - iDivide; memcpy(m_pLow ->m_Candidates, m_Candidates , m_pLow ->m_nCandidates * sizeof(TCandidate)); memcpy(m_pHigh->m_Candidates, m_Candidates + m_pLow->m_nCandidates, m_pHigh->m_nCandidates * sizeof(TCandidate)); SG_Free(m_Candidates); m_Candidates = NULL; } if( Similarity > m_pHigh->Get_Minimum() ) { m_pHigh->Add(x, y, Segment, Similarity); } else { m_pLow ->Add(x, y, Segment, Similarity); } } m_nCandidates++; } //--------------------------------------------------------- double CCandidates::Get_Minimum(void) { if( m_nCandidates > 0 ) { if( m_pLow ) { return( m_pLow->Get_Minimum() ); } return( m_Candidates[0].Similarity ); } return( 0.0 ); } //--------------------------------------------------------- double CCandidates::Get_Maximum(void) { if( m_nCandidates > 0 ) { if( m_pHigh ) { return( m_pHigh->Get_Maximum() ); } return( m_Candidates[m_nCandidates - 1].Similarity ); } return( 0.0 ); } //--------------------------------------------------------- int CCandidates::_Find(double Similarity) { if( m_nCandidates == 0 ) { return( 0 ); } int a, b; a = 0; b = m_nCandidates - 1; if( Similarity < m_Candidates[a].Similarity ) { return( a ); } if( Similarity > m_Candidates[b].Similarity ) { return( b + 1 ); } for(int d=(b-a)/2 ; d>0; d/=2) { int i = a + d; if( Similarity > m_Candidates[i].Similarity ) { a = a < i ? i : a + 1; } else { b = b > i ? i : b - 1; } } for(int i=a; i<=b; i++) { if( Similarity < m_Candidates[i].Similarity ) { return( i ); } } return( b ); } //--------------------------------------------------------- bool CCandidates::Get(int &x, int &y, int &Segment) { if( m_nCandidates > 0 ) { m_nCandidates--; if( m_Candidates ) { x = m_Candidates[m_nCandidates].x; y = m_Candidates[m_nCandidates].y; Segment = m_Candidates[m_nCandidates].Segment; } else // if( m_pLow ) { m_pHigh->Get(x, y, Segment); if( m_pHigh->m_nCandidates == 0 ) { delete(m_pHigh); CCandidates *pLow = m_pLow; // m_nCandidates = pLow->m_nCandidates; m_Candidates = pLow->m_Candidates; m_pLow = pLow->m_pLow; m_pHigh = pLow->m_pHigh; pLow->m_Candidates = NULL; pLow->m_pLow = NULL; pLow->m_pHigh = NULL; delete(pLow); } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define SEEDFIELD_X 2 #define SEEDFIELD_Y (SEEDFIELD_X + 1) #define SEEDFIELD_Z (SEEDFIELD_X + 2) #define NO_SEGMENT -1 #define NO_SIMILARITY -1.0 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CRGA_Basic::CRGA_Basic(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Simple Region Growing")); Set_Author (SG_T("B. Bechtel, O. Conrad (c) 2008")); Set_Description (_TW( "\n" "References\n" "Bechtel, B., Ringeler, A., Boehner, J. (2008): " "Segmentation for Object Extraction of Trees using MATLAB and SAGA. " "In: Boehner, J., Blaschke, T., Montanarella, L. [Eds.]: SAGA - Seconds Out. " "Hamburger Beitraege zur Physischen Geographie und Landschaftsoekologie, 19:59-70. " "download\n" "\n" )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "SEEDS" , _TL("Seeds"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "FEATURES" , _TL("Features"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "SEGMENTS" , _TL("Segments"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "SIMILARITY" , _TL("Similarity"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Table( NULL , "TABLE" , _TL("Seeds"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("feature space and position"), _TL("feature space") ), 0 ); Parameters.Add_Choice( NULL , "NEIGHBOUR" , _TL("Neighbourhood"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("4 (von Neumann)"), _TL("8 (Moore)") ), 0 ); pNode = Parameters.Add_Node( NULL , "NODE_COLSPACE" , _TL("Feature Space Options"), _TL("") ); Parameters.Add_Value( pNode , "SIG_1" , _TL("Variance in Feature Space"), _TL(""), PARAMETER_TYPE_Double , 1.0, 0.0, true // 0.36 ); Parameters.Add_Value( pNode , "SIG_2" , _TL("Variance in Position Space"), _TL(""), PARAMETER_TYPE_Double , 1.0, 0.0, true // 8.2141 ); Parameters.Add_Value( pNode , "THRESHOLD" , _TL("Threshold - Similarity"), _TL(""), PARAMETER_TYPE_Double , 0.0, 0.0, true // 0.15 ); Parameters.Add_Value( pNode , "REFRESH" , _TL("Refresh"), _TL(""), PARAMETER_TYPE_Bool , false ); Parameters.Add_Value( pNode , "LEAFSIZE" , _TL("Leaf Size (for Speed Optimisation)"), _TL(""), PARAMETER_TYPE_Int , 256, 2, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CRGA_Basic::On_Execute(void) { bool bRefresh; long n; int x, y, i, Segment; CSG_Grid *pSeeds; //----------------------------------------------------- m_pSegments = Parameters("SEGMENTS") ->asGrid(); m_pFeatures = Parameters("FEATURES") ->asGridList(); m_nFeatures = m_pFeatures->Get_Count(); pSeeds = Parameters("SEEDS") ->asGrid(); m_pSeeds = Parameters("TABLE") ->asTable(); m_pSimilarity = Parameters("SIMILARITY") ->asGrid(); m_dNeighbour = Parameters("NEIGHBOUR")->asInt() == 0 ? 2 : 1; m_Var_1 = SG_Get_Square(Parameters("SIG_1")->asDouble()); m_Var_2 = SG_Get_Square(Parameters("SIG_2")->asDouble()); m_Threshold = Parameters("THRESHOLD") ->asDouble(); m_Method = Parameters("METHOD") ->asInt(); bRefresh = Parameters("REFRESH") ->asBool(); //----------------------------------------------------- m_pSegments ->Assign(-1); m_pSegments ->Set_NoData_Value(-1); m_pSimilarity ->Assign(-1); m_pSimilarity ->Set_NoData_Value(-1); //----------------------------------------------------- m_pSeeds->Destroy(); m_pSeeds->Add_Field(_TL("ID") , SG_DATATYPE_Int); m_pSeeds->Add_Field(_TL("AREA") , SG_DATATYPE_Double); m_pSeeds->Add_Field(_TL("X") , SG_DATATYPE_Double); m_pSeeds->Add_Field(_TL("Y") , SG_DATATYPE_Double); for(i=0; iGet_Count(); i++) { m_pSeeds->Add_Field(m_pFeatures->asGrid(i)->Get_Name(), SG_DATATYPE_Double); } m_Candidates.Create(Parameters("LEAFSIZE")->asInt()); //----------------------------------------------------- for(y=0, n=0; yis_NoData(x, y) ) { CSG_Table_Record *pRec = m_pSeeds->Add_Record(); pRec->Set_Value(0, n); pRec->Set_Value(SEEDFIELD_X, x); pRec->Set_Value(SEEDFIELD_Y, y); for(i=0; iGet_Count(); i++) { pRec->Set_Value(SEEDFIELD_Z + i, m_pFeatures->asGrid(i)->asDouble(x, y)); } m_pSimilarity->Set_Value(x, y, 1.0); Add_To_Segment(x, y, n++); } } } //----------------------------------------------------- if( n > 0 ) { n = 0; while( n++ < Get_NCells() && Set_Progress_NCells(n) && Get_Next_Candidate(x, y, Segment) ) { Add_To_Segment(x, y, Segment); if( bRefresh && (n % Get_NX()) == 0 ) { DataObject_Update(m_pSegments, 0, m_pSeeds->Get_Record_Count()); Process_Set_Text(CSG_String::Format(SG_T("%.2f"), 100.0 * m_Candidates.Get_Count() / Get_NCells())); } } m_Candidates.Destroy(); return( true ); } //----------------------------------------------------- m_Candidates.Destroy(); return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CRGA_Basic::Get_Next_Candidate(int &x, int &y, int &Segment) { while( m_Candidates.Get(x, y, Segment) ) { if( m_pSegments->is_NoData(x, y) ) { return( true ); } } return( false ); } //--------------------------------------------------------- bool CRGA_Basic::Add_To_Segment(int x, int y, int Segment) { if( is_InGrid(x, y) && m_pSegments->is_NoData(x, y) ) // if the pixel is not element of any segment... { int i, ix, iy; m_pSegments->Set_Value(x, y, Segment); // the candidate is added to the correspondig region for(i=0; i<8; i+=m_dNeighbour) // update of candidate-grid - all 8-Neigbours of the added pixel are checked { if( Get_System()->Get_Neighbor_Pos(i, x, y, ix, iy) && m_pSegments->is_NoData(ix, iy) ) { double Similarity = Get_Similarity(ix, iy, Segment); if( Similarity >= m_Threshold // a neigbour-pixel is only added as candidate if its similarity is higher than the preset threshold && Similarity > m_pSimilarity->asDouble(ix, iy) ) // and it is not candidate for another region with a higher similarity-value yet { m_Candidates.Add(ix, iy, Segment, Similarity); m_pSimilarity->Set_Value(ix, iy, Similarity); } } } return( true ); } return( false ); } //--------------------------------------------------------- double CRGA_Basic::Get_Similarity(int x, int y, int Segment) { CSG_Table_Record *pSeed; if( is_InGrid(x, y) && (pSeed = m_pSeeds->Get_Record(Segment)) != NULL ) { int i; double a, b, Result; switch( m_Method ) { //------------------------------------------------- case 0: // feature space and position for(i=0, a=0.0; iasGrid(i)->asDouble(x, y) - pSeed->asDouble(SEEDFIELD_Z + i)); } b = SG_Get_Square(x - pSeed->asDouble(SEEDFIELD_X)) + SG_Get_Square(y - pSeed->asDouble(SEEDFIELD_Y)); Result = a / m_Var_1 + b / m_Var_2; break; //------------------------------------------------- case 1: // feature space for(i=0, a=0.0; iasGrid(i)->asDouble(x, y) - pSeed->asDouble(SEEDFIELD_Z + i)); } Result = a / m_Var_1; break; } return( 1.0 / (1.0 + Result) ); // from 'distance' to 'similarity' !!! // return( exp(-0.5 * Result) ); } return( -1.0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/rga_basic.h000066400000000000000000000127261224124640700306240ustar00rootroot00000000000000/********************************************************** * Version $Id: rga_basic.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_segmentation // // // //-------------------------------------------------------// // // // rga_basic.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__rga_basic_H #define HEADER_INCLUDED__rga_basic_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- typedef struct SCandidate { int x, y, Segment; double Similarity; } TCandidate; //--------------------------------------------------------- class CCandidates { public: CCandidates(void); CCandidates(int nMax); ~CCandidates(void); void Create (void); void Create (int nMax); void Destroy (void); void Add (int x, int y, int Segment, double Similarity); bool Get (int &x, int &y, int &Segment); int Get_Count (void) { return( m_nCandidates ); } double Get_Minimum (void); double Get_Maximum (void); private: int m_nCandidates, m_nMax; TCandidate *m_Candidates; CCandidates *m_pLow, *m_pHigh; int _Find (double Similarity); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CRGA_Basic : public CSG_Module_Grid { public: CRGA_Basic(void); protected: virtual bool On_Execute (void); private: int m_Method, m_nFeatures, m_dNeighbour; double m_Var_1, m_Var_2, m_Threshold; CSG_Table *m_pSeeds; CSG_Grid *m_pSegments, *m_pSimilarity; CSG_Parameter_Grid_List *m_pFeatures; CCandidates m_Candidates; bool Get_Next_Candidate (int &x, int &y, int &Segment); bool Add_To_Segment (int x, int y, int Segment); double Get_Similarity (int x, int y, int Segment); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__rga_basic_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/skeletonization.cpp000066400000000000000000000507551224124640700324730ustar00rootroot00000000000000/********************************************************** * Version $Id: skeletonization.cpp 1084 2011-06-08 08:10:42Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_segmentation // // // //-------------------------------------------------------// // // // Grid_Skeletonize.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "skeletonization.h" //--------------------------------------------------------- #define skNE 1 #define skJA 2 #define SEGMENT_END 1 #define SEGMENT_NODE 2 #define SEGMENT_LOCKED 3 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSkeletonization::CSkeletonization(void) { Set_Name (_TL("Grid Skeletonization")); Set_Author (SG_T("O.Conrad (c) 2002")); Set_Description (_TW( "Simple skeletonisation methods for grids.\n" )); Parameters.Add_Grid( NULL, "INPUT" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "RESULT" , _TL("Skeleton"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Char ); Parameters.Add_Shapes( NULL, "VECTOR" , _TL("Skeleton"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Choice( NULL, "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Standard"), _TL("Hilditch's Algorithm"), _TL("Channel Skeleton") ), 0 ); Parameters.Add_Choice( NULL, "INIT_METHOD" , _TL("Initialisation"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Less than"), _TL("Greater than") ),1 ); Parameters.Add_Value( NULL, "INIT_THRESHOLD" , _TL("Threshold (Init.)"), _TL(""), PARAMETER_TYPE_Double ); Parameters.Add_Value( NULL, "CONVERGENCE" , _TL("Convergence"), _TL(""), PARAMETER_TYPE_Int, 3 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSkeletonization::On_Execute(void) { int Initiation; long n; double Threshold; CSG_Grid *pInput; //----------------------------------------------------- pInput = Parameters("INPUT") ->asGrid(); pResult = Parameters("RESULT") ->asGrid(); Initiation = Parameters("INIT_METHOD") ->asInt(); Threshold = Parameters("INIT_THRESHOLD") ->asDouble(); DataObject_Set_Colors(pResult, 3, SG_COLORS_BLACK_WHITE, true); pResult->Assign(0.0); //----------------------------------------------------- for(n=0; nasDouble(n) < Threshold ) { pResult->Set_Value(n, 1); } break; case 1: if( pInput->asDouble(n) > Threshold ) { pResult->Set_Value(n, 1); } break; } } //----------------------------------------------------- switch( Parameters("METHOD")->asInt() ) { case 0: default: Standard_Execute(); break; case 1: Hilditch_Execute(); break; case 2: SK_Execute(); break; } //------------------------------------------------- if( Parameters("VECTOR")->asShapes() ) { Vectorize(Parameters("VECTOR")->asShapes()); } if( 1 ) { for(n=0; nasDouble(n) < Threshold ) { pResult->Add_Value(n, 1); } break; case 1: if( pInput->asDouble(n) > Threshold ) { pResult->Add_Value(n, 1); } break; } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // Helpers // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CSkeletonization::Get_Neighbours(int x, int y, CSG_Grid *pGrid, bool Neighbours[8]) { int i, ix, iy, nNeighbours; nNeighbours = 0; for(i=0; i<8; i++) { ix = Get_System()->Get_xTo(i, x); iy = Get_System()->Get_yTo(i, y); if( pGrid->is_InGrid(ix, iy) && pGrid->asByte(ix, iy) ) { Neighbours[i] = true; nNeighbours++; } else { Neighbours[i] = false; } } return( nNeighbours ); } /////////////////////////////////////////////////////////// // // // Vectorization // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CSkeletonization::Vectorize(CSG_Shapes *pShapes) { bool z[8], bPrev; int x, y, i, ix, iy, n, nSegments; double xMin, yMin, dx, dy; CSG_Shape *pShape; //----------------------------------------------------- pShapes->Create(SHAPE_TYPE_Line, _TL("Skeleton")); pShapes->Add_Field("ID", SG_DATATYPE_Int); Lock_Create(); //----------------------------------------------------- for(y=0; yasByte(x, y) ) { n = Get_Neighbours(x, y, pResult, z); if( n == 1 ) { Lock_Set(x, y, SEGMENT_END); } else if( n > 1 ) { n = 0; for(i=0, bPrev=z[7]; i<8; i++) { if( bPrev == false && z[i] == true ) { n++; } bPrev = z[i]; } if( n > 2 ) { Lock_Set(x, y, SEGMENT_NODE); } } } } } //----------------------------------------------------- nSegments = 0; for(y=0; yGet_Cellsize(); xMin = pResult->Get_XMin();// + 0.5 * dx; dy = pResult->Get_Cellsize(); yMin = pResult->Get_YMin();// + 0.5 * dy; for(x=0; xGet_xTo(i, x); iy = Get_System()->Get_yTo(i, y); if( pResult->is_InGrid(ix, iy) && pResult->asByte(ix, iy) && !Lock_Get(ix, iy) ) { pShape = pShapes->Add_Shape(); pShape->Set_Value(0, ++nSegments); pShape->Add_Point(xMin + dx * (double)x, yMin + dy * (double)y); Vectorize_Trace(ix, iy, pShape); } } } } } //----------------------------------------------------- Lock_Destroy(); Message_Dlg(CSG_String::Format(SG_T("%d %s\n"), nSegments, _TL("segments identified")), Get_Name()); return( nSegments ); } //--------------------------------------------------------- bool CSkeletonization::Vectorize_Trace(int x, int y, CSG_Shape *pShape) { bool bContinue; int i, ix, iy, iNext; double xMin, yMin, dx, dy; //----------------------------------------------------- dx = pResult->Get_Cellsize(); xMin = pResult->Get_XMin();// + 0.5 * dx; dy = pResult->Get_Cellsize(); yMin = pResult->Get_YMin();// + 0.5 * dy; bContinue = true; do { pShape->Add_Point(xMin + dx * (double)x, yMin + dy * (double)y); if( Lock_Get(x, y) == SEGMENT_NODE || Lock_Get(x, y) == SEGMENT_END ) { bContinue = false; } else { Lock_Set(x, y, SEGMENT_LOCKED); iNext = -1; for(i=0; i<8; i+=2) { ix = Get_System()->Get_xTo(i, x); iy = Get_System()->Get_yTo(i, y); if( pResult->is_InGrid(ix, iy) && pResult->asByte(ix, iy) && Lock_Get(ix, iy) != SEGMENT_LOCKED ) { iNext = i; if( Lock_Get(ix, iy) == SEGMENT_NODE ) { break; } } } if( iNext < 0 ) { for(i=1; i<8; i+=2) { ix = Get_System()->Get_xTo(i, x); iy = Get_System()->Get_yTo(i, y); if( pResult->is_InGrid(ix, iy) && pResult->asByte(ix, iy) && Lock_Get(ix, iy) != SEGMENT_LOCKED ) { iNext = i; if( Lock_Get(ix, iy) == SEGMENT_NODE ) { break; } } } } if( iNext < 0 ) { bContinue = false; } else { x += Get_System()->Get_xTo(iNext); y += Get_System()->Get_yTo(iNext); } } } while( bContinue ); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // Standard // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CSkeletonization::Standard_Execute(void) { int i, nChanges; CSG_Grid *pPrev, *pNext, *pTemp; //----------------------------------------------------- pPrev = pResult; pNext = SG_Create_Grid(pPrev); //----------------------------------------------------- do { DataObject_Update(pResult, 0, 1, true); nChanges = 0; for(i=0; i<8; i++) { nChanges += Standard_Step(i, pPrev, pNext); pTemp = pPrev; pPrev = pNext; pNext = pTemp; } } while( nChanges > 0 && Process_Get_Okay(true) ); //----------------------------------------------------- if( pNext == pResult ) { delete(pPrev); } else { pResult->Assign(pNext); delete(pNext); } } //--------------------------------------------------------- int CSkeletonization::Standard_Step(int iDir, CSG_Grid *pPrev, CSG_Grid *pNext) { bool z[8], bRemove; int x, y, nNeighbours, nChanges; pNext->Assign(); nChanges = 0; for(y=0; yasByte(x, y) ) { bRemove = false; nNeighbours = Get_Neighbours(x, y, pPrev, z); if( nNeighbours > 1 && nNeighbours < 6 ) { bRemove = Standard_Check(iDir, z); } if( bRemove ) { nChanges++; } else { pNext->Set_Value(x, y, 1); } } } } return( nChanges ); } //--------------------------------------------------------- inline bool CSkeletonization::Standard_Check(int iDir, bool z[8]) { bool bRemove; switch( iDir ) { default: bRemove = false; break; case 0: bRemove = !z[7] && !z[0] && !z[1] && z[3] && z[4] && z[5]; break; case 1: bRemove = !z[0] && !z[1] && !z[2] && z[4] && z[6]; break; case 2: bRemove = !z[1] && !z[2] && !z[3] && z[5] && z[6] && z[7]; break; case 3: bRemove = !z[2] && !z[3] && !z[4] && z[6] && z[0]; break; case 4: bRemove = !z[3] && !z[4] && !z[5] && z[7] && z[0] && z[1]; break; case 5: bRemove = !z[4] && !z[5] && !z[6] && z[0] && z[2]; break; case 6: bRemove = !z[5] && !z[6] && !z[7] && z[1] && z[2] && z[3]; break; case 7: bRemove = !z[6] && !z[7] && !z[0] && z[2] && z[4]; break; } return( bRemove ); } /////////////////////////////////////////////////////////// // // // Hilditch // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CSkeletonization::Hilditch_Execute(void) { int nChanges; CSG_Grid *pPrev, *pNext, *pTemp, *pNC_Gaps; //----------------------------------------------------- pPrev = pResult; pNext = SG_Create_Grid(pPrev); pNC_Gaps = SG_Create_Grid(pPrev, SG_DATATYPE_Char); //----------------------------------------------------- do { DataObject_Update(pResult, 0, 1, true); nChanges = Hilditch_Step(pPrev, pNext, pNC_Gaps); pTemp = pPrev; pPrev = pNext; pNext = pTemp; } while( nChanges > 0 && Process_Get_Okay(true) ); //----------------------------------------------------- delete(pNC_Gaps); if( pNext == pResult ) { delete(pPrev); } else { pResult->Assign(pNext); delete(pNext); } } //--------------------------------------------------------- int CSkeletonization::Hilditch_Step(CSG_Grid *pPrev, CSG_Grid *pNext, CSG_Grid *pNC_Gaps) { bool z[8], bPrev, bRemove; int x, y, i, nChanges, nNeighbours; //----------------------------------------------------- for(y=0; yasByte(x, y) && Get_Neighbours(x, y, pPrev, z) > 0 ) { for(i=0, bPrev=z[7]; i<8; i++) { if( bPrev == false && z[i] == true ) { nChanges++; } bPrev = z[i]; } } pNC_Gaps->Set_Value(x, y, nChanges); } } //----------------------------------------------------- pNext->Assign(); nChanges = 0; for(y=0; yasByte(x, y) ) { bRemove = false; nNeighbours = Get_Neighbours(x, y, pPrev, z); //----------------------------------------- if( 2 <= nNeighbours && nNeighbours <= 6 && pNC_Gaps->asByte(x, y) == 1 ) { bRemove = Hilditch_Check(pNC_Gaps, x, y, 0, z) || Hilditch_Check(pNC_Gaps, x, y, 2, z) || Hilditch_Check(pNC_Gaps, x, y, 4, z) || Hilditch_Check(pNC_Gaps, x, y, 6, z) ; } //----------------------------------------- if( bRemove ) { nChanges++; } else { pNext->Set_Value(x, y, true); } } } } //----------------------------------------------------- return( nChanges ); } //--------------------------------------------------------- inline bool CSkeletonization::Hilditch_Check(CSG_Grid *pNC_Gaps, int x, int y, int i0, bool z[8]) { int ix, iy, i2, i4, i6; i2 = (i0 + 2) % 8; i4 = (i0 + 4) % 8; i6 = (i0 + 6) % 8; if( z[i0] || z[i2] || z[i6] ) { ix = Get_System()->Get_xTo(i0, x); iy = Get_System()->Get_yTo(i0, y); if( pNC_Gaps->is_InGrid(ix, iy) && pNC_Gaps->asByte(ix, iy) == 1 ) { return( false ); } } if( z[i0] || z[i2] || z[i4] ) { ix = Get_System()->Get_xTo(i2, x); iy = Get_System()->Get_yTo(i2, y); if( pNC_Gaps->is_InGrid(ix, iy) && pNC_Gaps->asByte(ix, iy) == 1 ) { return( false ); } } return( true ); } /////////////////////////////////////////////////////////// // // // Channel Detection // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CSkeletonization::SK_Execute(void) { int x, y, i, ix, iy, n, Convergence, NB[8]; double z, iz; CSG_Grid *pInput; //----------------------------------------------------- Convergence = Parameters("CONVERGENCE")->asInt(); pInput = Parameters("INPUT")->asGrid(); pResult->Assign(); //----------------------------------------------------- // 1.) Find definitive channel points... for(y=0; yasDouble(x, y); n = 0; for(i=0; i<8; i++) { ix = Get_System()->Get_xTo(i, x); iy = Get_System()->Get_yTo(i, y); if( pInput->is_InGrid(ix, iy) && z < pInput->asDouble(ix, iy) ) { n++; } } if( Convergence > n ) { pResult->Set_Value(x, y, 2); } } } //----------------------------------------------------- // 2.) Find channels... for(n=0; nGet_Sorted(n, x, y) ) // Von oben nach unten... { z = pInput->asDouble(x, y); for(i=0; i<8; i++) { ix = Get_System()->Get_xTo(i,x); iy = Get_System()->Get_yTo(i,y); if( !pInput->is_InGrid(ix, iy) ) { NB[i] = skNE; } else { iz = pInput->asDouble(ix, iy); if( iz < z ) { NB[i] = skNE; } else if( iz > z && pResult->asByte(ix, iy) ) { NB[i] = skJA; } else { NB[i] = 0; } } } if( SK_Connectivity(NB) ) { pResult->Set_Value(x, y, 1); } } } //----------------------------------------------------- /*/ 3.) Filter... Lock_Create(); for(y=0; ySet_Value(x, y, 0); } } } Lock_Destroy();/**/ } //--------------------------------------------------------- int CSkeletonization::SK_Connectivity(int NB[8]) { int i; for(i=0; i<8; i+=2) { if( !NB[i] ) { if( !NB[(i+2)%8] ) // Diagonal Connection { /* if( ( NB[(i+1)%8] ) && ( NB[(i+3)%8] || NB[(i+4)%8] || NB[(i+5)%8] || NB[(i+6)%8] || NB[(i+7)%8] ) ) return(1); */ ///* if( ( NB[(i+1)%8]==skNE ) && ( NB[(i+3)%8]==skJA || NB[(i+4)%8]==skJA || NB[(i+5)%8]==skJA || NB[(i+6)%8]==skJA || NB[(i+7)%8]==skJA ) ) return(1); if( ( NB[(i+1)%8]==skJA ) && ( NB[(i+3)%8]==skNE || NB[(i+4)%8]==skNE || NB[(i+5)%8]==skNE || NB[(i+6)%8]==skNE || NB[(i+7)%8]==skNE ) ) return(1); //*/ } //---Orthogonal-Connection--------------------------------- if(!NB[(i+4)%8]) { /* if( ( NB[(i+1)%8] || NB[(i+2)%8] || NB[(i+3)%8] ) && ( NB[(i+5)%8] || NB[(i+6)%8] || NB[(i+7)%8] ) ) return(1); */ ///* if( ( NB[(i+1)%8]==skJA || NB[(i+2)%8]==skJA || NB[(i+3)%8]==skJA ) && ( NB[(i+5)%8]==skNE || NB[(i+6)%8]==skNE || NB[(i+7)%8]==skNE ) ) return(1); if( ( NB[(i+1)%8]==skNE || NB[(i+2)%8]==skNE || NB[(i+3)%8]==skNE ) && ( NB[(i+5)%8]==skJA || NB[(i+6)%8]==skJA || NB[(i+7)%8]==skJA ) ) return(1); //*/ } } } return( 0 ); } //--------------------------------------------------------- bool CSkeletonization::SK_Filter(int x, int y) { bool z[8]; if( !pResult->asByte(x, y) && Get_Neighbours(x, y, pResult, z) == 4 ) { if( z[0] && z[2] && z[4] && z[6] ) { Lock_Set(Get_System()->Get_xTo(0, x), Get_System()->Get_yTo(0, y)); Lock_Set(Get_System()->Get_xTo(2, x), Get_System()->Get_yTo(2, y)); Lock_Set(Get_System()->Get_xTo(4, x), Get_System()->Get_yTo(4, y)); Lock_Set(Get_System()->Get_xTo(6, x), Get_System()->Get_yTo(6, y)); return( true ); } } return( false ); } saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/skeletonization.h000066400000000000000000000121721224124640700321270ustar00rootroot00000000000000/********************************************************** * Version $Id: skeletonization.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_segmentation // // // //-------------------------------------------------------// // // // skeletonization.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__skeletonization_H #define HEADER_INCLUDED__skeletonization_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSkeletonization : public CSG_Module_Grid { public: CSkeletonization(void); protected: virtual bool On_Execute (void); private: CSG_Grid *pResult; int Get_Neighbours (int x, int y, CSG_Grid *pGrid, bool Neighbours[8]); int Vectorize (CSG_Shapes *pShapes); bool Vectorize_Trace (int x, int y, CSG_Shape *pShape); void Standard_Execute (void); int Standard_Step (int iDir, CSG_Grid *pPrev, CSG_Grid *pNext); bool Standard_Check (int iDir, bool z[8]); void Hilditch_Execute (void); int Hilditch_Step (CSG_Grid *pPrev, CSG_Grid *pNext, CSG_Grid *pNC_Gaps); bool Hilditch_Check (CSG_Grid *pNC_Gaps, int x, int y, int i0, bool z[8]); void SK_Execute (void); int SK_Connectivity (int NB[8]); bool SK_Filter (int x, int y); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__skeletonization_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.cpp000066400000000000000000000340761224124640700340120ustar00rootroot00000000000000/********************************************************** * Version $Id: watershed_segmentation.cpp 1081 2011-06-08 08:05:26Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_segmentation // // // //-------------------------------------------------------// // // // watershed_segmentation.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "watershed_segmentation.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { SEED_X = 0, SEED_Y, SEED_Z, SEED_ID, SEED_JOIN }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CWatershed_Segmentation::CWatershed_Segmentation(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Watershed Segmentation")); Set_Author (SG_T("O.Conrad (c) 2002")); Set_Description (_TW( "Watershed segmentation." )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); pNode = Parameters.Add_Grid( NULL , "SEGMENTS" , _TL("Segments"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Shapes( NULL , "SEEDS" , _TL("Seed Points"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Grid_Output( NULL , "BORDERS" , _TL("Borders"), _TL("") ); //----------------------------------------------------- Parameters.Add_Choice( pNode , "OUTPUT" , _TL("Output"), _TL("The values of the resultant grid can be either the seed value (e.g. the local maximum) or the enumerated segment id."), CSG_String::Format(SG_T("%s|%s|"), _TL("Seed Value"), _TL("Segment ID") ), 1 ); Parameters.Add_Choice( NULL , "DOWN" , _TL("Method"), _TL("Choose if you want to segmentate either on minima or on maxima."), CSG_String::Format(SG_T("%s|%s|"), _TL("Minima"), _TL("Maxima") ), 1 ); pNode = Parameters.Add_Choice( NULL , "JOIN" , _TL("Join Segments based on Threshold Value"), _TL("Join segments based on threshold value."), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("do not join"), _TL("seed to saddle difference"), _TL("seeds difference") ), 0 ); Parameters.Add_Value( pNode , "THRESHOLD" , _TL("Threshold"), _TL("Specify a threshold value as minimum difference between neighboured segments."), PARAMETER_TYPE_Double, 0.0, 0.0, true ); Parameters.Add_Value( NULL , "EDGE" , _TL("Allow Edge Pixels to be Seeds"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( NULL , "BBORDERS" , _TL("Borders"), _TL("Create borders between segments as new grid."), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWatershed_Segmentation::On_Execute(void) { //----------------------------------------------------- m_pGrid = Parameters("GRID") ->asGrid(); m_pSeeds = Parameters("SEEDS") ->asShapes(); m_pSegments = Parameters("SEGMENTS") ->asGrid(); m_bDown = Parameters("DOWN") ->asInt() == 1; //----------------------------------------------------- m_pSeeds->Create(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_pGrid->Get_Name(), _TL("Seeds"))); m_pSeeds->Add_Field(SG_T("XCELL") , SG_DATATYPE_Int); // SEED_X m_pSeeds->Add_Field(SG_T("YCELL") , SG_DATATYPE_Int); // SEED_Y m_pSeeds->Add_Field(SG_T("VALUE") , SG_DATATYPE_Double); // SEED_Z m_pSeeds->Add_Field(SG_T("ID") , SG_DATATYPE_Int); // SEED_ID m_pSeeds->Add_Field(SG_T("ID_JOIN") , SG_DATATYPE_Int); // SEED_JOIN //----------------------------------------------------- m_pSegments->Set_Name(CSG_String::Format(SG_T("%s [%s]"), m_pGrid->Get_Name(), _TL("Segments"))); m_pSegments->Set_NoData_Value(-999999.0); m_Dir.Create(*Get_System(), SG_DATATYPE_Char); //----------------------------------------------------- if( !Get_Seeds() ) { Message_Add(_TL("no seed points identified")); return( false ); } //----------------------------------------------------- Get_Segments(); //----------------------------------------------------- if( Parameters("OUTPUT")->asInt() == 0 ) { for(int y=0; yasInt(x, y); if( ID >= 0 ) { m_pSegments->Set_Value(x, y, m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z)); } } } } //----------------------------------------------------- if( Parameters("BBORDERS")->asBool() ) { Get_Borders(); } //----------------------------------------------------- m_Dir.Destroy(); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWatershed_Segmentation::Get_Seeds(void) { Process_Set_Text(_TL("Seeds")); bool bEdge, bEdge_Seeds; int x, y, i, ix, iy, iMax; double z, dz, dzMax; //----------------------------------------------------- bEdge_Seeds = Parameters("EDGE") ->asBool(); //----------------------------------------------------- for(y=0; yis_InGrid(x, y) ) { m_Dir.Set_Value(x, y, -1); m_pSegments->Set_NoData(x, y); } else { for(i=0, iMax=-1, dzMax=0.0, z=m_pGrid->asDouble(x, y), bEdge=false; i<8; i++) { if( !m_pGrid->is_InGrid(ix = Get_xTo(i, x), iy = Get_yTo(i, y)) ) { bEdge = true; } else if( dzMax < (dz = (m_bDown ? m_pGrid->asDouble(ix, iy) - z : z - m_pGrid->asDouble(ix, iy)) / Get_Length(i)) ) { dzMax = dz; iMax = i; } } //--------------------------------------------- m_Dir.Set_Value(x, y, iMax); if( iMax < 0 && (bEdge_Seeds || !bEdge) ) { int ID = m_pSeeds->Get_Count(); CSG_Shape *pSeed = m_pSeeds->Add_Shape(); pSeed->Set_Point(Get_System()->Get_Grid_to_World(x, y), 0); pSeed->Set_Value(SEED_X , x); pSeed->Set_Value(SEED_Y , y); pSeed->Set_Value(SEED_Z , z); pSeed->Set_Value(SEED_ID , ID); pSeed->Set_Value(SEED_JOIN , -1); m_pSegments->Set_Value(x, y, ID); } else { m_pSegments->Set_Value(x, y, -1); } } } } return( m_pSeeds->Get_Count() > 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWatershed_Segmentation::Get_Segments(void) { Process_Set_Text(_TL("Segments")); double Threshold = Parameters("THRESHOLD")->asDouble(); int Join = Threshold > 0.0 ? Parameters("JOIN")->asInt() : 0; //----------------------------------------------------- for(long n=0; nGet_Sorted(n, x, y, m_bDown) && (i = m_Dir.asInt(x, y)) >= 0 ) { m_pSegments->Set_Value(x, y, ID = m_pSegments->asInt(Get_xTo(i, x), Get_yTo(i, y))); if( Join != 0 && ID >= 0 ) { double z = m_pGrid->asDouble(x, y); for(int i=0; i<8; i++) { int ix = Get_xTo(i, x); int iy = Get_yTo(i, y); if( m_pSegments->is_InGrid(ix, iy) && (iID = m_pSegments->asInt(ix, iy)) >= 0 ) // Border < 0, Segment >= 0 { if( ID != iID ) { bool bJoin; if( Join == 1 ) { bJoin = (Threshold >= fabs(m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) - z)) || (Threshold >= fabs(m_pSeeds->Get_Shape( ID)->asDouble(SEED_Z) - z)); } else { bJoin = Threshold >= fabs(m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) - m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z)); } if( bJoin ) { if( (m_bDown == true && m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) < m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z)) || (m_bDown == false && m_pSeeds->Get_Shape(iID)->asDouble(SEED_Z) > m_pSeeds->Get_Shape(ID)->asDouble(SEED_Z)) ) { Segment_Change(iID, ID); } else { Segment_Change(ID, iID); ID = iID; } } } } } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWatershed_Segmentation::Segment_Change(int ID, int new_ID) { bool bContinue; int ax, ay, bx, by; //----------------------------------------------------- CSG_Shape *pSeed = m_pSeeds->Get_Shape(ID); pSeed->Set_Value(SEED_JOIN, new_ID); ax = bx = pSeed->asInt(SEED_X); ay = by = pSeed->asInt(SEED_Y); do { bContinue = false; for(int x=ax; x<=bx; x++) { if( m_pSegments->asInt( x, ay) == ID ) { m_pSegments->Set_Value( x, ay, new_ID); bContinue = true; } if( m_pSegments->asInt( x, by) == ID ) { m_pSegments->Set_Value( x, by, new_ID); bContinue = true; } } for(int y=ay; y<=by; y++) { if( m_pSegments->asInt(ax, y) == ID ) { m_pSegments->Set_Value(ax, y, new_ID); bContinue = true; } if( m_pSegments->asInt(bx, y) == ID ) { m_pSegments->Set_Value(bx, y, new_ID); bContinue = true; } } if( ax > 0 ) ax--; if( ay > 0 ) ay--; if( bx < Get_NX() - 1 ) bx++; if( by < Get_NY() - 1 ) by++; } while( bContinue ); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWatershed_Segmentation::Get_Borders(void) { Process_Set_Text(_TL("Borders")); CSG_Grid *pBorders = SG_Create_Grid(SG_DATATYPE_Byte, Get_NX() + 2, Get_NY() + 2, Get_Cellsize(), Get_XMin() - 0.5 * Get_Cellsize(), Get_YMin() - 0.5 * Get_Cellsize()); pBorders->Set_NoData_Value(0); Parameters("BORDERS")->Set_Value(pBorders); for(int y=0, yy=1; yyasInt(x, y); if( id != m_pSegments->asInt(xx, y) ) { pBorders->Set_Value(xx, y, 1); } if( id != m_pSegments->asInt( x, yy) ) { pBorders->Set_Value( x, yy, 1); } if( id != m_pSegments->asInt(xx, yy) ) { pBorders->Set_Value(xx, yy, 1); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_segmentation/watershed_segmentation.h000066400000000000000000000107321224124640700334500ustar00rootroot00000000000000/********************************************************** * Version $Id: watershed_segmentation.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_segmentation // // // //-------------------------------------------------------// // // // watershed_segmentation.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__watershed_segmentation_H #define HEADER_INCLUDED__watershed_segmentation_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CWatershed_Segmentation : public CSG_Module_Grid { public: CWatershed_Segmentation(void); protected: virtual bool On_Execute (void); private: bool m_bDown; CSG_Grid *m_pGrid, *m_pSegments, m_Dir; CSG_Shapes *m_pSeeds; bool Get_Seeds (void); bool Get_Segments (void); bool Segment_Change (int ID, int new_ID); bool Get_Borders (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__watershed_segmentation_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_svm/000077500000000000000000000000001224124640700246415ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_svm/MLB_Interface.cpp000066400000000000000000000112221224124640700277350ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // SVM // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" #include "svm.h" //--------------------------------------------------------- CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Imagery - SVM") ); case MLB_INFO_Author: return( SG_T("O.Conrad (c) 2012") ); case MLB_INFO_Description: return( _TW( "Interface to LIBSVM - A Library for Support Vector Machines.\n" "Reference:\n" "Chang, C.-C. / Lin, C.-J. (2011): A library for support vector machines. " "ACM Transactions on Intelligent Systems and Technology, vol.2/3, p.1-27. " "LIBSVM Homepage.\n" )); case MLB_INFO_Version: return( CSG_String::Format(SG_T("LIBSVM %d.%d"), libsvm_version / 100, libsvm_version - 100 * (libsvm_version / 100)) ); case MLB_INFO_Menu_Path: return( _TL("SVM") ); } } //--------------------------------------------------------- #include "svm_grids.h" //--------------------------------------------------------- CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CSVM_Grids ); case 10: return( NULL ); default: return( MLB_INTERFACE_SKIP_MODULE ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_svm/MLB_Interface.h000066400000000000000000000077761224124640700274250ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 1462 2012-08-16 18:55:05Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_classification // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__grid_discretisation_H #define HEADER_INCLUDED__grid_discretisation_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef grid_discretisation_EXPORTS #define grid_discretisation_EXPORT _SAGA_DLL_EXPORT #else #define grid_discretisation_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__grid_discretisation_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_svm/Makefile.am000066400000000000000000000010701224124640700266730ustar00rootroot00000000000000if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libimagery_svm.la libimagery_svm_la_SOURCES =\ MLB_Interface.cpp\ svm.cpp\ svm_grids.cpp\ MLB_Interface.h\ svm.h\ svm_grids.h libimagery_svm_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_svm/Makefile.in000066400000000000000000000442701224124640700267150ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_images/modules_imagery/imagery_svm DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libimagery_svm_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libimagery_svm_la_OBJECTS = MLB_Interface.lo svm.lo svm_grids.lo libimagery_svm_la_OBJECTS = $(am_libimagery_svm_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libimagery_svm_la_SOURCES) DIST_SOURCES = $(libimagery_svm_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libimagery_svm.la libimagery_svm_la_SOURCES = \ MLB_Interface.cpp\ svm.cpp\ svm_grids.cpp\ MLB_Interface.h\ svm.h\ svm_grids.h libimagery_svm_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_images/modules_imagery/imagery_svm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_images/modules_imagery/imagery_svm/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libimagery_svm.la: $(libimagery_svm_la_OBJECTS) $(libimagery_svm_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libimagery_svm_la_OBJECTS) $(libimagery_svm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svm_grids.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_svm/svm.cpp000066400000000000000000001727431224124640700261700ustar00rootroot00000000000000#include #include #include #include #include #include #include #include #include "svm.h" int libsvm_version = LIBSVM_VERSION; typedef float Qfloat; typedef signed char schar; #ifndef min template static inline T min(T x,T y) { return (x static inline T max(T x,T y) { return (x>y)?x:y; } #endif template static inline void swap(T& x, T& y) { T t=x; x=y; y=t; } template static inline void clone(T*& dst, S* src, int n) { dst = new T[n]; memcpy((void *)dst,(void *)src,sizeof(T)*n); } static inline double powi(double base, int times) { double tmp = base, ret = 1.0; for(int t=times; t>0; t/=2) { if(t%2==1) ret*=tmp; tmp = tmp * tmp; } return ret; } #define INF HUGE_VAL #define TAU 1e-12 #define Malloc(type,n) (type *)malloc((n)*sizeof(type)) static void print_string_stdout(const char *s) { fputs(s,stdout); fflush(stdout); } static void (*svm_print_string) (const char *) = &print_string_stdout; #if 1 static void info(const char *fmt,...) { char buf[BUFSIZ]; va_list ap; va_start(ap,fmt); vsprintf(buf,fmt,ap); va_end(ap); (*svm_print_string)(buf); } #else static void info(const char *fmt,...) {} #endif // // Kernel Cache // // l is the number of total data items // size is the cache size limit in bytes // class Cache { public: Cache(int l,long int size); ~Cache(); // request data [0,len) // return some position p where [p,len) need to be filled // (p >= len if nothing needs to be filled) int get_data(const int index, Qfloat **data, int len); void swap_index(int i, int j); private: int l; long int size; struct head_t { head_t *prev, *next; // a circular list Qfloat *data; int len; // data[0,len) is cached in this entry }; head_t *head; head_t lru_head; void lru_delete(head_t *h); void lru_insert(head_t *h); }; Cache::Cache(int l_,long int size_):l(l_),size(size_) { head = (head_t *)calloc(l,sizeof(head_t)); // initialized to 0 size /= sizeof(Qfloat); size -= l * sizeof(head_t) / sizeof(Qfloat); size = max(size, 2 * (long int) l); // cache must be large enough for two columns lru_head.next = lru_head.prev = &lru_head; } Cache::~Cache() { for(head_t *h = lru_head.next; h != &lru_head; h=h->next) free(h->data); free(head); } void Cache::lru_delete(head_t *h) { // delete from current location h->prev->next = h->next; h->next->prev = h->prev; } void Cache::lru_insert(head_t *h) { // insert to last position h->next = &lru_head; h->prev = lru_head.prev; h->prev->next = h; h->next->prev = h; } int Cache::get_data(const int index, Qfloat **data, int len) { head_t *h = &head[index]; if(h->len) lru_delete(h); int more = len - h->len; if(more > 0) { // free old space while(size < more) { head_t *old = lru_head.next; lru_delete(old); free(old->data); size += old->len; old->data = 0; old->len = 0; } // allocate new space h->data = (Qfloat *)realloc(h->data,sizeof(Qfloat)*len); size -= more; swap(h->len,len); } lru_insert(h); *data = h->data; return len; } void Cache::swap_index(int i, int j) { if(i==j) return; if(head[i].len) lru_delete(&head[i]); if(head[j].len) lru_delete(&head[j]); swap(head[i].data,head[j].data); swap(head[i].len,head[j].len); if(head[i].len) lru_insert(&head[i]); if(head[j].len) lru_insert(&head[j]); if(i>j) swap(i,j); for(head_t *h = lru_head.next; h!=&lru_head; h=h->next) { if(h->len > i) { if(h->len > j) swap(h->data[i],h->data[j]); else { // give up lru_delete(h); free(h->data); size += h->len; h->data = 0; h->len = 0; } } } } // // Kernel evaluation // // the static method k_function is for doing single kernel evaluation // the constructor of Kernel prepares to calculate the l*l kernel matrix // the member function get_Q is for getting one column from the Q Matrix // class QMatrix { public: virtual Qfloat *get_Q(int column, int len) const = 0; virtual double *get_QD() const = 0; virtual void swap_index(int i, int j) const = 0; virtual ~QMatrix() {} }; class Kernel: public QMatrix { public: Kernel(int l, svm_node * const * x, const svm_parameter& param); virtual ~Kernel(); static double k_function(const svm_node *x, const svm_node *y, const svm_parameter& param); virtual Qfloat *get_Q(int column, int len) const = 0; virtual double *get_QD() const = 0; virtual void swap_index(int i, int j) const // no so const... { swap(x[i],x[j]); if(x_square) swap(x_square[i],x_square[j]); } protected: double (Kernel::*kernel_function)(int i, int j) const; private: const svm_node **x; double *x_square; // svm_parameter const int kernel_type; const int degree; const double gamma; const double coef0; static double dot(const svm_node *px, const svm_node *py); double kernel_linear(int i, int j) const { return dot(x[i],x[j]); } double kernel_poly(int i, int j) const { return powi(gamma*dot(x[i],x[j])+coef0,degree); } double kernel_rbf(int i, int j) const { return exp(-gamma*(x_square[i]+x_square[j]-2*dot(x[i],x[j]))); } double kernel_sigmoid(int i, int j) const { return tanh(gamma*dot(x[i],x[j])+coef0); } double kernel_precomputed(int i, int j) const { return x[i][(int)(x[j][0].value)].value; } }; Kernel::Kernel(int l, svm_node * const * x_, const svm_parameter& param) :kernel_type(param.kernel_type), degree(param.degree), gamma(param.gamma), coef0(param.coef0) { switch(kernel_type) { case LINEAR: kernel_function = &Kernel::kernel_linear; break; case POLY: kernel_function = &Kernel::kernel_poly; break; case RBF: kernel_function = &Kernel::kernel_rbf; break; case SIGMOID: kernel_function = &Kernel::kernel_sigmoid; break; case PRECOMPUTED: kernel_function = &Kernel::kernel_precomputed; break; } clone(x,x_,l); if(kernel_type == RBF) { x_square = new double[l]; for(int i=0;iindex != -1 && py->index != -1) { if(px->index == py->index) { sum += px->value * py->value; ++px; ++py; } else { if(px->index > py->index) ++py; else ++px; } } return sum; } double Kernel::k_function(const svm_node *x, const svm_node *y, const svm_parameter& param) { switch(param.kernel_type) { case LINEAR: return dot(x,y); case POLY: return powi(param.gamma*dot(x,y)+param.coef0,param.degree); case RBF: { double sum = 0; while(x->index != -1 && y->index !=-1) { if(x->index == y->index) { double d = x->value - y->value; sum += d*d; ++x; ++y; } else { if(x->index > y->index) { sum += y->value * y->value; ++y; } else { sum += x->value * x->value; ++x; } } } while(x->index != -1) { sum += x->value * x->value; ++x; } while(y->index != -1) { sum += y->value * y->value; ++y; } return exp(-param.gamma*sum); } case SIGMOID: return tanh(param.gamma*dot(x,y)+param.coef0); case PRECOMPUTED: //x: test (validation), y: SV return x[(int)(y->value)].value; default: return 0; // Unreachable } } // An SMO algorithm in Fan et al., JMLR 6(2005), p. 1889--1918 // Solves: // // min 0.5(\alpha^T Q \alpha) + p^T \alpha // // y^T \alpha = \delta // y_i = +1 or -1 // 0 <= alpha_i <= Cp for y_i = 1 // 0 <= alpha_i <= Cn for y_i = -1 // // Given: // // Q, p, y, Cp, Cn, and an initial feasible point \alpha // l is the size of vectors and matrices // eps is the stopping tolerance // // solution will be put in \alpha, objective value will be put in obj // class Solver { public: Solver() {}; virtual ~Solver() {}; struct SolutionInfo { double obj; double rho; double upper_bound_p; double upper_bound_n; double r; // for Solver_NU }; void Solve(int l, const QMatrix& Q, const double *p_, const schar *y_, double *alpha_, double Cp, double Cn, double eps, SolutionInfo* si, int shrinking); protected: int active_size; schar *y; double *G; // gradient of objective function enum { LOWER_BOUND, UPPER_BOUND, FREE }; char *alpha_status; // LOWER_BOUND, UPPER_BOUND, FREE double *alpha; const QMatrix *Q; const double *QD; double eps; double Cp,Cn; double *p; int *active_set; double *G_bar; // gradient, if we treat free variables as 0 int l; bool unshrink; // XXX double get_C(int i) { return (y[i] > 0)? Cp : Cn; } void update_alpha_status(int i) { if(alpha[i] >= get_C(i)) alpha_status[i] = UPPER_BOUND; else if(alpha[i] <= 0) alpha_status[i] = LOWER_BOUND; else alpha_status[i] = FREE; } bool is_upper_bound(int i) { return alpha_status[i] == UPPER_BOUND; } bool is_lower_bound(int i) { return alpha_status[i] == LOWER_BOUND; } bool is_free(int i) { return alpha_status[i] == FREE; } void swap_index(int i, int j); void reconstruct_gradient(); virtual int select_working_set(int &i, int &j); virtual double calculate_rho(); virtual void do_shrinking(); private: bool be_shrunk(int i, double Gmax1, double Gmax2); }; void Solver::swap_index(int i, int j) { Q->swap_index(i,j); swap(y[i],y[j]); swap(G[i],G[j]); swap(alpha_status[i],alpha_status[j]); swap(alpha[i],alpha[j]); swap(p[i],p[j]); swap(active_set[i],active_set[j]); swap(G_bar[i],G_bar[j]); } void Solver::reconstruct_gradient() { // reconstruct inactive elements of G from G_bar and free variables if(active_size == l) return; int i,j; int nr_free = 0; for(j=active_size;j 2*active_size*(l-active_size)) { for(i=active_size;iget_Q(i,active_size); for(j=0;jget_Q(i,l); double alpha_i = alpha[i]; for(j=active_size;jl = l; this->Q = &Q; QD=Q.get_QD(); clone(p, p_,l); clone(y, y_,l); clone(alpha,alpha_,l); this->Cp = Cp; this->Cn = Cn; this->eps = eps; unshrink = false; // initialize alpha_status { alpha_status = new char[l]; for(int i=0;iINT_MAX/100 ? INT_MAX : 100*l); int counter = min(l,1000)+1; while(iter < max_iter) { // show progress and do shrinking if(--counter == 0) { counter = min(l,1000); if(shrinking) do_shrinking(); info("."); } int i,j; if(select_working_set(i,j)!=0) { // reconstruct the whole gradient reconstruct_gradient(); // reset active set size and check active_size = l; info("*"); if(select_working_set(i,j)!=0) break; else counter = 1; // do shrinking next iteration } ++iter; // update alpha[i] and alpha[j], handle bounds carefully const Qfloat *Q_i = Q.get_Q(i,active_size); const Qfloat *Q_j = Q.get_Q(j,active_size); double C_i = get_C(i); double C_j = get_C(j); double old_alpha_i = alpha[i]; double old_alpha_j = alpha[j]; if(y[i]!=y[j]) { double quad_coef = QD[i]+QD[j]+2*Q_i[j]; if (quad_coef <= 0) quad_coef = TAU; double delta = (-G[i]-G[j])/quad_coef; double diff = alpha[i] - alpha[j]; alpha[i] += delta; alpha[j] += delta; if(diff > 0) { if(alpha[j] < 0) { alpha[j] = 0; alpha[i] = diff; } } else { if(alpha[i] < 0) { alpha[i] = 0; alpha[j] = -diff; } } if(diff > C_i - C_j) { if(alpha[i] > C_i) { alpha[i] = C_i; alpha[j] = C_i - diff; } } else { if(alpha[j] > C_j) { alpha[j] = C_j; alpha[i] = C_j + diff; } } } else { double quad_coef = QD[i]+QD[j]-2*Q_i[j]; if (quad_coef <= 0) quad_coef = TAU; double delta = (G[i]-G[j])/quad_coef; double sum = alpha[i] + alpha[j]; alpha[i] -= delta; alpha[j] += delta; if(sum > C_i) { if(alpha[i] > C_i) { alpha[i] = C_i; alpha[j] = sum - C_i; } } else { if(alpha[j] < 0) { alpha[j] = 0; alpha[i] = sum; } } if(sum > C_j) { if(alpha[j] > C_j) { alpha[j] = C_j; alpha[i] = sum - C_j; } } else { if(alpha[i] < 0) { alpha[i] = 0; alpha[j] = sum; } } } // update G double delta_alpha_i = alpha[i] - old_alpha_i; double delta_alpha_j = alpha[j] - old_alpha_j; for(int k=0;k= max_iter) { if(active_size < l) { // reconstruct the whole gradient to calculate objective value reconstruct_gradient(); active_size = l; info("*"); } info("\nWARNING: reaching max number of iterations"); } // calculate rho si->rho = calculate_rho(); // calculate objective value { double v = 0; int i; for(i=0;iobj = v/2; } // put back the solution { for(int i=0;iupper_bound_p = Cp; si->upper_bound_n = Cn; info("\noptimization finished, #iter = %d\n",iter); delete[] p; delete[] y; delete[] alpha; delete[] alpha_status; delete[] active_set; delete[] G; delete[] G_bar; } // return 1 if already optimal, return 0 otherwise int Solver::select_working_set(int &out_i, int &out_j) { // return i,j such that // i: maximizes -y_i * grad(f)_i, i in I_up(\alpha) // j: minimizes the decrease of obj value // (if quadratic coefficeint <= 0, replace it with tau) // -y_j*grad(f)_j < -y_i*grad(f)_i, j in I_low(\alpha) double Gmax = -INF; double Gmax2 = -INF; int Gmax_idx = -1; int Gmin_idx = -1; double obj_diff_min = INF; for(int t=0;t= Gmax) { Gmax = -G[t]; Gmax_idx = t; } } else { if(!is_lower_bound(t)) if(G[t] >= Gmax) { Gmax = G[t]; Gmax_idx = t; } } int i = Gmax_idx; const Qfloat *Q_i = NULL; if(i != -1) // NULL Q_i not accessed: Gmax=-INF if i=-1 Q_i = Q->get_Q(i,active_size); for(int j=0;j= Gmax2) Gmax2 = G[j]; if (grad_diff > 0) { double obj_diff; double quad_coef = QD[i]+QD[j]-2.0*y[i]*Q_i[j]; if (quad_coef > 0) obj_diff = -(grad_diff*grad_diff)/quad_coef; else obj_diff = -(grad_diff*grad_diff)/TAU; if (obj_diff <= obj_diff_min) { Gmin_idx=j; obj_diff_min = obj_diff; } } } } else { if (!is_upper_bound(j)) { double grad_diff= Gmax-G[j]; if (-G[j] >= Gmax2) Gmax2 = -G[j]; if (grad_diff > 0) { double obj_diff; double quad_coef = QD[i]+QD[j]+2.0*y[i]*Q_i[j]; if (quad_coef > 0) obj_diff = -(grad_diff*grad_diff)/quad_coef; else obj_diff = -(grad_diff*grad_diff)/TAU; if (obj_diff <= obj_diff_min) { Gmin_idx=j; obj_diff_min = obj_diff; } } } } } if(Gmax+Gmax2 < eps) return 1; out_i = Gmax_idx; out_j = Gmin_idx; return 0; } bool Solver::be_shrunk(int i, double Gmax1, double Gmax2) { if(is_upper_bound(i)) { if(y[i]==+1) return(-G[i] > Gmax1); else return(-G[i] > Gmax2); } else if(is_lower_bound(i)) { if(y[i]==+1) return(G[i] > Gmax2); else return(G[i] > Gmax1); } else return(false); } void Solver::do_shrinking() { int i; double Gmax1 = -INF; // max { -y_i * grad(f)_i | i in I_up(\alpha) } double Gmax2 = -INF; // max { y_i * grad(f)_i | i in I_low(\alpha) } // find maximal violating pair first for(i=0;i= Gmax1) Gmax1 = -G[i]; } if(!is_lower_bound(i)) { if(G[i] >= Gmax2) Gmax2 = G[i]; } } else { if(!is_upper_bound(i)) { if(-G[i] >= Gmax2) Gmax2 = -G[i]; } if(!is_lower_bound(i)) { if(G[i] >= Gmax1) Gmax1 = G[i]; } } } if(unshrink == false && Gmax1 + Gmax2 <= eps*10) { unshrink = true; reconstruct_gradient(); active_size = l; info("*"); } for(i=0;i i) { if (!be_shrunk(active_size, Gmax1, Gmax2)) { swap_index(i,active_size); break; } active_size--; } } } double Solver::calculate_rho() { double r; int nr_free = 0; double ub = INF, lb = -INF, sum_free = 0; for(int i=0;i0) r = sum_free/nr_free; else r = (ub+lb)/2; return r; } // // Solver for nu-svm classification and regression // // additional constraint: e^T \alpha = constant // class Solver_NU : public Solver { public: Solver_NU() {} void Solve(int l, const QMatrix& Q, const double *p, const schar *y, double *alpha, double Cp, double Cn, double eps, SolutionInfo* si, int shrinking) { this->si = si; Solver::Solve(l,Q,p,y,alpha,Cp,Cn,eps,si,shrinking); } private: SolutionInfo *si; int select_working_set(int &i, int &j); double calculate_rho(); bool be_shrunk(int i, double Gmax1, double Gmax2, double Gmax3, double Gmax4); void do_shrinking(); }; // return 1 if already optimal, return 0 otherwise int Solver_NU::select_working_set(int &out_i, int &out_j) { // return i,j such that y_i = y_j and // i: maximizes -y_i * grad(f)_i, i in I_up(\alpha) // j: minimizes the decrease of obj value // (if quadratic coefficeint <= 0, replace it with tau) // -y_j*grad(f)_j < -y_i*grad(f)_i, j in I_low(\alpha) double Gmaxp = -INF; double Gmaxp2 = -INF; int Gmaxp_idx = -1; double Gmaxn = -INF; double Gmaxn2 = -INF; int Gmaxn_idx = -1; int Gmin_idx = -1; double obj_diff_min = INF; for(int t=0;t= Gmaxp) { Gmaxp = -G[t]; Gmaxp_idx = t; } } else { if(!is_lower_bound(t)) if(G[t] >= Gmaxn) { Gmaxn = G[t]; Gmaxn_idx = t; } } int ip = Gmaxp_idx; int in = Gmaxn_idx; const Qfloat *Q_ip = NULL; const Qfloat *Q_in = NULL; if(ip != -1) // NULL Q_ip not accessed: Gmaxp=-INF if ip=-1 Q_ip = Q->get_Q(ip,active_size); if(in != -1) Q_in = Q->get_Q(in,active_size); for(int j=0;j= Gmaxp2) Gmaxp2 = G[j]; if (grad_diff > 0) { double obj_diff; double quad_coef = QD[ip]+QD[j]-2*Q_ip[j]; if (quad_coef > 0) obj_diff = -(grad_diff*grad_diff)/quad_coef; else obj_diff = -(grad_diff*grad_diff)/TAU; if (obj_diff <= obj_diff_min) { Gmin_idx=j; obj_diff_min = obj_diff; } } } } else { if (!is_upper_bound(j)) { double grad_diff=Gmaxn-G[j]; if (-G[j] >= Gmaxn2) Gmaxn2 = -G[j]; if (grad_diff > 0) { double obj_diff; double quad_coef = QD[in]+QD[j]-2*Q_in[j]; if (quad_coef > 0) obj_diff = -(grad_diff*grad_diff)/quad_coef; else obj_diff = -(grad_diff*grad_diff)/TAU; if (obj_diff <= obj_diff_min) { Gmin_idx=j; obj_diff_min = obj_diff; } } } } } if(max(Gmaxp+Gmaxp2,Gmaxn+Gmaxn2) < eps) return 1; if (y[Gmin_idx] == +1) out_i = Gmaxp_idx; else out_i = Gmaxn_idx; out_j = Gmin_idx; return 0; } bool Solver_NU::be_shrunk(int i, double Gmax1, double Gmax2, double Gmax3, double Gmax4) { if(is_upper_bound(i)) { if(y[i]==+1) return(-G[i] > Gmax1); else return(-G[i] > Gmax4); } else if(is_lower_bound(i)) { if(y[i]==+1) return(G[i] > Gmax2); else return(G[i] > Gmax3); } else return(false); } void Solver_NU::do_shrinking() { double Gmax1 = -INF; // max { -y_i * grad(f)_i | y_i = +1, i in I_up(\alpha) } double Gmax2 = -INF; // max { y_i * grad(f)_i | y_i = +1, i in I_low(\alpha) } double Gmax3 = -INF; // max { -y_i * grad(f)_i | y_i = -1, i in I_up(\alpha) } double Gmax4 = -INF; // max { y_i * grad(f)_i | y_i = -1, i in I_low(\alpha) } // find maximal violating pair first int i; for(i=0;i Gmax1) Gmax1 = -G[i]; } else if(-G[i] > Gmax4) Gmax4 = -G[i]; } if(!is_lower_bound(i)) { if(y[i]==+1) { if(G[i] > Gmax2) Gmax2 = G[i]; } else if(G[i] > Gmax3) Gmax3 = G[i]; } } if(unshrink == false && max(Gmax1+Gmax2,Gmax3+Gmax4) <= eps*10) { unshrink = true; reconstruct_gradient(); active_size = l; } for(i=0;i i) { if (!be_shrunk(active_size, Gmax1, Gmax2, Gmax3, Gmax4)) { swap_index(i,active_size); break; } active_size--; } } } double Solver_NU::calculate_rho() { int nr_free1 = 0,nr_free2 = 0; double ub1 = INF, ub2 = INF; double lb1 = -INF, lb2 = -INF; double sum_free1 = 0, sum_free2 = 0; for(int i=0;i 0) r1 = sum_free1/nr_free1; else r1 = (ub1+lb1)/2; if(nr_free2 > 0) r2 = sum_free2/nr_free2; else r2 = (ub2+lb2)/2; si->r = (r1+r2)/2; return (r1-r2)/2; } // // Q matrices for various formulations // class SVC_Q: public Kernel { public: SVC_Q(const svm_problem& prob, const svm_parameter& param, const schar *y_) :Kernel(prob.l, prob.x, param) { clone(y,y_,prob.l); cache = new Cache(prob.l,(long int)(param.cache_size*(1<<20))); QD = new double[prob.l]; for(int i=0;i*kernel_function)(i,i); } Qfloat *get_Q(int i, int len) const { Qfloat *data; int start, j; if((start = cache->get_data(i,&data,len)) < len) { for(j=start;j*kernel_function)(i,j)); } return data; } double *get_QD() const { return QD; } void swap_index(int i, int j) const { cache->swap_index(i,j); Kernel::swap_index(i,j); swap(y[i],y[j]); swap(QD[i],QD[j]); } ~SVC_Q() { delete[] y; delete cache; delete[] QD; } private: schar *y; Cache *cache; double *QD; }; class ONE_CLASS_Q: public Kernel { public: ONE_CLASS_Q(const svm_problem& prob, const svm_parameter& param) :Kernel(prob.l, prob.x, param) { cache = new Cache(prob.l,(long int)(param.cache_size*(1<<20))); QD = new double[prob.l]; for(int i=0;i*kernel_function)(i,i); } Qfloat *get_Q(int i, int len) const { Qfloat *data; int start, j; if((start = cache->get_data(i,&data,len)) < len) { for(j=start;j*kernel_function)(i,j); } return data; } double *get_QD() const { return QD; } void swap_index(int i, int j) const { cache->swap_index(i,j); Kernel::swap_index(i,j); swap(QD[i],QD[j]); } ~ONE_CLASS_Q() { delete cache; delete[] QD; } private: Cache *cache; double *QD; }; class SVR_Q: public Kernel { public: SVR_Q(const svm_problem& prob, const svm_parameter& param) :Kernel(prob.l, prob.x, param) { l = prob.l; cache = new Cache(l,(long int)(param.cache_size*(1<<20))); QD = new double[2*l]; sign = new schar[2*l]; index = new int[2*l]; for(int k=0;k*kernel_function)(k,k); QD[k+l] = QD[k]; } buffer[0] = new Qfloat[2*l]; buffer[1] = new Qfloat[2*l]; next_buffer = 0; } void swap_index(int i, int j) const { swap(sign[i],sign[j]); swap(index[i],index[j]); swap(QD[i],QD[j]); } Qfloat *get_Q(int i, int len) const { Qfloat *data; int j, real_i = index[i]; if(cache->get_data(real_i,&data,l) < l) { for(j=0;j*kernel_function)(real_i,j); } // reorder and copy Qfloat *buf = buffer[next_buffer]; next_buffer = 1 - next_buffer; schar si = sign[i]; for(j=0;jl; double *minus_ones = new double[l]; schar *y = new schar[l]; int i; for(i=0;iy[i] > 0) y[i] = +1; else y[i] = -1; } Solver s; s.Solve(l, SVC_Q(*prob,*param,y), minus_ones, y, alpha, Cp, Cn, param->eps, si, param->shrinking); double sum_alpha=0; for(i=0;il)); for(i=0;il; double nu = param->nu; schar *y = new schar[l]; for(i=0;iy[i]>0) y[i] = +1; else y[i] = -1; double sum_pos = nu*l/2; double sum_neg = nu*l/2; for(i=0;ieps, si, param->shrinking); double r = si->r; info("C = %f\n",1/r); for(i=0;irho /= r; si->obj /= (r*r); si->upper_bound_p = 1/r; si->upper_bound_n = 1/r; delete[] y; delete[] zeros; } static void solve_one_class( const svm_problem *prob, const svm_parameter *param, double *alpha, Solver::SolutionInfo* si) { int l = prob->l; double *zeros = new double[l]; schar *ones = new schar[l]; int i; int n = (int)(param->nu*prob->l); // # of alpha's at upper bound for(i=0;il) alpha[n] = param->nu * prob->l - n; for(i=n+1;ieps, si, param->shrinking); delete[] zeros; delete[] ones; } static void solve_epsilon_svr( const svm_problem *prob, const svm_parameter *param, double *alpha, Solver::SolutionInfo* si) { int l = prob->l; double *alpha2 = new double[2*l]; double *linear_term = new double[2*l]; schar *y = new schar[2*l]; int i; for(i=0;ip - prob->y[i]; y[i] = 1; alpha2[i+l] = 0; linear_term[i+l] = param->p + prob->y[i]; y[i+l] = -1; } Solver s; s.Solve(2*l, SVR_Q(*prob,*param), linear_term, y, alpha2, param->C, param->C, param->eps, si, param->shrinking); double sum_alpha = 0; for(i=0;iC*l)); delete[] alpha2; delete[] linear_term; delete[] y; } static void solve_nu_svr( const svm_problem *prob, const svm_parameter *param, double *alpha, Solver::SolutionInfo* si) { int l = prob->l; double C = param->C; double *alpha2 = new double[2*l]; double *linear_term = new double[2*l]; schar *y = new schar[2*l]; int i; double sum = C * param->nu * l / 2; for(i=0;iy[i]; y[i] = 1; linear_term[i+l] = prob->y[i]; y[i+l] = -1; } Solver_NU s; s.Solve(2*l, SVR_Q(*prob,*param), linear_term, y, alpha2, C, C, param->eps, si, param->shrinking); info("epsilon = %f\n",-si->r); for(i=0;il); Solver::SolutionInfo si; switch(param->svm_type) { case C_SVC: solve_c_svc(prob,param,alpha,&si,Cp,Cn); break; case NU_SVC: solve_nu_svc(prob,param,alpha,&si); break; case ONE_CLASS: solve_one_class(prob,param,alpha,&si); break; case EPSILON_SVR: solve_epsilon_svr(prob,param,alpha,&si); break; case NU_SVR: solve_nu_svr(prob,param,alpha,&si); break; } info("obj = %f, rho = %f\n",si.obj,si.rho); // output SVs int nSV = 0; int nBSV = 0; for(int i=0;il;i++) { if(fabs(alpha[i]) > 0) { ++nSV; if(prob->y[i] > 0) { if(fabs(alpha[i]) >= si.upper_bound_p) ++nBSV; } else { if(fabs(alpha[i]) >= si.upper_bound_n) ++nBSV; } } } info("nSV = %d, nBSV = %d\n",nSV,nBSV); decision_function f; f.alpha = alpha; f.rho = si.rho; return f; } // Platt's binary SVM Probablistic Output: an improvement from Lin et al. static void sigmoid_train( int l, const double *dec_values, const double *labels, double& A, double& B) { double prior1=0, prior0 = 0; int i; for (i=0;i 0) prior1+=1; else prior0+=1; int max_iter=100; // Maximal number of iterations double min_step=1e-10; // Minimal step taken in line search double sigma=1e-12; // For numerically strict PD of Hessian double eps=1e-5; double hiTarget=(prior1+1.0)/(prior1+2.0); double loTarget=1/(prior0+2.0); double *t=Malloc(double,l); double fApB,p,q,h11,h22,h21,g1,g2,det,dA,dB,gd,stepsize; double newA,newB,newf,d1,d2; int iter; // Initial Point and Initial Fun Value A=0.0; B=log((prior0+1.0)/(prior1+1.0)); double fval = 0.0; for (i=0;i0) t[i]=hiTarget; else t[i]=loTarget; fApB = dec_values[i]*A+B; if (fApB>=0) fval += t[i]*fApB + log(1+exp(-fApB)); else fval += (t[i] - 1)*fApB +log(1+exp(fApB)); } for (iter=0;iter= 0) { p=exp(-fApB)/(1.0+exp(-fApB)); q=1.0/(1.0+exp(-fApB)); } else { p=1.0/(1.0+exp(fApB)); q=exp(fApB)/(1.0+exp(fApB)); } d2=p*q; h11+=dec_values[i]*dec_values[i]*d2; h22+=d2; h21+=dec_values[i]*d2; d1=t[i]-p; g1+=dec_values[i]*d1; g2+=d1; } // Stopping Criteria if (fabs(g1)= min_step) { newA = A + stepsize * dA; newB = B + stepsize * dB; // New function value newf = 0.0; for (i=0;i= 0) newf += t[i]*fApB + log(1+exp(-fApB)); else newf += (t[i] - 1)*fApB +log(1+exp(fApB)); } // Check sufficient decrease if (newf=max_iter) info("Reaching maximal iterations in two-class probability estimates\n"); free(t); } static double sigmoid_predict(double decision_value, double A, double B) { double fApB = decision_value*A+B; // 1-p used later; avoid catastrophic cancellation if (fApB >= 0) return exp(-fApB)/(1.0+exp(-fApB)); else return 1.0/(1+exp(fApB)) ; } // Method 2 from the multiclass_prob paper by Wu, Lin, and Weng static void multiclass_probability(int k, double **r, double *p) { int t,j; int iter = 0, max_iter=max(100,k); double **Q=Malloc(double *,k); double *Qp=Malloc(double,k); double pQp, eps=0.005/k; for (t=0;tmax_error) max_error=error; } if (max_error=max_iter) info("Exceeds max_iter in multiclass_prob\n"); for(t=0;tl); double *dec_values = Malloc(double,prob->l); // random shuffle for(i=0;il;i++) perm[i]=i; for(i=0;il;i++) { int j = i+rand()%(prob->l-i); swap(perm[i],perm[j]); } for(i=0;il/nr_fold; int end = (i+1)*prob->l/nr_fold; int j,k; struct svm_problem subprob; subprob.l = prob->l-(end-begin); subprob.x = Malloc(struct svm_node*,subprob.l); subprob.y = Malloc(double,subprob.l); k=0; for(j=0;jx[perm[j]]; subprob.y[k] = prob->y[perm[j]]; ++k; } for(j=end;jl;j++) { subprob.x[k] = prob->x[perm[j]]; subprob.y[k] = prob->y[perm[j]]; ++k; } int p_count=0,n_count=0; for(j=0;j0) p_count++; else n_count++; if(p_count==0 && n_count==0) for(j=begin;j 0 && n_count == 0) for(j=begin;j 0) for(j=begin;jx[perm[j]],&(dec_values[perm[j]])); // ensure +1 -1 order; reason not using CV subroutine dec_values[perm[j]] *= submodel->label[0]; } svm_free_and_destroy_model(&submodel); svm_destroy_param(&subparam); } free(subprob.x); free(subprob.y); } sigmoid_train(prob->l,dec_values,prob->y,probA,probB); free(dec_values); free(perm); } // Return parameter of a Laplace distribution static double svm_svr_probability( const svm_problem *prob, const svm_parameter *param) { int i; int nr_fold = 5; double *ymv = Malloc(double,prob->l); double mae = 0; svm_parameter newparam = *param; newparam.probability = 0; svm_cross_validation(prob,&newparam,nr_fold,ymv); for(i=0;il;i++) { ymv[i]=prob->y[i]-ymv[i]; mae += fabs(ymv[i]); } mae /= prob->l; double std=sqrt(2*mae*mae); int count=0; mae=0; for(i=0;il;i++) if (fabs(ymv[i]) > 5*std) count=count+1; else mae+=fabs(ymv[i]); mae /= (prob->l-count); info("Prob. model for test data: target value = predicted value + z,\nz: Laplace distribution e^(-|z|/sigma)/(2sigma),sigma= %g\n",mae); free(ymv); return mae; } // label: label name, start: begin of each class, count: #data of classes, perm: indices to the original data // perm, length l, must be allocated before calling this subroutine static void svm_group_classes(const svm_problem *prob, int *nr_class_ret, int **label_ret, int **start_ret, int **count_ret, int *perm) { int l = prob->l; int max_nr_class = 16; int nr_class = 0; int *label = Malloc(int,max_nr_class); int *count = Malloc(int,max_nr_class); int *data_label = Malloc(int,l); int i; for(i=0;iy[i]; int j; for(j=0;jparam = *param; model->free_sv = 0; // XXX if(param->svm_type == ONE_CLASS || param->svm_type == EPSILON_SVR || param->svm_type == NU_SVR) { // regression or one-class-svm model->nr_class = 2; model->label = NULL; model->nSV = NULL; model->probA = NULL; model->probB = NULL; model->sv_coef = Malloc(double *,1); if(param->probability && (param->svm_type == EPSILON_SVR || param->svm_type == NU_SVR)) { model->probA = Malloc(double,1); model->probA[0] = svm_svr_probability(prob,param); } decision_function f = svm_train_one(prob,param,0,0); model->rho = Malloc(double,1); model->rho[0] = f.rho; int nSV = 0; int i; for(i=0;il;i++) if(fabs(f.alpha[i]) > 0) ++nSV; model->l = nSV; model->SV = Malloc(svm_node *,nSV); model->sv_coef[0] = Malloc(double,nSV); int j = 0; for(i=0;il;i++) if(fabs(f.alpha[i]) > 0) { model->SV[j] = prob->x[i]; model->sv_coef[0][j] = f.alpha[i]; ++j; } free(f.alpha); } else { // classification int l = prob->l; int nr_class; int *label = NULL; int *start = NULL; int *count = NULL; int *perm = Malloc(int,l); // group training data of the same class svm_group_classes(prob,&nr_class,&label,&start,&count,perm); if(nr_class == 1) info("WARNING: training data in only one class. See README for details.\n"); svm_node **x = Malloc(svm_node *,l); int i; for(i=0;ix[perm[i]]; // calculate weighted C double *weighted_C = Malloc(double, nr_class); for(i=0;iC; for(i=0;inr_weight;i++) { int j; for(j=0;jweight_label[i] == label[j]) break; if(j == nr_class) fprintf(stderr,"WARNING: class label %d specified in weight is not found\n", param->weight_label[i]); else weighted_C[j] *= param->weight[i]; } // train k*(k-1)/2 models bool *nonzero = Malloc(bool,l); for(i=0;iprobability) { probA=Malloc(double,nr_class*(nr_class-1)/2); probB=Malloc(double,nr_class*(nr_class-1)/2); } int p = 0; for(i=0;iprobability) svm_binary_svc_probability(&sub_prob,param,weighted_C[i],weighted_C[j],probA[p],probB[p]); f[p] = svm_train_one(&sub_prob,param,weighted_C[i],weighted_C[j]); for(k=0;k 0) nonzero[si+k] = true; for(k=0;k 0) nonzero[sj+k] = true; free(sub_prob.x); free(sub_prob.y); ++p; } // build output model->nr_class = nr_class; model->label = Malloc(int,nr_class); for(i=0;ilabel[i] = label[i]; model->rho = Malloc(double,nr_class*(nr_class-1)/2); for(i=0;irho[i] = f[i].rho; if(param->probability) { model->probA = Malloc(double,nr_class*(nr_class-1)/2); model->probB = Malloc(double,nr_class*(nr_class-1)/2); for(i=0;iprobA[i] = probA[i]; model->probB[i] = probB[i]; } } else { model->probA=NULL; model->probB=NULL; } int total_sv = 0; int *nz_count = Malloc(int,nr_class); model->nSV = Malloc(int,nr_class); for(i=0;inSV[i] = nSV; nz_count[i] = nSV; } info("Total nSV = %d\n",total_sv); model->l = total_sv; model->SV = Malloc(svm_node *,total_sv); p = 0; for(i=0;iSV[p++] = x[i]; int *nz_start = Malloc(int,nr_class); nz_start[0] = 0; for(i=1;isv_coef = Malloc(double *,nr_class-1); for(i=0;isv_coef[i] = Malloc(double,total_sv); p = 0; for(i=0;isv_coef[j-1][q++] = f[p].alpha[k]; q = nz_start[j]; for(k=0;ksv_coef[i][q++] = f[p].alpha[ci+k]; ++p; } free(label); free(probA); free(probB); free(count); free(perm); free(start); free(x); free(weighted_C); free(nonzero); for(i=0;il; int *perm = Malloc(int,l); int nr_class; // stratified cv may not give leave-one-out rate // Each class to l folds -> some folds may have zero elements if((param->svm_type == C_SVC || param->svm_type == NU_SVC) && nr_fold < l) { int *start = NULL; int *label = NULL; int *count = NULL; svm_group_classes(prob,&nr_class,&label,&start,&count,perm); // random shuffle and then data grouped by fold using the array perm int *fold_count = Malloc(int,nr_fold); int c; int *index = Malloc(int,l); for(i=0;ix[perm[j]]; subprob.y[k] = prob->y[perm[j]]; ++k; } for(j=end;jx[perm[j]]; subprob.y[k] = prob->y[perm[j]]; ++k; } struct svm_model *submodel = svm_train(&subprob,param); if(param->probability && (param->svm_type == C_SVC || param->svm_type == NU_SVC)) { double *prob_estimates=Malloc(double,svm_get_nr_class(submodel)); for(j=begin;jx[perm[j]],prob_estimates); free(prob_estimates); } else for(j=begin;jx[perm[j]]); svm_free_and_destroy_model(&submodel); free(subprob.x); free(subprob.y); } free(fold_start); free(perm); } int svm_get_svm_type(const svm_model *model) { return model->param.svm_type; } int svm_get_nr_class(const svm_model *model) { return model->nr_class; } void svm_get_labels(const svm_model *model, int* label) { if (model->label != NULL) for(int i=0;inr_class;i++) label[i] = model->label[i]; } double svm_get_svr_probability(const svm_model *model) { if ((model->param.svm_type == EPSILON_SVR || model->param.svm_type == NU_SVR) && model->probA!=NULL) return model->probA[0]; else { fprintf(stderr,"Model doesn't contain information for SVR probability inference\n"); return 0; } } double svm_predict_values(const svm_model *model, const svm_node *x, double* dec_values) { int i; if(model->param.svm_type == ONE_CLASS || model->param.svm_type == EPSILON_SVR || model->param.svm_type == NU_SVR) { double *sv_coef = model->sv_coef[0]; double sum = 0; for(i=0;il;i++) sum += sv_coef[i] * Kernel::k_function(x,model->SV[i],model->param); sum -= model->rho[0]; *dec_values = sum; if(model->param.svm_type == ONE_CLASS) return (sum>0)?1:-1; else return sum; } else { int nr_class = model->nr_class; int l = model->l; double *kvalue = Malloc(double,l); for(i=0;iSV[i],model->param); int *start = Malloc(int,nr_class); start[0] = 0; for(i=1;inSV[i-1]; int *vote = Malloc(int,nr_class); for(i=0;inSV[i]; int cj = model->nSV[j]; int k; double *coef1 = model->sv_coef[j-1]; double *coef2 = model->sv_coef[i]; for(k=0;krho[p]; dec_values[p] = sum; if(dec_values[p] > 0) ++vote[i]; else ++vote[j]; p++; } int vote_max_idx = 0; for(i=1;i vote[vote_max_idx]) vote_max_idx = i; free(kvalue); free(start); free(vote); return model->label[vote_max_idx]; } } double svm_predict(const svm_model *model, const svm_node *x) { int nr_class = model->nr_class; double *dec_values; if(model->param.svm_type == ONE_CLASS || model->param.svm_type == EPSILON_SVR || model->param.svm_type == NU_SVR) dec_values = Malloc(double, 1); else dec_values = Malloc(double, nr_class*(nr_class-1)/2); double pred_result = svm_predict_values(model, x, dec_values); free(dec_values); return pred_result; } double svm_predict_probability( const svm_model *model, const svm_node *x, double *prob_estimates) { if ((model->param.svm_type == C_SVC || model->param.svm_type == NU_SVC) && model->probA!=NULL && model->probB!=NULL) { int i; int nr_class = model->nr_class; double *dec_values = Malloc(double, nr_class*(nr_class-1)/2); svm_predict_values(model, x, dec_values); double min_prob=1e-7; double **pairwise_prob=Malloc(double *,nr_class); for(i=0;iprobA[k],model->probB[k]),min_prob),1-min_prob); pairwise_prob[j][i]=1-pairwise_prob[i][j]; k++; } multiclass_probability(nr_class,pairwise_prob,prob_estimates); int prob_max_idx = 0; for(i=1;i prob_estimates[prob_max_idx]) prob_max_idx = i; for(i=0;ilabel[prob_max_idx]; } else return svm_predict(model, x); } static const char *svm_type_table[] = { "c_svc","nu_svc","one_class","epsilon_svr","nu_svr",NULL }; static const char *kernel_type_table[]= { "linear","polynomial","rbf","sigmoid","precomputed",NULL }; int svm_save_model(const char *model_file_name, const svm_model *model) { FILE *fp = fopen(model_file_name,"w"); if(fp==NULL) return -1; const svm_parameter& param = model->param; fprintf(fp,"svm_type %s\n", svm_type_table[param.svm_type]); fprintf(fp,"kernel_type %s\n", kernel_type_table[param.kernel_type]); if(param.kernel_type == POLY) fprintf(fp,"degree %d\n", param.degree); if(param.kernel_type == POLY || param.kernel_type == RBF || param.kernel_type == SIGMOID) fprintf(fp,"gamma %g\n", param.gamma); if(param.kernel_type == POLY || param.kernel_type == SIGMOID) fprintf(fp,"coef0 %g\n", param.coef0); int nr_class = model->nr_class; int l = model->l; fprintf(fp, "nr_class %d\n", nr_class); fprintf(fp, "total_sv %d\n",l); { fprintf(fp, "rho"); for(int i=0;irho[i]); fprintf(fp, "\n"); } if(model->label) { fprintf(fp, "label"); for(int i=0;ilabel[i]); fprintf(fp, "\n"); } if(model->probA) // regression has probA only { fprintf(fp, "probA"); for(int i=0;iprobA[i]); fprintf(fp, "\n"); } if(model->probB) { fprintf(fp, "probB"); for(int i=0;iprobB[i]); fprintf(fp, "\n"); } if(model->nSV) { fprintf(fp, "nr_sv"); for(int i=0;inSV[i]); fprintf(fp, "\n"); } fprintf(fp, "SV\n"); const double * const *sv_coef = model->sv_coef; const svm_node * const *SV = model->SV; for(int i=0;ivalue)); else while(p->index != -1) { fprintf(fp,"%d:%.8g ",p->index,p->value); p++; } fprintf(fp, "\n"); } if (ferror(fp) != 0 || fclose(fp) != 0) return -1; else return 0; } static char *line = NULL; static int max_line_len; static char* readline(FILE *input) { int len; if(fgets(line,max_line_len,input) == NULL) return NULL; while(strrchr(line,'\n') == NULL) { max_line_len *= 2; line = (char *) realloc(line,max_line_len); len = (int) strlen(line); if(fgets(line+len,max_line_len-len,input) == NULL) break; } return line; } svm_model *svm_load_model(const char *model_file_name) { FILE *fp = fopen(model_file_name,"rb"); if(fp==NULL) return NULL; // read parameters svm_model *model = Malloc(svm_model,1); svm_parameter& param = model->param; model->rho = NULL; model->probA = NULL; model->probB = NULL; model->label = NULL; model->nSV = NULL; char cmd[81]; while(1) { fscanf(fp,"%80s",cmd); if(strcmp(cmd,"svm_type")==0) { fscanf(fp,"%80s",cmd); int i; for(i=0;svm_type_table[i];i++) { if(strcmp(svm_type_table[i],cmd)==0) { param.svm_type=i; break; } } if(svm_type_table[i] == NULL) { fprintf(stderr,"unknown svm type.\n"); free(model->rho); free(model->label); free(model->nSV); free(model); return NULL; } } else if(strcmp(cmd,"kernel_type")==0) { fscanf(fp,"%80s",cmd); int i; for(i=0;kernel_type_table[i];i++) { if(strcmp(kernel_type_table[i],cmd)==0) { param.kernel_type=i; break; } } if(kernel_type_table[i] == NULL) { fprintf(stderr,"unknown kernel function.\n"); free(model->rho); free(model->label); free(model->nSV); free(model); return NULL; } } else if(strcmp(cmd,"degree")==0) fscanf(fp,"%d",¶m.degree); else if(strcmp(cmd,"gamma")==0) fscanf(fp,"%lf",¶m.gamma); else if(strcmp(cmd,"coef0")==0) fscanf(fp,"%lf",¶m.coef0); else if(strcmp(cmd,"nr_class")==0) fscanf(fp,"%d",&model->nr_class); else if(strcmp(cmd,"total_sv")==0) fscanf(fp,"%d",&model->l); else if(strcmp(cmd,"rho")==0) { int n = model->nr_class * (model->nr_class-1)/2; model->rho = Malloc(double,n); for(int i=0;irho[i]); } else if(strcmp(cmd,"label")==0) { int n = model->nr_class; model->label = Malloc(int,n); for(int i=0;ilabel[i]); } else if(strcmp(cmd,"probA")==0) { int n = model->nr_class * (model->nr_class-1)/2; model->probA = Malloc(double,n); for(int i=0;iprobA[i]); } else if(strcmp(cmd,"probB")==0) { int n = model->nr_class * (model->nr_class-1)/2; model->probB = Malloc(double,n); for(int i=0;iprobB[i]); } else if(strcmp(cmd,"nr_sv")==0) { int n = model->nr_class; model->nSV = Malloc(int,n); for(int i=0;inSV[i]); } else if(strcmp(cmd,"SV")==0) { while(1) { int c = getc(fp); if(c==EOF || c=='\n') break; } break; } else { fprintf(stderr,"unknown text in model file: [%s]\n",cmd); free(model->rho); free(model->label); free(model->nSV); free(model); return NULL; } } // read sv_coef and SV int elements = 0; long pos = ftell(fp); max_line_len = 1024; line = Malloc(char,max_line_len); char *p,*endptr,*idx,*val; while(readline(fp)!=NULL) { p = strtok(line,":"); while(1) { p = strtok(NULL,":"); if(p == NULL) break; ++elements; } } elements += model->l; fseek(fp,pos,SEEK_SET); int m = model->nr_class - 1; int l = model->l; model->sv_coef = Malloc(double *,m); int i; for(i=0;isv_coef[i] = Malloc(double,l); model->SV = Malloc(svm_node*,l); svm_node *x_space = NULL; if(l>0) x_space = Malloc(svm_node,elements); int j=0; for(i=0;iSV[i] = &x_space[j]; p = strtok(line, " \t"); model->sv_coef[0][i] = strtod(p,&endptr); for(int k=1;ksv_coef[k][i] = strtod(p,&endptr); } while(1) { idx = strtok(NULL, ":"); val = strtok(NULL, " \t"); if(val == NULL) break; x_space[j].index = (int) strtol(idx,&endptr,10); x_space[j].value = strtod(val,&endptr); ++j; } x_space[j++].index = -1; } free(line); if (ferror(fp) != 0 || fclose(fp) != 0) return NULL; model->free_sv = 1; // XXX return model; } void svm_free_model_content(svm_model* model_ptr) { if(model_ptr->free_sv && model_ptr->l > 0 && model_ptr->SV != NULL) free((void *)(model_ptr->SV[0])); if(model_ptr->sv_coef) { for(int i=0;inr_class-1;i++) free(model_ptr->sv_coef[i]); } free(model_ptr->SV); model_ptr->SV = NULL; free(model_ptr->sv_coef); model_ptr->sv_coef = NULL; free(model_ptr->rho); model_ptr->rho = NULL; free(model_ptr->label); model_ptr->label= NULL; free(model_ptr->probA); model_ptr->probA = NULL; free(model_ptr->probB); model_ptr->probB= NULL; free(model_ptr->nSV); model_ptr->nSV = NULL; } void svm_free_and_destroy_model(svm_model** model_ptr_ptr) { if(model_ptr_ptr != NULL && *model_ptr_ptr != NULL) { svm_free_model_content(*model_ptr_ptr); free(*model_ptr_ptr); *model_ptr_ptr = NULL; } } void svm_destroy_param(svm_parameter* param) { free(param->weight_label); free(param->weight); } const char *svm_check_parameter(const svm_problem *prob, const svm_parameter *param) { // svm_type int svm_type = param->svm_type; if(svm_type != C_SVC && svm_type != NU_SVC && svm_type != ONE_CLASS && svm_type != EPSILON_SVR && svm_type != NU_SVR) return "unknown svm type"; // kernel_type, degree int kernel_type = param->kernel_type; if(kernel_type != LINEAR && kernel_type != POLY && kernel_type != RBF && kernel_type != SIGMOID && kernel_type != PRECOMPUTED) return "unknown kernel type"; if(param->gamma < 0) return "gamma < 0"; if(param->degree < 0) return "degree of polynomial kernel < 0"; // cache_size,eps,C,nu,p,shrinking if(param->cache_size <= 0) return "cache_size <= 0"; if(param->eps <= 0) return "eps <= 0"; if(svm_type == C_SVC || svm_type == EPSILON_SVR || svm_type == NU_SVR) if(param->C <= 0) return "C <= 0"; if(svm_type == NU_SVC || svm_type == ONE_CLASS || svm_type == NU_SVR) if(param->nu <= 0 || param->nu > 1) return "nu <= 0 or nu > 1"; if(svm_type == EPSILON_SVR) if(param->p < 0) return "p < 0"; if(param->shrinking != 0 && param->shrinking != 1) return "shrinking != 0 and shrinking != 1"; if(param->probability != 0 && param->probability != 1) return "probability != 0 and probability != 1"; if(param->probability == 1 && svm_type == ONE_CLASS) return "one-class SVM probability output not supported yet"; // check whether nu-svc is feasible if(svm_type == NU_SVC) { int l = prob->l; int max_nr_class = 16; int nr_class = 0; int *label = Malloc(int,max_nr_class); int *count = Malloc(int,max_nr_class); int i; for(i=0;iy[i]; int j; for(j=0;jnu*(n1+n2)/2 > min(n1,n2)) { free(label); free(count); return "specified nu is infeasible"; } } } free(label); free(count); } return NULL; } int svm_check_probability_model(const svm_model *model) { return ((model->param.svm_type == C_SVC || model->param.svm_type == NU_SVC) && model->probA!=NULL && model->probB!=NULL) || ((model->param.svm_type == EPSILON_SVR || model->param.svm_type == NU_SVR) && model->probA!=NULL); } void svm_set_print_string_function(void (*print_func)(const char *)) { if(print_func == NULL) svm_print_string = &print_string_stdout; else svm_print_string = print_func; } saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_svm/svm.h000066400000000000000000000060711224124640700256230ustar00rootroot00000000000000#ifndef _LIBSVM_H #define _LIBSVM_H #define LIBSVM_VERSION 311 #ifdef __cplusplus extern "C" { #endif extern int libsvm_version; struct svm_node { int index; double value; }; struct svm_problem { int l; double *y; struct svm_node **x; }; enum { C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR }; /* svm_type */ enum { LINEAR, POLY, RBF, SIGMOID, PRECOMPUTED }; /* kernel_type */ struct svm_parameter { int svm_type; int kernel_type; int degree; /* for poly */ double gamma; /* for poly/rbf/sigmoid */ double coef0; /* for poly/sigmoid */ /* these are for training only */ double cache_size; /* in MB */ double eps; /* stopping criteria */ double C; /* for C_SVC, EPSILON_SVR and NU_SVR */ int nr_weight; /* for C_SVC */ int *weight_label; /* for C_SVC */ double* weight; /* for C_SVC */ double nu; /* for NU_SVC, ONE_CLASS, and NU_SVR */ double p; /* for EPSILON_SVR */ int shrinking; /* use the shrinking heuristics */ int probability; /* do probability estimates */ }; // // svm_model // struct svm_model { struct svm_parameter param; /* parameter */ int nr_class; /* number of classes, = 2 in regression/one class svm */ int l; /* total #SV */ struct svm_node **SV; /* SVs (SV[l]) */ double **sv_coef; /* coefficients for SVs in decision functions (sv_coef[k-1][l]) */ double *rho; /* constants in decision functions (rho[k*(k-1)/2]) */ double *probA; /* pariwise probability information */ double *probB; /* for classification only */ int *label; /* label of each class (label[k]) */ int *nSV; /* number of SVs for each class (nSV[k]) */ /* nSV[0] + nSV[1] + ... + nSV[k-1] = l */ /* XXX */ int free_sv; /* 1 if svm_model is created by svm_load_model*/ /* 0 if svm_model is created by svm_train */ }; struct svm_model *svm_train(const struct svm_problem *prob, const struct svm_parameter *param); void svm_cross_validation(const struct svm_problem *prob, const struct svm_parameter *param, int nr_fold, double *target); int svm_save_model(const char *model_file_name, const struct svm_model *model); struct svm_model *svm_load_model(const char *model_file_name); int svm_get_svm_type(const struct svm_model *model); int svm_get_nr_class(const struct svm_model *model); void svm_get_labels(const struct svm_model *model, int *label); double svm_get_svr_probability(const struct svm_model *model); double svm_predict_values(const struct svm_model *model, const struct svm_node *x, double* dec_values); double svm_predict(const struct svm_model *model, const struct svm_node *x); double svm_predict_probability(const struct svm_model *model, const struct svm_node *x, double* prob_estimates); void svm_free_model_content(struct svm_model *model_ptr); void svm_free_and_destroy_model(struct svm_model **model_ptr_ptr); void svm_destroy_param(struct svm_parameter *param); const char *svm_check_parameter(const struct svm_problem *prob, const struct svm_parameter *param); int svm_check_probability_model(const struct svm_model *model); void svm_set_print_string_function(void (*print_func)(const char *)); #ifdef __cplusplus } #endif #endif /* _LIBSVM_H */ saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_svm/svm_grids.cpp000066400000000000000000000531071224124640700273500ustar00rootroot00000000000000/********************************************************** * Version $Id: svm_grids.cpp 1462 2012-08-16 18:55:05Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // svm // // // //-------------------------------------------------------// // // // svm_grids.cpp // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "svm_grids.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void SVM_Printf(const char *s) { SG_UI_Msg_Add_Execution(s, false); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSVM_Grids::CSVM_Grids(void) { //----------------------------------------------------- Set_Name (_TL("SVM Classification")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "Support Vector Machine (SVM) based classification for grids.\n" "Reference:\n" "Chang, C.-C. / Lin, C.-J. (2011): A library for support vector machines. " "ACM Transactions on Intelligent Systems and Technology, vol.2/3, p.1-27. " "LIBSVM Homepage.\n" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "CLASSES" , _TL("Classification"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Short ); Parameters.Add_Choice( NULL , "SCALING" , _TL("Scaling"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("none"), _TL("normalize (0-1)"), _TL("standardize") ), 2 ); Parameters.Add_Value( NULL , "MESSAGE" , _TL("Verbose Messages"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Choice( NULL , "MODEL_SRC" , _TL("Model Source"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("create from training areas"), _TL("restore from file") ), 0 ); //----------------------------------------------------- Parameters.Add_FilePath( NULL , "MODEL_LOAD" , _TL("Restore Model from File"), _TL(""), NULL, NULL, false ); //----------------------------------------------------- CSG_Parameter *pNode = Parameters.Add_Node( NULL , "MODEL_TRAIN" , _TL("Training Options"), _TL("") ); CSG_Parameter *pShape = Parameters.Add_Shapes( pNode , "ROI" , _TL("Training Areas"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Polygon ); Parameters.Add_Table_Field( pShape , "ROI_ID" , _TL("Class Identifier"), _TL("") ); Parameters.Add_FilePath( pNode , "MODEL_SAVE" , _TL("Store Model to File"), _TL(""), NULL, NULL, true ); Parameters.Add_Choice( pNode , "SVM_TYPE" , _TL("SVM Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("C-SVC"), _TL("nu-SVC"), _TL("one-class SVM"), _TL("epsilon-SVR"), _TL("nu-SVR") ), 0 ); Parameters.Add_Choice( pNode , "KERNEL_TYPE" , _TL("Kernel Type"), _TL("linear: u'*v\npolynomial: (gamma*u'*v + coef0)^degree\nradial basis function: exp(-gamma*|u-v|^2)\nsigmoid: tanh(gamma*u'*v + coef0)"), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("linear"), _TL("polynomial"), _TL("radial basis function"), _TL("sigmoid") ), 2 ); Parameters.Add_Value( pNode , "DEGREE" , _TL("Degree"), _TL("degree in kernel function"), PARAMETER_TYPE_Int, 3 ); Parameters.Add_Value( pNode , "GAMMA" , _TL("Gamma"), _TL("gamma in kernel function"), PARAMETER_TYPE_Double , 0 ); Parameters.Add_Value( pNode , "COEF0" , _TL("coef0"), _TL("coef0 in kernel function"), PARAMETER_TYPE_Double , 0 ); Parameters.Add_Value( pNode , "COST" , _TL("C"), _TL("parameter C (cost) of C-SVC, epsilon-SVR, and nu-SVR"), PARAMETER_TYPE_Double , 1 ); Parameters.Add_Value( pNode , "NU" , _TL("nu-SVR"), _TL("parameter nu of nu-SVC, one-class SVM, and nu-SVR"), PARAMETER_TYPE_Double , 0.5 ); Parameters.Add_Value( pNode , "EPS_SVR" , _TL("SVR Epsilon"), _TL("epsilon in loss function of epsilon-SVR"), PARAMETER_TYPE_Double , 0.1 ); Parameters.Add_Value( pNode , "CACHE_SIZE" , _TL("Cache Size"), _TL("cache memory size in MB"), PARAMETER_TYPE_Double , 100 ); Parameters.Add_Value( pNode , "EPS" , _TL("Epsilon"), _TL("tolerance of termination criterion"), PARAMETER_TYPE_Double , 1e-3 ); Parameters.Add_Value( pNode , "SHRINKING" , _TL("Shrinking"), _TL("whether to use the shrinking heuristics"), PARAMETER_TYPE_Bool , false ); Parameters.Add_Value( pNode , "PROBABILITY" , _TL("Probability Estimates"), _TL("whether to train a SVC or SVR model for probability estimates"), PARAMETER_TYPE_Bool , false ); // Parameters.Add_Value(pNode , "nr_weight" , _TL("Type"), _TL(""), PARAMETER_TYPE_Int , 0); // Parameters.Add_Value(pNode , "weight_label" , _TL("Type"), _TL(""), PARAMETER_TYPE_Int , NULL); // Parameters.Add_Value(pNode , "weight" , _TL("Type"), _TL(""), PARAMETER_TYPE_Int , NULL); Parameters.Add_Value( pNode , "CROSSVAL" , _TL("Cross Validation"), _TL("n-fold cross validation: n must > 1"), PARAMETER_TYPE_Int , 1, 1, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CSVM_Grids::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("MODEL_SRC")) ) { pParameters->Get_Parameter("MODEL_TRAIN")->Set_Enabled(pParameter->asInt() == 0); pParameters->Get_Parameter("MODEL_LOAD" )->Set_Enabled(pParameter->asInt() == 1); } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline double CSVM_Grids::Get_Value(int x, int y, int iGrid) { CSG_Grid *pGrid = m_pGrids->asGrid(iGrid); switch( m_Scaling ) { default: return( (pGrid->asDouble(x, y)) ); case 1: return( (pGrid->asDouble(x, y) - pGrid->Get_ZMin()) / pGrid->Get_ZRange() ); case 2: return( (pGrid->asDouble(x, y) - pGrid->Get_ArithMean()) / pGrid->Get_StdDev() ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSVM_Grids::On_Execute(void) { //----------------------------------------------------- m_pModel = NULL; m_pClasses = Parameters("CLASSES")->asGrid(); m_pClasses ->Set_NoData_Value(-1); m_pClasses ->Assign(0.0); m_Scaling = Parameters("SCALING")->asInt(); m_pGrids = Parameters("GRIDS" )->asGridList(); for(int i=m_pGrids->Get_Count()-1; i>=0; i--) { if( m_pGrids->asGrid(i)->Get_ZRange() <= 0.0 ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("grid has been dropped"), m_pGrids->asGrid(i)->Get_Name())); m_pGrids->Del_Item(i); } } if( m_pGrids->Get_Count() <= 0 ) { Error_Set(_TL("no valid grid in list.")); return( false ); } //----------------------------------------------------- svm_set_print_string_function(Parameters("MESSAGE")->asBool() ? SVM_Printf : NULL); //------------------------------------------------- m_Problem.y = NULL; m_Problem.x = NULL; m_Nodes = NULL; switch( Parameters("MODEL_SRC")->asInt() ) { case 0: // create from training areas if( !Training() ) { return( false ); } break; case 1: // restore from file if( !Load() ) { return( false ); } break; } //----------------------------------------------------- Predict(); svm_free_and_destroy_model(&m_pModel); SG_FREE_SAFE(m_Problem.y); SG_FREE_SAFE(m_Problem.x); SG_FREE_SAFE(m_Nodes); Finalize(); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSVM_Grids::Predict(void) { Process_Set_Text(_TL("prediction")); struct svm_node *Features = (struct svm_node *)SG_Malloc((m_pGrids->Get_Count() + 1) * sizeof(struct svm_node)); Features[m_pGrids->Get_Count()].index = -1; //----------------------------------------------------- for(int y=0; yis_NoData(x, y) ) { for(int iGrid=0; iGridGet_Count(); iGrid++) { Features[iGrid].index = iGrid + 1; Features[iGrid].value = Get_Value(x, y, iGrid); } m_pClasses->Set_Value(x, y, svm_predict(m_pModel, Features)); } } } //----------------------------------------------------- SG_Free(Features); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSVM_Grids::Load(void) { Process_Set_Text(_TL("restore model from file")); CSG_String File = Parameters("MODEL_LOAD")->asString(); if( (m_pModel = svm_load_model(File)) == NULL ) { Error_Set(CSG_String::Format(SG_T("%s [%s]"), _TL("could not open model file"), File.c_str())); return( false ); } //----------------------------------------------------- for(int y=0; yGet_Count() && !bNoData; iGrid++) { if( m_pGrids->asGrid(iGrid)->is_NoData(x, y) ) { bNoData = true; m_pClasses->Set_NoData(x, y); } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSVM_Grids::Training(void) { CSG_Table Elements; struct svm_parameter param; //----------------------------------------------------- Process_Set_Text(_TL("create model from training areas")); if( !Training_Get_Elements(Elements) ) { return( false ); } if( !Training_Get_Parameters(param) ) { return( false ); } //----------------------------------------------------- m_Problem.l = Elements.Get_Count(); m_Problem.y = (double *)SG_Malloc(m_Problem.l * sizeof(double)); m_Problem.x = (struct svm_node **)SG_Malloc(m_Problem.l * sizeof(struct svm_node *)); m_Nodes = (struct svm_node *)SG_Malloc(m_Problem.l * sizeof(struct svm_node ) * (1 + m_pGrids->Get_Count())); //----------------------------------------------------- CSG_String ID_ROI; m_Classes.Destroy(); m_Classes.Add_Field(SG_T("NAME"), SG_DATATYPE_String); Elements.Set_Index(0, TABLE_INDEX_Ascending); for(int i=0, j=0, ID_Class=0; iasString(0)) ) { ID_ROI = pElement->asString(0); ID_Class ++; m_Classes.Add_Record()->Set_Value(0, pElement->asString(0)); } m_Problem.x[i] = &m_Nodes[j]; m_Problem.y[i] = ID_Class; for(int iGrid=0; iGridGet_Count(); iGrid++, j++) { m_Nodes[j].index = 1 + iGrid; m_Nodes[j].value = pElement->asDouble(1 + iGrid); } m_Nodes[j].index = -1; } /*/----------------------------------------------------- if( param.kernel_type == PRECOMPUTED ) { for(i=0; i max_index) { Error_Set("Wrong input format: sample_serial_number out of range"); return( false ); } } }/**/ //----------------------------------------------------- const char *error_msg = svm_check_parameter(&m_Problem, ¶m); if( error_msg ) { Error_Set(_TL("training failed")); Error_Set(error_msg); } else if( (m_pModel = svm_train(&m_Problem, ¶m)) != NULL ) { //------------------------------------------------- CSG_String File = Parameters("MODEL_SAVE")->asString(); if( File.Length() > 0 && svm_save_model(File, m_pModel) ) { Error_Set(CSG_String::Format(SG_T("%s [%s]"), _TL("could not save model to file"), File.c_str())); } //------------------------------------------------- if( Parameters("CROSSVAL")->asInt() > 1 ) { CSG_String Summary; double *target = (double *)SG_Malloc(m_Problem.l * sizeof(double)); svm_cross_validation(&m_Problem, ¶m, Parameters("CROSSVAL")->asInt(), target); if( param.svm_type == EPSILON_SVR || param.svm_type == NU_SVR ) { double total_error = 0.0, sum_v = 0.0, sum_y = 0.0, sum_vv = 0.0, sum_yy = 0.0, sum_vy = 0.0; for(int i=0; iasInt (); param.kernel_type = Parameters("KERNEL_TYPE")->asInt (); param.degree = Parameters("DEGREE" )->asInt (); param.gamma = Parameters("GAMMA" )->asDouble(); param.coef0 = Parameters("COEF0" )->asDouble(); param.nu = Parameters("NU" )->asDouble(); param.cache_size = Parameters("CACHE_SIZE" )->asDouble(); param.C = Parameters("COST" )->asDouble(); param.eps = Parameters("EPS" )->asDouble(); param.p = Parameters("EPS_SVR" )->asDouble(); param.shrinking = Parameters("SHRINKING" )->asBool () ? 1 : 0; param.probability = Parameters("PROBABILITY")->asBool () ? 1 : 0; param.nr_weight = 0; param.weight_label = NULL; param.weight = NULL; if( param.gamma == 0 && m_pGrids->Get_Count() > 0 ) { param.gamma = 1.0 / m_pGrids->Get_Count(); } return( true ); } //--------------------------------------------------------- bool CSVM_Grids::Training_Get_Elements(CSG_Table &Elements) { int iROI_ID, iGrid; CSG_Shapes *pROIs; //----------------------------------------------------- pROIs = Parameters("ROI" )->asShapes(); iROI_ID = Parameters("ROI_ID")->asInt(); Elements.Destroy(); Elements.Add_Field(SG_T("ID"), SG_DATATYPE_String); for(iGrid=0; iGridGet_Count(); iGrid++) { Elements.Add_Field(SG_Get_String(iGrid, 0), SG_DATATYPE_Double); } //----------------------------------------------------- for(int y=0; yGet_Count() && !bNoData; iGrid++) { if( m_pGrids->asGrid(iGrid)->is_NoData(x, y) ) { bNoData = true; } } if( bNoData ) { m_pClasses->Set_NoData(x, y); } else { double p_x = Get_XMin() + x * Get_Cellsize(); for(int iROI=0; iROIGet_Count(); iROI++) { CSG_Shape_Polygon *pROI = (CSG_Shape_Polygon *)pROIs->Get_Shape(iROI); if( pROI->Contains(p_x, p_y) ) { CSG_Table_Record *pElement = Elements.Add_Record(); pElement->Set_Value(0, pROI->asString(iROI_ID)); for(iGrid=0; iGridGet_Count(); iGrid++) { pElement->Set_Value(1 + iGrid, Get_Value(x, y, iGrid)); } } } } } } //----------------------------------------------------- if( Elements.Get_Count() <= 0 ) { Error_Set(_TL("no training areas could be analysed.")); return( false ); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSVM_Grids::Finalize(void) { //----------------------------------------------------- CSG_Parameters P; if( DataObject_Get_Parameters(m_pClasses, P) && P("COLORS_TYPE") && P("LUT") ) { CSG_Table *pTable = P("LUT")->asTable(); for(int iClass=0; iClassGet_Record(iClass); if( pRecord == NULL ) { pRecord = pTable->Add_Record(); pRecord->Set_Value(0, SG_GET_RGB(rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX, rand() * 255.0 / RAND_MAX)); } pRecord->Set_Value(1, m_Classes[iClass].asString(0)); pRecord->Set_Value(2, m_Classes[iClass].asString(0)); pRecord->Set_Value(3, iClass + 1); pRecord->Set_Value(4, iClass + 1); } while( pTable->Get_Record_Count() > m_Classes.Get_Count() ) { pTable->Del_Record(pTable->Get_Record_Count() - 1); } P("COLORS_TYPE")->Set_Value(1); // Color Classification Type: Lookup Table DataObject_Set_Parameters(m_pClasses, P); } //----------------------------------------------------- m_pClasses->Set_Name(CSG_String::Format(SG_T("%s [%s]"), _TL("Classification"), _TL("SVM"))); //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_svm/svm_grids.h000066400000000000000000000126741224124640700270210ustar00rootroot00000000000000/********************************************************** * Version $Id: svm_grids.h 1462 2012-08-16 18:55:05Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // svm // // // //-------------------------------------------------------// // // // svm_grids.h // // // // Copyright (C) 2012 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__svm_grids_H #define HEADER_INCLUDED__svm_grids_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" #include "svm.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSVM_Grids : public CSG_Module_Grid { public: CSVM_Grids(void); virtual CSG_String Get_MenuPath (void) { return( _TL("A:Imagery|Classification") ); } protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: int m_Scaling; CSG_Table m_Classes; CSG_Parameter_Grid_List *m_pGrids; CSG_Grid *m_pClasses; struct svm_problem m_Problem; struct svm_node *m_Nodes; struct svm_model *m_pModel; double Get_Value (int x, int y, int iGrid); bool Load (void); bool Training (void); bool Training_Get_Parameters (struct svm_parameter ¶m); bool Training_Get_Elements (CSG_Table &Elements); bool Predict (void); bool Finalize (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__svm_grids_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/000077500000000000000000000000001224124640700251745ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.cpp000066400000000000000000000231361224124640700311370ustar00rootroot00000000000000/********************************************************** * Version $Id: Image_VI_Distance.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Image_VI_Distance.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Image_VI_Distance.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CImage_VI_Distance::CImage_VI_Distance(void) { Set_Name (_TL("Vegetation Index (Distance Based)")); Set_Author (SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011")); Set_Description (_TW( "Distance based vegetation indices.\n" // "\n
    " // "
  • Transformed Soil Adjusted Vegetation Index (s. McCloy, 2006)\n" // " TSAVI = (NIR - Gain * R - Offset) * Gain / (Gain * NIR + R - Gain * Offset)
  • \n" // "
  • Transformed Soil Adjusted Vegetation Index (s. McCloy, 2006)\n" // " ATSAVI = (NIR - Gain * R - Offset) / (Gain * NIR + R - gain * Offset + 0.8 * (1 + Gain^2))
  • \n" // "
(NIR = near infrared, R = red, S = soil adjustment factor)\n" "\n" "References:\n" "K.R. McCloy (2006): Resource Management Information Systems: Remote Sensing, GIS and Modelling. 2nd Edition, CRC Taylor & Francis, 575pp.\n" "\n" "N.G. Silleos, T.K. Alexandridis, I.Z. Gitas & K. Perakis (2006): " "Vegetation Indices: Advances Made in Biomass Estimation and Vegetation Monitoring in the Last 30 Years, " "Geocarto International, 21:4, 21-28, " "online.\n" )); Parameters.Add_Grid( NULL, "RED" , _TL("Red Reflectance"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "NIR" , _TL("Near Infrared Reflectance"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "PVI0" , _TL("Perpendicular Vegetation Index (Richardson and Wiegand, 1977)"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "PVI1" , _TL("Perpendicular Vegetation Index (Perry and Lautenschlager, 1984)"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "PVI2" , _TL("Perpendicular Vegetation Index (Walther and Shabaani)"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "PVI3" , _TL("Perpendicular Vegetation Index (Qi, et al., 1994)"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "TSAVI" , _TL("Transformed Soil Adjusted Vegetation Index (Baret et al. 1989)"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "ATSAVI" , _TL("Transformed Soil Adjusted Vegetation Index (Baret and Guyot, 1991)"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Value( NULL, "INTERCEPT" , _TL("Intercept of Soil Line"), _TL(""), PARAMETER_TYPE_Double, 0 ); Parameters.Add_Value( NULL, "SLOPE" , _TL("Slope of Soil Line"), _TL(""), PARAMETER_TYPE_Double, 0.5 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CImage_VI_Distance::On_Execute(void) { CSG_Grid *pRed = Parameters("RED" )->asGrid(); CSG_Grid *pNIR = Parameters("NIR" )->asGrid(); CSG_Grid *pPVI0 = Parameters("PVI0" )->asGrid(); CSG_Grid *pPVI1 = Parameters("PVI1" )->asGrid(); CSG_Grid *pPVI2 = Parameters("PVI2" )->asGrid(); CSG_Grid *pPVI3 = Parameters("PVI3" )->asGrid(); CSG_Grid *pTSAVI = Parameters("TSAVI" )->asGrid(); CSG_Grid *pATSAVI = Parameters("ATSAVI")->asGrid(); DataObject_Set_Colors(pPVI0 , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pPVI1 , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pPVI2 , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pPVI3 , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pTSAVI , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pATSAVI, 100, SG_COLORS_WHITE_GREEN, false); m_Slope = Parameters("SLOPE" )->asDouble(); m_Intercept = Parameters("INTERCEPT")->asDouble(); if( m_Slope <= 0.0 ) { Error_Set(_TL("slope value has to be greater than zero")); return( false ); } for(int y=0; yis_NoData(x, y) || pNIR->is_NoData(x, y) ) { if( pPVI0 ) pPVI0 ->Set_NoData(x, y); if( pPVI1 ) pPVI1 ->Set_NoData(x, y); if( pPVI2 ) pPVI2 ->Set_NoData(x, y); if( pPVI3 ) pPVI3 ->Set_NoData(x, y); if( pTSAVI ) pTSAVI ->Set_NoData(x, y); if( pATSAVI ) pATSAVI->Set_NoData(x, y); } else { double R, NIR, Value; R = pRed->asDouble(x, y); NIR = pNIR->asDouble(x, y); if( pPVI0 ) { if( Get_PVI0 (R, NIR, Value) ) pPVI0 ->Set_Value(x, y, Value); else pPVI0 ->Set_NoData(x, y); } if( pPVI1 ) { if( Get_PVI1 (R, NIR, Value) ) pPVI1 ->Set_Value(x, y, Value); else pPVI1 ->Set_NoData(x, y); } if( pPVI2 ) { if( Get_PVI2 (R, NIR, Value) ) pPVI2 ->Set_Value(x, y, Value); else pPVI2 ->Set_NoData(x, y); } if( pPVI3 ) { if( Get_PVI3 (R, NIR, Value) ) pPVI3 ->Set_Value(x, y, Value); else pPVI3 ->Set_NoData(x, y); } if( pTSAVI ) { if( Get_TSAVI (R, NIR, Value) ) pTSAVI ->Set_Value(x, y, Value); else pTSAVI ->Set_NoData(x, y); } if( pATSAVI ) { if( Get_ATSAVI(R, NIR, Value) ) pATSAVI->Set_Value(x, y, Value); else pATSAVI->Set_NoData(x, y); } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline bool CImage_VI_Distance::Get_PVI0(double R, double NIR, double &Value) // Richardson & Wiegand, 1977 { double dB1 = 1.0 / m_Slope; double dB0 = R - NIR / m_Slope; double Rgg5 = (dB1 * m_Intercept - dB0 * m_Slope) / (dB1 - m_Slope); double Rgg7 = (m_Intercept - dB0) / (dB1 - m_Slope); Value = sqrt(pow(Rgg5 - R, 2.0) + pow(Rgg7 - NIR, 3.0)); return( true ); } //--------------------------------------------------------- inline bool CImage_VI_Distance::Get_PVI1(double R, double NIR, double &Value) // Perry & Rautenschlager, 1984 { if( (Value = sqrt(1.0 + m_Slope * m_Slope)) != 0.0 ) { Value = ((m_Slope * NIR - R) + m_Intercept) / Value; return( true ); } return( false ); } //--------------------------------------------------------- inline bool CImage_VI_Distance::Get_PVI2(double R, double NIR, double &Value) { if( (Value = sqrt(1.0 + m_Intercept)) != 0.0 ) { Value = (NIR - m_Intercept) * (R + m_Slope) / Value; return( true ); } return( false ); } //--------------------------------------------------------- inline bool CImage_VI_Distance::Get_PVI3(double R, double NIR, double &Value) // Qi et al., 1994 { Value = (NIR * m_Intercept) - (R * m_Slope); return( true ); } //--------------------------------------------------------- inline bool CImage_VI_Distance::Get_TSAVI(double R, double NIR, double &Value) // Baret et al., 1989 { if( (Value = R + m_Slope * NIR - m_Slope * m_Intercept) != 0.0 ) { Value = m_Slope * (NIR - m_Slope) * (R - m_Intercept) / Value; return( true ); } return( false ); } //--------------------------------------------------------- inline bool CImage_VI_Distance::Get_ATSAVI(double R, double NIR, double &Value) // Baret & Guyot, 1991 { if( (Value = R + m_Slope * NIR - m_Slope * m_Intercept + 0.08 * (1.0 + m_Slope*m_Slope)) != 0.0 ) { Value = m_Slope * (NIR - m_Slope * R - m_Intercept) / Value; return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/Image_VI_Distance.h000066400000000000000000000064741224124640700306120ustar00rootroot00000000000000/********************************************************** * Version $Id: Image_VI_Distance.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Image_VI_Distance.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Image_VI_Distance_H #define HEADER_INCLUDED__Image_VI_Distance_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CImage_VI_Distance : public CSG_Module_Grid { public: CImage_VI_Distance(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Vegetation Indices") ); } protected: virtual bool On_Execute (void); private: double m_Intercept, m_Slope; bool Get_PVI0 (double R, double NIR, double &Value); bool Get_PVI1 (double R, double NIR, double &Value); bool Get_PVI2 (double R, double NIR, double &Value); bool Get_PVI3 (double R, double NIR, double &Value); bool Get_TSAVI (double R, double NIR, double &Value); bool Get_ATSAVI (double R, double NIR, double &Value); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Image_VI_Distance_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.cpp000066400000000000000000000247321224124640700304720ustar00rootroot00000000000000/********************************************************** * Version $Id: Image_VI_Slope.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Image_VI_Slope.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Image_VI_Slope.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CImage_VI_Slope::CImage_VI_Slope(void) { Set_Name (_TL("Vegetation Index (Slope Based)")); Set_Author (SG_T("V.Olaya (c) 2004, O.Conrad (c) 2011")); Set_Description (_TW( "Slope based vegetation indices.\n" "\n
    " "
  • Ratio Vegetation Index (Richardson and Wiegand, 1977)\n" " RVI = R / NIR
  • \n" "
  • Normalized Ratio Vegetation Index (Baret and Guyot, 1991)\n" " NRVI = (RVI - 1) / (RVI + 1)
  • \n" "
  • Normalized Difference Vegetation Index (Rouse et al. 1974)\n" " NDVI = (NIR - R) / (NIR + R)
  • \n" "
  • Transformed Vegetation Index (Deering et al., 1975)\n" " TVI = [(NIR - R) / (NIR + R)]^0.5 + 0.5
  • \n" "
  • Corrected Transformed Ratio Vegetation Index (Perry and Lautenschlager, 1984)\n" " CTVI = [(NDVI + 0.5) / abs(NDVI + 0.5)] * [abs(NDVI + 0.5)]^0.5
  • \n" "
  • Thiam's Transformed Vegetation Index (Thiam, 1997)\n" " RVI = [abs(NDVI) + 0.5]^0.5
  • \n" "
  • Soil Adjusted Vegetation Index (Huete, 1988)\n" " SAVI = [(NIR - R) / (NIR + R)] * (1 + S)
  • \n" "
(NIR = near infrared, R = red, S = soil adjustment factor)\n" "\n" "References:\n" "K.R. McCloy (2006): Resource Management Information Systems: Remote Sensing, GIS and Modelling. 2nd Edition, CRC Taylor & Francis, 575pp.\n" "\n" "N.G. Silleos, T.K. Alexandridis, I.Z. Gitas & K. Perakis (2006): " "Vegetation Indices: Advances Made in Biomass Estimation and Vegetation Monitoring in the Last 30 Years, " "Geocarto International, 21:4, 21-28, " "online.\n" )); Parameters.Add_Grid( NULL, "RED" , _TL("Red Reflectance"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "NIR" , _TL("Near Infrared Reflectance"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "DVI" , _TL("Difference Vegetation Index"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "NDVI" , _TL("Normalized Difference Vegetation Index"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "RVI" , _TL("Ratio Vegetation Index"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "NRVI" , _TL("Normalized Ratio Vegetation Index"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "TVI" , _TL("Transformed Vegetation Index"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "CTVI" , _TL("Corrected Transformed Vegetation Index"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "TTVI" , _TL("Thiam's Transformed Vegetation Index"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "SAVI" , _TL("Soil Adjusted Vegetation Index"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Value( NULL, "SOIL" , _TL("Soil Adjustment Factor"), _TW("Soil adjustment factor for SAVI calculation. " "Suggested values are 1.0 in case of very low vegetation, " "0.5 for intermediate 0.5, and 0.25 for high densities (Silleos et al. 2006)."), PARAMETER_TYPE_Double, 0.5, 0.0, true, 1.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CImage_VI_Slope::On_Execute(void) { CSG_Grid *pRed = Parameters("RED" )->asGrid(); CSG_Grid *pNIR = Parameters("NIR" )->asGrid(); CSG_Grid *pDVI = Parameters("DVI" )->asGrid(); CSG_Grid *pNDVI = Parameters("NDVI" )->asGrid(); CSG_Grid *pRVI = Parameters("RVI" )->asGrid(); CSG_Grid *pNRVI = Parameters("NRVI" )->asGrid(); CSG_Grid *pTVI = Parameters("TVI" )->asGrid(); CSG_Grid *pCTVI = Parameters("CTVI" )->asGrid(); CSG_Grid *pTTVI = Parameters("TTVI" )->asGrid(); CSG_Grid *pSAVI = Parameters("SAVI" )->asGrid(); DataObject_Set_Colors(pDVI , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pNDVI , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pRVI , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pNRVI , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pTVI , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pCTVI , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pTTVI , 100, SG_COLORS_WHITE_GREEN, false); DataObject_Set_Colors(pSAVI , 100, SG_COLORS_WHITE_GREEN, false); m_Soil = Parameters("SOIL")->asDouble(); for(int y=0; yis_NoData(x, y) || pNIR->is_NoData(x, y) ) { if( pDVI ) pDVI ->Set_NoData(x, y); if( pNDVI ) pNDVI ->Set_NoData(x, y); if( pRVI ) pRVI ->Set_NoData(x, y); if( pNRVI ) pNRVI ->Set_NoData(x, y); if( pTVI ) pTVI ->Set_NoData(x, y); if( pTTVI ) pTTVI ->Set_NoData(x, y); if( pCTVI ) pCTVI ->Set_NoData(x, y); if( pSAVI ) pSAVI ->Set_NoData(x, y); } else { double R, NIR, Value; R = pRed->asDouble(x, y); NIR = pNIR->asDouble(x, y); if( pDVI ) { if( Get_DVI (R, NIR, Value) ) pDVI ->Set_Value(x, y, Value); else pDVI ->Set_NoData(x, y); } if( pNDVI ) { if( Get_NDVI (R, NIR, Value) ) pNDVI ->Set_Value(x, y, Value); else pNDVI ->Set_NoData(x, y); } if( pRVI ) { if( Get_RVI (R, NIR, Value) ) pRVI ->Set_Value(x, y, Value); else pRVI ->Set_NoData(x, y); } if( pNRVI ) { if( Get_NRVI (R, NIR, Value) ) pNRVI ->Set_Value(x, y, Value); else pNRVI ->Set_NoData(x, y); } if( pTVI ) { if( Get_TVI (R, NIR, Value) ) pTVI ->Set_Value(x, y, Value); else pTVI ->Set_NoData(x, y); } if( pCTVI ) { if( Get_CTVI (R, NIR, Value) ) pCTVI ->Set_Value(x, y, Value); else pCTVI ->Set_NoData(x, y); } if( pTTVI ) { if( Get_TTVI (R, NIR, Value) ) pTTVI ->Set_Value(x, y, Value); else pTTVI ->Set_NoData(x, y); } if( pSAVI ) { if( Get_SAVI (R, NIR, Value) ) pSAVI ->Set_Value(x, y, Value); else pSAVI ->Set_NoData(x, y); } } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- inline bool CImage_VI_Slope::Get_DVI(double R, double NIR, double &Value) { Value = NIR - R; return( true ); } //--------------------------------------------------------- inline bool CImage_VI_Slope::Get_NDVI(double R, double NIR, double &Value) { if( R + NIR != 0.0 ) { Value = (NIR - R) / (NIR + R); return( true ); } return( false ); } //--------------------------------------------------------- inline bool CImage_VI_Slope::Get_RVI(double R, double NIR, double &Value) { if( R != 0.0 ) { Value = NIR / R; return( true ); } return( false ); } //--------------------------------------------------------- inline bool CImage_VI_Slope::Get_NRVI(double R, double NIR, double &Value) { if( Get_RVI(R, NIR, Value) && Value + 1.0 != 0.0 ) { Value = (Value - 1.0) / (Value + 1.0); return( true ); } return( false ); } //--------------------------------------------------------- inline bool CImage_VI_Slope::Get_TVI(double R, double NIR, double &Value) { if( Get_NDVI(R, NIR, Value) && Value > 0.0 ) { Value = sqrt(Value) + 0.5; return( true ); } return( false ); } //--------------------------------------------------------- inline bool CImage_VI_Slope::Get_CTVI(double R, double NIR, double &Value) { if( Get_NDVI(R, NIR, Value) ) { Value += 0.5; Value = Value > 0.0 ? sqrt(fabs(Value)) : -sqrt(fabs(Value)); return( true ); } return( false ); } //--------------------------------------------------------- inline bool CImage_VI_Slope::Get_TTVI(double R, double NIR, double &Value) { if( Get_NDVI(R, NIR, Value) ) { Value = sqrt(fabs(Value + 0.5)); return( true ); } return( false ); } //--------------------------------------------------------- inline bool CImage_VI_Slope::Get_SAVI(double R, double NIR, double &Value) { if( Get_NDVI(R, NIR, Value) ) { Value = Value * (1.0 + m_Soil); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/Image_VI_Slope.h000066400000000000000000000066361224124640700301420ustar00rootroot00000000000000/********************************************************** * Version $Id: Image_VI_Slope.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /******************************************************************************* Image_VI_Slope.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Image_VI_Slope_H #define HEADER_INCLUDED__Image_VI_Slope_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CImage_VI_Slope : public CSG_Module_Grid { public: CImage_VI_Slope(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Vegetation Indices") ); } protected: virtual bool On_Execute (void); private: double m_Soil, m_Offset, m_Gain; bool Get_DVI (double R, double NIR, double &Value); bool Get_NDVI (double R, double NIR, double &Value); bool Get_RVI (double R, double NIR, double &Value); bool Get_NRVI (double R, double NIR, double &Value); bool Get_TVI (double R, double NIR, double &Value); bool Get_CTVI (double R, double NIR, double &Value); bool Get_TTVI (double R, double NIR, double &Value); bool Get_SAVI (double R, double NIR, double &Value); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Image_VI_Slope_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/MLB_Interface.cpp000066400000000000000000000117211224124640700302740ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1744 2013-06-21 10:42:30Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_tools // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2009 by // // SAGA User Group Assoc. // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: author@email.de // // // // contact: Author // // Sesame Street. 7 // // 12345 Metropolis // // Nirwana // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Imagery - Tools") ); case MLB_INFO_Author: return( SG_T("SAGA User Group Assoc. (c) 2009") ); case MLB_INFO_Description: return( _TL("Image processing tools.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Imagery|Tools") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "Image_VI_Distance.h" #include "Image_VI_Slope.h" #include "evi.h" #include "tasseled_cap.h" #include "pansharpening.h" #include "landsat_toar.h" #include "landsat_acca.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CImage_VI_Distance ); case 1: return( new CImage_VI_Slope ); case 2: return( new CEnhanced_VI ); case 3: return( new CTasseled_Cap ); case 4: return( new CPanSharp_IHS ); case 5: return( new CPanSharp_Brovey ); case 6: return( new CPanSharp_CN ); case 7: return( new CPanSharp_PCA ); case 8: return( new CLandsat_TOAR ); case 9: return( new CLandsat_ACCA ); //----------------------------------------------------- case 10: return( NULL ); default: return( MLB_INTERFACE_SKIP_MODULE ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/MLB_Interface.h000066400000000000000000000066771224124640700277570ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Library Template // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Author // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: author@email.de // // // // contact: Author // // Sesame Street. 7 // // 12345 Metropolis // // Nirwana // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__imagery_segmentation_H #define HEADER_INCLUDED__imagery_segmentation_H //--------------------------------------------------------- #include //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__imagery_segmentation_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/Makefile.am000066400000000000000000000014521224124640700272320ustar00rootroot00000000000000if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libimagery_tools.la libimagery_tools_la_SOURCES =\ evi.cpp\ Image_VI_Distance.cpp\ Image_VI_Slope.cpp\ landsat_acca.cpp\ landsat_toar.cpp\ landsat_toar_core.cpp\ MLB_Interface.cpp\ pansharpening.cpp\ tasseled_cap.cpp\ evi.h\ Image_VI_Distance.h\ Image_VI_Slope.h\ landsat_acca.h\ landsat_toar.h\ landsat_toar_core.h\ MLB_Interface.h\ pansharpening.h\ tasseled_cap.h libimagery_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/Makefile.in000066400000000000000000000460351224124640700272510ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_images/modules_imagery/imagery_tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libimagery_tools_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libimagery_tools_la_OBJECTS = evi.lo Image_VI_Distance.lo \ Image_VI_Slope.lo landsat_acca.lo landsat_toar.lo \ landsat_toar_core.lo MLB_Interface.lo pansharpening.lo \ tasseled_cap.lo libimagery_tools_la_OBJECTS = $(am_libimagery_tools_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libimagery_tools_la_SOURCES) DIST_SOURCES = $(libimagery_tools_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libimagery_tools.la libimagery_tools_la_SOURCES = \ evi.cpp\ Image_VI_Distance.cpp\ Image_VI_Slope.cpp\ landsat_acca.cpp\ landsat_toar.cpp\ landsat_toar_core.cpp\ MLB_Interface.cpp\ pansharpening.cpp\ tasseled_cap.cpp\ evi.h\ Image_VI_Distance.h\ Image_VI_Slope.h\ landsat_acca.h\ landsat_toar.h\ landsat_toar_core.h\ MLB_Interface.h\ pansharpening.h\ tasseled_cap.h libimagery_tools_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_images/modules_imagery/imagery_tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_images/modules_imagery/imagery_tools/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libimagery_tools.la: $(libimagery_tools_la_OBJECTS) $(libimagery_tools_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libimagery_tools_la_OBJECTS) $(libimagery_tools_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Image_VI_Distance.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Image_VI_Slope.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/landsat_acca.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/landsat_toar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/landsat_toar_core.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pansharpening.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tasseled_cap.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/evi.cpp000066400000000000000000000157761224124640700265030ustar00rootroot00000000000000/********************************************************** * Version $Id: evi.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_tools // // // //-------------------------------------------------------// // // // evi.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "evi.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CEnhanced_VI::CEnhanced_VI(void) { Set_Name (_TL("Enhanced Vegetation Index")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Enhanced Vegetation Index (EVI).\n" "\n" "References:\n" "A Huete, K Didan, T Miura, E.P Rodriguez, X Gao, L.G Ferreira, " "Overview of the radiometric and biophysical performance of the MODIS vegetation indices, " "Remote Sensing of Environment, Volume 83, Issues 1-2, November 2002, Pages 195-213, ISSN 0034-4257, 10.1016/S0034-4257(02)00096-2. " "online\n" )); Parameters.Add_Grid( NULL, "BLUE" , _TL("Blue Reflectance"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "RED" , _TL("Red Reflectance"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "NIR" , _TL("Near Infrared Reflectance"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "EVI" , _TL("Enhanced Vegetation Index"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL, "GAIN" , _TL("Gain"), _TL(""), PARAMETER_TYPE_Double, 2.5, 0.0, true ); Parameters.Add_Value( NULL, "L" , _TL("Canopy Background Adjustment"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); Parameters.Add_Value( NULL, "CBLUE" , _TL("Aerosol Resistance Coefficient (Blue)"), _TL(""), PARAMETER_TYPE_Double, 7.5, 0.0, true ); Parameters.Add_Value( NULL, "CRED" , _TL("Aerosol Resistance Coefficient (Red)"), _TL(""), PARAMETER_TYPE_Double, 6.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CEnhanced_VI::On_Execute(void) { CSG_Grid *pBlue = Parameters("BLUE" )->asGrid(); CSG_Grid *pRed = Parameters("RED" )->asGrid(); CSG_Grid *pNIR = Parameters("NIR" )->asGrid(); CSG_Grid *pEVI = Parameters("EVI" )->asGrid(); double Gain = Parameters("GAIN" )->asDouble(); double L = Parameters("L" )->asDouble(); double CBlue = Parameters("CBLUE")->asDouble(); double CRed = Parameters("CRED" )->asDouble(); DataObject_Set_Colors(pEVI, 100, SG_COLORS_WHITE_GREEN, false); for(int y=0; yis_NoData(x, y)) || pRed->is_NoData(x, y) || pNIR->is_NoData(x, y) ) { d = 0.0; } else if( pBlue ) { d = L + pNIR->asDouble(x, y) + CRed * pRed->asDouble(x, y) + CBlue * pBlue->asDouble(x, y); } else { d = L + pNIR->asDouble(x, y) + CRed * pRed->asDouble(x, y); } if( d ) { pEVI->Set_Value(x, y, Gain * (pNIR->asDouble(x, y) - pRed->asDouble(x, y)) / d); } else { pEVI->Set_NoData(x, y); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/evi.h000066400000000000000000000112001224124640700261220ustar00rootroot00000000000000/********************************************************** * Version $Id: Image_VI_Slope.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_tools // // // //-------------------------------------------------------// // // // evi.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__evi_H #define HEADER_INCLUDED__evi_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CEnhanced_VI : public CSG_Module_Grid { public: CEnhanced_VI(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Vegetation Indices") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__evi_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/landsat_acca.cpp000066400000000000000000000633211224124640700303020ustar00rootroot00000000000000/********************************************************** * Version $Id: landsat_acca.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_tools // // // //-------------------------------------------------------// // // // landsat_acca.cpp // // // // Copyright (C) 2013 by // // Benjamin Bechtel & Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "landsat_acca.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define NO_DEFINED 1 #define IS_SHADOW 2 #define IS_COLD_CLOUD 6 #define IS_WARM_CLOUD 9 //--------------------------------------------------------- #define LUT_SET_CLASS(id, name, color) { CSG_Table_Record *pR = pLUT->asTable()->Add_Record(); pR->Set_Value(0, color); pR->Set_Value(1, name); pR->Set_Value(3, id); pR->Set_Value(3, id); } //--------------------------------------------------------- void acca_algorithm (CSG_Grid *pCloud, CSG_Grid *band[], int single_pass, int with_shadow, int cloud_signature); void filter_holes (CSG_Grid *pGrid); /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CLandsat_ACCA::CLandsat_ACCA(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Automated Cloud Cover Assessment")); Set_Author (_TL("B.Bechtel, O.Conrad (c) 2013")); Set_Description (_TW( "Automated Cloud-Cover Assessment (ACCA) for Landsat TM/ETM+ imagery as proposed by Irish (2000). " "This module incorporates E.J. Tizado's GRASS GIS implementation (i.landsat.acca).\n" "\n" "References:\n" "- Irish, R.R. (2000): Landsat 7 Automatic Cloud Cover Assessment." " In Shen, S.S., Descour, M.R. (Eds.): Algorithms for Multispectral, Hyperspectral, and Ultraspectral Imagery VI. " " Proceedings of SPIE, 4049: 348-355. " "online.\n" "- Irish, R.R., Barker J.L., Goward S.N., Arvidson T. (2006): " " Characterization of the Landsat-7 ETM+ Automated Cloud-Cover Assessment (ACCA) Algorithm." " Photogrammetric Engineering and Remote Sensing vol. 72(10): 1179-1188. " "online.\n" )); //----------------------------------------------------- Parameters.Add_Grid(NULL, "BAND2", _TL("Landsat Band 2"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "BAND3", _TL("Landsat Band 3"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "BAND4", _TL("Landsat Band 4"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "BAND5", _TL("Landsat Band 5"), _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL, "BAND6", _TL("Landsat Band 6"), _TL(""), PARAMETER_INPUT, false); Parameters.Add_Grid( NULL , "CLOUD" , _TL("Cloud Cover"), _TL(""), PARAMETER_OUTPUT, true, SG_DATATYPE_Char ); Parameters.Add_Value( NULL , "FILTER" , _TL("Apply post-processing filter to remove small holes"), _TL(""), PARAMETER_TYPE_Bool, true ); //----------------------------------------------------- pNode = Parameters.Add_Node( NULL , "NODE_THRS" , _TL("Thresholds"), _TL("") ); Parameters.Add_Value( pNode , "B56C" , _TL("B56 Composite (step 6)"), _TL(""), PARAMETER_TYPE_Double, 225.0 ); Parameters.Add_Value( pNode , "B45R" , _TL("B45 Ratio: Desert detection (step 10)"), _TL(""), PARAMETER_TYPE_Double, 1.0 ); //----------------------------------------------------- pNode = Parameters.Add_Node( NULL , "NODE_CLOUD" , _TL("Cloud Settings"), _TL("") ); // Parameters.Add_Value( // pNode , "HIST_N" , _TL("Number of classes in the cloud temperature histogram"), // _TL(""), // PARAMETER_TYPE_Int, 100, 10, true // ); Parameters.Add_Value( pNode , "CSIG" , _TL("Always use cloud signature (step 14)"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( pNode , "PASS2" , _TL("Bypass second-pass processing, and merge warm (not ambiguous) and cold clouds"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( pNode , "SHADOW" , _TL("Include a category for cloud shadows"), _TL(""), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLandsat_ACCA::On_Execute(void) { CSG_Grid *pCloud, *pBand[5]; //----------------------------------------------------- // Get parameter settings... pBand[0] = Parameters("BAND2")->asGrid(); pBand[1] = Parameters("BAND3")->asGrid(); pBand[2] = Parameters("BAND4")->asGrid(); pBand[3] = Parameters("BAND5")->asGrid(); pBand[4] = Parameters("BAND6")->asGrid(); pCloud = Parameters("CLOUD")->asGrid(); pCloud ->Set_NoData_Value(0); //----------------------------------------------------- // int hist_n = Parameters("HIST_N")->asInt(); //----------------------------------------------------- acca_algorithm(pCloud, pBand, Parameters("PASS2" )->asBool(), Parameters("SHADOW")->asBool(), Parameters("CSIG" )->asBool() ); if( Parameters("FILTER")->asBool() ) { filter_holes(pCloud); } //----------------------------------------------------- CSG_Parameter *pLUT = DataObject_Get_Parameter(pCloud, "LUT"); if( pLUT && pLUT->asTable() ) { pLUT->asTable()->Del_Records(); LUT_SET_CLASS(IS_SHADOW , _TL("Shadow" ), SG_COLOR_BLUE_DARK); LUT_SET_CLASS(IS_COLD_CLOUD, _TL("Cold Cloud"), SG_COLOR_BLUE); LUT_SET_CLASS(IS_WARM_CLOUD, _TL("Warm Cloud"), SG_COLOR_BLUE_LIGHT); DataObject_Set_Parameter(pCloud, pLUT); DataObject_Set_Parameter(pCloud, "COLORS_TYPE", 1); // Color Classification Type: Lookup Table } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// /**************************************************************************** * * MODULE: i.landsat.acca * * AUTHOR(S): E. Jorge Tizado - ej.tizado@unileon.es * * PURPOSE: Landsat TM/ETM+ Automatic Cloud Cover Assessment * Adopted for GRASS 7 by Martin Landa * * COPYRIGHT: (C) 2008, 2010 by the GRASS Development Team * * This program is free software under the GNU General Public * License (>=v2). Read the file COPYING that comes with GRASS * for details. * *****************************************************************************/ #define SCALE 200. #define K_BASE 230. /* value and count */ #define TOTAL 0 #define WARM 1 #define COLD 2 #define SNOW 3 #define SOIL 4 /* signa */ #define COVER 1 #define SUM_COLD 0 #define SUM_WARM 1 #define KMEAN 2 #define KMAX 3 #define KMIN 4 /* re-use value */ #define KLOWER 0 #define KUPPER 1 #define MEAN 2 #define SKEW 3 #define DSTD 4 /********************************************************** * * Automatic Cloud Cover Assessment (ACCA): Irish 2000 * **********************************************************/ /*-------------------------------------------------------- CONSTANTS Usar esta forma para que via extern puedan modificarse como opciones desde el programa main. ---------------------------------------------------------*/ double th_1 = 0.08; /* Band 3 Brightness Threshold */ double th_1_b = 0.07; double th_2[2] = { -0.25, 0.70 }; /* Normalized Snow Difference Index */ double th_2_b = 0.8; double th_3 = 300.; /* Band 6 Temperature Threshold */ double th_4 = 225.; /* Band 5/6 Composite */ double th_4_b = 0.08; double th_5 = 2.35; /* Band 4/3 Ratio */ double th_6 = 2.16248; /* Band 4/2 Ratio */ double th_7 = 1.0; /* Band 4/5 Ratio */ ; double th_8 = 210.; /* Band 5/6 Composite */ //--------------------------------------------------------- const int hist_n = 100; /* interval of real data 100/hist_n */ //--------------------------------------------------------- #define G_message(s) SG_UI_Msg_Add(s, false) void acca_first(CSG_Grid *pCloud, CSG_Grid *band[], int with_shadow, int count[], int cold[], int warm[], double stats[]); void acca_second(CSG_Grid *pCloud, CSG_Grid *band, int review_warm, double upper, double lower); int shadow_algorithm(double pixel[]); void hist_put(double t, int hist[]); double quantile(double q, int hist[]); double moment(int n, int hist[], int k); #define BAND2 0 #define BAND3 1 #define BAND4 2 #define BAND5 3 #define BAND6 4 #define NO_CLOUD 0 #define IS_CLOUD 1 #define COLD_CLOUD 30 #define WARM_CLOUD 50 //--------------------------------------------------------- void acca_algorithm(CSG_Grid *pCloud, CSG_Grid *band[], int single_pass, int with_shadow, int cloud_signature) { int i, count[5], hist_cold[hist_n], hist_warm[hist_n], review_warm; double max, value[5], signa[5], idesert, shift; /* Reset variables ... */ for (i = 0; i < 5; i++) { count[i] = 0; value[i] = 0.; } for (i = 0; i < hist_n; i++) { hist_cold[i] = hist_warm[i] = 0; } /* FIRST FILTER ... */ acca_first(pCloud, band, with_shadow, count, hist_cold, hist_warm, signa); /* CATEGORIES: NO_DEFINED, WARM_CLOUD, COLD_CLOUD, NULL (= NO_CLOUD) */ value[WARM] = (double)count[WARM] / (double)count[TOTAL]; value[COLD] = (double)count[COLD] / (double)count[TOTAL]; value[SNOW] = (double)count[SNOW] / (double)count[TOTAL]; value[SOIL] = (double)count[SOIL] / (double)count[TOTAL]; value[0] = (double)(count[WARM] + count[COLD]); idesert = (value[0] == 0. ? 0. : value[0] / ((double)count[SOIL])); //----------------------------------------------------- // BAND-6 CLOUD SIGNATURE DEVELOPMENT if( idesert <= .5 || value[SNOW] > 0.01 ) { // Only the cold clouds are used if snow or desert soil is present review_warm = 1; } else { // The cold and warm clouds are combined and treated as a single population review_warm = 0; count[COLD] += count[WARM]; value[COLD] += value[WARM]; signa[SUM_COLD] += signa[SUM_WARM]; for(i=0; i .5 && signa[COVER] > 0.004 && signa[KMEAN] < 295.) ) { G_message(_TL("Histogram cloud signature:")); value[MEAN] = quantile(0.5, hist_cold) + K_BASE; value[DSTD] = sqrt(moment(2, hist_cold, 1)); value[SKEW] = moment(3, hist_cold, 3) / pow(value[DSTD], 3); /* G_message(_TL("* Mean temperature: %.2lf K"), value[MEAN]); G_message(_TL("* Standard deviation: %.2lf"), value[DSTD]); G_message(_TL("* Skewness: %.2lf"), value[SKEW]); G_message(_TL("* Histogram classes: %d"), hist_n); /**/ shift = value[SKEW]; if (shift > 1.) shift = 1.; else if (shift < 0.) shift = 0.; max = quantile(0.9875, hist_cold) + K_BASE; value[KUPPER] = quantile(0.975, hist_cold) + K_BASE; value[KLOWER] = quantile(0.835, hist_cold) + K_BASE; /* G_message(_TL("* 98.75 percentile: %.2lf K"), max); G_message(_TL("* 97.50 percentile: %.2lf K"), value[KUPPER]); G_message(_TL("* 83.50 percentile: %.2lf K"), value[KLOWER]); /**/ /* step 17 & 18 */ if (shift > 0.) { shift *= value[DSTD]; if ((value[KUPPER] + shift) > max) { if ((value[KLOWER] + shift) > max) { value[KLOWER] += (max - value[KUPPER]); } else { value[KLOWER] += shift; } value[KUPPER] = max; } else { value[KLOWER] += shift; value[KUPPER] += shift; } } /* G_message(_TL("Maximum temperature:")); G_message(_TL("* Cold cloud: %.2lf K"), value[KUPPER]); G_message(_TL("* Warm cloud: %.2lf K"), value[KLOWER]); /**/ } else if( signa[KMEAN] < 295. ) { // Retained warm and cold clouds G_message(_TL("Result: Scene with clouds")); review_warm = 0; value[KUPPER] = 0.; value[KLOWER] = 0.; } else { // Retained cold clouds G_message(_TL("Result: Scene cloud free")); review_warm = 1; value[KUPPER] = 0.; value[KLOWER] = 0.; } //----------------------------------------------------- // SECOND FILTER ... // By-pass two processing but it retains warm and cold clouds if( single_pass != 0 ) { review_warm = -1; value[KUPPER] = 0.; value[KLOWER] = 0.; } // CATEGORIES: IS_WARM_CLOUD, IS_COLD_CLOUD, IS_SHADOW, NULL (= NO_CLOUD) acca_second(pCloud, band[BAND6], review_warm, value[KUPPER], value[KLOWER]); //----------------------------------------------------- return; } //--------------------------------------------------------- void acca_first(CSG_Grid *pCloud, CSG_Grid *band[], int with_shadow, int count[], int cold[], int warm[], double stats[]) { double nsdi, rat56; /* Creation of output file */ /* ----- ----- */ SG_UI_Msg_Add_Execution(_TL("Processing first pass..."), true); stats[SUM_COLD] = 0.; stats[SUM_WARM] = 0.; stats[KMAX] = 0.; stats[KMIN] = 10000.; for(int y=0; yGet_NY() && SG_UI_Process_Set_Progress(y, pCloud->Get_NY()); y++) { for(int x=0; xGet_NX(); x++) { char code = NO_DEFINED; double pixel[5]; for(int i=BAND2; i<=BAND6; i++) // Null when null pixel in any band { if( pCloud->Get_System() == band[i]->Get_System() ) { if( band[i]->is_NoData(x, y) ) { code = NO_CLOUD; break; } pixel[i] = band[i]->asDouble(x, y); } else if( !band[i]->Get_Value(pCloud->Get_System().Get_Grid_to_World(x, y), pixel[i]) ) { code = NO_CLOUD; break; } } /* Determina los pixeles de sombras */ if( code == NO_DEFINED && with_shadow ) { code = shadow_algorithm(pixel); } /* Analiza el valor de los pixeles no definidos */ if (code == NO_DEFINED) { code = NO_CLOUD; count[TOTAL]++; nsdi = (pixel[BAND2] - pixel[BAND5]) / (pixel[BAND2] + pixel[BAND5]); /* ----------------------------------------------------- */ /* step 1. Brightness Threshold: Eliminates dark images */ if (pixel[BAND3] > th_1) { /* step 3. Normalized Snow Difference Index: Eliminates many types of snow */ if (nsdi > th_2[0] && nsdi < th_2[1]) { /* step 5. Temperature Threshold: Eliminates warm image features */ if (pixel[BAND6] < th_3) { rat56 = (1. - pixel[BAND5]) * pixel[BAND6]; /* step 6. Band 5/6 Composite: Eliminates numerous categories including ice */ if (rat56 < th_4) { /* step 8. Eliminates growing vegetation */ if ((pixel[BAND4] / pixel[BAND3]) < th_5) { /* step 9. Eliminates senescing vegetation */ if ((pixel[BAND4] / pixel[BAND2]) < th_6) { /* step 10. Eliminates rocks and desert */ count[SOIL]++; if ((pixel[BAND4] / pixel[BAND5]) > th_7) { /* step 11. Distinguishes warm clouds from cold clouds */ if (rat56 < th_8) { code = COLD_CLOUD; count[COLD]++; /* for statistic */ stats[SUM_COLD] += (pixel[BAND6] / SCALE); hist_put(pixel[BAND6] - K_BASE, cold); } else { code = WARM_CLOUD; count[WARM]++; /* for statistic */ stats[SUM_WARM] += (pixel[BAND6] / SCALE); hist_put(pixel[BAND6] - K_BASE, warm); } if (pixel[BAND6] > stats[KMAX]) stats[KMAX] = pixel[BAND6]; if (pixel[BAND6] < stats[KMIN]) stats[KMIN] = pixel[BAND6]; } else { code = NO_DEFINED; } } else { code = NO_DEFINED; count[SOIL]++; } } else { code = NO_DEFINED; } } else { /* step 7 */ code = (pixel[BAND5] < th_4_b) ? NO_CLOUD : NO_DEFINED; } } else { code = NO_CLOUD; } } else { /* step 3 */ code = NO_CLOUD; if (nsdi > th_2_b) count[SNOW]++; } } else { /* step 2 */ code = (pixel[BAND3] < th_1_b) ? NO_CLOUD : NO_DEFINED; } } //--------------------------------------------- if (code == NO_CLOUD) { pCloud->Set_Value(x, y, 1); } else { pCloud->Set_Value(x, y, code); } } } return; } //--------------------------------------------------------- void acca_second(CSG_Grid *pCloud, CSG_Grid *pThermal, int review_warm, double upper, double lower) { SG_UI_Process_Set_Text(upper == 0.0 ? _TL("Removing ambiguous pixels...") : _TL("Pass two processing...") ); //----------------------------------------------------- for(int y=0; yGet_NY() && SG_UI_Process_Set_Progress(y, pCloud->Get_NY()); y++) { double p_y = pCloud->Get_YMin() + y * pCloud->Get_Cellsize(); #pragma omp parallel for for(int x=0; xGet_NX(); x++) { if( !pCloud->is_NoData(x, y) ) { int code = pCloud->asInt(x, y); if( code == NO_DEFINED || (code == WARM_CLOUD && review_warm == 1) ) // Resolve ambiguous pixels { double t, p_x = pCloud->Get_XMin() + x * pCloud->Get_Cellsize(); if( !pThermal->Get_Value(p_x, p_y, t) || t > upper ) { pCloud->Set_NoData(x, y); } else { pCloud->Set_Value(x, y, t < lower ? IS_WARM_CLOUD : IS_COLD_CLOUD); } } else if( code == COLD_CLOUD || code == WARM_CLOUD ) // Join warm (not ambiguous) and cold clouds { pCloud->Set_Value(x, y, (code == WARM_CLOUD && review_warm == 0) ? IS_WARM_CLOUD : IS_COLD_CLOUD); } else { pCloud->Set_Value(x, y, IS_SHADOW); } } } } //----------------------------------------------------- return; } /////////////////////////////////////////////////////////// // // // Cloud shadows // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int shadow_algorithm(double pixel[]) { // I think this filter is better but not in any paper if( pixel[BAND3] < 0.07 && (1 - pixel[BAND4]) * pixel[BAND6] > 240. && pixel[BAND4] / pixel[BAND2] > 1. && (pixel[BAND3] - pixel[BAND5]) / (pixel[BAND3] + pixel[BAND5]) < 0.10 ) // if( pixel[BAND3] < 0.07 && (1 - pixel[BAND4]) * pixel[BAND6] > 240. && pixel[BAND4] / pixel[BAND2] > 1. ) { return IS_SHADOW; } return NO_DEFINED; } /////////////////////////////////////////////////////////// // // // HISTOGRAM ANALYSIS // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // Define un factor de escala = hist_n/100 con objeto // de dividir el entero 1 por 100/hist_n partes y // aumentar la precision. // // Afecta al almacenamiento en el histograma pero // modifica el calculo de quantiles y momentos. //--------------------------------------------------------- //--------------------------------------------------------- void hist_put(double t, int hist[]) { int i = (int)(t * ((double)hist_n / 100.)); // scale factor if( i < 1 ) i = 1; else if (i > hist_n) i = hist_n; hist[i - 1]++; } //--------------------------------------------------------- /* histogram moment */ double moment(int n, int hist[], int k) { int i, total; double value, mean; for(i=0, total=0, mean=0; i=0; i--) { qmin = qmax - (double)hist[i] / (double)total; if( q >= qmin ) { value = (q - qmin) / (qmax - qmin) + (i - 1); break; } qmax = qmin; } /* remove scale factor */ return (value / ((double)hist_n / 100.)); } /////////////////////////////////////////////////////////// // // // FILTER HOLES OF CLOUDS // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // This a >=50% filter of 3x3 // if >= 50% vecinos cloud then pixel set to cloud //--------------------------------------------------------- void filter_holes(CSG_Grid *pCloud) { if( pCloud->Get_NY() < 3 || pCloud->Get_NX() < 3 ) return; SG_UI_Process_Set_Text(_TL("Filling small holes in clouds...")); CSG_Grid Cloud(*pCloud); //----------------------------------------------------- for(int y=0; yGet_NY() && SG_UI_Process_Set_Progress(y, pCloud->Get_NY()); y++) { #pragma omp parallel for for(int x=0; xGet_NX(); x++) { int z = Cloud.asInt(x, y); if( z == 0 ) { int cold, warm, shadow, nulo; cold = warm = shadow = nulo = 0; for(int i=0; i<8; i++) { int ix = pCloud->Get_System().Get_xTo(i, x); int iy = pCloud->Get_System().Get_yTo(i, y); switch( Cloud.is_InGrid(ix, iy) ? Cloud.asInt(ix, iy) : -1 ) { case IS_COLD_CLOUD: cold ++; break; case IS_WARM_CLOUD: warm ++; break; case IS_SHADOW: shadow++; break; default: nulo ++; break; } } int lim = (cold + warm + shadow + nulo) / 2; // Entra pixel[0] = 0 if( nulo < lim ) { if( shadow >= (cold + warm) ) z = IS_SHADOW; else z = (warm > cold) ? IS_WARM_CLOUD : IS_COLD_CLOUD; } } if( z != 0 ) { pCloud->Set_Value(x, y, z); } else { pCloud->Set_NoData(x, y); } } } //----------------------------------------------------- return; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/landsat_acca.h000066400000000000000000000115021224124640700277410ustar00rootroot00000000000000/********************************************************** * Version $Id: landsat_acca.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_tools // // // //-------------------------------------------------------// // // // landsat_acca.h // // // // Copyright (C) 2012 by // // Benjamin Bechtel & Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__landsat_acca_H #define HEADER_INCLUDED__landsat_acca_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CLandsat_ACCA : public CSG_Module_Grid { public: CLandsat_ACCA(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Landsat") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__landsat_acca_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/landsat_toar.cpp000066400000000000000000000635751224124640700303730ustar00rootroot00000000000000/********************************************************** * Version $Id: landsat_toar.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_tools // // // //-------------------------------------------------------// // // // landsat_toar.cpp // // // // Copyright (C) 2013 by // // Benjamin Bechtel & Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "landsat_toar.h" //--------------------------------------------------------- #include "landsat_toar_core.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- enum { mss1 = 0, // Landsat-1 MSS mss2, // Landsat-2 MSS mss3, // Landsat-3 MSS mss4, // Landsat-4 MSS mss5, // Landsat-5 MSS tm4, // Landsat-4 TM tm5, // Landsat-5 TM tm7 // Landsat-7 ETM+ }; //--------------------------------------------------------- #define PRM_IN(id) (CSG_String("DN_") + id) #define PRM_OUT(id) (CSG_String("RF_") + id) #define PRM_ADD_BAND__IN(id) Parameters.Add_Grid(pNode, PRM_IN (id), CSG_String::Format(SG_T("%s %s"), _TL("DN"), _TL("Band")) + id, _TL(""), PARAMETER_INPUT_OPTIONAL); #define PRM_ADD_BAND_OUT(id) Parameters.Add_Grid(pNode, PRM_OUT(id), CSG_String::Format(SG_T("%s %s"), _TL("Reflectance"), _TL("Band")) + id, _TL(""), PARAMETER_OUTPUT_OPTIONAL); #define PRM_ADD_BAND(id) PRM_ADD_BAND_IN(id); PRM_ADD_BAND_OUT(id) #define PRM_ENABLE_OUTPUT(id) pParameters->Get_Parameter(PRM_OUT(id))->Set_Enabled(pParameters->Get_Parameter(PRM_IN(id))->is_Enabled() && pParameters->Get_Parameter(PRM_IN(id))->asGrid()) //--------------------------------------------------------- #define GET_DESC_INT(name, value) CSG_String::Format(SG_T("%s: %d\n"), name, value) #define GET_DESC_FLT(name, value) CSG_String::Format(SG_T("%s: %f\n"), name, value) #define GET_DESC_RNG(name, min, max) CSG_String::Format(SG_T("%s: %f / %f\n"), name, min, max) #define GET_DESC_STR(name, value) CSG_String(name) + ": " + CSG_String(value) + "\n" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool Set_Date_from_String (char *date, const CSG_String s) { // yyyy-mm-dd // 0123456789 if( s.Length() == 10 ) { strncpy(date, s.b_str(), 11); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool Load_MetaFile (const CSG_String &MetaFile, lsat_data &lsat) { if( !SG_File_Exists(MetaFile) ) // Data from metadata file { return( false ); } if( !lsat_newdata(MetaFile, &lsat) && !lsat_mtldata(MetaFile, &lsat) && !lsat_metdata(MetaFile, &lsat) ) { return( false ); } return( true ); } //--------------------------------------------------------- int Get_Sensor_Index (int LSat_Number, const CSG_String &LSat_Sensor) { if( !LSat_Sensor.CmpNoCase("MSS") ) { switch( LSat_Number ) { case 1: return(0); break; // Landsat-1 MSS case 2: return(1); break; // Landsat-2 MSS case 3: return(2); break; // Landsat-3 MSS case 4: return(3); break; // Landsat-4 MSS case 5: return(4); break; // Landsat-5 MSS } } else if( !CSG_String(LSat_Sensor).CmpNoCase("TM") ) { switch( LSat_Number ) { case 4: return(5); break; // Landsat-1 MSS case 5: return(6); break; // Landsat-2 MSS } } else if( !CSG_String(LSat_Sensor).Find("ETM") && LSat_Number == 7 ) { return(7); // Landsat-7 ETM+ } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CLandsat_TOAR::CLandsat_TOAR(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Top of Atmosphere Reflectance")); Set_Author (_TL("B.Bechtel, O.Conrad (c) 2013")); Set_Description (_TW( "Calculation of top-of-atmosphere radiance or reflectance and temperature (TOAR) for Landsat MSS/TM/ETM+. " "This module incorporates E.J. Tizado's GRASS GIS implementation (i.landsat.toar).\n" "\n" "References:\n" "Landsat 7 Science Data Users Handbook" )); //----------------------------------------------------- pNode = Parameters.Add_Grid_System(NULL, "GS_SPECTRAL", _TL("Spectral" ), _TL("")); PRM_ADD_BAND__IN("10"); PRM_ADD_BAND__IN("20"); PRM_ADD_BAND__IN("30"); PRM_ADD_BAND__IN("40"); PRM_ADD_BAND__IN("50"); PRM_ADD_BAND__IN("70"); PRM_ADD_BAND_OUT("10"); PRM_ADD_BAND_OUT("20"); PRM_ADD_BAND_OUT("30"); PRM_ADD_BAND_OUT("40"); PRM_ADD_BAND_OUT("50"); PRM_ADD_BAND_OUT("70"); pNode = Parameters.Add_Grid_System(NULL, "GS_THERMAL" , _TL("Thermal" ), _TL("")); PRM_ADD_BAND__IN("60"); PRM_ADD_BAND__IN("61"); PRM_ADD_BAND__IN("62"); PRM_ADD_BAND_OUT("60"); PRM_ADD_BAND_OUT("61"); PRM_ADD_BAND_OUT("62"); pNode = Parameters.Add_Grid_System(NULL, "GS_PAN" , _TL("Panchromatic"), _TL("")); PRM_ADD_BAND__IN("80"); PRM_ADD_BAND_OUT("80"); //----------------------------------------------------- Parameters.Add_FilePath( NULL , "METAFILE" , _TL("Metadata File"), _TL("Name of Landsat metadata file (.met or MTL.txt)"), CSG_String::Format(SG_T("%s|*.met;*.txt|%s|*.*"), _TL("Metadata Files (*.met, *.txt)"), _TL("All Files") ) ); //----------------------------------------------------- Parameters.Add_Choice( NULL , "SENSOR" , _TL("Spacecraft Sensor"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|"), _TL("Landsat-1 MSS"), _TL("Landsat-2 MSS"), _TL("Landsat-3 MSS"), _TL("Landsat-4 MSS"), _TL("Landsat-5 MSS"), _TL("Landsat-4 TM"), _TL("Landsat-5 TM"), _TL("Landsat-7 ETM+") ), 7 ); //----------------------------------------------------- Parameters.Add_String( NULL , "DATE_ACQU" , _TL("Image Acquisition Date"), _TL("Image acquisition date (yyyy-mm-dd)"), "2001-01-01" ); Parameters.Add_String( NULL , "DATE_PROD" , _TL("Image Creation Date"), _TL("Image creation date (yyyy-mm-dd)"), "2001-01-01" ); Parameters.Add_Value( NULL , "SUN_HGT" , _TL("Suns's Height"), _TL("Sun's height above horizon in degree"), PARAMETER_TYPE_Double, 45.0, 0.0, true, 90.0, true ); Parameters.Add_Value( NULL , "AS_RAD" , _TL("At-Sensor Radiance"), _TL("Output at-sensor radiance for all bands"), PARAMETER_TYPE_Bool, false ); //----------------------------------------------------- pNode = Parameters.Add_Choice( NULL , "AC_METHOD" , _TL("Atmospheric Correction"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|"), _TL("uncorrected"), _TL("corrected"), _TL("dos1"), _TL("dos2"), _TL("dos2b"), _TL("dos3"), _TL("dos4") ), 0 ); Parameters.Add_Value( pNode , "AC_DO_CELLS" , _TL("Minimum Number of Dark Object Cells"), _TL("Minimum pixels to consider digital number as dark object"), PARAMETER_TYPE_Int, 1000, 0, true ); Parameters.Add_Value( pNode , "AC_RAYLEIGH" , _TL("Rayleigh Scattering"), _TL("Rayleigh atmosphere (diffuse sky irradiance)"), PARAMETER_TYPE_Double, 0.0 ); Parameters.Add_Value( pNode , "AC_SUN_RAD" , _TL("Solar Radiance"), _TL("Percent of solar radiance in path radiance"), PARAMETER_TYPE_Double, 1.0, 0.0, true, 100.0, true ); //----------------------------------------------------- pNode = Parameters.Add_Node( NULL , "ETM_GAIN" , _TL("ETM+ Gain"), _TL("Gain (H/L) of all Landsat ETM+ bands (1-5,61,62,7,8)") ); Parameters.Add_Choice(pNode, "ETM_GAIN_10", _TL("Band 1" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1); Parameters.Add_Choice(pNode, "ETM_GAIN_20", _TL("Band 2" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1); Parameters.Add_Choice(pNode, "ETM_GAIN_30", _TL("Band 3" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1); Parameters.Add_Choice(pNode, "ETM_GAIN_40", _TL("Band 4" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1); Parameters.Add_Choice(pNode, "ETM_GAIN_50", _TL("Band 5" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1); Parameters.Add_Choice(pNode, "ETM_GAIN_61", _TL("Band 61"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 0); Parameters.Add_Choice(pNode, "ETM_GAIN_62", _TL("Band 62"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1); Parameters.Add_Choice(pNode, "ETM_GAIN_70", _TL("Band 7" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 1); Parameters.Add_Choice(pNode, "ETM_GAIN_80", _TL("Band 8" ), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("low"), _TL("high")), 0); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CLandsat_TOAR::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("METAFILE")) && *pParameter->asString() ) { lsat_data lsat; if( !Load_MetaFile(pParameter->asString(), lsat) ) { pParameter->Set_Value((const char *)""); Error_Set(_TL("could not read metadata file")); } else { pParameters->Get_Parameter("SENSOR" )->Set_Value(Get_Sensor_Index(lsat.number, lsat.sensor)); pParameters->Get_Parameter("DATE_ACQU")->Set_Value((const char *)lsat.date); pParameters->Get_Parameter("DATE_PROD")->Set_Value((const char *)lsat.creation); pParameters->Get_Parameter("SUN_HGT" )->Set_Value(lsat.sun_elev); } } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SENSOR")) ) { pParameters->Get_Parameter("METAFILE")->Set_Value((const char *)""); } return( 0 ); } //--------------------------------------------------------- int CLandsat_TOAR::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("AC_METHOD")) ) { pParameters->Get_Parameter("AC_DO_CELLS")->Set_Enabled(pParameter->asInt() > 1); } if( 1 ) { int Sensor = pParameters->Get_Parameter("SENSOR")->asInt(); pParameters->Get_Parameter("ETM_GAIN" )->Set_Enabled(Sensor == tm7 && !(*pParameters->Get_Parameter("METAFILE")->asString())); pParameters->Get_Parameter("GS_PAN" )->Set_Enabled(Sensor == tm7); pParameters->Get_Parameter("GS_THERMAL")->Set_Enabled(Sensor >= tm4); pParameters->Get_Parameter(PRM_IN("50"))->Set_Enabled(Sensor >= tm4); pParameters->Get_Parameter(PRM_IN("70"))->Set_Enabled(Sensor >= tm4); pParameters->Get_Parameter(PRM_IN("60"))->Set_Enabled(Sensor == tm4 || Sensor == tm5); pParameters->Get_Parameter(PRM_IN("61"))->Set_Enabled(Sensor == tm7); pParameters->Get_Parameter(PRM_IN("62"))->Set_Enabled(Sensor == tm7); PRM_ENABLE_OUTPUT("10"); PRM_ENABLE_OUTPUT("20"); PRM_ENABLE_OUTPUT("30"); PRM_ENABLE_OUTPUT("40"); PRM_ENABLE_OUTPUT("50"); PRM_ENABLE_OUTPUT("60"); PRM_ENABLE_OUTPUT("61"); PRM_ENABLE_OUTPUT("62"); PRM_ENABLE_OUTPUT("70"); PRM_ENABLE_OUTPUT("80"); } return( 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CLandsat_TOAR::On_Execute(void) { //----------------------------------------------------- int Sensor, iBand, dn_dark[MAX_BANDS], dn_mode[MAX_BANDS], AC_Method, AC_nCells; double AC_Rayleigh, AC_SunRad; CSG_Grid *pInput, *pOutput; lsat_data lsat; //----------------------------------------------------- if( *Parameters("METAFILE")->asString() ) { if( !Load_MetaFile(Parameters("METAFILE")->asString(), lsat) ) { Error_Set(_TL("could not read metadata file")); return( false ); } Sensor = Get_Sensor_Index(lsat.number, lsat.sensor); } //----------------------------------------------------- else { memset(&lsat, 0, sizeof(lsat)); if( !Set_Date_from_String(lsat.date , Parameters("DATE_ACQU")->asString()) ) { Error_Set(_TL("invalid acquisition date")); return( false ); } if( !Set_Date_from_String(lsat.creation, Parameters("DATE_PROD")->asString()) ) { Error_Set(_TL("invalid production date")); return( false ); } lsat.sun_elev = Parameters("SUN_HGT")->asDouble(); switch( Sensor = Parameters("SENSOR")->asInt() ) { case mss1: set_MSS1(&lsat); break; case mss2: set_MSS2(&lsat); break; case mss3: set_MSS3(&lsat); break; case mss4: set_MSS4(&lsat); break; case mss5: set_MSS5(&lsat); break; case tm4: set_TM4 (&lsat); break; case tm5: set_TM5 (&lsat); break; case tm7: { char gain[9]; gain[0] = Parameters("ETM_GAIN_10")->asInt() == 0 ? 'L' : 'H'; gain[1] = Parameters("ETM_GAIN_20")->asInt() == 0 ? 'L' : 'H'; gain[2] = Parameters("ETM_GAIN_30")->asInt() == 0 ? 'L' : 'H'; gain[3] = Parameters("ETM_GAIN_40")->asInt() == 0 ? 'L' : 'H'; gain[4] = Parameters("ETM_GAIN_50")->asInt() == 0 ? 'L' : 'H'; gain[5] = Parameters("ETM_GAIN_61")->asInt() == 0 ? 'L' : 'H'; gain[6] = Parameters("ETM_GAIN_62")->asInt() == 0 ? 'L' : 'H'; gain[7] = Parameters("ETM_GAIN_70")->asInt() == 0 ? 'L' : 'H'; gain[8] = Parameters("ETM_GAIN_80")->asInt() == 0 ? 'L' : 'H'; set_ETM (&lsat, gain); // Landsat-7 requires band gain with 9 (H/L) data break; } } } /////////////////////////////////////////////////////// //----------------------------------------------------- // Atmospheric Correction switch( Parameters("AC_METHOD")->asInt() ) { default: AC_Method = UNCORRECTED; break; case 1: AC_Method = CORRECTED; break; case 2: AC_Method = DOS1; break; case 3: AC_Method = DOS2; break; case 4: AC_Method = DOS2b; break; case 5: AC_Method = DOS3; break; case 6: AC_Method = DOS4; break; } AC_nCells = Parameters("AC_DO_CELLS")->asInt(); AC_Rayleigh = Parameters("AC_RAYLEIGH")->asDouble(); AC_SunRad = Parameters("AC_SUN_RAD" )->asDouble() / 100.0; //----------------------------------------------------- for(iBand=0; iBand DOS && !lsat.band[iBand].thermal ) // calculate dark pixel { Process_Set_Text(CSG_String::Format(SG_T("%s [%d/%d]"), _TL("Dark Object Subtraction"), lsat.band[iBand].number, lsat.bands)); int j; unsigned long hist[256], h_max; memset(hist, 0, 256 * sizeof(unsigned long)); //--------------------------------------------- // histogram for(int y=0; yGet_NY() && Set_Progress(y, pInput->Get_NY()); y++) { for(int x=0, q; xGet_NX(); x++) { if( !pInput->is_NoData(x, y) && (q = pInput->asInt(x, y)) != 0 && q >= lsat.band[iBand].qcalmin && q <= 255 ) { hist[q]++; } } } //--------------------------------------------- // DN of dark object for(j=(int)lsat.band[iBand].qcalmin; j<256; j++) { if( hist[j] >= (unsigned int)AC_nCells ) { dn_dark[iBand] = j; break; } } //--------------------------------------------- // Mode of DN for(j=(int)lsat.band[iBand].qcalmin, h_max=0L; j<241; j++) { if( hist[j] > h_max ) // Exclude potentially saturated < 240 { h_max = hist[j]; dn_mode[iBand] = j; } } Message_Add(CSG_String::Format(SG_T("DN = %.2d [%lu] : mode %.2d [%lu] %s"), dn_dark[iBand], hist[dn_dark[iBand]], dn_mode[iBand], hist[dn_mode[iBand]], hist[255] > hist[dn_mode[iBand]] ? ", excluding DN > 241" : "" )); } //------------------------------------------------- lsat_bandctes(&lsat, iBand, AC_Method, AC_SunRad, dn_dark[iBand], AC_Rayleigh); // calculate transformation constants } /////////////////////////////////////////////////////// //----------------------------------------------------- bool bRadiance = Parameters("AS_RAD")->asBool(); CSG_String sAll = _TL("Top of Atmosphere Reflectance"); sAll += "\n"; sAll += GET_DESC_STR(_TL("Platform") , CSG_String::Format(SG_T("Landsat-%d"), lsat.number)); sAll += GET_DESC_STR(_TL("Sensor") , lsat.sensor); sAll += GET_DESC_STR(_TL("Acquisition") , lsat.date); sAll += GET_DESC_STR(_TL("Production") , lsat.creation); sAll += GET_DESC_FLT(_TL("Earth-Sun Distance") , lsat.dist_es); sAll += GET_DESC_FLT(_TL("Solar Height") , lsat.sun_elev); sAll += GET_DESC_STR(_TL("Atmospheric Correction"), Parameters("AC_METHOD")->asString()); //----------------------------------------------------- for(iBand=0; iBandGet_NY() && Set_Progress(y, pInput->Get_NY()); y++) { #pragma omp parallel for for(int x=0; xGet_NX(); x++) { double qcal; if( pInput->is_NoData(x, y) || (qcal = pInput->asDouble(x, y)) == 0.0 || qcal < lsat.band[iBand].qcalmin ) { pOutput->Set_NoData(x, y); } else { double r = lsat_qcal2rad(qcal, &lsat.band[iBand]); if( bRadiance ) { pOutput->Set_Value(x, y, r); } else if( lsat.band[iBand].thermal ) { pOutput->Set_Value(x, y, lsat_rad2temp(r, &lsat.band[iBand])); } else { r = lsat_rad2ref(r, &lsat.band[iBand]); pOutput->Set_Value(x, y, r < 0.0 && AC_Method > DOS ? 0.0 : r); } } } } //------------------------------------------------- CSG_String sBand; sBand += GET_DESC_INT(_TL("Band" ), lsat.band[iBand].number); sBand += GET_DESC_STR(_TL("Type" ), bRadiance ? _TL("Radiance") : lsat.band[iBand].thermal ? _TL("Temperature") : _TL("Reflectance")); sBand += GET_DESC_RNG(_TL("Calibrated Digital Number"), lsat.band[iBand].qcalmin, lsat.band[iBand].qcalmax); sBand += GET_DESC_RNG(_TL("Calibration Constants" ), lsat.band[iBand].lmin , lsat.band[iBand].lmax); sBand += GET_DESC_STR(AC_Method > DOS ? _TL("At-Surface Radiance") : _TL("At-Sensor Radiance"), CSG_String::Format(SG_T("%.5lf * DN + %.5lf"), lsat.band[iBand].gain, lsat.band[iBand].bias)); if( lsat.band[iBand].thermal ) { sBand += GET_DESC_STR(_TL("At-Sensor Temperature"), CSG_String::Format(SG_T("%.3lf / ln[(%.3lf / %s) + 1.0]"), lsat.band[iBand].K2, lsat.band[iBand].K1, _TL("Radiance"))); sBand += GET_DESC_FLT(_TL("Temperature K1" ), lsat.band[iBand].K1); sBand += GET_DESC_FLT(_TL("Temperature K2" ), lsat.band[iBand].K2); } else { sBand += GET_DESC_FLT(_TL("Mean Solar Irradiance"), lsat.band[iBand].esun); // Mean Solar Exoatmospheric Irradiance sBand += GET_DESC_STR(AC_Method > DOS ? _TL("At-Surface Reflectance") : _TL("At-Sensor Reflectance"), CSG_String::Format(SG_T("%s / %.5lf"), _TL("Radiance"), lsat.band[iBand].K2)); if( AC_Method > DOS ) { double ref_mode = lsat_rad2ref(lsat_qcal2rad(dn_mode[iBand], &lsat.band[iBand]), &lsat.band[iBand]); sBand += GET_DESC_INT(_TL("Minimum of Darkness DN Cells" ), AC_nCells); sBand += GET_DESC_INT(_TL("Darkness Digital Number (DN)" ), dn_dark[iBand]); sBand += GET_DESC_INT(_TL("Mode of DN" ), dn_mode[iBand]); sBand += GET_DESC_FLT(_TL("Mode in Reflectance Histogram"), ref_mode); } } Message_Add(sBand, true); //------------------------------------------------- pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), bRadiance ? _TL("Radiance") : lsat.band[iBand].thermal ? _TL("Temperature") : _TL("Reflectance") )); if( lsat.band[iBand].thermal ) { pOutput->Set_Unit(_TL("Kelvin")); } pOutput->Set_Description(sAll + sBand); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Grid * CLandsat_TOAR::Get_Band_Input(int iBand, int Sensor) { switch( iBand ) { case 0: return( Parameters(PRM_IN("10"))->asGrid() ); case 1: return( Parameters(PRM_IN("20"))->asGrid() ); case 2: return( Parameters(PRM_IN("30"))->asGrid() ); case 3: return( Parameters(PRM_IN("40"))->asGrid() ); } switch( Sensor ) { case tm4: case tm5: switch( iBand ) { case 4: return( Parameters(PRM_IN("50"))->asGrid() ); case 5: return( Parameters(PRM_IN("60"))->asGrid() ); case 6: return( Parameters(PRM_IN("70"))->asGrid() ); } break; case tm7: switch( iBand ) { case 4: return( Parameters(PRM_IN("50"))->asGrid() ); case 5: return( Parameters(PRM_IN("61"))->asGrid() ); case 6: return( Parameters(PRM_IN("62"))->asGrid() ); case 7: return( Parameters(PRM_IN("80"))->asGrid() ); } break; } return( NULL ); } //--------------------------------------------------------- CSG_Grid * CLandsat_TOAR::Get_Band_Output(int iBand, int Sensor) { CSG_Grid *pInput = Get_Band_Input(iBand, Sensor); if( pInput ) { CSG_Parameter *pOutput = NULL; switch( iBand ) { case 0: pOutput = Parameters(PRM_OUT("10")); break; case 1: pOutput = Parameters(PRM_OUT("20")); break; case 2: pOutput = Parameters(PRM_OUT("30")); break; case 3: pOutput = Parameters(PRM_OUT("40")); break; } switch( Sensor ) { case tm4: case tm5: switch( iBand ) { case 4: pOutput = Parameters(PRM_OUT("50")); break; case 5: pOutput = Parameters(PRM_OUT("60")); break; case 6: pOutput = Parameters(PRM_OUT("70")); break; } break; case tm7: switch( iBand ) { case 4: pOutput = Parameters(PRM_OUT("50")); break; case 5: pOutput = Parameters(PRM_OUT("61")); break; case 6: pOutput = Parameters(PRM_OUT("62")); break; case 7: pOutput = Parameters(PRM_OUT("80")); break; } break; } if( pOutput ) { if( !pOutput->asGrid() ) { CSG_Grid *pGrid = SG_Create_Grid(pInput); if( pGrid && pGrid->is_Valid() && pGrid->Get_System() == pInput->Get_System() ) { pOutput->Set_Value(pGrid); } else { if( pGrid ) { delete(pGrid); } return( NULL ); } } pOutput->asGrid()->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), _TL("Reflectance"))); return( pOutput->asGrid() ); } } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/landsat_toar.h000066400000000000000000000121561224124640700300250ustar00rootroot00000000000000/********************************************************** * Version $Id: landsat_toar.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_tools // // // //-------------------------------------------------------// // // // landsat_toar.h // // // // Copyright (C) 2012 by // // Benjamin Bechtel & Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__landsat_toar_H #define HEADER_INCLUDED__landsat_toar_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CLandsat_TOAR : public CSG_Module { public: CLandsat_TOAR(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Landsat") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: CSG_Grid * Get_Band_Input (int iBand, int Sensor); CSG_Grid * Get_Band_Output (int iBand, int Sensor); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__landsat_toar_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/landsat_toar_core.cpp000066400000000000000000002640201224124640700313670ustar00rootroot00000000000000#include #include #include #include #include "landsat_toar_core.h" #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- double earth_sun(char date[]); double julian_int(int year, int month, int day); double julian_char(char date[]); /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void G_debug (int i, const char *s) { SG_UI_Msg_Add_Execution('\n', false); SG_UI_Msg_Add_Execution(s , false); } //--------------------------------------------------------- void G_warning (const char *s) { SG_UI_Msg_Add_Execution('\n', false); SG_UI_Msg_Add_Execution(s , false, SG_UI_MSG_STYLE_FAILURE); } /////////////////////////////////////////////////////////// // // // landsat_met.c // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define MAX_STR 127 #define METADATA_SIZE 65535 /* MTL.txt file size 65535 bytes */ #define TM5_MET_SIZE 28700 /* .met file size 28686 bytes */ inline void chrncpy(char *dest, const char src[], int n) { if (src == NULL) { dest[0] = '\0'; } else { int i; for (i = 0; i < n && src[i] != '\0' && src[i] != '\"'; i++) dest[i] = src[i]; dest[i] = '\0'; } } /**************************************************************************** * PURPOSE: Read values of Landsat MSS/TM from header (.met) file *****************************************************************************/ void get_metdata(const char mettext[], const char *text, char value[]) { const char *ptr = strstr(mettext, text); if (ptr == NULL) { value[0] = 0; return; } ptr = strstr(ptr, " VALUE "); if (ptr == NULL) return; while (*ptr++ != '\"') ; int i = 0; while (*ptr != '\"' && i < MAX_STR) value[i++] = *ptr++; value[i] = '\0'; return; } int lsat_metdata(const char *metfile, lsat_data * lsat) { memset(lsat, 0, sizeof(lsat_data)); char mettext[TM5_MET_SIZE], value[MAX_STR]; CSG_File f; if( !f.Open(metfile, SG_FILE_R, false) || f.Read(mettext, TM5_MET_SIZE) == 0 ) { return( false ); } /* --------------------------------------- */ get_metdata(mettext, "PLATFORMSHORTNAME", value); lsat->number = atoi(value + 8); get_metdata(mettext, "SENSORSHORTNAME", value); chrncpy(lsat->sensor, value + 1, 4); get_metdata(mettext, "CALENDARDATE", value); chrncpy(lsat->date, value, 10); get_metdata(mettext, "PRODUCTIONDATETIME", value); chrncpy(lsat->creation, value, 10); get_metdata(mettext, "SolarElevation", value); lsat->sun_elev = atof(value); /* Fill data with the sensor_XXX functions */ switch( lsat->number ) { default: return( false ); case 1: set_MSS1(lsat); break; case 2: set_MSS2(lsat); break; case 3: set_MSS3(lsat); break; case 4: if( lsat->sensor[0] == 'M' ) set_MSS4(lsat); else set_TM4(lsat); break; case 5: if( lsat->sensor[0] == 'M' ) set_MSS5(lsat); else set_TM5(lsat); break; } /* --------------------------------------- */ lsat->flag = METADATAFILE; return( *lsat->sensor ? true : false ); } /**************************************************************************** * PURPOSE: Read values of Landsat from MTL metadata (MTL.txt) file *****************************************************************************/ /*int get_mtldata(const char mtltext[], const char *text, char value[]) { const char *ptr = strstr(mtltext, text); if( ptr == NULL ) { value[0] = '\0'; return( 0 ); } while( *ptr++ != '=' ); while( *ptr <= ' ' || *ptr == '\"' ) *ptr++; int i = 0; while( i < MAX_STR && *ptr != '\"' && *ptr > ' ' ) value[i++] = *ptr++; value[i] = '\0'; return( i ); } int lsat_mtldata(const char *mtlfile, lsat_data *lsat) { memset(lsat, 0, sizeof(lsat_data)); char mtldata[METADATA_SIZE], value[MAX_STR]; CSG_File f; if( !f.Open(mtlfile, SG_FILE_R, false) || f.Read(mtldata, METADATA_SIZE) == 0 ) { return( false ); } //------------------------------------------- get_mtldata(mtldata, "SPACECRAFT_ID" , value); if( !(*value) ) return( false ); lsat->number = atoi(value + 7); get_mtldata(mtldata, "SENSOR_ID" , value); if( !(*value) ) return( false ); chrncpy(lsat->sensor, value, 4); get_mtldata(mtldata, "ACQUISITION_DATE", value); if( !(*value) ) return( false ); chrncpy(lsat->date, value, 10); get_mtldata(mtldata, "CREATION_TIME" , value); if( !(*value) ) return( false ); chrncpy(lsat->creation, value, 10); get_mtldata(mtldata, "SUN_ELEVATION" , value); if( !(*value) ) return( false ); lsat->sun_elev = atof(value); switch( lsat->number ) // Fill data with the sensor_XXX functions { default: return( false ); case 1: set_MSS1(lsat); break; case 2: set_MSS2(lsat); break; case 3: set_MSS3(lsat); break; case 4: if( lsat->sensor[0] == 'M' ) set_MSS4(lsat); else set_TM4(lsat); break; case 5: if( lsat->sensor[0] == 'M' ) set_MSS5(lsat); else set_TM5(lsat); break; case 7: get_mtldata(mtldata, "BAND1_GAIN", value); get_mtldata(mtldata, "BAND2_GAIN", value + 1); get_mtldata(mtldata, "BAND3_GAIN", value + 2); get_mtldata(mtldata, "BAND4_GAIN", value + 3); get_mtldata(mtldata, "BAND5_GAIN", value + 4); get_mtldata(mtldata, "BAND6_GAIN1", value + 5); get_mtldata(mtldata, "BAND6_GAIN2", value + 6); get_mtldata(mtldata, "BAND7_GAIN", value + 7); get_mtldata(mtldata, "BAND8_GAIN", value + 8); value[9] = '\0'; set_ETM(lsat, value); break; } for(int i=0; ibands; i++) // Update the information from metadata file { get_mtldata(mtldata, CSG_String::Format(SG_T("LMAX_BAND%d" ), lsat->band[i].code), value); if( *value ) lsat->band[i].lmax = atof(value); get_mtldata(mtldata, CSG_String::Format(SG_T("LMIN_BAND%d" ), lsat->band[i].code), value); if( *value ) lsat->band[i].lmin = atof(value); get_mtldata(mtldata, CSG_String::Format(SG_T("QCALMAX_BAND%d"), lsat->band[i].code), value); if( *value ) lsat->band[i].qcalmax = atof(value); get_mtldata(mtldata, CSG_String::Format(SG_T("QCALMIN_BAND%d"), lsat->band[i].code), value); if( *value ) lsat->band[i].qcalmin = atof(value); } //------------------------------------------- return( *lsat->sensor ? true : false ); } /*int lsat_newdata(const char *mtlfile, lsat_data * lsat) { memset(lsat, 0, sizeof(lsat_data)); char mtldata[METADATA_SIZE], value[MAX_STR]; CSG_File f; if( !f.Open(mtlfile, SG_FILE_R, false) || f.Read(mtldata, METADATA_SIZE) == 0 ) { return( false ); } //------------------------------------------- get_mtldata(mtldata, "SPACECRAFT_ID", value); if( !(*value) ) return( false ); lsat->number = atoi(value + 8); get_mtldata(mtldata, "SENSOR_ID" , value); if( !(*value) ) return( false ); chrncpy(lsat->sensor, value, 4); get_mtldata(mtldata, "DATE_ACQUIRED", value); if( !(*value) ) return( false ); chrncpy(lsat->date, value, 10); get_mtldata(mtldata, "FILE_DATE" , value); if( !(*value) ) return( false ); chrncpy(lsat->creation, value, 10); get_mtldata(mtldata, "SUN_ELEVATION", value); if( !(*value) ) return( false ); lsat->sun_elev = atof(value); // Fill data with the sensor_XXX functions switch( lsat->number ) { default: return( false ); case 1: set_MSS1(lsat); break; case 2: set_MSS2(lsat); break; case 3: set_MSS3(lsat); break; case 4: if( lsat->sensor[0] == 'M' ) set_MSS4(lsat); else set_TM4(lsat); break; case 5: if( lsat->sensor[0] == 'M' ) set_MSS5(lsat); else set_TM5(lsat); break; case 7: get_mtldata(mtldata, "GAIN_BAND_1" , value + 0); get_mtldata(mtldata, "GAIN_BAND_2" , value + 1); get_mtldata(mtldata, "GAIN_BAND_3" , value + 2); get_mtldata(mtldata, "GAIN_BAND_4" , value + 3); get_mtldata(mtldata, "GAIN_BAND_5" , value + 4); get_mtldata(mtldata, "GAIN_BAND_6_VCID_1", value + 5); get_mtldata(mtldata, "GAIN_BAND_6_VCID_2", value + 6); get_mtldata(mtldata, "GAIN_BAND_7" , value + 7); get_mtldata(mtldata, "GAIN_BAND_8" , value + 8); value[9] = '\0'; set_ETM(lsat, value); break; } // Update the information from metadata file for(int i=0; ibands; i++) { CSG_String Code; if( lsat->band[i].code == 61 ) Code = "6_VCID_1"; else if( lsat->band[i].code == 62 ) Code = "6_VCID_1"; else Code.Printf(SG_T("%d"), lsat->band[i].code); get_mtldata(mtldata, CSG_String::Format(SG_T("RADIANCE_MAXIMUM_BAND_%s"), Code.c_str()), value); if( *value ) lsat->band[i].lmax = atof(value); get_mtldata(mtldata, CSG_String::Format(SG_T("RADIANCE_MINIMUM_BAND_%s"), Code.c_str()), value); if( *value ) lsat->band[i].lmin = atof(value); get_mtldata(mtldata, CSG_String::Format(SG_T("QUANTIZE_CAL_MAX_BAND_%s"), Code.c_str()), value); if( *value ) lsat->band[i].qcalmax = atof(value); get_mtldata(mtldata, CSG_String::Format(SG_T("QUANTIZE_CAL_MIN_BAND_%s"), Code.c_str()), value); if( *value ) lsat->band[i].qcalmin = atof(value); } //------------------------------------------- return( *lsat->sensor ? true : false ); }/**/ //--------------------------------------------------------- bool Load_MetaData(const char *filename, CSG_MetaData &MetaData) { CSG_String sLine, sKey, sVal; CSG_File f; MetaData.Destroy(); if( !f.Open(filename, SG_FILE_R, false) ) { return( false ); } while( !f.is_EOF() && f.Read_Line(sLine) ) { sKey = sLine.BeforeFirst('='); sKey.Trim(false); sKey.Trim(true); if( !sKey.is_Empty() && sKey.CmpNoCase("GROUP") && sKey.CmpNoCase("END_GROUP") ) { sVal = sLine.AfterFirst ('='); sVal.Trim(false); sVal.Trim(true); sVal.Replace("\"", ""); MetaData.Add_Child(sKey, sVal); } } return( true ); } //--------------------------------------------------------- bool Get_MetaData(const CSG_MetaData &MetaData, const CSG_String &key, CSG_String &value) { CSG_MetaData *p = MetaData.Get_Child(key); if( p ) { value = p->Get_Content(); return( true ); } value.Clear(); return( false ); } //--------------------------------------------------------- #define GET_METADATA(key) if( Get_MetaData(m, key, s) == false ) return( false ); #define IF_GET_METADATA(key) if( Get_MetaData(m, key, s) == true ) //--------------------------------------------------------- int lsat_mtldata(const char *mtlfile, lsat_data *lsat) { memset(lsat, 0, sizeof(lsat_data)); CSG_String s; CSG_MetaData m; if( !Load_MetaData(mtlfile, m) ) { return( false ); } //------------------------------------------- GET_METADATA("SPACECRAFT_ID" ); lsat->number = CSG_String(s.Get_Char(7)).asInt(); GET_METADATA("SENSOR_ID" ); chrncpy(lsat->sensor , s, 4); GET_METADATA("ACQUISITION_DATE" ); chrncpy(lsat->date , s, 10); GET_METADATA("ORTHO_PRODUCT_CREATION_TIME"); chrncpy(lsat->creation, s, 10); GET_METADATA("SUN_ELEVATION" ); lsat->sun_elev = s.asDouble(); switch( lsat->number ) // Fill data with the sensor_XXX functions { default: return( false ); case 1: set_MSS1(lsat); break; case 2: set_MSS2(lsat); break; case 3: set_MSS3(lsat); break; case 4: if( lsat->sensor[0] == 'M' ) set_MSS4(lsat); else set_TM4(lsat); break; case 5: if( lsat->sensor[0] == 'M' ) set_MSS5(lsat); else set_TM5(lsat); break; case 7: { char gain[9]; GET_METADATA("BAND1_GAIN" ); gain[0] = *s.b_str(); GET_METADATA("BAND2_GAIN" ); gain[1] = *s.b_str(); GET_METADATA("BAND3_GAIN" ); gain[2] = *s.b_str(); GET_METADATA("BAND4_GAIN" ); gain[3] = *s.b_str(); GET_METADATA("BAND5_GAIN" ); gain[4] = *s.b_str(); GET_METADATA("BAND6_GAIN1"); gain[5] = *s.b_str(); GET_METADATA("BAND6_GAIN2"); gain[6] = *s.b_str(); GET_METADATA("BAND7_GAIN" ); gain[7] = *s.b_str(); GET_METADATA("BAND8_GAIN" ); gain[8] = *s.b_str(); set_ETM(lsat, gain); } break; } for(int i=0; ibands; i++) // Update the information from metadata file { CSG_String Code(CSG_String::Format(SG_T("%d"), lsat->band[i].code)); IF_GET_METADATA("LMAX_BAND" + Code) lsat->band[i].lmax = s.asDouble(); IF_GET_METADATA("LMIN_BAND" + Code) lsat->band[i].lmin = s.asDouble(); IF_GET_METADATA("QCALMAX_BAND" + Code) lsat->band[i].qcalmax = s.asDouble(); IF_GET_METADATA("QCALMIN_BAND" + Code) lsat->band[i].qcalmin = s.asDouble(); } //------------------------------------------- lsat->flag = METADATAFILE; return( *lsat->sensor ? true : false ); } //--------------------------------------------------------- int lsat_newdata(const char *mtlfile, lsat_data * lsat) { memset(lsat, 0, sizeof(lsat_data)); CSG_String s; CSG_MetaData m; if( !Load_MetaData(mtlfile, m) ) { return( false ); } //------------------------------------------- GET_METADATA("SPACECRAFT_ID"); lsat->number = CSG_String(s.Get_Char(8)).asInt(); GET_METADATA("SENSOR_ID" ); chrncpy(lsat->sensor , s, 4); GET_METADATA("DATE_ACQUIRED"); chrncpy(lsat->date , s, 10); GET_METADATA("FILE_DATE" ); chrncpy(lsat->creation, s, 10); GET_METADATA("SUN_ELEVATION"); lsat->sun_elev = s.asDouble(); switch( lsat->number ) // Fill data with the sensor_XXX functions { default: return( false ); case 1: set_MSS1(lsat); break; case 2: set_MSS2(lsat); break; case 3: set_MSS3(lsat); break; case 4: if( lsat->sensor[0] == 'M' ) set_MSS4(lsat); else set_TM4(lsat); break; case 5: if( lsat->sensor[0] == 'M' ) set_MSS5(lsat); else set_TM5(lsat); break; case 7: { char gain[9]; GET_METADATA("GAIN_BAND_1" ); gain[0] = *s.b_str(); GET_METADATA("GAIN_BAND_2" ); gain[1] = *s.b_str(); GET_METADATA("GAIN_BAND_3" ); gain[2] = *s.b_str(); GET_METADATA("GAIN_BAND_4" ); gain[3] = *s.b_str(); GET_METADATA("GAIN_BAND_5" ); gain[4] = *s.b_str(); GET_METADATA("GAIN_BAND_6_VCID_1"); gain[5] = *s.b_str(); GET_METADATA("GAIN_BAND_6_VCID_2"); gain[6] = *s.b_str(); GET_METADATA("GAIN_BAND_7" ); gain[7] = *s.b_str(); GET_METADATA("GAIN_BAND_8" ); gain[8] = *s.b_str(); set_ETM(lsat, gain); } break; } for(int i=0; ibands; i++) // Update the information from metadata file { CSG_String Code; if( lsat->band[i].code == 61 ) Code = "6_VCID_1"; else if( lsat->band[i].code == 62 ) Code = "6_VCID_2"; else Code.Printf(SG_T("%d"), lsat->band[i].code); IF_GET_METADATA("RADIANCE_MAXIMUM_BAND_" + Code) lsat->band[i].lmax = s.asDouble(); IF_GET_METADATA("RADIANCE_MINIMUM_BAND_" + Code) lsat->band[i].lmin = s.asDouble(); IF_GET_METADATA("QUANTIZE_CAL_MAX_BAND_" + Code) lsat->band[i].qcalmax = s.asDouble(); IF_GET_METADATA("QUANTIZE_CAL_MIN_BAND_" + Code) lsat->band[i].qcalmin = s.asDouble(); } //------------------------------------------- lsat->flag = METADATAFILE; return( *lsat->sensor ? true : false ); } /////////////////////////////////////////////////////////// // // // landsat_set.c // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void sensor_MSS(lsat_data * lsat) { int i; /* green, red, near infrared, near infrared */ int band[] = { 1, 2, 3, 4 }; int code[] = { 4, 5, 6, 7 }; double wmax[] = { 0.6, 0.7, 0.8, 1.1 }; double wmin[] = { 0.5, 0.6, 0.7, 0.8 }; /* 68x83, 68x83, 68x83, 68x83 */ strcpy(lsat->sensor, "MSS"); lsat->bands = 4; for (i = 0; i < lsat->bands; i++) { lsat->band[i].number = *(band + i); lsat->band[i].code = *(code + i); lsat->band[i].wavemax = *(wmax + i); lsat->band[i].wavemin = *(wmin + i); lsat->band[i].qcalmax = 255.; lsat->band[i].qcalmin = 0.; lsat->band[i].thermal = 0; } return; } void sensor_TM(lsat_data * lsat) { int i; /* blue, green red, near infrared, shortwave IR, thermal IR, shortwave IR */ int band[] = { 1, 2, 3, 4, 5, 6, 7 }; double wmax[] = { 0.52, 0.60, 0.69, 0.90, 1.75, 12.50, 2.35 }; double wmin[] = { 0.45, 0.52, 0.63, 0.76, 1.55, 10.40, 2.08 }; /* 30, 30, 30, 30, 30, 120, 30 */ if (!lsat->sensor) strcpy(lsat->sensor, "TM"); lsat->bands = 7; for (i = 0; i < lsat->bands; i++) { lsat->band[i].number = *(band + i); lsat->band[i].code = *(band + i); lsat->band[i].wavemax = *(wmax + i); lsat->band[i].wavemin = *(wmin + i); lsat->band[i].qcalmax = 255.; lsat->band[i].qcalmin = 0.; /* Modified in set_TM5 by date */ lsat->band[i].thermal = (lsat->band[i].number == 6 ? 1 : 0); } return; } void sensor_ETM(lsat_data * lsat) { int i; /* blue, green red, near infrared, shortwave IR, thermal IR, shortwave IR, panchromatic */ int band[] = { 1, 2, 3, 4, 5, 6, 6, 7, 8 }; int code[] = { 1, 2, 3, 4, 5, 61, 62, 7, 8 }; double wmax[] = { 0.515, 0.605, 0.690, 0.90, 1.75, 12.50, 2.35, 0.90 }; double wmin[] = { 0.450, 0.525, 0.630, 0.75, 1.55, 10.40, 2.09, 0.52 }; /* 30, 30, 30, 30, 30, 60, 30, 15 */ strcpy(lsat->sensor, "ETM+"); lsat->bands = 9; for (i = 0; i < lsat->bands; i++) { lsat->band[i].number = *(band + i); lsat->band[i].code = *(code + i); lsat->band[i].wavemax = *(wmax + i); lsat->band[i].wavemin = *(wmin + i); lsat->band[i].qcalmax = 255.; lsat->band[i].qcalmin = 1.; lsat->band[i].thermal = (lsat->band[i].number == 6 ? 1 : 0); } return; } /** ********************************************** ** Before access to these functions ... ** store previously ** >>> adquisition date, ** >>> creation date, and ** >>> sun_elev ** **********************************************/ /**************************************************************************** * PURPOSE: Store values of Landsat-1 MSS * July 23, 1972 to January 6, 1978 *****************************************************************************/ void set_MSS1(lsat_data * lsat) { int i, j; /** USGS Calibration Parameter Files 2012 */ /* Spectral radiances at detector */ double lmax[] = { 248., 200., 176., 153. }; double lmin[] = { 0., 0., 0., 0. }; /* Solar exoatmospheric spectral irradiances */ double esun[] = { 1824., 1570., 1249., 853.4 }; lsat->number = 1; sensor_MSS(lsat); lsat->dist_es = earth_sun(lsat->date); for (i = 0; i < lsat->bands; i++) { j = lsat->band[i].number - 1; lsat->band[i].esun = *(esun + j); lsat->band[i].lmax = *(lmax + j); lsat->band[i].lmin = *(lmin + j); } G_debug(1, "Landsat-1 MSS"); return; } /**************************************************************************** * PURPOSE: Store values of Landsat-2 MSS * January 22, 1975 to February 5, 1982 *****************************************************************************/ void set_MSS2(lsat_data * lsat) { int i, j; double julian, *lmax, *lmin; /** USGS Calibration Parameter Files 2012 */ /* Spectral radiances at detector */ double Lmax[][4] = { {210., 156., 140., 138.}, /* before July 16, 1975 */ {263., 176., 152., 130.} /* on or after July 16, 1975 */ }; double Lmin[][4] = { {10., 7., 7., 5.}, {8., 6., 6., 4.} }; /* Solar exoatmospheric spectral irradiances */ double esun[] = { 1824., 1570., 1249., 853.4 }; julian = julian_char(lsat->creation); if (julian < julian_char("1975-07-16")) i = 0; else i = 1; lmax = Lmax[i]; lmin = Lmin[i]; lsat->number = 2; sensor_MSS(lsat); lsat->dist_es = earth_sun(lsat->date); for (i = 0; i < lsat->bands; i++) { j = lsat->band[i].number - 1; lsat->band[i].esun = *(esun + j); lsat->band[i].lmax = *(lmax + j); lsat->band[i].lmin = *(lmin + j); } G_debug(1, "Landsat-2 MSS"); return; } /**************************************************************************** * PURPOSE: Store values of Landsat-3 MSS * March 5, 1978 to March 31, 1983 * * tiene una banda 8 thermal *****************************************************************************/ void set_MSS3(lsat_data * lsat) { int i, j; double julian, *lmax, *lmin; /** USGS Calibration Parameter Files 2012 */ /* Spectral radiances at detector */ double Lmax[][4] = { {220., 175., 145., 147.}, /* before June 1, 1978 */ {259., 179., 149., 128.} /* on or after June 1, 1978 */ }; double Lmin[][4] = { {4., 3., 3., 1.}, {4., 3., 3., 1.} }; /* Solar exoatmospheric spectral irradiances */ double esun[] = { 1824., 1570., 1249., 853.4 }; julian = julian_char(lsat->creation); if (julian < julian_char("1978-06-01")) i = 0; else i = 1; lmax = Lmax[i]; lmin = Lmin[i]; lsat->number = 3; sensor_MSS(lsat); lsat->dist_es = earth_sun(lsat->date); for (i = 0; i < lsat->bands; i++) { j = lsat->band[i].number - 1; lsat->band[i].esun = *(esun + j); lsat->band[i].lmax = *(lmax + j); lsat->band[i].lmin = *(lmin + j); } G_debug(1, "Landsat-3 MSS"); return; } /**************************************************************************** * PURPOSE: Store values of Landsat-4 MSS/TM * July 16, 1982 to June 15, 2001 *****************************************************************************/ void set_MSS4(lsat_data * lsat) { int i, j; double julian, *lmax, *lmin; /** USGS Calibration Parameter Files 2012 */ /* Spectral radiances at detector */ double Lmax[][4] = { {250., 180., 150., 133.}, /* before August 26, 1982 */ {230., 180., 130., 133.}, /* between */ {238., 164., 142., 116.} /* on or after April 1, 1983 */ }; double Lmin[][4] = { {2., 4., 4., 3.}, {2., 4., 4., 3.}, {4., 4., 5., 4.} }; /* Solar exoatmospheric spectral irradiances */ double esun[] = { 1824., 1570., 1249., 853.4 }; julian = julian_char(lsat->creation); if (julian < julian_char("1982-08-26")) i = 0; else if (julian < julian_char("1983-03-31")) i = 1; else i = 2; lmax = Lmax[i]; lmin = Lmin[i]; lsat->number = 4; sensor_MSS(lsat); lsat->dist_es = earth_sun(lsat->date); for (i = 0; i < lsat->bands; i++) { j = lsat->band[i].number - 1; lsat->band[i].esun = *(esun + j); lsat->band[i].lmax = *(lmax + j); lsat->band[i].lmin = *(lmin + j); } G_debug(1, "Landsat-4 MSS"); return; } void set_TM4(lsat_data * lsat) { int i, j; double julian, *lmax, *lmin; /** USGS Calibration Parameter Files 2012 */ /* Spectral radiances at detector */ double Lmax[][7] = { {158.42, 308.17, 234.63, 224.32, 32.42, 15.64, 17.00}, /* before August 1983 */ {142.86, 291.25, 225.00, 214.29, 30.00, 12.40, 15.93}, /* before January 15, 1984 */ {171.00, 336.00, 254.00, 221.00, 31.40, 15.303, 16.60} /* after Jaunary 15, 1984 */ }; double Lmin[][7] = { {-1.52, -2.84, -1.17, -1.51, -0.37, 2.00, -0.15}, {0.00, 0.00, 0.00, 0.00, 0.00, 4.84, 0.00}, {-1.52, -2.84, -1.17, -1.51, -0.37, 1.2378, -0.15} }; /* Solar exoatmospheric spectral irradiances */ double esun[] = { 1957., 1825., 1557., 1033., 214.9, 0., 80.72 }; /* Thermal band calibration constants: K1 = 671.62 K2 = 1284.30 */ julian = julian_char(lsat->creation); if (julian < julian_char("1983-08-01")) i = 0; else if (julian < julian_char("1984-01-15")) i = 1; else i = 2; lmax = Lmax[i]; lmin = Lmin[i]; lsat->number = 4; sensor_TM(lsat); lsat->dist_es = earth_sun(lsat->date); for (i = 0; i < lsat->bands; i++) { j = lsat->band[i].number - 1; lsat->band[i].esun = *(esun + j); lsat->band[i].lmax = *(lmax + j); lsat->band[i].lmin = *(lmin + j); if (lsat->band[i].thermal) { lsat->band[i].K1 = 671.62; lsat->band[i].K2 = 1284.30; } } G_debug(1, "Landsat-4 TM"); return; } /**************************************************************************** * PURPOSE: Store values of Landsat-5 MSS/TM * March 1, 1984 to today *****************************************************************************/ void set_MSS5(lsat_data * lsat) { int i, j; double julian, *lmax, *lmin; /** USGS Calibration Parameter Files 2012 */ /* Spectral radiances at detector */ double Lmax[][4] = { {240., 170., 150., 127.}, /* before April 6, 1984 */ {268., 179., 159., 123.}, /* betweeen */ {268., 179., 148., 123.} /* after November 9, 1984 */ }; double Lmin[][4] = { {4., 3., 4., 2.}, {3., 3., 4., 3.}, {3., 3., 5., 3.} }; /* Solar exoatmospheric spectral irradiances */ double esun[] = { 1824., 1570., 1249., 853.4 }; julian = julian_char(lsat->creation); if (julian < julian_char("1984-04-06")) i = 0; else if (julian < julian_char("1984-11-08")) i = 1; else i = 2; lmax = Lmax[i]; lmin = Lmin[i]; lsat->number = 5; sensor_MSS(lsat); lsat->dist_es = earth_sun(lsat->date); for (i = 0; i < lsat->bands; i++) { j = lsat->band[i].number - 1; lsat->band[i].esun = *(esun + j); lsat->band[i].lmax = *(lmax + j); lsat->band[i].lmin = *(lmin + j); } G_debug(1, "Landsat-5 MSS"); return; } void set_TM5(lsat_data * lsat) { int i, j; double julian, *lmax, *lmin, jbuf; /** USGS Calibration Parameter Files 2012 */ /* Spectral radiances at detector */ double Lmax[][7] = { {152.10, 296.81, 204.30, 206.20, 27.19, 15.303, 14.38}, /* before May 4, 2003 */ {193.00, 365.00, 264.00, 221.00, 30.20, 15.303, 16.50}, /* after May 4, 2003 */ {169.00, 333.00, 264.00, 221.00, 30.20, 15.303, 16.50} /* after April 2, 2007 */ }; double Lmin[][7] = { {-1.52, -2.84, -1.17, -1.51, -0.37, 1.2378, -0.15}, {-1.52, -2.84, -1.17, -1.51, -0.37, 1.2378, -0.15}, {-1.52, -2.84, -1.17, -1.51, -0.37, 1.2378, -0.15} }; /* Solar exoatmospheric spectral irradiances */ double esun[] = { 1957., 1826., 1554., 1036., 215.0, 0., 80.67 }; /* Thermal band calibration constants: K1 = 607.76 K2 = 1260.56 */ julian = julian_char(lsat->creation); if (julian < julian_char("2003-05-04")) i = 0; else if (julian < julian_char("2007-04-02")) i = 1; else i = 2; lmax = Lmax[i]; lmin = Lmin[i]; if (i == 2) { /* in Chander, Markham and Barsi 2007 */ julian = julian_char(lsat->date); /* Yes, here acquisition date */ if (julian >= julian_char("1992-01-01")) { lmax[0] = 193.0; lmax[1] = 365.0; } } jbuf = julian_char("2004-04-04"); if (julian >= jbuf && !(lsat->flag & METADATAFILE) ) { G_warning("Using QCalMin=1.0 as a NLAPS product processed after 04/04/2004"); } lsat->number = 5; sensor_TM(lsat); lsat->dist_es = earth_sun(lsat->date); for (i = 0; i < lsat->bands; i++) { j = lsat->band[i].number - 1; if (julian >= jbuf) lsat->band[i].qcalmin = 1.; lsat->band[i].esun = *(esun + j); lsat->band[i].lmax = *(lmax + j); lsat->band[i].lmin = *(lmin + j); if (lsat->band[i].thermal) { lsat->band[i].K1 = 607.76; lsat->band[i].K2 = 1260.56; } } G_debug(1, "Landsat-5 TM"); return; } /**************************************************************************** * PURPOSE: Store values of Landsat-7 ETM+ * April 15, 1999 to May 31, 2003 (SLC failure) *****************************************************************************/ void set_ETM(lsat_data * lsat, const char gain[]) { int i, k, j; double julian, *lmax, *lmin; /** USGS Calibration Parameter Files 2012 */ /* Spectral radiances at detector */ /* - LOW GAIN - */ double LmaxL[][8] = { {297.5, 303.4, 235.5, 235.0, 47.70, 17.04, 16.60, 244.0}, /* before July 1, 2000 */ {293.7, 300.9, 234.4, 241.1, 47.57, 17.04, 16.54, 243.1} /* on or after July 1, 2000 */ }; double LminL[][8] = { {-6.2, -6.0, -4.5, -4.5, -1.0, 0.0, -0.35, -5.0}, {-6.2, -6.4, -5.0, -5.1, -1.0, 0.0, -0.35, -4.7} }; /* - HIGH GAIN - */ double LmaxH[][8] = { {194.3, 202.4, 158.6, 157.5, 31.76, 12.65, 10.932, 158.4}, {191.6, 196.5, 152.9, 157.4, 31.06, 12.65, 10.80, 158.3} }; double LminH[][8] = { {-6.2, -6.0, -4.5, -4.5, -1.0, 3.2, -0.35, -5.0}, {-6.2, -6.4, -5.0, -5.1, -1.0, 3.2, -0.35, -4.7} }; /* Solar exoatmospheric spectral irradiances */ double esun[] = { 1969., 1840., 1551., 1044., 225.7, 0., 82.07, 1368. }; /* Thermal band calibration constants: K1 = 666.09 K2 = 1282.71 */ julian = julian_char(lsat->creation); if (julian < julian_char("2000-07-01")) k = 0; else k = 1; lsat->number = 7; sensor_ETM(lsat); lsat->dist_es = earth_sun(lsat->date); for (i = 0; i < lsat->bands; i++) { j = lsat->band[i].number - 1; lsat->band[i].esun = *(esun + j); if (gain[i] == 'H' || gain[i] == 'h') { lmax = LmaxH[k]; lmin = LminH[k]; } else { lmax = LmaxL[k]; lmin = LminL[k]; } lsat->band[i].lmax = *(lmax + j); lsat->band[i].lmin = *(lmin + j); if (lsat->band[i].thermal) { lsat->band[i].K1 = 666.09; lsat->band[i].K2 = 1282.71; } } G_debug(1, "Landsat-7 ETM+"); return; } /////////////////////////////////////////////////////////// // // // landsat.c // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define PI 3.1415926535897932384626433832795 #define R2D 57.295779513082320877 #define D2R 0.017453292519943295769 /**************************************************************************** * PURPOSE: Calibrated Digital Number to at-satellite Radiance *****************************************************************************/ double lsat_qcal2rad(double qcal, band_data * band) { return (double)(qcal * band->gain + band->bias); } /**************************************************************************** * PURPOSE: Radiance of non-thermal band to at-satellite Reflectance *****************************************************************************/ double lsat_rad2ref(double rad, band_data * band) { return (double)(rad / band->K2); } /**************************************************************************** * PURPOSE: Radiance of thermal band to at-satellite Temperature *****************************************************************************/ double lsat_rad2temp(double rad, band_data * band) { return (double)(band->K2 / log((band->K1 / rad) + 1.0)); } /**************************************************************************** * PURPOSE: Some band constants * * zenith = 90 - sun_elevation * sin( sun_elevation ) = cos( sun_zenith ) * * lsat : satellite data * i : band number * method : level of atmospheric correction * percent : percent of solar irradiance in path radiance * dos : digital number of dark object for DOS *****************************************************************************/ #define abs(x) (((x)>0)?(x):(-x)) void lsat_bandctes(lsat_data * lsat, int i, char method, double percent, int dos, double rayleigh) { double pi_d2, sin_e, cos_v, rad_sun; /* TAUv = at. transmittance surface-sensor */ /* TAUz = at. transmittance sun-surface */ /* Edown = diffuse sky spectral irradiance */ double TAUv, TAUz, Edown; pi_d2 = (double)(PI * lsat->dist_es * lsat->dist_es); sin_e = (double)(sin(D2R * lsat->sun_elev)); cos_v = (double)(cos(D2R * (lsat->number < 4 ? 9.2 : 8.2))); /** Global irradiance on the sensor. Radiance to reflectance coefficient, only NO thermal bands. K1 and K2 variables are also utilized as thermal constants */ if (lsat->band[i].thermal == 0) { switch (method) { case DOS2: { TAUv = 1.; TAUz = (lsat->band[i].wavemax < 1.) ? sin_e : 1.; Edown = 0.; break; } case DOS2b: { TAUv = (lsat->band[i].wavemax < 1.) ? cos_v : 1.; TAUz = (lsat->band[i].wavemax < 1.) ? sin_e : 1.; Edown = 0.; break; } case DOS3: { double t; t = 2. / (lsat->band[i].wavemax + lsat->band[i].wavemin); t = 0.008569 * t * t * t * t * (1 + 0.0113 * t * t + 0.000013 * t * t * t * t); TAUv = exp(-t / cos_v); TAUz = exp(-t / sin_e); Edown = rayleigh; break; } case DOS4: { double Ro = (lsat->band[i].lmax - lsat->band[i].lmin) * (dos - lsat->band [i].qcalmin) / (lsat->band[i].qcalmax - lsat->band[i].qcalmin) + lsat->band[i].lmin; double Tv = 1.; double Tz = 1.; double Lp = 0.; do { TAUz = Tz; TAUv = Tv; Lp = Ro - percent * TAUv * (lsat->band[i].esun * sin_e * TAUz + PI * Lp) / pi_d2; Tz = 1 - (4 * pi_d2 * Lp) / (lsat->band[i].esun * sin_e); Tv = exp(sin_e * log(Tz) / cos_v); /* G_message("TAUv = %.5f (%.5f), TAUz = %.5f (%.5f) and Edown = %.5f\n", TAUv, Tv, TAUz, Tz, PI * Lp ); */ /* } while( abs(TAUv - Tv) > 0.0000001 || abs(TAUz - Tz) > 0.0000001); */ } while (TAUv != Tv && TAUz != Tz); TAUz = (Tz < 1. ? Tz : 1.); TAUv = (Tv < 1. ? Tv : 1.); Edown = (Lp < 0. ? 0. : PI * Lp); break; } default: /* DOS1 and Without atmospheric-correction */ TAUv = 1.; TAUz = 1.; Edown = 0.; break; } rad_sun = TAUv * (lsat->band[i].esun * sin_e * TAUz + Edown) / pi_d2; // G_verbose_message("... TAUv = %.5f, TAUz = %.5f, Edown = %.5f\n", TAUv, TAUz, Edown); lsat->band[i].K1 = 0.; lsat->band[i].K2 = rad_sun; } /** Digital number to radiance coefficients. Whitout atmospheric calibration for thermal bands. */ lsat->band[i].gain = ((lsat->band[i].lmax - lsat->band[i].lmin) / (lsat->band[i].qcalmax - lsat->band[i].qcalmin)); if (method == UNCORRECTED || lsat->band[i].thermal) { /* L = G * (DN - Qmin) + Lmin -> bias = Lmin - G * Qmin */ lsat->band[i].bias = (lsat->band[i].lmin - lsat->band[i].gain * lsat->band[i].qcalmin); } else { if (method == CORRECTED) { /* L = G * (DN - Qmin) + Lmin - Lmin -> bias = - G * Qmin */ lsat->band[i].bias = -(lsat->band[i].gain * lsat->band[i].qcalmin); /* Another possibility is cut when rad < 0 */ } else if (method > DOS) { /* L = Lsat - Lpath = G * DNsat + B - (G * dark + B - p * rad_sun) = G * DNsat - G * dark + p * rad_sun -> bias = p * rad_sun - G * dark */ lsat->band[i].bias = percent * rad_sun - lsat->band[i].gain * dos; } } } /////////////////////////////////////////////////////////// // // // earth_sun.c // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /* * Modified from LIBNOVA-0.12 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Some functions in this file use the VSOP87 solution by * Messrs. Bretagnon and Francou. * * Copyright (C) 2000 - 2005 Liam Girdwood * Modified to GRASS (C) 2006 E. Jorge Tizado */ #define RADIUS_R0 523 #define RADIUS_R1 290 #define RADIUS_R2 134 #define RADIUS_R3 20 #define RADIUS_R4 9 #define RADIUS_R5 2 struct ln_vsop { double A; double B; double C; }; double ln_calc_series(const struct ln_vsop *data, int terms, double t); double julian_int(int year, int month, int day); double julian_char(char date[]); static const struct ln_vsop earth_radius_r0[RADIUS_R0] = { {1.00013988784, 0.00000000000, 0.00000000000}, {0.01670699632, 3.09846350258, 6283.07584999140}, {0.00013956024, 3.05524609456, 12566.15169998280}, {0.00003083720, 5.19846674381, 77713.77146812050}, {0.00001628463, 1.17387558054, 5753.38488489680}, {0.00001575572, 2.84685214877, 7860.41939243920}, {0.00000924799, 5.45292236722, 11506.76976979360}, {0.00000542439, 4.56409151453, 3930.20969621960}, {0.00000472110, 3.66100022149, 5884.92684658320}, {0.00000328780, 5.89983686142, 5223.69391980220}, {0.00000345969, 0.96368627272, 5507.55323866740}, {0.00000306784, 0.29867139512, 5573.14280143310}, {0.00000174844, 3.01193636733, 18849.22754997420}, {0.00000243181, 4.27349530790, 11790.62908865880}, {0.00000211836, 5.84714461348, 1577.34354244780}, {0.00000185740, 5.02199710705, 10977.07880469900}, {0.00000109835, 5.05510635860, 5486.77784317500}, {0.00000098316, 0.88681311278, 6069.77675455340}, {0.00000086500, 5.68956418946, 15720.83878487840}, {0.00000085831, 1.27079125277, 161000.68573767410}, {0.00000062917, 0.92177053978, 529.69096509460}, {0.00000057056, 2.01374292245, 83996.84731811189}, {0.00000064908, 0.27251341435, 17260.15465469040}, {0.00000049384, 3.24501240359, 2544.31441988340}, {0.00000055736, 5.24159799170, 71430.69561812909}, {0.00000042520, 6.01110257982, 6275.96230299060}, {0.00000046966, 2.57799853213, 775.52261132400}, {0.00000038963, 5.36063832897, 4694.00295470760}, {0.00000044666, 5.53715663816, 9437.76293488700}, {0.00000035661, 1.67447135798, 12036.46073488820}, {0.00000031922, 0.18368299942, 5088.62883976680}, {0.00000031846, 1.77775642078, 398.14900340820}, {0.00000033193, 0.24370221704, 7084.89678111520}, {0.00000038245, 2.39255343973, 8827.39026987480}, {0.00000028468, 1.21344887533, 6286.59896834040}, {0.00000037486, 0.82961281844, 19651.04848109800}, {0.00000036957, 4.90107587287, 12139.55350910680}, {0.00000034537, 1.84270693281, 2942.46342329160}, {0.00000026275, 4.58896863104, 10447.38783960440}, {0.00000024596, 3.78660838036, 8429.24126646660}, {0.00000023587, 0.26866098169, 796.29800681640}, {0.00000027795, 1.89934427832, 6279.55273164240}, {0.00000023927, 4.99598548145, 5856.47765911540}, {0.00000020345, 4.65282190725, 2146.16541647520}, {0.00000023287, 2.80783632869, 14143.49524243060}, {0.00000022099, 1.95002636847, 3154.68708489560}, {0.00000019509, 5.38233922479, 2352.86615377180}, {0.00000017958, 0.19871369960, 6812.76681508600}, {0.00000017178, 4.43322156854, 10213.28554621100}, {0.00000016190, 5.23159323213, 17789.84561978500}, {0.00000017315, 6.15224075188, 16730.46368959580}, {0.00000013814, 5.18962074032, 8031.09226305840}, {0.00000018834, 0.67280058021, 149854.40013480789}, {0.00000018330, 2.25348717053, 23581.25817731760}, {0.00000013639, 3.68511810757, 4705.73230754360}, {0.00000013142, 0.65267698994, 13367.97263110660}, {0.00000010414, 4.33285688501, 11769.85369316640}, {0.00000009978, 4.20126336356, 6309.37416979120}, {0.00000010170, 1.59366684542, 4690.47983635860}, {0.00000007564, 2.62560597391, 6256.77753019160}, {0.00000009654, 3.67583728703, 27511.46787353720}, {0.00000006743, 0.56269927047, 3340.61242669980}, {0.00000008743, 6.06359123461, 1748.01641306700}, {0.00000007786, 3.67371235367, 12168.00269657460}, {0.00000006633, 5.66149277789, 11371.70468975820}, {0.00000007712, 0.31242577788, 7632.94325965020}, {0.00000006586, 3.13580054586, 801.82093112380}, {0.00000007460, 5.64758066660, 11926.25441366880}, {0.00000006933, 2.92384586372, 6681.22485339960}, {0.00000006805, 1.42327153767, 23013.53953958720}, {0.00000006118, 5.13395999022, 1194.44701022460}, {0.00000006477, 2.64986648493, 19804.82729158280}, {0.00000005233, 4.62432817299, 6438.49624942560}, {0.00000006147, 3.02863936662, 233141.31440436149}, {0.00000004608, 1.72194702724, 7234.79425624200}, {0.00000004221, 1.55697533726, 7238.67559160000}, {0.00000005310, 2.40821524293, 11499.65622279280}, {0.00000005128, 5.32398965690, 11513.88331679440}, {0.00000004770, 0.25554311730, 11856.21865142450}, {0.00000005519, 2.09089153789, 17298.18232732620}, {0.00000005625, 4.34052903053, 90955.55169449610}, {0.00000004578, 4.46569641570, 5746.27133789600}, {0.00000003788, 4.90728294810, 4164.31198961300}, {0.00000005337, 5.09957905103, 31441.67756975680}, {0.00000003967, 1.20054555175, 1349.86740965880}, {0.00000004005, 3.02853885902, 1059.38193018920}, {0.00000003480, 0.76066308841, 10973.55568635000}, {0.00000004232, 1.05485713117, 5760.49843189760}, {0.00000004582, 3.76570026763, 6386.16862421000}, {0.00000003335, 3.13829943354, 6836.64525283380}, {0.00000003420, 3.00043974511, 4292.33083295040}, {0.00000003595, 5.70703236079, 5643.17856367740}, {0.00000003236, 4.16387400645, 9917.69687450980}, {0.00000004154, 2.59940749519, 7058.59846131540}, {0.00000003362, 4.54577164994, 4732.03062734340}, {0.00000002978, 1.30561268820, 6283.14316029419}, {0.00000002765, 0.51311975671, 26.29831979980}, {0.00000002807, 5.66230537649, 8635.94200376320}, {0.00000002927, 5.73787834080, 16200.77272450120}, {0.00000003167, 1.69181759900, 11015.10647733480}, {0.00000002598, 2.96244118358, 25132.30339996560}, {0.00000003519, 3.62639325753, 244287.60000722769}, {0.00000002676, 4.20727719487, 18073.70493865020}, {0.00000002978, 1.74971565805, 6283.00853968860}, {0.00000002287, 1.06976449088, 14314.16811304980}, {0.00000002863, 5.92838917309, 14712.31711645800}, {0.00000003071, 0.23793217000, 35371.88726597640}, {0.00000002656, 0.89959301615, 12352.85260454480}, {0.00000002415, 2.79975176800, 709.93304855830}, {0.00000002811, 3.51513864541, 21228.39202354580}, {0.00000001977, 2.61358297551, 951.71840625060}, {0.00000002548, 2.47684686575, 6208.29425142410}, {0.00000001999, 0.56090396506, 7079.37385680780}, {0.00000002305, 1.05376463592, 22483.84857449259}, {0.00000001855, 2.86093570752, 5216.58037280140}, {0.00000002157, 1.31395211105, 154717.60988768269}, {0.00000001970, 4.36931551625, 167283.76158766549}, {0.00000001754, 2.14452400686, 6290.18939699220}, {0.00000001628, 5.85704450617, 10984.19235169980}, {0.00000002154, 6.03828353794, 10873.98603048040}, {0.00000001714, 3.70158195222, 1592.59601363280}, {0.00000001541, 6.21599512982, 23543.23050468179}, {0.00000001602, 1.99860679677, 10969.96525769820}, {0.00000001712, 1.34295218697, 3128.38876509580}, {0.00000001647, 5.54948299069, 6496.37494542940}, {0.00000001495, 5.43980459648, 155.42039943420}, {0.00000001827, 5.91227480351, 3738.76143010800}, {0.00000001726, 2.16765465036, 10575.40668294180}, {0.00000001532, 5.35683107063, 13521.75144159140}, {0.00000001824, 1.66056145084, 39302.09696219600}, {0.00000001605, 1.90930973224, 6133.51265285680}, {0.00000001282, 2.46013372544, 13916.01910964160}, {0.00000001211, 4.41360631550, 3894.18182954220}, {0.00000001394, 1.77801929250, 9225.53927328300}, {0.00000001571, 4.95512957606, 25158.60171976540}, {0.00000001205, 1.19212756308, 3.52311834900}, {0.00000001132, 2.69830084955, 6040.34724601740}, {0.00000001504, 5.77577388271, 18209.33026366019}, {0.00000001393, 1.62625077326, 5120.60114558360}, {0.00000001081, 2.93726744446, 17256.63153634140}, {0.00000001232, 0.71651766504, 143571.32428481648}, {0.00000001087, 0.99769687961, 955.59974160860}, {0.00000001068, 5.28472576591, 65147.61976813770}, {0.00000001169, 3.11663802316, 14945.31617355440}, {0.00000000975, 5.10887260780, 6172.86952877200}, {0.00000001202, 4.02992510403, 553.56940284240}, {0.00000000979, 2.00000879106, 15110.46611986620}, {0.00000000962, 4.02380771400, 6282.09552892320}, {0.00000000999, 3.62643002790, 6262.30045449900}, {0.00000001030, 5.84987815239, 213.29909543800}, {0.00000001014, 2.84227679965, 8662.24032356300}, {0.00000001185, 1.51330629149, 17654.78053974960}, {0.00000000967, 2.67081017562, 5650.29211067820}, {0.00000001222, 2.65423784904, 88860.05707098669}, {0.00000000986, 2.36212814824, 6206.80977871580}, {0.00000001034, 0.13634950642, 11712.95531823080}, {0.00000001103, 3.08477302937, 43232.30665841560}, {0.00000000781, 2.53374971725, 16496.36139620240}, {0.00000001019, 3.04569392376, 6037.24420376200}, {0.00000000795, 5.80662989126, 5230.80746680300}, {0.00000000813, 3.57702871938, 10177.25767953360}, {0.00000000962, 5.31470594766, 6284.05617105960}, {0.00000000717, 5.95797471837, 12559.03815298200}, {0.00000000967, 2.74413738053, 6244.94281435360}, {0.00000000921, 0.10160160830, 29088.81141598500}, {0.00000000719, 5.91788189939, 4136.91043351620}, {0.00000000688, 3.89489045092, 1589.07289528380}, {0.00000000772, 4.05505380285, 6127.65545055720}, {0.00000000706, 5.49323197725, 22003.91463486980}, {0.00000000665, 1.60002747134, 11087.28512591840}, {0.00000000690, 4.50539825729, 426.59819087600}, {0.00000000854, 3.26104645060, 20426.57109242200}, {0.00000000656, 4.32410182940, 16858.48253293320}, {0.00000000840, 2.59572585212, 28766.92442448400}, {0.00000000686, 0.61944033771, 11403.67699557500}, {0.00000000700, 3.40901412473, 7.11354700080}, {0.00000000728, 0.04050185963, 5481.25491886760}, {0.00000000653, 1.03869451230, 6062.66320755260}, {0.00000000559, 4.79221805695, 20199.09495963300}, {0.00000000633, 5.70229959167, 45892.73043315699}, {0.00000000591, 6.10986487621, 9623.68827669120}, {0.00000000520, 3.62310356479, 5333.90024102160}, {0.00000000602, 5.58381898589, 10344.29506538580}, {0.00000000496, 2.21027756314, 1990.74501704100}, {0.00000000691, 1.96733114988, 12416.58850284820}, {0.00000000640, 1.59062417043, 18319.53658487960}, {0.00000000625, 3.82358168221, 13517.87010623340}, {0.00000000475, 1.17025904180, 12569.67481833180}, {0.00000000660, 5.08498512995, 283.85931886520}, {0.00000000664, 4.50029469969, 47162.51635463520}, {0.00000000569, 0.16318535463, 17267.26820169119}, {0.00000000568, 3.86100969474, 6076.89030155420}, {0.00000000462, 0.26368763517, 4590.91018048900}, {0.00000000535, 4.83225423196, 18422.62935909819}, {0.00000000466, 0.75873879417, 7342.45778018060}, {0.00000000541, 3.07212190556, 226858.23855437008}, {0.00000000610, 1.53597089605, 33019.02111220460}, {0.00000000617, 2.62356328726, 11190.37790013700}, {0.00000000548, 4.55798855803, 18875.52586977400}, {0.00000000633, 4.60110281228, 66567.48586525429}, {0.00000000587, 5.78087907808, 632.78373931320}, {0.00000000603, 5.38458554802, 316428.22867391503}, {0.00000000525, 5.01522072363, 12132.43996210600}, {0.00000000469, 0.59975173763, 21954.15760939799}, {0.00000000548, 3.50627043672, 17253.04110768959}, {0.00000000502, 0.98804327589, 11609.86254401220}, {0.00000000568, 1.98497313089, 7668.63742494250}, {0.00000000482, 1.62460405687, 12146.66705610760}, {0.00000000391, 3.68718382972, 18052.92954315780}, {0.00000000457, 3.77214896610, 156137.47598479928}, {0.00000000401, 5.29221540240, 15671.08175940660}, {0.00000000469, 1.80963351735, 12562.62858163380}, {0.00000000514, 3.37031288919, 20597.24396304120}, {0.00000000452, 5.66811219778, 10454.50138660520}, {0.00000000375, 4.98528185039, 9779.10867612540}, {0.00000000523, 0.97215560834, 155427.54293624099}, {0.00000000403, 5.13948189770, 1551.04522264800}, {0.00000000372, 3.69883738807, 9388.00590941520}, {0.00000000367, 4.43875659833, 4535.05943692440}, {0.00000000406, 4.20863156497, 12592.45001978260}, {0.00000000362, 2.55099560446, 242.72860397400}, {0.00000000471, 4.61907324819, 5436.99301524020}, {0.00000000388, 4.96020928400, 24356.78078864160}, {0.00000000441, 5.83872966262, 3496.03282613400}, {0.00000000349, 6.16307810648, 19800.94595622480}, {0.00000000356, 0.23819081240, 5429.87946823940}, {0.00000000346, 5.60809622572, 2379.16447357160}, {0.00000000380, 2.72105213132, 11933.36796066960}, {0.00000000432, 0.24215988572, 17996.03116822220}, {0.00000000378, 5.22516848076, 7477.52286021600}, {0.00000000337, 5.10885555836, 5849.36411211460}, {0.00000000315, 0.57827745123, 10557.59416082380}, {0.00000000318, 4.49949007320, 3634.62102451840}, {0.00000000323, 1.55850824803, 10440.27429260360}, {0.00000000314, 5.77154773334, 20.77539549240}, {0.00000000303, 2.34615580398, 4686.88940770680}, {0.00000000414, 5.93237602310, 51092.72605085480}, {0.00000000362, 2.17561997119, 28237.23345938940}, {0.00000000288, 0.18377405421, 13095.84266507740}, {0.00000000277, 5.12952205030, 13119.72110282519}, {0.00000000325, 6.18608287927, 6268.84875598980}, {0.00000000273, 0.30522428863, 23141.55838292460}, {0.00000000267, 5.76152585786, 5966.68398033480}, {0.00000000345, 2.94246040875, 36949.23080842420}, {0.00000000253, 5.20994580359, 24072.92146977640}, {0.00000000342, 5.76212804329, 16460.33352952499}, {0.00000000307, 6.01039067183, 22805.73556599360}, {0.00000000261, 2.00304796059, 6148.01076995600}, {0.00000000238, 5.08241964961, 6915.85958930460}, {0.00000000249, 2.94762789744, 135.06508003540}, {0.00000000306, 3.89765478921, 10988.80815753500}, {0.00000000308, 0.05451027736, 4701.11650170840}, {0.00000000319, 2.95712862064, 163096.18036118349}, {0.00000000272, 2.07967681309, 4804.20927592700}, {0.00000000209, 4.43768461442, 6546.15977336420}, {0.00000000217, 0.73691592312, 6303.85124548380}, {0.00000000203, 0.32033085531, 25934.12433108940}, {0.00000000205, 5.22936478995, 20995.39296644940}, {0.00000000213, 0.20671418919, 28286.99048486120}, {0.00000000197, 0.48286131290, 16737.57723659660}, {0.00000000230, 6.06567392849, 6287.00800325450}, {0.00000000219, 1.29194216300, 5326.78669402080}, {0.00000000201, 1.74700937253, 22743.40937951640}, {0.00000000207, 4.45440927276, 6279.48542133960}, {0.00000000269, 6.05640445030, 64471.99124174489}, {0.00000000190, 0.99261116842, 29296.61538957860}, {0.00000000194, 3.82656562755, 419.48464387520}, {0.00000000262, 5.26961924126, 522.57741809380}, {0.00000000210, 4.68618183158, 6254.62666252360}, {0.00000000197, 2.80624554186, 4933.20844033260}, {0.00000000252, 4.36220154620, 40879.44050464380}, {0.00000000261, 1.07241516738, 55022.93574707440}, {0.00000000233, 5.41751014958, 39609.65458316560}, {0.00000000185, 4.14324541379, 5642.19824260920}, {0.00000000247, 3.44855612987, 6702.56049386660}, {0.00000000205, 4.04424043226, 536.80451209540}, {0.00000000191, 3.15807087926, 16723.35014259500}, {0.00000000222, 5.16259496507, 23539.70738633280}, {0.00000000180, 4.56214752149, 6489.26139842860}, {0.00000000227, 0.60156339452, 5905.70224207560}, {0.00000000170, 0.93185903228, 16062.18452611680}, {0.00000000159, 0.92751013112, 23937.85638974100}, {0.00000000157, 4.69607868164, 6805.65326808520}, {0.00000000218, 0.85533373430, 16627.37091537720}, {0.00000000169, 0.94641052064, 3097.88382272579}, {0.00000000207, 4.88410451334, 6286.66627864320}, {0.00000000160, 4.95943826819, 10021.83728009940}, {0.00000000175, 6.12762824563, 239424.39025435288}, {0.00000000173, 3.13887234973, 6179.98307577280}, {0.00000000157, 3.62822057807, 18451.07854656599}, {0.00000000206, 5.74617821138, 3646.35037735440}, {0.00000000157, 4.67695912207, 6709.67404086740}, {0.00000000146, 3.09506069745, 4907.30205014560}, {0.00000000165, 2.27139128760, 10660.68693504240}, {0.00000000144, 3.96947747592, 6019.99192661860}, {0.00000000171, 5.91302216729, 6058.73105428950}, {0.00000000144, 2.13155655120, 26084.02180621620}, {0.00000000151, 0.67417383565, 2388.89402044920}, {0.00000000196, 1.67718461229, 2107.03450754240}, {0.00000000146, 5.10373877968, 10770.89325626180}, {0.00000000187, 1.23915444627, 19402.79695281660}, {0.00000000137, 1.26247412216, 12566.21901028560}, {0.00000000191, 5.03547476279, 263.08392337280}, {0.00000000137, 3.52825454595, 639.89728631400}, {0.00000000135, 0.73840670927, 5017.50837136500}, {0.00000000164, 2.39195095081, 6357.85744855870}, {0.00000000168, 0.05515907462, 9380.95967271720}, {0.00000000161, 1.15721259392, 26735.94526221320}, {0.00000000144, 1.76097645199, 5888.44996493220}, {0.00000000131, 2.51859277344, 6599.46771964800}, {0.00000000142, 2.43802911123, 5881.40372823420}, {0.00000000159, 5.90325893762, 6281.59137728310}, {0.00000000151, 3.72338532519, 12669.24447420140}, {0.00000000132, 2.38417741883, 6525.80445396540}, {0.00000000127, 0.00254936441, 10027.90319572920}, {0.00000000148, 2.85102145528, 6418.14093002680}, {0.00000000143, 5.74460279560, 26087.90314157420}, {0.00000000172, 0.41289962240, 174242.46596404970}, {0.00000000136, 4.15497742275, 6311.52503745920}, {0.00000000170, 5.98194913129, 327574.51427678125}, {0.00000000136, 2.48430537541, 13341.67431130680}, {0.00000000149, 0.33002271275, 245.83164622940}, {0.00000000165, 2.49667924600, 58953.14544329400}, {0.00000000123, 1.67328384813, 32217.20018108080}, {0.00000000123, 3.45660563754, 6277.55292568400}, {0.00000000117, 0.86065134175, 6245.04817735560}, {0.00000000149, 5.61358281003, 5729.50644714900}, {0.00000000128, 0.71204006448, 103.09277421860}, {0.00000000159, 2.43166592149, 221995.02880149524}, {0.00000000137, 1.70657709200, 12566.08438968000}, {0.00000000129, 2.80667872683, 6016.46880826960}, {0.00000000113, 3.58302904101, 25685.87280280800}, {0.00000000109, 3.26403795962, 6819.88036208680}, {0.00000000122, 0.34120688202, 1162.47470440780}, {0.00000000106, 1.59721172719, 17782.73207278420}, {0.00000000144, 2.28891651774, 12489.88562870720}, {0.00000000137, 5.82029768354, 44809.65020086340}, {0.00000000134, 1.26539983018, 5331.35744374080}, {0.00000000103, 5.96518130595, 6321.10352262720}, {0.00000000109, 0.33808549034, 11300.58422135640}, {0.00000000129, 5.89187277190, 12029.34718788740}, {0.00000000122, 5.77325634636, 11919.14086666800}, {0.00000000107, 6.24998989350, 77690.75950573849}, {0.00000000107, 1.00535580713, 77736.78343050249}, {0.00000000115, 5.86963518266, 12721.57209941700}, {0.00000000102, 5.66283467269, 5540.08578945880}, {0.00000000143, 0.24122178432, 4214.06901508480}, {0.00000000143, 0.88529649733, 7576.56007357400}, {0.00000000107, 2.92124030351, 31415.37924995700}, {0.00000000100, 5.99485644501, 4061.21921539440}, {0.00000000103, 2.41941934525, 5547.19933645960}, {0.00000000104, 4.44106051277, 2118.76386037840}, {0.00000000110, 0.37559635174, 5863.59120611620}, {0.00000000124, 2.55619029611, 12539.85338018300}, {0.00000000110, 3.66952094465, 238004.52415723629}, {0.00000000112, 4.32512422724, 97238.62754448749}, {0.00000000120, 1.26895630075, 12043.57428188900}, {0.00000000097, 5.42612959752, 7834.12107263940}, {0.00000000094, 2.56461130309, 19004.64794940840}, {0.00000000105, 5.68272475301, 16522.65971600220}, {0.00000000117, 3.65425622684, 34520.30930938080}, {0.00000000108, 1.24206843948, 84672.47584450469}, {0.00000000098, 0.13589994287, 11080.17157891760}, {0.00000000097, 2.46722096722, 71980.63357473118}, {0.00000000095, 5.36958330451, 6288.59877429880}, {0.00000000096, 0.20796618776, 18139.29450141590}, {0.00000000111, 5.01961920313, 11823.16163945020}, {0.00000000090, 2.72355843779, 26880.31981303260}, {0.00000000099, 0.90164266199, 18635.92845453620}, {0.00000000126, 4.78722177847, 305281.94307104882}, {0.00000000124, 5.00979495566, 172146.97134054029}, {0.00000000090, 4.50544881196, 40077.61957352000}, {0.00000000104, 5.63679680710, 2787.04302385740}, {0.00000000091, 5.43564326147, 6272.03014972750}, {0.00000000100, 2.00639461597, 12323.42309600880}, {0.00000000117, 2.35555589778, 83286.91426955358}, {0.00000000105, 2.59824000109, 30666.15495843280}, {0.00000000090, 2.35779490026, 12491.37010141550}, {0.00000000089, 3.57152453732, 11720.06886523160}, {0.00000000095, 5.67015349858, 14919.01785375460}, {0.00000000087, 1.86043406047, 27707.54249429480}, {0.00000000106, 3.04150600352, 22345.26037610820}, {0.00000000082, 5.58298993353, 10241.20229116720}, {0.00000000083, 3.10607039533, 36147.40987730040}, {0.00000000094, 5.47749711149, 9924.81042151060}, {0.00000000082, 4.71988314145, 15141.39079431200}, {0.00000000096, 3.89073946348, 6379.05507720920}, {0.00000000110, 4.92131611151, 5621.84292321040}, {0.00000000110, 4.89978492291, 72140.62866668739}, {0.00000000097, 5.20764563059, 6303.43116939020}, {0.00000000085, 1.61269222311, 33326.57873317420}, {0.00000000093, 1.32651591333, 23020.65308658799}, {0.00000000090, 0.57733016380, 26482.17080962440}, {0.00000000078, 3.99588630754, 11293.47067435560}, {0.00000000106, 3.92012705073, 62883.35513951360}, {0.00000000098, 2.94397773524, 316.39186965660}, {0.00000000076, 3.96310417608, 29026.48522950779}, {0.00000000098, 0.95914722366, 48739.85989708300}, {0.00000000078, 1.97068528043, 90279.92316810328}, {0.00000000076, 0.23027966596, 21424.46664430340}, {0.00000000079, 1.46227790922, 8982.81066930900}, {0.00000000078, 2.28840998832, 266.60704172180}, {0.00000000071, 1.51940765590, 33794.54372352860}, {0.00000000076, 0.22880641443, 57375.80190084620}, {0.00000000097, 0.39449562097, 24279.10701821359}, {0.00000000075, 2.77638584795, 12964.30070339100}, {0.00000000077, 5.18846946344, 11520.99686379520}, {0.00000000068, 0.50006599129, 4274.51831083240}, {0.00000000075, 2.07323762803, 15664.03552270859}, {0.00000000077, 0.46665178780, 16207.88627150200}, {0.00000000081, 4.10452219483, 161710.61878623239}, {0.00000000071, 3.91415328513, 7875.67186362420}, {0.00000000081, 0.91938383406, 74.78159856730}, {0.00000000083, 4.69916218791, 23006.42599258639}, {0.00000000069, 0.98999300277, 6393.28217121080}, {0.00000000065, 5.41938745446, 28628.33622609960}, {0.00000000073, 2.45564765251, 15508.61512327440}, {0.00000000065, 3.02336771694, 5959.57043333400}, {0.00000000064, 0.18375587635, 1066.49547719000}, {0.00000000080, 5.81239171612, 12341.80690428090}, {0.00000000066, 2.15105504851, 38.02767263580}, {0.00000000067, 5.14047250153, 9814.60410029120}, {0.00000000062, 2.43313614978, 10138.10951694860}, {0.00000000068, 2.24442548639, 24383.07910844140}, {0.00000000078, 1.39649333997, 9411.46461508720}, {0.00000000059, 4.95362151577, 35707.71008290740}, {0.00000000073, 1.35229143121, 5327.47610838280}, {0.00000000057, 3.16018882154, 5490.30096152400}, {0.00000000072, 5.91833527334, 10881.09957748120}, {0.00000000067, 0.66414713064, 29864.33402730900}, {0.00000000065, 0.30352816135, 7018.95236352320}, {0.00000000059, 5.36231868425, 10239.58386601080}, {0.00000000056, 3.22196331515, 2636.72547263700}, {0.00000000068, 5.32086226658, 3116.65941225980}, {0.00000000059, 1.63156134967, 61306.01159706580}, {0.00000000054, 4.29491690425, 21947.11137270000}, {0.00000000070, 0.29271565928, 6528.90749622080}, {0.00000000057, 5.89190132575, 34513.26307268280}, {0.00000000054, 2.51856815404, 6279.19451463340}, {0.00000000074, 1.38235845304, 9967.45389998160}, {0.00000000054, 0.92276712152, 6286.95718534940}, {0.00000000070, 5.00933012248, 6453.74872061060}, {0.00000000053, 3.86543309344, 32370.97899156560}, {0.00000000055, 4.51794544854, 34911.41207609100}, {0.00000000063, 5.41479412056, 11502.83761653050}, {0.00000000063, 2.34416220742, 11510.70192305670}, {0.00000000056, 0.91310629913, 9910.58332750900}, {0.00000000067, 4.03308763854, 34596.36465465240}, {0.00000000060, 5.57024703495, 5756.90800324580}, {0.00000000072, 2.80863088166, 10866.87248347960}, {0.00000000066, 6.12047940728, 12074.48840752400}, {0.00000000051, 2.59519527563, 11396.56344857420}, {0.00000000062, 5.14746754396, 25287.72379939980}, {0.00000000054, 2.50994032776, 5999.21653112620}, {0.00000000051, 4.51195861837, 29822.78323632420}, {0.00000000059, 0.44167237876, 250570.67585721909}, {0.00000000051, 3.68849066760, 6262.72053059260}, {0.00000000049, 0.54704693048, 22594.05489571199}, {0.00000000065, 2.38423614501, 52670.06959330260}, {0.00000000069, 5.34363738671, 66813.56483573320}, {0.00000000056, 2.67216180349, 17892.93839400359}, {0.00000000049, 4.18361320516, 18606.49894600020}, {0.00000000055, 0.83886167974, 20452.86941222180}, {0.00000000050, 1.46327331958, 37455.72649597440}, {0.00000000058, 3.34847975377, 33990.61834428620}, {0.00000000065, 1.45522693982, 76251.32777062019}, {0.00000000056, 2.35650664200, 37724.75341974820}, {0.00000000048, 1.80689447612, 206.18554843720}, {0.00000000056, 3.84224878744, 5483.25472482600}, {0.00000000053, 0.17334326094, 77717.29458646949}, {0.00000000053, 0.79879700631, 77710.24834977149}, {0.00000000047, 0.43240779709, 735.87651353180}, {0.00000000053, 4.58786566028, 11616.97609101300}, {0.00000000048, 6.20230111054, 4171.42553661380}, {0.00000000052, 2.91719053030, 6993.00889854970}, {0.00000000057, 3.42008310383, 50317.20343953080}, {0.00000000048, 0.12356889012, 13362.44970679920}, {0.00000000060, 5.52056066934, 949.17560896980}, {0.00000000045, 3.37963782356, 10763.77970926100}, {0.00000000047, 5.50958184902, 12779.45079542080}, {0.00000000052, 5.42770349015, 310145.15282392364}, {0.00000000061, 2.93237974631, 5791.41255753260}, {0.00000000044, 2.87440620802, 8584.66166590080}, {0.00000000046, 4.03141796560, 10667.80048204320}, {0.00000000044, 1.21579107625, 6272.43918464160}, {0.00000000047, 2.57670800912, 11492.54267579200}, {0.00000000044, 3.62570223167, 63658.87775083760}, {0.00000000051, 0.84531181151, 12345.73905754400}, {0.00000000046, 1.17584556517, 149.56319713460}, {0.00000000043, 0.01524970172, 37853.87549938260}, {0.00000000043, 0.79038834934, 640.87760738220}, {0.00000000044, 2.22554419931, 6293.71251534120}, {0.00000000049, 1.01528394907, 149144.46708624958}, {0.00000000041, 3.27146326065, 8858.31494432060}, {0.00000000045, 3.03765521215, 65236.22129328540}, {0.00000000058, 5.45843180927, 1975.49254585600}, {0.00000000041, 1.32190847146, 2547.83753823240}, {0.00000000047, 3.67626039848, 28313.28880466100}, {0.00000000047, 6.21438985953, 10991.30589870060}, {0.00000000040, 2.37237751212, 8273.82086703240}, {0.00000000056, 1.09773690181, 77376.20102240759}, {0.00000000040, 2.35698541041, 2699.73481931760}, {0.00000000043, 5.28030897946, 17796.95916678580}, {0.00000000054, 2.59175932091, 22910.44676536859}, {0.00000000055, 0.07988985505, 83467.15635301729}, {0.00000000041, 4.47510694062, 5618.31980486140}, {0.00000000040, 1.35670430524, 27177.85152920020}, {0.00000000041, 2.48011323946, 6549.68289171320}, {0.00000000050, 2.56387920528, 82576.98122099529}, {0.00000000042, 4.78798367468, 7856.89627409019}, {0.00000000047, 2.75482175292, 18202.21671665939}, {0.00000000039, 1.97008298629, 24491.42579258340}, {0.00000000042, 4.04346599946, 7863.94251078820}, {0.00000000039, 3.01033936420, 853.19638175200}, {0.00000000038, 0.49178679251, 38650.17350619900}, {0.00000000044, 1.35931241699, 21393.54196985760}, {0.00000000036, 4.86047906533, 4157.19844261220}, {0.00000000043, 5.64354880978, 1062.90504853820}, {0.00000000039, 3.92736779879, 3903.91137641980}, {0.00000000040, 5.39694918320, 9498.21223063460}, {0.00000000043, 2.40863861919, 29424.63423291600}, {0.00000000046, 2.08022244271, 12573.26524698360}, {0.00000000050, 6.15760345261, 78051.34191383338}, }; static const struct ln_vsop earth_radius_r1[RADIUS_R1] = { {0.00103018607, 1.10748968172, 6283.07584999140}, {0.00001721238, 1.06442300386, 12566.15169998280}, {0.00000702217, 3.14159265359, 0.00000000000}, {0.00000032345, 1.02168583254, 18849.22754997420}, {0.00000030801, 2.84358443952, 5507.55323866740}, {0.00000024978, 1.31906570344, 5223.69391980220}, {0.00000018487, 1.42428709076, 1577.34354244780}, {0.00000010077, 5.91385248388, 10977.07880469900}, {0.00000008635, 0.27158192945, 5486.77784317500}, {0.00000008654, 1.42046854427, 6275.96230299060}, {0.00000005069, 1.68613408916, 5088.62883976680}, {0.00000004985, 6.01402338185, 6286.59896834040}, {0.00000004667, 5.98749245692, 529.69096509460}, {0.00000004395, 0.51800423445, 4694.00295470760}, {0.00000003870, 4.74932206877, 2544.31441988340}, {0.00000003755, 5.07053801166, 796.29800681640}, {0.00000004100, 1.08424801084, 9437.76293488700}, {0.00000003518, 0.02290216978, 83996.84731811189}, {0.00000003436, 0.94937503872, 71430.69561812909}, {0.00000003221, 6.15628775321, 2146.16541647520}, {0.00000003418, 5.41151581880, 775.52261132400}, {0.00000002863, 5.48433323746, 10447.38783960440}, {0.00000002525, 0.24296913555, 398.14900340820}, {0.00000002205, 4.94892172085, 6812.76681508600}, {0.00000002186, 0.41991932164, 8031.09226305840}, {0.00000002828, 3.41986300734, 2352.86615377180}, {0.00000002554, 6.13241770582, 6438.49624942560}, {0.00000001932, 5.31374587091, 8429.24126646660}, {0.00000002427, 3.09118902115, 4690.47983635860}, {0.00000001730, 1.53685999718, 4705.73230754360}, {0.00000002250, 3.68836395620, 7084.89678111520}, {0.00000002094, 1.28169060400, 1748.01641306700}, {0.00000001483, 3.22226346483, 7234.79425624200}, {0.00000001434, 0.81293662216, 14143.49524243060}, {0.00000001754, 3.22883705112, 6279.55273164240}, {0.00000001583, 4.09815978783, 11499.65622279280}, {0.00000001575, 5.53890314149, 3154.68708489560}, {0.00000001847, 1.82041234937, 7632.94325965020}, {0.00000001499, 3.63177937611, 11513.88331679440}, {0.00000001337, 4.64442556061, 6836.64525283380}, {0.00000001275, 2.69329661394, 1349.86740965880}, {0.00000001348, 6.15284035323, 5746.27133789600}, {0.00000001126, 3.35676107739, 17789.84561978500}, {0.00000001470, 3.65282991735, 1194.44701022460}, {0.00000001101, 4.49747427670, 4292.33083295040}, {0.00000001168, 2.58033028504, 13367.97263110660}, {0.00000001236, 5.64980098028, 5760.49843189760}, {0.00000000985, 0.65326301914, 5856.47765911540}, {0.00000000928, 2.32555018290, 10213.28554621100}, {0.00000001073, 5.82672338169, 12036.46073488820}, {0.00000000918, 0.76907130762, 16730.46368959580}, {0.00000000876, 1.50335727807, 11926.25441366880}, {0.00000001023, 5.62071200879, 6256.77753019160}, {0.00000000853, 0.65678134630, 155.42039943420}, {0.00000000802, 4.10519132094, 951.71840625060}, {0.00000000859, 1.42880883564, 5753.38488489680}, {0.00000000992, 1.14238001610, 1059.38193018920}, {0.00000000814, 1.63584008733, 6681.22485339960}, {0.00000000664, 4.55039663226, 5216.58037280140}, {0.00000000627, 1.50782904323, 5643.17856367740}, {0.00000000644, 4.19480024859, 6040.34724601740}, {0.00000000590, 6.18371704849, 4164.31198961300}, {0.00000000635, 0.52423584770, 6290.18939699220}, {0.00000000650, 0.97935492869, 25132.30339996560}, {0.00000000568, 2.30121525349, 10973.55568635000}, {0.00000000549, 5.26737827342, 3340.61242669980}, {0.00000000547, 2.20143332641, 1592.59601363280}, {0.00000000526, 0.92464258271, 11371.70468975820}, {0.00000000493, 5.91036281399, 3894.18182954220}, {0.00000000483, 1.66005711540, 12168.00269657460}, {0.00000000514, 3.59683072524, 10969.96525769820}, {0.00000000516, 3.97164781773, 17298.18232732620}, {0.00000000529, 5.03538677680, 9917.69687450980}, {0.00000000487, 2.50544745305, 6127.65545055720}, {0.00000000419, 4.05235655996, 10984.19235169980}, {0.00000000538, 5.54081539813, 553.56940284240}, {0.00000000402, 2.16859478359, 7860.41939243920}, {0.00000000552, 2.32219865498, 11506.76976979360}, {0.00000000367, 3.39145698451, 6496.37494542940}, {0.00000000360, 5.34467204596, 7079.37385680780}, {0.00000000334, 3.61346365667, 11790.62908865880}, {0.00000000454, 0.28755421898, 801.82093112380}, {0.00000000419, 3.69613970002, 10575.40668294180}, {0.00000000319, 0.30793759304, 16200.77272450120}, {0.00000000376, 5.81560210508, 7058.59846131540}, {0.00000000364, 1.08425056923, 6309.37416979120}, {0.00000000294, 4.54798604178, 11856.21865142450}, {0.00000000290, 1.26451946335, 8635.94200376320}, {0.00000000394, 4.15683669084, 26.29831979980}, {0.00000000260, 5.09424572996, 10177.25767953360}, {0.00000000241, 2.25766000302, 11712.95531823080}, {0.00000000239, 1.06936978753, 242.72860397400}, {0.00000000276, 3.44260568764, 5884.92684658320}, {0.00000000255, 5.38496803122, 21228.39202354580}, {0.00000000307, 4.24313885601, 3738.76143010800}, {0.00000000213, 3.44661200485, 213.29909543800}, {0.00000000198, 0.69427265195, 1990.74501704100}, {0.00000000195, 5.16563409007, 12352.85260454480}, {0.00000000213, 3.89937836808, 13916.01910964160}, {0.00000000214, 4.00445200772, 5230.80746680300}, {0.00000000184, 5.59805976614, 6283.14316029419}, {0.00000000184, 2.85275392124, 7238.67559160000}, {0.00000000179, 2.54259058252, 14314.16811304980}, {0.00000000236, 5.58826125715, 6069.77675455340}, {0.00000000189, 2.72689937708, 6062.66320755260}, {0.00000000184, 6.04216273598, 6283.00853968860}, {0.00000000225, 1.66128561344, 4732.03062734340}, {0.00000000230, 3.62591335086, 6284.05617105960}, {0.00000000172, 0.97566476085, 3930.20969621960}, {0.00000000162, 2.19467339429, 18073.70493865020}, {0.00000000215, 1.04672844028, 3496.03282613400}, {0.00000000182, 5.17782354566, 17253.04110768959}, {0.00000000167, 2.17754938066, 6076.89030155420}, {0.00000000167, 4.75672473773, 17267.26820169119}, {0.00000000149, 0.80944185798, 709.93304855830}, {0.00000000149, 0.17584214812, 9779.10867612540}, {0.00000000192, 5.00680790235, 11015.10647733480}, {0.00000000141, 4.38420380014, 4136.91043351620}, {0.00000000158, 4.60969054283, 9623.68827669120}, {0.00000000133, 3.30507062245, 154717.60988768269}, {0.00000000166, 6.13191098325, 3.52311834900}, {0.00000000181, 1.60715321141, 7.11354700080}, {0.00000000150, 5.28136702046, 13517.87010623340}, {0.00000000142, 0.49788089569, 25158.60171976540}, {0.00000000124, 6.03440459813, 9225.53927328300}, {0.00000000124, 0.99251562639, 65147.61976813770}, {0.00000000128, 1.92032744711, 22483.84857449259}, {0.00000000124, 3.99739675184, 4686.88940770680}, {0.00000000121, 2.37814805239, 167283.76158766549}, {0.00000000123, 5.62315112940, 5642.19824260920}, {0.00000000117, 5.81755956156, 12569.67481833180}, {0.00000000157, 3.40236948518, 16496.36139620240}, {0.00000000130, 2.10499918142, 1589.07289528380}, {0.00000000116, 0.55839966736, 5849.36411211460}, {0.00000000123, 5.81645568991, 6282.09552892320}, {0.00000000110, 0.42176497674, 6172.86952877200}, {0.00000000150, 4.26279600865, 3128.38876509580}, {0.00000000106, 2.27436561182, 5429.87946823940}, {0.00000000114, 1.52894564202, 12559.03815298200}, {0.00000000121, 0.39459045915, 12132.43996210600}, {0.00000000104, 2.41845930933, 426.59819087600}, {0.00000000109, 5.82786999856, 16858.48253293320}, {0.00000000102, 4.46626484910, 23543.23050468179}, {0.00000000100, 2.93812275274, 4535.05943692440}, {0.00000000097, 3.97935904984, 6133.51265285680}, {0.00000000098, 0.87616810121, 6525.80445396540}, {0.00000000110, 6.22339014386, 12146.66705610760}, {0.00000000098, 3.17344332543, 10440.27429260360}, {0.00000000096, 2.44128701699, 3097.88382272579}, {0.00000000099, 5.75642493267, 7342.45778018060}, {0.00000000090, 0.18984343165, 13119.72110282519}, {0.00000000099, 5.58884724219, 2388.89402044920}, {0.00000000091, 6.04278320182, 20426.57109242200}, {0.00000000080, 1.29028142103, 5650.29211067820}, {0.00000000086, 3.94529200528, 10454.50138660520}, {0.00000000085, 1.92836879835, 29088.81141598500}, {0.00000000076, 2.70726317966, 143571.32428481648}, {0.00000000091, 5.63859073351, 8827.39026987480}, {0.00000000076, 1.80783856698, 28286.99048486120}, {0.00000000075, 3.40858032804, 5481.25491886760}, {0.00000000070, 4.53719487231, 17256.63153634140}, {0.00000000089, 1.10064490942, 11769.85369316640}, {0.00000000066, 2.78384937771, 536.80451209540}, {0.00000000068, 3.88199295043, 17260.15465469040}, {0.00000000088, 3.88075269535, 7477.52286021600}, {0.00000000061, 6.17558202197, 11087.28512591840}, {0.00000000060, 4.34824715818, 6206.80977871580}, {0.00000000082, 4.59843208943, 9388.00590941520}, {0.00000000079, 1.63139280394, 4933.20844033260}, {0.00000000081, 1.55550779371, 9380.95967271720}, {0.00000000078, 4.20905757519, 5729.50644714900}, {0.00000000058, 5.76889633224, 3634.62102451840}, {0.00000000060, 0.93813100594, 12721.57209941700}, {0.00000000071, 6.11408885148, 8662.24032356300}, {0.00000000057, 5.48112524468, 18319.53658487960}, {0.00000000070, 0.01749174864, 14945.31617355440}, {0.00000000074, 1.09976045820, 16460.33352952499}, {0.00000000056, 1.63036186739, 15720.83878487840}, {0.00000000055, 4.86788348404, 13095.84266507740}, {0.00000000060, 5.93729841267, 12539.85338018300}, {0.00000000054, 0.22608242982, 15110.46611986620}, {0.00000000054, 2.30250047594, 16062.18452611680}, {0.00000000064, 2.13513754101, 7875.67186362420}, {0.00000000059, 5.87963500139, 5331.35744374080}, {0.00000000058, 2.30546168615, 955.59974160860}, {0.00000000049, 1.93839278478, 5333.90024102160}, {0.00000000054, 5.80331607119, 12043.57428188900}, {0.00000000054, 4.44671053809, 4701.11650170840}, {0.00000000049, 0.30241161485, 6805.65326808520}, {0.00000000046, 2.76898193028, 6709.67404086740}, {0.00000000046, 3.98449608961, 98068.53671630539}, {0.00000000049, 3.72022009896, 12323.42309600880}, {0.00000000045, 3.30065998328, 22003.91463486980}, {0.00000000048, 0.71071357303, 6303.43116939020}, {0.00000000061, 1.66030429494, 6262.30045449900}, {0.00000000047, 1.26317154881, 11919.14086666800}, {0.00000000051, 1.08020906825, 10988.80815753500}, {0.00000000045, 0.89150445122, 51868.24866217880}, {0.00000000043, 0.57756724285, 24356.78078864160}, {0.00000000043, 1.61526242998, 6277.55292568400}, {0.00000000045, 2.96132920534, 8982.81066930900}, {0.00000000043, 5.74295325645, 11403.67699557500}, {0.00000000055, 3.14274403422, 33019.02111220460}, {0.00000000057, 0.06379726305, 15671.08175940660}, {0.00000000041, 2.53761820726, 6262.72053059260}, {0.00000000040, 1.53130436944, 18451.07854656599}, {0.00000000052, 1.71451922581, 1551.04522264800}, {0.00000000055, 0.89439119424, 11933.36796066960}, {0.00000000045, 3.88495384656, 60530.48898574180}, {0.00000000040, 4.75740908001, 38526.57435087200}, {0.00000000040, 3.77498297348, 26087.90314157420}, {0.00000000039, 2.97113832621, 2118.76386037840}, {0.00000000040, 3.36050962605, 10021.83728009940}, {0.00000000047, 1.67051113434, 6303.85124548380}, {0.00000000052, 5.21827368711, 77713.77146812050}, {0.00000000047, 4.26356628717, 21424.46664430340}, {0.00000000037, 1.66712389942, 6819.88036208680}, {0.00000000037, 0.65746800933, 12029.34718788740}, {0.00000000035, 3.36255650927, 24072.92146977640}, {0.00000000036, 0.11087914947, 10344.29506538580}, {0.00000000040, 4.14725582115, 2787.04302385740}, {0.00000000035, 5.93650887012, 31570.79964939120}, {0.00000000036, 2.15108874765, 30774.50164257480}, {0.00000000036, 1.75078825382, 16207.88627150200}, {0.00000000034, 2.75708224536, 12139.55350910680}, {0.00000000034, 6.16891378800, 24491.42579258340}, {0.00000000034, 2.31528650443, 55798.45835839840}, {0.00000000032, 4.21446357042, 15664.03552270859}, {0.00000000034, 3.19783054699, 32217.20018108080}, {0.00000000039, 1.24979117796, 6418.14093002680}, {0.00000000038, 5.89832942685, 640.87760738220}, {0.00000000033, 4.80200120107, 16723.35014259500}, {0.00000000032, 1.72442327688, 27433.88921587499}, {0.00000000035, 4.44608896525, 18202.21671665939}, {0.00000000031, 4.52790731280, 6702.56049386660}, {0.00000000034, 3.96287980676, 18216.44381066100}, {0.00000000030, 5.06259854444, 226858.23855437008}, {0.00000000034, 1.43910280005, 49515.38250840700}, {0.00000000030, 0.29303163371, 13521.75144159140}, {0.00000000029, 2.02633840220, 11609.86254401220}, {0.00000000030, 2.54923230240, 9924.81042151060}, {0.00000000032, 4.91793198558, 11300.58422135640}, {0.00000000030, 0.23284423547, 23581.25817731760}, {0.00000000029, 1.62807736495, 639.89728631400}, {0.00000000028, 3.84568936822, 2699.73481931760}, {0.00000000029, 1.83149729794, 29822.78323632420}, {0.00000000033, 4.60320094415, 19004.64794940840}, {0.00000000027, 1.86151121799, 6288.59877429880}, {0.00000000030, 4.46494072240, 36147.40987730040}, {0.00000000028, 5.19684492912, 5863.59120611620}, {0.00000000035, 4.52695674113, 36949.23080842420}, {0.00000000027, 3.52528177609, 10770.89325626180}, {0.00000000026, 1.48499438453, 11080.17157891760}, {0.00000000035, 2.82154380962, 19402.79695281660}, {0.00000000025, 2.46339998836, 6279.48542133960}, {0.00000000026, 4.97688894643, 16737.57723659660}, {0.00000000027, 0.40827112500, 12964.30070339100}, {0.00000000029, 4.15148654061, 45892.73043315699}, {0.00000000026, 4.56404104286, 17796.95916678580}, {0.00000000025, 2.89309528854, 6286.66627864320}, {0.00000000026, 4.82914580957, 1066.49547719000}, {0.00000000031, 3.93096113738, 29864.33402730900}, {0.00000000024, 6.14987193584, 18606.49894600020}, {0.00000000024, 3.74225964547, 29026.48522950779}, {0.00000000025, 5.70460621565, 27707.54249429480}, {0.00000000025, 5.33928840652, 15141.39079431200}, {0.00000000023, 2.37624087345, 17996.03116822220}, {0.00000000026, 1.34231351782, 18875.52586977400}, {0.00000000022, 5.50791626120, 6245.04817735560}, {0.00000000024, 1.33998410121, 19800.94595622480}, {0.00000000023, 0.22512280890, 6279.78949257360}, {0.00000000022, 1.17576471775, 11925.27409260060}, {0.00000000022, 3.58603606640, 6915.85958930460}, {0.00000000023, 3.21621246666, 6286.36220740920}, {0.00000000029, 2.09564449439, 15265.88651930040}, {0.00000000022, 4.74660932338, 28230.18722269139}, {0.00000000021, 2.30688751432, 5999.21653112620}, {0.00000000028, 3.92087592807, 18208.34994259200}, {0.00000000021, 3.22643339385, 25934.12433108940}, {0.00000000021, 3.04956726238, 6566.93516885660}, {0.00000000027, 5.35645770522, 33794.54372352860}, {0.00000000025, 5.91542362188, 6489.26139842860}, {0.00000000020, 1.52296293311, 135.06508003540}, {0.00000000019, 1.78134428631, 156137.47598479928}, {0.00000000019, 0.34388684087, 5327.47610838280}, {0.00000000026, 3.41701003233, 25287.72379939980}, {0.00000000019, 2.86664271911, 18422.62935909819}, {0.00000000019, 4.71432851499, 77690.75950573849}, {0.00000000019, 2.54227398241, 77736.78343050249}, {0.00000000020, 5.91915117116, 48739.85989708300}, }; static const struct ln_vsop earth_radius_r2[RADIUS_R2] = { {0.00004359385, 5.78455133808, 6283.07584999140}, {0.00000123633, 5.57935427994, 12566.15169998280}, {0.00000012342, 3.14159265359, 0.00000000000}, {0.00000008792, 3.62777893099, 77713.77146812050}, {0.00000005689, 1.86958905084, 5573.14280143310}, {0.00000003302, 5.47034879713, 18849.22754997420}, {0.00000001471, 4.47964125007, 5507.55323866740}, {0.00000001013, 2.81323115556, 5223.69391980220}, {0.00000000854, 3.10776566900, 1577.34354244780}, {0.00000001102, 2.84173992403, 161000.68573767410}, {0.00000000648, 5.47348203398, 775.52261132400}, {0.00000000608, 1.37894173533, 6438.49624942560}, {0.00000000499, 4.41649242250, 6286.59896834040}, {0.00000000416, 0.90332697974, 10977.07880469900}, {0.00000000404, 3.20567269530, 5088.62883976680}, {0.00000000351, 1.81081728907, 5486.77784317500}, {0.00000000466, 3.65086758149, 7084.89678111520}, {0.00000000458, 5.38585314743, 149854.40013480789}, {0.00000000304, 3.51015066341, 796.29800681640}, {0.00000000266, 6.17413982699, 6836.64525283380}, {0.00000000281, 1.83874672540, 4694.00295470760}, {0.00000000262, 1.41420110644, 2146.16541647520}, {0.00000000264, 3.14103683911, 71430.69561812909}, {0.00000000319, 5.35037932146, 3154.68708489560}, {0.00000000238, 2.17695432424, 155.42039943420}, {0.00000000229, 4.75969588070, 7234.79425624200}, {0.00000000291, 4.61776401638, 4690.47983635860}, {0.00000000211, 0.21864885298, 4705.73230754360}, {0.00000000204, 4.22895113488, 1349.86740965880}, {0.00000000195, 4.58550676556, 529.69096509460}, {0.00000000255, 2.81442711144, 1748.01641306700}, {0.00000000182, 5.70454011389, 6040.34724601740}, {0.00000000180, 6.02147727878, 4292.33083295040}, {0.00000000186, 1.58690991244, 6309.37416979120}, {0.00000000167, 2.88802733052, 9437.76293488700}, {0.00000000166, 1.99990574734, 8031.09226305840}, {0.00000000160, 0.04412738495, 2544.31441988340}, {0.00000000197, 2.01089431842, 1194.44701022460}, {0.00000000165, 5.78372596774, 83996.84731811189}, {0.00000000214, 3.38300910371, 7632.94325965020}, {0.00000000140, 0.36669664351, 10447.38783960440}, {0.00000000151, 0.95519595275, 6127.65545055720}, {0.00000000136, 1.48417295645, 2352.86615377180}, {0.00000000128, 5.48057748834, 951.71840625060}, {0.00000000126, 5.26866506592, 6279.55273164240}, {0.00000000127, 3.77552907014, 6812.76681508600}, {0.00000000103, 4.95897533789, 398.14900340820}, {0.00000000104, 0.70183576826, 1592.59601363280}, {0.00000000101, 1.14481598642, 3894.18182954220}, {0.00000000131, 0.76624310306, 553.56940284240}, {0.00000000109, 5.41063597567, 6256.77753019160}, {0.00000000078, 5.84775340741, 242.72860397400}, {0.00000000097, 1.94685257714, 11856.21865142450}, {0.00000000100, 5.19725292131, 244287.60000722769}, {0.00000000076, 0.70480774041, 8429.24126646660}, {0.00000000080, 6.18430772683, 1059.38193018920}, {0.00000000068, 5.29561709093, 14143.49524243060}, {0.00000000085, 5.39487308005, 25132.30339996560}, {0.00000000055, 5.16874637579, 7058.59846131540}, {0.00000000063, 0.48494730699, 801.82093112380}, {0.00000000058, 4.07254840265, 13367.97263110660}, {0.00000000051, 3.89696552232, 12036.46073488820}, {0.00000000051, 5.56335232286, 1990.74501704100}, {0.00000000060, 2.25046596710, 8635.94200376320}, {0.00000000049, 5.58163417371, 6290.18939699220}, {0.00000000051, 3.87240194908, 26.29831979980}, {0.00000000051, 4.19300909995, 7860.41939243920}, {0.00000000041, 3.97169191582, 10973.55568635000}, {0.00000000041, 3.57080919230, 7079.37385680780}, {0.00000000056, 2.76959005761, 90955.55169449610}, {0.00000000042, 1.91461189163, 7477.52286021600}, {0.00000000042, 0.42775891995, 10213.28554621100}, {0.00000000042, 1.06925480488, 709.93304855830}, {0.00000000038, 6.17935925345, 9917.69687450980}, {0.00000000050, 0.81691517401, 11506.76976979360}, {0.00000000053, 1.45828359397, 233141.31440436149}, {0.00000000038, 3.32444534628, 5643.17856367740}, {0.00000000047, 6.21543665927, 6681.22485339960}, {0.00000000037, 0.36359309980, 10177.25767953360}, {0.00000000045, 5.29587706357, 10575.40668294180}, {0.00000000034, 5.63446915337, 6525.80445396540}, {0.00000000034, 5.36385158519, 4933.20844033260}, {0.00000000035, 5.36152295839, 25158.60171976540}, {0.00000000042, 5.08837645072, 11015.10647733480}, {0.00000000042, 4.22496037505, 88860.05707098669}, {0.00000000039, 1.99171699618, 6284.05617105960}, {0.00000000029, 3.19088628170, 11926.25441366880}, {0.00000000029, 0.14996158324, 12168.00269657460}, {0.00000000030, 1.58346276808, 9779.10867612540}, {0.00000000026, 4.16210340581, 12569.67481833180}, {0.00000000036, 2.74684637873, 3738.76143010800}, {0.00000000026, 0.72824915320, 1589.07289528380}, {0.00000000031, 5.34906371821, 143571.32428481648}, {0.00000000025, 0.10240267494, 22483.84857449259}, {0.00000000030, 3.47110495524, 14945.31617355440}, {0.00000000026, 3.89359701125, 5753.38488489680}, {0.00000000024, 1.18744224678, 4535.05943692440}, {0.00000000033, 2.99317143244, 3930.20969621960}, {0.00000000024, 1.57253767584, 6496.37494542940}, {0.00000000024, 3.47434797542, 4136.91043351620}, {0.00000000022, 3.91230073719, 6275.96230299060}, {0.00000000025, 4.02978941287, 3128.38876509580}, {0.00000000023, 1.07724492065, 12721.57209941700}, {0.00000000021, 1.89591807148, 16730.46368959580}, {0.00000000025, 2.42198937013, 5729.50644714900}, {0.00000000020, 1.78163489101, 17789.84561978500}, {0.00000000021, 0.49258939822, 29088.81141598500}, {0.00000000026, 4.14947806747, 2388.89402044920}, {0.00000000027, 2.54785812264, 3496.03282613400}, {0.00000000020, 4.29944129273, 16858.48253293320}, {0.00000000021, 5.97796936723, 7.11354700080}, {0.00000000019, 0.80292033311, 16062.18452611680}, {0.00000000024, 4.89894141052, 17260.15465469040}, {0.00000000025, 1.37003752175, 6282.09552892320}, {0.00000000022, 4.92663152168, 18875.52586977400}, {0.00000000023, 5.68902059771, 16460.33352952499}, {0.00000000023, 3.03021283729, 66567.48586525429}, {0.00000000016, 3.89713736666, 5331.35744374080}, {0.00000000016, 5.68562539832, 12559.03815298200}, {0.00000000016, 3.95085099736, 3097.88382272579}, {0.00000000016, 3.99041783945, 6283.14316029419}, {0.00000000020, 6.10643919100, 167283.76158766549}, {0.00000000015, 4.09775914607, 11712.95531823080}, {0.00000000016, 5.71769940700, 17298.18232732620}, {0.00000000016, 3.28894009404, 5884.92684658320}, {0.00000000015, 4.42564243680, 13517.87010623340}, {0.00000000016, 4.43452080930, 6283.00853968860}, {0.00000000014, 1.44384279999, 4164.31198961300}, {0.00000000014, 4.47380919159, 11790.62908865880}, {0.00000000014, 4.77646531825, 7342.45778018060}, {0.00000000011, 2.56768522896, 5481.25491886760}, {0.00000000011, 1.51443332200, 16200.77272450120}, {0.00000000011, 0.88708889185, 21228.39202354580}, {0.00000000014, 4.50116508534, 640.87760738220}, }; static const struct ln_vsop earth_radius_r3[RADIUS_R3] = { {0.00000144595, 4.27319433901, 6283.07584999140}, {0.00000006729, 3.91706261708, 12566.15169998280}, {0.00000000774, 0.00000000000, 0.00000000000}, {0.00000000247, 3.73021571217, 18849.22754997420}, {0.00000000036, 2.80081409050, 6286.59896834040}, {0.00000000033, 5.62990083112, 6127.65545055720}, {0.00000000018, 3.72826142555, 6438.49624942560}, {0.00000000016, 4.26011484232, 6525.80445396540}, {0.00000000014, 3.47817116396, 6256.77753019160}, {0.00000000012, 3.55747379482, 25132.30339996560}, {0.00000000010, 4.43995693209, 4705.73230754360}, {0.00000000010, 4.28045255470, 83996.84731811189}, {0.00000000009, 5.36457057335, 6040.34724601740}, {0.00000000008, 1.78458957263, 5507.55323866740}, {0.00000000009, 0.47275199930, 6279.55273164240}, {0.00000000009, 1.34741231639, 6309.37416979120}, {0.00000000009, 0.77092900708, 5729.50644714900}, {0.00000000007, 3.50146897332, 7058.59846131540}, {0.00000000005, 2.89071061700, 775.52261132400}, {0.00000000006, 2.36514111314, 6836.64525283380}, }; static const struct ln_vsop earth_radius_r4[RADIUS_R4] = { {0.00000003858, 2.56389016346, 6283.07584999140}, {0.00000000306, 2.26911740541, 12566.15169998280}, {0.00000000053, 3.44031471924, 5573.14280143310}, {0.00000000015, 2.03136359366, 18849.22754997420}, {0.00000000013, 2.05688873673, 77713.77146812050}, {0.00000000007, 4.41218854480, 161000.68573767410}, {0.00000000004, 5.33854414781, 6438.49624942560}, {0.00000000006, 3.81514213664, 149854.40013480789}, {0.00000000004, 4.26602478239, 6127.65545055720}, }; static const struct ln_vsop earth_radius_r5[RADIUS_R5] = { {0.00000000086, 1.21805304895, 6283.07584999140}, {0.00000000012, 0.65572878044, 12566.15169998280}, }; /* Use in earth-sun function */ double ln_calc_series(const struct ln_vsop *data, int terms, double t) { double value = 0; int i; for (i = 0; i < terms; i++) { value += data->A * cos(data->B + data->C * t); data++; } return value; } /* Get Julian day from Gregorian year, month and day */ double julian_int(int year, int month, int day) { int a, b; if (month < 3) { year--; month += 12; } /* check for Julian or Gregorian calendar (starts Oct 4th 1582) */ b = 0; if (year > 1582 || (year == 1582 && (month > 10 || (month == 10 && day >= 4)))) { a = year / 100; b = 2 - a + (a / 4); } return ((int)(365.25 * (year + 4716)) + (int)(30.6001 * (month + 1)) + day + b - 1524.5); } /* Get Julian day form Gregorian string yyyy-mm-dd */ double julian_char(char date[]) { int day, month, year; year = atoi(date); month = atoi(date + 5); day = atoi(date + 8); return julian_int(year, month, day); } /* Earth-Sun distance in astronomical units */ double earth_sun(char *date) { double t; double R0, R1, R2, R3, R4, R5; t = (julian_char(date) - 2451545.0) / 365250.0; R0 = ln_calc_series(earth_radius_r0, RADIUS_R0, t); R1 = ln_calc_series(earth_radius_r1, RADIUS_R1, t); R2 = ln_calc_series(earth_radius_r2, RADIUS_R2, t); R3 = ln_calc_series(earth_radius_r3, RADIUS_R3, t); R4 = ln_calc_series(earth_radius_r4, RADIUS_R4, t); R5 = ln_calc_series(earth_radius_r5, RADIUS_R5, t); return (R0 + R1 * t + R2 * t * t + R3 * t * t * t + R4 * t * t * t * t + R5 * t * t * t * t * t); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/landsat_toar_core.h000066400000000000000000000050441224124640700310330ustar00rootroot00000000000000#ifndef _LANDSAT_H #define _LANDSAT_H #define UNCORRECTED 0 #define CORRECTED 1 #define DOS 10 #define DOS1 12 #define DOS2 14 #define DOS2b 15 #define DOS3 16 #define DOS4 18 #define NOMETADATAFILE 0 #define METADATAFILE 1 /***************************************************** * Landsat Structures * * Lmax and Lmin in W / (m^2 * sr * m) -> Radiance * Esun in W / (m^2 * m) -> Irradiance ****************************************************/ #define MAX_BANDS 9 typedef struct { int number; /* Band number */ int code; /* Band code */ double wavemax, wavemin; /* Wavelength in m */ double lmax, lmin; /* Spectral radiance */ double qcalmax, qcalmin; /* Quantized calibrated pixel */ double esun; /* Mean solar irradiance */ char thermal; /* Flag to thermal band */ double gain, bias; /* Gain and Bias of sensor */ double K1, K2; /* Thermal calibration constants, or Rad2Ref constants */ } band_data; typedef struct { int flag; unsigned char number; /* Landsat number */ char creation[11]; /* Image production date */ char date[11]; /* Image acquisition date */ double dist_es; /* Distance Earth-Sun */ double sun_elev; /* Solar elevation */ char sensor[5]; /* Type of sensor: MSS, TM, ETM+ */ int bands; /* Total number of bands */ band_data band[MAX_BANDS]; /* Data for each band */ } lsat_data; /***************************************************************************** * Landsat Equations Prototypes *****************************************************************************/ double lsat_qcal2rad(double, band_data *); double lsat_rad2ref(double, band_data *); double lsat_rad2temp(double, band_data *); void lsat_bandctes(lsat_data *, int, char, double, int, double); //--------------------------------------------------------- int lsat_mtldata(const char *, lsat_data *); int lsat_metdata(const char *, lsat_data *); int lsat_newdata(const char *, lsat_data *); void set_MSS1(lsat_data *); void set_MSS2(lsat_data *); void set_MSS3(lsat_data *); void set_MSS4(lsat_data *); void set_MSS5(lsat_data *); void set_TM4(lsat_data *); void set_TM5(lsat_data *); void set_ETM(lsat_data *, const char[]); //--------------------------------------------------------- void G_debug (int i, const char *s); void G_warning (const char *s); #endif saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/pansharpening.cpp000066400000000000000000000573141224124640700305470ustar00rootroot00000000000000/********************************************************** * Version $Id: pansharp_pca.cpp 1081 2011-06-08 08:05:26Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_tools // // // //-------------------------------------------------------// // // // pansharpening.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pansharpening.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- TSG_Grid_Interpolation Get_Interpolation(int Interpolation) { switch( Interpolation ) { case 0: return( GRID_INTERPOLATION_NearestNeighbour ); case 1: return( GRID_INTERPOLATION_Bilinear ); case 2: default: return( GRID_INTERPOLATION_BSpline ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPanSharp_IHS::CPanSharp_IHS(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("IHS Sharpening")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Intensity, hue, saturation (IHS) sharpening.\n" "\nReferences:\n" "Haydn, R., Dalke, G. W., Henkel, J., Bare, J. E. (1982): " "Application of the IHS color transform to the processing of multisensor data and image enhancement. " "Proceedings of the International Symposium on Remote Sensing of Arid and Semi-Arid Lands, " "Cairo, Egypt (Environmental Research Institute, Ann Arbor, Mich., 1982), pp. 599616.\n" )); //----------------------------------------------------- Parameters.Add_Grid(NULL , "R" , _TL("Red") , _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL , "G" , _TL("Green") , _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL , "B" , _TL("Blue") , _TL(""), PARAMETER_INPUT); pNode = Parameters.Add_Grid_System( NULL , "PAN_SYSTEM" , _TL("High Resolution Grid System"), _TL("") ); Parameters.Add_Grid( pNode , "PAN" , _TL("Panchromatic Channel"), _TL(""), PARAMETER_INPUT, false ); Parameters.Add_Grid(pNode , "R_SHARP" , _TL("Red") , _TL(""), PARAMETER_OUTPUT, false); Parameters.Add_Grid(pNode , "G_SHARP" , _TL("Green") , _TL(""), PARAMETER_OUTPUT, false); Parameters.Add_Grid(pNode , "B_SHARP" , _TL("Blue") , _TL(""), PARAMETER_OUTPUT, false); Parameters.Add_Grid_List( NULL , "SHARPEN" , _TL("Sharpend Channels"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "RESAMPLING" , _TL("Resampling"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("nearest neighbour"), _TL("bilinear"), _TL("cubic convolution") ), 2 ); Parameters.Add_Choice( NULL , "PAN_MATCH" , _TL("Panchromatic Channel Matching"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("normalized"), _TL("standardized") ), 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPanSharp_IHS::On_Execute(void) { //----------------------------------------------------- TSG_Grid_Interpolation Interpolation = Get_Interpolation(Parameters("RESAMPLING")->asInt()); //----------------------------------------------------- int y; double r, g, b, i, h, s; CSG_Grid *pPan, *pR, *pG, *pB; pPan = Parameters("PAN")->asGrid(); //----------------------------------------------------- Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("R")->asGrid()->Get_Name())); pR = Parameters("R_SHARP")->asGrid(); pR ->Assign (Parameters("R")->asGrid(), Interpolation); pR ->Set_Name(Parameters("R")->asGrid()->Get_Name()); Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("G")->asGrid()->Get_Name())); pG = Parameters("G_SHARP")->asGrid(); pG ->Assign (Parameters("G")->asGrid(), Interpolation); pG ->Set_Name(Parameters("G")->asGrid()->Get_Name()); Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("B")->asGrid()->Get_Name())); pB = Parameters("B_SHARP")->asGrid(); pB ->Assign (Parameters("B")->asGrid(), Interpolation); pB ->Set_Name(Parameters("B")->asGrid()->Get_Name()); //----------------------------------------------------- Process_Set_Text(_TL("RGB to IHS")); double rMin = pR->Get_ZMin(), rRange = pR->Get_ZRange(); double gMin = pG->Get_ZMin(), gRange = pG->Get_ZRange(); double bMin = pB->Get_ZMin(), bRange = pB->Get_ZRange(); for(y=0; yGet_NY() && Set_Progress(y, pPan->Get_NY()); y++) { for(int x=0; xGet_NX(); x++) { bool bNoData = true; if( pPan->is_NoData(x, y) || pR->is_NoData(x, y) || pG->is_NoData(x, y) || pB->is_NoData(x, y) ) { pR->Set_NoData(x, y); pG->Set_NoData(x, y); pB->Set_NoData(x, y); } else { r = (pR->asDouble(x, y) - rMin) / rRange; if( r < 0.0 ) r = 0.0; else if( r > 1.0 ) r = 1.0; g = (pG->asDouble(x, y) - gMin) / gRange; if( g < 0.0 ) g = 0.0; else if( g > 1.0 ) g = 1.0; b = (pB->asDouble(x, y) - bMin) / bRange; if( b < 0.0 ) b = 0.0; else if( b > 1.0 ) b = 1.0; i = r + g + b; if( i <= 0.0 ) { h = 0.0; s = 0.0; } else { if( r == g && g == b ) { h = 0.0; } else if( b < r && b < g ) { h = (g - b) / (i - 3 * b) ; } else if( r < g && r < b ) { h = (b - r) / (i - 3 * r) + 1; } else { h = (r - g) / (i - 3 * g) + 2; } if ( 0.0 <= h && h < 1.0 ) { s = (i - 3 * b) / i; } else if( 1.0 <= h && h < 2.0 ) { s = (i - 3 * r) / i; } else { s = (i - 3 * g) / i; } } pR->Set_Value(x, y, i); pG->Set_Value(x, y, s); pB->Set_Value(x, y, h); } } } //----------------------------------------------------- double Offset_Pan, Offset, Scale; if( Parameters("PAN_MATCH")->asInt() == 0 ) { Offset_Pan = pPan->Get_ZMin(); Offset = pR->Get_ZMin(); Scale = pR->Get_ZRange() / pPan->Get_ZRange(); } else { Offset_Pan = pPan->Get_ArithMean(); Offset = pR->Get_ArithMean(); Scale = pR->Get_StdDev() / pPan->Get_StdDev(); } //----------------------------------------------------- Process_Set_Text(_TL("IHS to RGB")); for(y=0; yGet_NY() && Set_Progress(y, pPan->Get_NY()); y++) { for(int x=0; xGet_NX(); x++) { if( !pR->is_NoData(x, y) ) { i = Offset + Scale * (pPan->asDouble(x, y) - Offset_Pan); s = pG ->asDouble(x, y); h = pB ->asDouble(x, y); if ( 0.0 <= h && h < 1.0 ) { r = i * (1 + 2 * s - 3 * s * h) / 3; g = i * (1 - s + 3 * s * h) / 3; b = i * (1 - s ) / 3; } else if( 1.0 <= h && h < 2.0 ) { r = i * (1 - s ) / 3; g = i * (1 + 2 * s - 3 * s * (h - 1)) / 3; b = i * (1 - s + 3 * s * (h - 1)) / 3; } else { r = i * (1 - s + 3 * s * (h - 2)) / 3; g = i * (1 - s ) / 3; b = i * (1 + 2 * s - 3 * s * (h - 2)) / 3; } pR->Set_Value(x, y, rMin + r * rRange); pG->Set_Value(x, y, gMin + g * gRange); pB->Set_Value(x, y, bMin + b * bRange); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPanSharp_Brovey::CPanSharp_Brovey(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Colour Normalized Brovey Sharpening")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Colour normalized (Brovey) sharpening.\n" "\n" "References:\n" "Vrabel, J. (1996): Multispectral Imagery Band Sharpening Study. " "Photogrammetric Engineering & Remote Sensing, Vol. 62, No. 9, pp. 1075-1083.\n" )); //----------------------------------------------------- Parameters.Add_Grid(NULL , "R" , _TL("Red") , _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL , "G" , _TL("Green") , _TL(""), PARAMETER_INPUT); Parameters.Add_Grid(NULL , "B" , _TL("Blue") , _TL(""), PARAMETER_INPUT); pNode = Parameters.Add_Grid_System( NULL , "PAN_SYSTEM" , _TL("High Resolution Grid System"), _TL("") ); Parameters.Add_Grid( pNode , "PAN" , _TL("Panchromatic Channel"), _TL(""), PARAMETER_INPUT, false ); Parameters.Add_Grid(pNode , "R_SHARP" , _TL("Red") , _TL(""), PARAMETER_OUTPUT, false); Parameters.Add_Grid(pNode , "G_SHARP" , _TL("Green") , _TL(""), PARAMETER_OUTPUT, false); Parameters.Add_Grid(pNode , "B_SHARP" , _TL("Blue") , _TL(""), PARAMETER_OUTPUT, false); Parameters.Add_Grid_List( NULL , "SHARPEN" , _TL("Sharpend Channels"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "RESAMPLING" , _TL("Resampling"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("nearest neighbour"), _TL("bilinear"), _TL("cubic convolution") ), 2 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPanSharp_Brovey::On_Execute(void) { //----------------------------------------------------- TSG_Grid_Interpolation Interpolation = Get_Interpolation(Parameters("RESAMPLING")->asInt()); //----------------------------------------------------- CSG_Grid *pPan, *pR, *pG, *pB; pPan = Parameters("PAN")->asGrid(); //----------------------------------------------------- Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("R")->asGrid()->Get_Name())); pR = Parameters("R_SHARP")->asGrid(); pR ->Assign (Parameters("R")->asGrid(), Interpolation); pR ->Set_Name(Parameters("R")->asGrid()->Get_Name()); Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("G")->asGrid()->Get_Name())); pG = Parameters("G_SHARP")->asGrid(); pG ->Assign (Parameters("G")->asGrid(), Interpolation); pG ->Set_Name(Parameters("G")->asGrid()->Get_Name()); Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), Parameters("B")->asGrid()->Get_Name())); pB = Parameters("B_SHARP")->asGrid(); pB ->Assign (Parameters("B")->asGrid(), Interpolation); pB ->Set_Name(Parameters("B")->asGrid()->Get_Name()); //----------------------------------------------------- Process_Set_Text(_TL("Sharpening")); for(int y=0; yGet_NY() && Set_Progress(y, pPan->Get_NY()); y++) { for(int x=0; xGet_NX(); x++) { if( !pPan->is_NoData(x, y) && !pR->is_NoData(x, y) && !pG->is_NoData(x, y) && !pB->is_NoData(x, y) ) { double k = (pR->asDouble(x, y) + pG->asDouble(x, y) + pB->asDouble(x, y)); if( k != 0.0 ) { k = pPan->asDouble(x, y) / k; } pR->Mul_Value(x, y, k); pG->Mul_Value(x, y, k); pB->Mul_Value(x, y, k); } else { pR->Set_NoData(x, y); pG->Set_NoData(x, y); pB->Set_NoData(x, y); } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPanSharp_CN::CPanSharp_CN(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Colour Normalized Spectral Sharpening")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Colour normalized spectral sharpening.\n" "\n" "References:\n" "Vrabel, J., Doraiswamy, P., McMurtrey, J., Stern, A. (2002): " "Demonstration of the Accuracy of Improved Resolution Hyperspectral Imagery. " "SPIE Symposium Proceedings.\n" "\n" "Vrabel, J., Doraiswamy, P., Stern, A. (2002): " "Application of Hyperspectral Imagery Resolution Improvement for Site-Specific Farming. " "ASPRS 2002 Conference Proceedings.\n" )); //----------------------------------------------------- pNode = Parameters.Add_Grid_System( NULL , "LO_RES" , _TL("Low Resolution Grid System"), _TL("") ); Parameters.Add_Grid_List( pNode , "GRIDS" , _TL("Original Channels"), _TL(""), PARAMETER_INPUT, false ); Parameters.Add_Grid( NULL , "PAN" , _TL("Panchromatic Channel"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "SHARPEN" , _TL("Sharpend Channels"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "RESAMPLING" , _TL("Resampling"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("nearest neighbour"), _TL("bilinear"), _TL("cubic convolution") ), 2 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPanSharp_CN::On_Execute(void) { //----------------------------------------------------- TSG_Grid_Interpolation Interpolation = Get_Interpolation(Parameters("RESAMPLING")->asInt()); //----------------------------------------------------- int i; CSG_Grid *pPan; CSG_Parameter_Grid_List *pGrids, *pSharp; pPan = Parameters("PAN" )->asGrid(); pGrids = Parameters("GRIDS" )->asGridList(); pSharp = Parameters("SHARPEN")->asGridList(); //----------------------------------------------------- pSharp->Del_Items(); for(i=0; iGet_Count(); i++) { Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), pGrids->asGrid(i)->Get_Name())); CSG_Grid *pGrid = SG_Create_Grid(*Get_System()); pGrid->Set_Name (pGrids->asGrid(i)->Get_Name()); pGrid->Assign (pGrids->asGrid(i), Interpolation); pSharp->Add_Item(pGrid); } //----------------------------------------------------- for(int y=0; yis_NoData(x, y) ) { for(i=0; iGet_Count(); i++) { if( !pSharp->asGrid(i)->is_NoData(x, y) ) { Sum += pSharp->asGrid(i)->asDouble (x, y); } else { Sum = 0.0; break; } } } if( Sum ) { Sum = pPan->asDouble(x, y) * pSharp->Get_Count() / (Sum + pSharp->Get_Count()); for(i=0; iGet_Count(); i++) { pSharp->asGrid(i)->Mul_Value(x, y, Sum); } } else { for(i=0; iGet_Count(); i++) { pSharp->asGrid(i)->Set_NoData(x, y); } } } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPanSharp_PCA::CPanSharp_PCA(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Principle Components Based Image Sharpening")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Principle components based image sharpening." )); //----------------------------------------------------- pNode = Parameters.Add_Grid_System( NULL , "LO_RES" , _TL("Low Resolution Grid System"), _TL("") ); Parameters.Add_Grid_List( pNode , "GRIDS" , _TL("Original Channels"), _TL(""), PARAMETER_INPUT, false ); Parameters.Add_Grid( NULL , "PAN" , _TL("Panchromatic Channel"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid_List( NULL , "SHARPEN" , _TL("Sharpend Channels"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Method"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("correlation matrix"), _TL("variance-covariance matrix"), _TL("sums-of-squares-and-cross-products matrix") ), 1 ); Parameters.Add_Choice( NULL , "RESAMPLING" , _TL("Resampling"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("nearest neighbour"), _TL("bilinear"), _TL("cubic convolution") ), 2 ); Parameters.Add_Choice( NULL , "PAN_MATCH" , _TL("Panchromatic Channel Matching"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("normalized"), _TL("standardized") ), 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define RUN_MODULE(BRETVAL, LIBRARY, MODULE, PARAMETERS, GRIDSYSTEM, CONDITION) {\ \ BRETVAL = false;\ \ CSG_Module *pModule = SG_Get_Module_Library_Manager().Get_Module(SG_T(LIBRARY), MODULE);\ \ if( pModule == NULL )\ {\ Error_Set(CSG_String::Format(SG_T("%s: %s"), _TL("could not find module"), SG_T(LIBRARY)));\ }\ else if( pModule->is_Grid() )\ {\ Process_Set_Text(pModule->Get_Name());\ \ CSG_Parameters P_tmp; P_tmp.Assign(pModule->Get_Parameters());\ \ pModule->Set_Manager(NULL);\ \ ((CSG_Module_Grid *)pModule)->Get_System()->Assign(GRIDSYSTEM);\ \ if( !(CONDITION) )\ {\ Error_Set(CSG_String::Format(SG_T("%s: %s > %s"), _TL("could not initialize module"), SG_T(LIBRARY), pModule->Get_Name().c_str()));\ }\ else if( !pModule->Execute() )\ {\ Error_Set(CSG_String::Format(SG_T("%s: %s > %s"), _TL("could not execute module") , SG_T(LIBRARY), pModule->Get_Name().c_str()));\ }\ else\ {\ BRETVAL = true;\ }\ \ PARAMETERS.Assign(pModule->Get_Parameters());\ \ pModule->Get_Parameters()->Assign_Values(&P_tmp);\ }\ } //--------------------------------------------------------- #define SET_PARAMETER(IDENTIFIER, VALUE) pModule->Get_Parameters()->Set_Parameter(SG_T(IDENTIFIER), VALUE) /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CPanSharp_PCA::On_Execute(void) { //----------------------------------------------------- TSG_Grid_Interpolation Interpolation = Get_Interpolation(Parameters("RESAMPLING")->asInt()); //----------------------------------------------------- bool bResult; CSG_Parameters P; CSG_Table Eigen; //----------------------------------------------------- RUN_MODULE(bResult, "geostatistics_grid", 8, P, Parameters("GRIDS")->asGridList()->asGrid(0)->Get_System(), SET_PARAMETER("GRIDS" , Parameters("GRIDS")) && SET_PARAMETER("METHOD" , Parameters("METHOD")) && SET_PARAMETER("EIGEN" , &Eigen) && SET_PARAMETER("NFIRST" , 0) ); if( !bResult ) { return( false ); } //----------------------------------------------------- CSG_Parameter_Grid_List *pPCA_0 = P.Get_Parameter("PCA")->asGridList(); CSG_Parameter_Grid_List *pPCA_1 = P.Add_Grid_List(NULL, "PCA_1", SG_T(""), SG_T(""), PARAMETER_INPUT, false)->asGridList(); CSG_Grid *PCA = new CSG_Grid[pPCA_0->Get_Count()]; CSG_Grid *pPan = Parameters("PAN")->asGrid(); double Offset_Pan, Offset, Scale; if( Parameters("PAN_MATCH")->asInt() == 0 ) { Offset_Pan = pPan->Get_ZMin(); Offset = pPCA_0->asGrid(0)->Get_ZMin(); Scale = pPCA_0->asGrid(0)->Get_ZRange() / pPan->Get_ZRange(); } else { Offset_Pan = pPan->Get_ArithMean(); Offset = pPCA_0->asGrid(0)->Get_ArithMean(); Scale = pPCA_0->asGrid(0)->Get_StdDev() / pPan->Get_StdDev(); } PCA[0].Create(*Get_System()); for(int y=0; yis_NoData(x, y) ) { PCA[0].Set_NoData(x, y); } else { PCA[0].Set_Value(x, y, Offset + Scale * (pPan->asDouble(x, y) - Offset_Pan)); } } } pPCA_1->Add_Item(&PCA[0]); delete(pPCA_0->asGrid(0)); for(int i=1; iGet_Count(); i++) { Process_Set_Text(CSG_String::Format(SG_T("%s: %s ..."), _TL("Resampling"), pPCA_0->asGrid(i)->Get_Name())); PCA[i].Create(*Get_System()); PCA[i].Assign(pPCA_0->asGrid(i), Interpolation); pPCA_1->Add_Item(&PCA[i]); delete(pPCA_0->asGrid(i)); } //----------------------------------------------------- RUN_MODULE(bResult, "geostatistics_grid", 10, P, *Get_System(), SET_PARAMETER("PCA" , P("PCA_1")) && SET_PARAMETER("GRIDS" , Parameters("SHARPEN")) && SET_PARAMETER("EIGEN" , &Eigen) ); delete[](PCA); if( !bResult ) { return( false ); } Parameters.Set_Parameter("SHARPEN", P.Get_Parameter("GRIDS")); CSG_Parameter_Grid_List *pGrids = Parameters("GRIDS" )->asGridList(); CSG_Parameter_Grid_List *pSharp = Parameters("SHARPEN")->asGridList(); for(int j=0; jGet_Count() && jGet_Count(); j++) { pSharp->asGrid(j)->Set_Name(pGrids->asGrid(j)->Get_Name()); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/pansharpening.h000066400000000000000000000133421224124640700302050ustar00rootroot00000000000000/********************************************************** * Version $Id: pansharp_pca.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_tools // // // //-------------------------------------------------------// // // // pansharpening.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__pansharpening_pca_H #define HEADER_INCLUDED__pansharpening_pca_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPanSharp_IHS : public CSG_Module_Grid { public: CPanSharp_IHS(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Image Sharpening") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPanSharp_Brovey : public CSG_Module_Grid { public: CPanSharp_Brovey(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Image Sharpening") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPanSharp_CN : public CSG_Module_Grid { public: CPanSharp_CN(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Image Sharpening") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPanSharp_PCA : public CSG_Module_Grid { public: CPanSharp_PCA(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Image Sharpening") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__pansharpening_pca_H saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/tasseled_cap.cpp000066400000000000000000000210561224124640700303330ustar00rootroot00000000000000/********************************************************** * Version $Id: evi.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_tools // // // //-------------------------------------------------------// // // // tasseled_cap.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "tasseled_cap.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTasseled_Cap::CTasseled_Cap(void) { Set_Name (_TL("Tasseled Cap Transformation")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Tasseled Cap Transformation as proposed for Landsat Thematic Mapper.\n" "\n" "References:\n" "Kauth R. J. und G. S. Thomas (1976): " "The Tasseled Cap - A Graphic Description of the Spectral-Temporal Development of Agricultural Crops as Seen by LANDSAT. " "Proceedings of the Symposium on Machine Processing of Remotely Sensed Data. " "online at Purdue University\n" "\n" "Huang, C., B. Wylie, L. Yang, C. Homer, and G. Zylstra. " "Derivation of a Tasseled Cap Transformation Based on Landsat 7 At-Satellite Reflectance. " "USGS EROS Data Center White Paper. " "online at USGS\n" )); Parameters.Add_Grid( NULL, "BLUE" , _TL("Blue (TM 1)"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Grid( NULL, "RED" , _TL("Red (TM 2)"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "GREEN" , _TL("Green (TM 3)"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "NIR" , _TL("Near Infrared (TM 4)"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "MIR1" , _TL("Mid Infrared (TM 5)"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "MIR2" , _TL("Mid Infrared (TM 7)"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL, "BRIGHTNESS" , _TL("Brightness"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL, "GREENNESS" , _TL("Greenness"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL, "WETNESS" , _TL("Wetness"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTasseled_Cap::On_Execute(void) { CSG_Grid *pBand[6], *pBright, *pGreen, *pWet; pBand[0] = Parameters("BLUE" )->asGrid(); pBand[1] = Parameters("GREEN" )->asGrid(); pBand[2] = Parameters("RED" )->asGrid(); pBand[3] = Parameters("NIR" )->asGrid(); pBand[4] = Parameters("MIR1" )->asGrid(); pBand[5] = Parameters("MIR2" )->asGrid(); pBright = Parameters("BRIGHTNESS")->asGrid(); pGreen = Parameters("GREENNESS" )->asGrid(); pWet = Parameters("WETNESS" )->asGrid(); DataObject_Set_Colors(pBright, 100, SG_COLORS_BLACK_WHITE , false); DataObject_Set_Colors(pGreen , 100, SG_COLORS_WHITE_GREEN , false); DataObject_Set_Colors(pWet , 100, SG_COLORS_RED_GREY_BLUE, false); for(int y=0; yis_NoData(x, y) || pBand[1]->is_NoData(x, y) || pBand[2]->is_NoData(x, y) || pBand[3]->is_NoData(x, y) || pBand[4]->is_NoData(x, y) || pBand[5]->is_NoData(x, y) ) { pBright ->Set_NoData(x, y); pGreen ->Set_NoData(x, y); pWet ->Set_NoData(x, y); } else { double b[6]; b[0] = pBand[0]->asDouble(x, y); b[1] = pBand[1]->asDouble(x, y); b[2] = pBand[2]->asDouble(x, y); b[3] = pBand[3]->asDouble(x, y); b[4] = pBand[4]->asDouble(x, y); b[5] = pBand[5]->asDouble(x, y); pBright ->Set_Value(x, y, 0.3037 * b[0] + 0.2793 * b[1] + 0.4743 * b[2] + 0.5585 * b[3] + 0.5082 * b[4] + 0.1863 * b[5] ); pGreen ->Set_Value(x, y, -0.2848 * b[0] - 0.2435 * b[1] - 0.5436 * b[2] + 0.7243 * b[3] + 0.0840 * b[4] - 0.1800 * b[5] ); pWet ->Set_Value(x, y, 0.1509 * b[0] + 0.1973 * b[1] + 0.3279 * b[2] + 0.3406 * b[3] - 0.7112 * b[4] - 0.4572 * b[5] ); } } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_imagery/imagery_tools/tasseled_cap.h000066400000000000000000000112351224124640700277760ustar00rootroot00000000000000/********************************************************** * Version $Id: Image_VI_Slope.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // imagery_tools // // // //-------------------------------------------------------// // // // tasseled_cap.h // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__tasseled_cap_H #define HEADER_INCLUDED__tasseled_cap_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTasseled_Cap : public CSG_Module_Grid { public: CTasseled_Cap(void); virtual CSG_String Get_MenuPath (void) { return( _TL("Vegetation Indices") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__tasseled_cap_H saga-2.1.0+dfsg/src/modules_images/modules_opencv/000077500000000000000000000000001224124640700221545ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_opencv/Makefile.am000066400000000000000000000000221224124640700242020ustar00rootroot00000000000000SUBDIRS = opencv saga-2.1.0+dfsg/src/modules_images/modules_opencv/Makefile.in000066400000000000000000000425041224124640700242260ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_images/modules_opencv DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = opencv all: all-recursive .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) --gnu src/modules_images/modules_opencv/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_images/modules_opencv/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/000077500000000000000000000000001224124640700234465ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/MLB_Interface.cpp000066400000000000000000000113601224124640700265450ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // OpenCV // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Imagery - OpenCV") ); case MLB_INFO_Author: return( _TL("O. Conrad (c) 2009") ); case MLB_INFO_Description: return( _TW( "OpenCV, the \"Open Source Computer Vision Library\". " "Find out more at the OpenCV - Open Source Computer Vision - homepage:\n" "" "http://opencv.willowgarage.com" )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Imagery|OpenCV") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "opencv_morphology.h" #include "opencv_fourier.h" #include "opencv_svd.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new COpenCV_Morphology ); case 1: return( new COpenCV_FFT ); case 2: return( new COpenCV_SVD ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/MLB_Interface.h000066400000000000000000000072231224124640700262150ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // OpenCV // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__MLB_OPENCV_H #define HEADER_INCLUDED__MLB_OPENCV_H //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__MLB_OPENCV_H saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/Makefile.am000066400000000000000000000013521224124640700255030ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif if HAVE_CV DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core -I/usr/include/opencv AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version -lcv pkglib_LTLIBRARIES = libopencv.la libopencv_la_SOURCES =\ MLB_Interface.cpp\ opencv.cpp\ opencv_fourier.cpp\ opencv_morphology.cpp\ opencv_svd.cpp\ MLB_Interface.h\ opencv.h\ opencv_fourier.h\ opencv_morphology.h\ opencv_svd.h libopencv_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la endif saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/Makefile.in000066400000000000000000000460331224124640700255210ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_images/modules_opencv/opencv DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) @HAVE_CV_TRUE@libopencv_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am__libopencv_la_SOURCES_DIST = MLB_Interface.cpp opencv.cpp \ opencv_fourier.cpp opencv_morphology.cpp opencv_svd.cpp \ MLB_Interface.h opencv.h opencv_fourier.h opencv_morphology.h \ opencv_svd.h @HAVE_CV_TRUE@am_libopencv_la_OBJECTS = MLB_Interface.lo opencv.lo \ @HAVE_CV_TRUE@ opencv_fourier.lo opencv_morphology.lo \ @HAVE_CV_TRUE@ opencv_svd.lo libopencv_la_OBJECTS = $(am_libopencv_la_OBJECTS) @HAVE_CV_TRUE@am_libopencv_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libopencv_la_SOURCES) DIST_SOURCES = $(am__libopencv_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE @HAVE_CV_TRUE@DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD @HAVE_CV_TRUE@CXX_INCS = -I$(top_srcdir)/src/saga_core -I/usr/include/opencv @HAVE_CV_TRUE@AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) @HAVE_CV_TRUE@AM_LDFLAGS = -fPIC -shared -avoid-version -lcv @HAVE_CV_TRUE@pkglib_LTLIBRARIES = libopencv.la @HAVE_CV_TRUE@libopencv_la_SOURCES = \ @HAVE_CV_TRUE@MLB_Interface.cpp\ @HAVE_CV_TRUE@opencv.cpp\ @HAVE_CV_TRUE@opencv_fourier.cpp\ @HAVE_CV_TRUE@opencv_morphology.cpp\ @HAVE_CV_TRUE@opencv_svd.cpp\ @HAVE_CV_TRUE@MLB_Interface.h\ @HAVE_CV_TRUE@opencv.h\ @HAVE_CV_TRUE@opencv_fourier.h\ @HAVE_CV_TRUE@opencv_morphology.h\ @HAVE_CV_TRUE@opencv_svd.h @HAVE_CV_TRUE@libopencv_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_images/modules_opencv/opencv/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_images/modules_opencv/opencv/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libopencv.la: $(libopencv_la_OBJECTS) $(libopencv_la_DEPENDENCIES) $(CXXLINK) $(am_libopencv_la_rpath) $(libopencv_la_OBJECTS) $(libopencv_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opencv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opencv_fourier.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opencv_morphology.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opencv_svd.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/opencv.cpp000066400000000000000000000172511224124640700254520ustar00rootroot00000000000000/********************************************************** * Version $Id: opencv.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // OpenCV // // // //-------------------------------------------------------// // // // opencv.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "opencv.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int Get_CVType (TSG_Data_Type Type) { switch( Type ) { case SG_DATATYPE_Bit: case SG_DATATYPE_Byte: return( IPL_DEPTH_8U ); // Unsigned 8-bit integer case SG_DATATYPE_Char: return( IPL_DEPTH_8S ); // Signed 8-bit integer case SG_DATATYPE_Word: return( IPL_DEPTH_16U ); // Unsigned 16-bit integer case SG_DATATYPE_Short: return( IPL_DEPTH_16S ); // Signed 16-bit integer case SG_DATATYPE_Color: case SG_DATATYPE_DWord: case SG_DATATYPE_ULong: case SG_DATATYPE_Long: case SG_DATATYPE_Int: return( IPL_DEPTH_32S ); // Signed 32-bit integer default: case SG_DATATYPE_Float: return( IPL_DEPTH_32F ); // Single-precision floating point case SG_DATATYPE_Double: return( IPL_DEPTH_64F ); // Double-precision floating point } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool Copy_Grid_To_CVImage(CSG_Grid *pGrid, IplImage *pImage, bool bCheckSize) { if( pImage && pGrid && (!bCheckSize || (pGrid->Get_NX() == pImage->width && pGrid->Get_NY() == pImage->height)) ) { int nx = pGrid->Get_NX() < pImage->width ? pGrid->Get_NX() : pImage->width; int ny = pGrid->Get_NY() < pImage->height ? pGrid->Get_NY() : pImage->height; for(int y=0; ydepth ) { case IPL_DEPTH_8U: Row.data.ptr[x] = pGrid->asByte (x, y); break; case IPL_DEPTH_8S: Row.data.ptr[x] = pGrid->asByte (x, y); break; case IPL_DEPTH_16U: Row.data.s [x] = pGrid->asShort (x, y); break; case IPL_DEPTH_16S: Row.data.s [x] = pGrid->asShort (x, y); break; case IPL_DEPTH_32S: Row.data.i [x] = pGrid->asInt (x, y); break; case IPL_DEPTH_32F: Row.data.fl [x] = pGrid->asFloat (x, y); break; case IPL_DEPTH_64F: Row.data.db [x] = pGrid->asDouble(x, y); break; } } } return( true ); } return( false ); } //--------------------------------------------------------- bool Copy_CVImage_To_Grid(CSG_Grid *pGrid, IplImage *pImage, bool bCheckSize) { if( pImage && pGrid && (!bCheckSize || (pGrid->Get_NX() == pImage->width && pGrid->Get_NY() == pImage->height)) ) { int nx = pGrid->Get_NX() < pImage->width ? pGrid->Get_NX() : pImage->width; int ny = pGrid->Get_NY() < pImage->height ? pGrid->Get_NY() : pImage->height; for(int y=0; ydepth ) { case IPL_DEPTH_8U: pGrid->Set_Value(x, y, Row.data.ptr[x]); break; case IPL_DEPTH_8S: pGrid->Set_Value(x, y, ((char *)Row.data.ptr)[x]); break; case IPL_DEPTH_16U: pGrid->Set_Value(x, y, ((WORD *)Row.data.s )[x]); break; case IPL_DEPTH_16S: pGrid->Set_Value(x, y, Row.data.s [x]); break; case IPL_DEPTH_32S: pGrid->Set_Value(x, y, Row.data.i [x]); break; case IPL_DEPTH_32F: pGrid->Set_Value(x, y, Row.data.fl [x]); break; case IPL_DEPTH_64F: pGrid->Set_Value(x, y, Row.data.db [x]); break; } } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- IplImage * Get_CVImage(int nx, int ny, TSG_Data_Type Type) { if( nx > 0 && ny > 0 ) { CvSize Size; Size.width = nx; Size.height = ny; return( cvCreateImage(Size, Get_CVType(Type), 1) ); } return( NULL ); } //--------------------------------------------------------- IplImage * Get_CVImage(CSG_Grid *pGrid, TSG_Data_Type Type) { IplImage *pImage = NULL; if( pGrid && (pImage = Get_CVImage(pGrid->Get_NX(), pGrid->Get_NY(), Type == SG_DATATYPE_Undefined ? pGrid->Get_Type() : Type)) != NULL ) { Copy_Grid_To_CVImage(pGrid, pImage); } return( pImage ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/opencv.h000066400000000000000000000111741224124640700251150ustar00rootroot00000000000000/********************************************************** * Version $Id: opencv.h 1044 2011-05-04 15:55:59Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // OpenCV // // // //-------------------------------------------------------// // // // opencv.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__opencv_H #define HEADER_INCLUDED__opencv_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int Get_CVType (TSG_Data_Type Type); //--------------------------------------------------------- bool Copy_Grid_To_CVImage (CSG_Grid *pGrid, IplImage *pImage, bool bCheckSize = true); bool Copy_CVImage_To_Grid (CSG_Grid *pGrid, IplImage *pImage, bool bCheckSize = true); //--------------------------------------------------------- IplImage * Get_CVImage (int nx, int ny , TSG_Data_Type Type); IplImage * Get_CVImage (CSG_Grid *pGrid, TSG_Data_Type Type = SG_DATATYPE_Undefined); /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__opencv_H saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/opencv_fourier.cpp000066400000000000000000000236501224124640700272050ustar00rootroot00000000000000/********************************************************** * Version $Id: opencv_fourier.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // OpenCV // // // //-------------------------------------------------------// // // // opencv_fourier.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "opencv_fourier.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool DFT (IplImage *pInput, IplImage **ppReal, IplImage **ppImag); /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- COpenCV_FFT::COpenCV_FFT(void) { Set_Name (_TL("OpenCV - Fourier Transformation")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "References:\n" "OpenCV - Open Source Computer Vision\n" "http://opencv.willowgarage.com" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "REAL" , _TL("Fourier Transformation (Real)"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "IMAG" , _TL("Fourier Transformation (Imaginary)"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool COpenCV_FFT::On_Execute(void) { CSG_Grid *pInput, *pReal, *pImag; pInput = Parameters("INPUT") ->asGrid(); pReal = Parameters("REAL") ->asGrid(); pImag = Parameters("IMAG") ->asGrid(); //----------------------------------------------------- IplImage *cv_pInput = Get_CVImage(pInput, SG_DATATYPE_Float); IplImage *cv_pReal = NULL;// Get_CVImage(Get_NX(), Get_NY(), SG_DATATYPE_Float); IplImage *cv_pImag = NULL;// Get_CVImage(Get_NX(), Get_NY(), SG_DATATYPE_Float); //----------------------------------------------------- DFT(cv_pInput, &cv_pReal, &cv_pImag); //----------------------------------------------------- Copy_CVImage_To_Grid(pReal, cv_pReal, false); Copy_CVImage_To_Grid(pImag, cv_pImag, false); cvReleaseImage(&cv_pInput); cvReleaseImage(&cv_pReal); cvReleaseImage(&cv_pImag); pReal->Set_Name(CSG_String::Format(SG_T("%s [DFT, %s]"), pInput->Get_Name(), _TL("Real"))); pImag->Set_Name(CSG_String::Format(SG_T("%s [DFT, %s]"), pInput->Get_Name(), _TL("Imaginary"))); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // Rearrange the quadrants of Fourier image so that the origin is at // the image center // src & dst arrays of equal size & type bool cvShiftDFT(CvArr * src_arr, CvArr * dst_arr ) { CvMat * tmp; CvMat q1stub, q2stub; CvMat q3stub, q4stub; CvMat d1stub, d2stub; CvMat d3stub, d4stub; CvMat * q1, * q2, * q3, * q4; CvMat * d1, * d2, * d3, * d4; CvSize size = cvGetSize(src_arr); CvSize dst_size = cvGetSize(dst_arr); int cx, cy; if( dst_size.width != size.width || dst_size.height != size.height ) { // cvError( CV_StsUnmatchedSizes, "cvShiftDFT", "Source and Destination arrays must have equal sizes", __FILE__, __LINE__ ); return( false ); } if(src_arr==dst_arr){ tmp = cvCreateMat(size.height/2, size.width/2, cvGetElemType(src_arr)); } cx = size.width/2; cy = size.height/2; // image center q1 = cvGetSubRect( src_arr, &q1stub, cvRect(0,0,cx, cy) ); q2 = cvGetSubRect( src_arr, &q2stub, cvRect(cx,0,cx,cy) ); q3 = cvGetSubRect( src_arr, &q3stub, cvRect(cx,cy,cx,cy) ); q4 = cvGetSubRect( src_arr, &q4stub, cvRect(0,cy,cx,cy) ); d1 = cvGetSubRect( src_arr, &d1stub, cvRect(0,0,cx,cy) ); d2 = cvGetSubRect( src_arr, &d2stub, cvRect(cx,0,cx,cy) ); d3 = cvGetSubRect( src_arr, &d3stub, cvRect(cx,cy,cx,cy) ); d4 = cvGetSubRect( src_arr, &d4stub, cvRect(0,cy,cx,cy) ); if(src_arr!=dst_arr){ if( !CV_ARE_TYPES_EQ( q1, d1 )){ // cvError( CV_StsUnmatchedFormats, "cvShiftDFT", "Source and Destination arrays must have the same format", __FILE__, __LINE__ ); return( false ); } cvCopy(q3, d1, 0); cvCopy(q4, d2, 0); cvCopy(q1, d3, 0); cvCopy(q2, d4, 0); } else{ cvCopy(q3, tmp, 0); cvCopy(q1, q3, 0); cvCopy(tmp, q1, 0); cvCopy(q4, tmp, 0); cvCopy(q2, q4, 0); cvCopy(tmp, q2, 0); } return( true ); } //--------------------------------------------------------- bool DFT(IplImage *im, IplImage **ppReal, IplImage **ppImag) { IplImage * realInput; IplImage * imaginaryInput; IplImage * complexInput; int dft_M, dft_N; CvMat* dft_A, tmp; IplImage * image_Re; IplImage * image_Im; double m, M; if( !im ) return false; realInput = cvCreateImage( cvGetSize(im), IPL_DEPTH_64F, 1); imaginaryInput = cvCreateImage( cvGetSize(im), IPL_DEPTH_64F, 1); complexInput = cvCreateImage( cvGetSize(im), IPL_DEPTH_64F, 2); cvScale(im, realInput, 1.0, 0.0); cvZero(imaginaryInput); cvMerge(realInput, imaginaryInput, NULL, NULL, complexInput); dft_M = cvGetOptimalDFTSize( im->height - 1 ); dft_N = cvGetOptimalDFTSize( im->width - 1 ); dft_A = cvCreateMat( dft_M, dft_N, CV_64FC2 ); *ppReal = image_Re = cvCreateImage( cvSize(dft_N, dft_M), IPL_DEPTH_64F, 1); *ppImag = image_Im = cvCreateImage( cvSize(dft_N, dft_M), IPL_DEPTH_64F, 1); // copy A to dft_A and pad dft_A with zeros cvGetSubRect( dft_A, &tmp, cvRect(0,0, im->width, im->height)); cvCopy( complexInput, &tmp, NULL ); if( dft_A->cols > im->width ) { cvGetSubRect( dft_A, &tmp, cvRect(im->width,0, dft_A->cols - im->width, im->height)); cvZero( &tmp ); } // no need to pad bottom part of dft_A with zeros because of // use nonzero_rows parameter in cvDFT() call below cvDFT( dft_A, dft_A, CV_DXT_FORWARD, complexInput->height ); // Split Fourier in real and imaginary parts cvSplit( dft_A, image_Re, image_Im, 0, 0 ); // Compute the magnitude of the spectrum Mag = sqrt(Re^2 + Im^2) // cvPow( image_Re, image_Re, 2.0); // cvPow( image_Im, image_Im, 2.0); // cvAdd( image_Re, image_Im, image_Re, NULL); // cvPow( image_Re, image_Re, 0.5 ); // Compute log(1 + Mag) // cvAddS( image_Re, cvScalarAll(1.0), image_Re, NULL ); // 1 + Mag // cvLog( image_Re, image_Re ); // log(1 + Mag) // Rearrange the quadrants of Fourier image so that the origin is at // the image center // cvShiftDFT( image_Re, image_Re ); // cvMinMaxLoc(image_Re, &m, &M, NULL, NULL, NULL); // cvScale(image_Re, image_Re, 1.0/(M-m), 1.0*(-m)/(M-m)); return true; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/opencv_fourier.h000066400000000000000000000103241224124640700266440ustar00rootroot00000000000000/********************************************************** * Version $Id: opencv_fourier.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // OpenCV // // // //-------------------------------------------------------// // // // opencv_fourier.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__opencv_fourier_H #define HEADER_INCLUDED__opencv_fourier_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "opencv.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class COpenCV_FFT : public CSG_Module_Grid { public: COpenCV_FFT(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__opencv_fourier_H saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/opencv_morphology.cpp000066400000000000000000000167441224124640700277370ustar00rootroot00000000000000/********************************************************** * Version $Id: opencv_morphology.cpp 1573 2012-12-18 08:47:44Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // OpenCV // // // //-------------------------------------------------------// // // // opencv_morphology.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "opencv_morphology.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- COpenCV_Morphology::COpenCV_Morphology(void) { Set_Name (_TL("OpenCV - Basic Morphological Operations")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "References:\n" "OpenCV - Open Source Computer Vision\n" "http://opencv.willowgarage.com" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT, SG_DATATYPE_Byte ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Operation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|"), _TL("dilation"), _TL("erosion"), _TL("opening"), _TL("closing"), _TL("morpological gradient"), _TL("top hat"), _TL("black hat") ) ); Parameters.Add_Choice( NULL , "SHAPE" , _TL("Element Shape"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("ellipse"), _TL("rectangle"), _TL("cross") ) ); Parameters.Add_Value( NULL , "RADIUS" , _TL("Radius (cells)"), _TL(""), PARAMETER_TYPE_Int, 1.0, 0.0, true ); Parameters.Add_Value( NULL , "ITERATIONS" , _TL("Iterations"), _TL(""), PARAMETER_TYPE_Int, 1.0, 1.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool COpenCV_Morphology::On_Execute(void) { int Type, Shape, Radius, Iterations; CSG_Grid *pInput, *pOutput; pInput = Parameters("INPUT") ->asGrid(); pOutput = Parameters("OUTPUT") ->asGrid(); Type = Parameters("TYPE") ->asInt(); Shape = Parameters("SHAPE") ->asInt(); Radius = Parameters("RADIUS") ->asInt(); Iterations = Parameters("ITERATIONS") ->asInt(); //----------------------------------------------------- switch( Shape ) { default: case 0: Shape = CV_SHAPE_ELLIPSE; break; case 1: Shape = CV_SHAPE_RECT; break; case 2: Shape = CV_SHAPE_CROSS; break; } //----------------------------------------------------- IplImage *cv_pInput = Get_CVImage(pInput); IplImage *cv_pOutput = Get_CVImage(Get_NX(), Get_NY(), pInput->Get_Type()); IplImage *cv_pTmp = NULL; //----------------------------------------------------- IplConvKernel *cv_pElement = cvCreateStructuringElementEx(Radius * 2 + 1, Radius * 2 + 1, Radius, Radius, Shape, 0); switch( Type ) { case 0: // dilation cvDilate (cv_pInput, cv_pOutput, cv_pElement, Iterations); break; case 1: // erosion cvErode (cv_pInput, cv_pOutput, cv_pElement, Iterations); break; case 2: // opening cvMorphologyEx (cv_pInput, cv_pOutput, cv_pTmp, cv_pElement, CV_MOP_OPEN , Iterations ); break; case 3: // closing cvMorphologyEx (cv_pInput, cv_pOutput, cv_pTmp, cv_pElement, CV_MOP_CLOSE , Iterations ); break; case 4: // morpological gradient cvMorphologyEx (cv_pInput, cv_pOutput, cv_pTmp = Get_CVImage(Get_NX(), Get_NY(), pInput->Get_Type()), cv_pElement, CV_MOP_GRADIENT, Iterations ); break; case 5: // top hat cvMorphologyEx (cv_pInput, cv_pOutput, cv_pTmp = Get_CVImage(Get_NX(), Get_NY(), pInput->Get_Type()), cv_pElement, CV_MOP_TOPHAT , Iterations ); break; case 6: // black hat cvMorphologyEx (cv_pInput, cv_pOutput, cv_pTmp = Get_CVImage(Get_NX(), Get_NY(), pInput->Get_Type()), cv_pElement, CV_MOP_BLACKHAT, Iterations ); break; } cvReleaseStructuringElement(&cv_pElement); //----------------------------------------------------- Copy_CVImage_To_Grid(pOutput, cv_pOutput); cvReleaseImage(&cv_pInput); cvReleaseImage(&cv_pOutput); if( cv_pTmp ) { cvReleaseImage(&cv_pTmp); } pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), Get_Name().c_str())); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/opencv_morphology.h000066400000000000000000000103561224124640700273750ustar00rootroot00000000000000/********************************************************** * Version $Id: opencv_morphology.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // OpenCV // // // //-------------------------------------------------------// // // // opencv_morphology.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__opencv_morphology_H #define HEADER_INCLUDED__opencv_morphology_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "opencv.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class COpenCV_Morphology : public CSG_Module_Grid { public: COpenCV_Morphology(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__opencv_morphology_H saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/opencv_svd.cpp000066400000000000000000000146611224124640700263300ustar00rootroot00000000000000/********************************************************** * Version $Id: opencv_svd.cpp 1575 2012-12-19 15:21:08Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // OpenCV // // // //-------------------------------------------------------// // // // opencv_svd.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "opencv_svd.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- COpenCV_SVD::COpenCV_SVD(void) { Set_Name (_TL("OpenCV - Single Value Decomposition")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "References:\n" "OpenCV - Open Source Computer Vision\n" "http://opencv.willowgarage.com" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Range( NULL , "RANGE" , _TL("Range"), _TL(""), 0.1, 0.9, 0.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool COpenCV_SVD::On_Execute(void) { int sMin, sMax; CSG_Grid *pInput, *pOutput; int n = MIN(Get_NY(), Get_NX()); int m = MAX(Get_NY(), Get_NX()); pInput = Parameters("INPUT") ->asGrid(); pOutput = Parameters("OUTPUT") ->asGrid(); sMin = (int)(Parameters("RANGE") ->asRange()->Get_LoVal() * n); sMax = (int)(Parameters("RANGE") ->asRange()->Get_HiVal() * n); //----------------------------------------------------- IplImage *cv_pInput = Get_CVImage(pInput, SG_DATATYPE_Double); //----------------------------------------------------- IplImage *cv_pOutput = Get_CVImage(m, n, SG_DATATYPE_Double); CvMat *cv_pW = cvCreateMat(n, cv_pInput->height, CV_64FC1); CvMat *cv_pU = cvCreateMat(n, cv_pInput->height, CV_64FC1); CvMat *cv_pV = cvCreateMat(n, cv_pInput->width , CV_64FC1); //----------------------------------------------------- cvSVD(cv_pInput, cv_pW, cv_pU, cv_pV, CV_SVD_MODIFY_A+CV_SVD_V_T); CSG_Matrix u(cv_pU->rows, cv_pU->cols, cv_pU->data.db); CSG_Matrix v(cv_pV->rows, cv_pV->cols, cv_pV->data.db); CSG_Matrix w(cv_pW->rows, cv_pW->cols, cv_pW->data.db); CSG_Matrix svd(Get_NY(), Get_NX()); for(int i=0; i sMax ) w[i][i] = 0.0; svd = u * w; svd *= v.Get_Transpose(); for(int y=0; ySet_Value(x, y, svd[y][x]); // pOutput->Set_Value(x, y, u[y][x]); // pOutput->Set_Value(x, y, v[y][x]); // pOutput->Set_Value(x, y, w[y][x]); //----------------------------------------------------- // cvSVBkSb(cv_pW, cv_pU, cv_pV, NULL, cv_pOutput, CV_SVD_U_T+CV_SVD_V_T); cvReleaseMat(&cv_pW); cvReleaseMat(&cv_pU); cvReleaseMat(&cv_pV); //----------------------------------------------------- // Copy_CVImage_To_Grid(pOutput, cv_pOutput); cvReleaseImage(&cv_pInput); cvReleaseImage(&cv_pOutput); pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), Get_Name().c_str())); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_opencv/opencv/opencv_svd.h000066400000000000000000000103041224124640700257630ustar00rootroot00000000000000/********************************************************** * Version $Id: opencv_svd.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // OpenCV // // // //-------------------------------------------------------// // // // opencv_svd.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__opencv_svd_H #define HEADER_INCLUDED__opencv_svd_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "opencv.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class COpenCV_SVD : public CSG_Module_Grid { public: COpenCV_SVD(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__opencv_svd_H saga-2.1.0+dfsg/src/modules_images/modules_vigra/000077500000000000000000000000001224124640700217725ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_vigra/Makefile.am000066400000000000000000000000211224124640700240170ustar00rootroot00000000000000SUBDIRS = vigra saga-2.1.0+dfsg/src/modules_images/modules_vigra/Makefile.in000066400000000000000000000425001224124640700240400ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_images/modules_vigra DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = vigra all: all-recursive .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) --gnu src/modules_images/modules_vigra/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_images/modules_vigra/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/000077500000000000000000000000001224124640700231025ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/MLB_Interface.cpp000066400000000000000000000126471224124640700262120ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Imagery - ViGrA") ); case MLB_INFO_Author: return( _TL("O. Conrad (c) 2009") ); case MLB_INFO_Description: return( _TW( "ViGrA stands for \"Vision with Generic Algorithms\". " "It's a novel computer vision library that puts its main " "emphasize on customizable algorithms and data structures. " "By using template techniques similar to those in the C++ " "Standard Template Library, you can easily adapt any VIGRA " "component to the needs of your application, without thereby " "giving up execution speed.\n" "Find out more at the ViGrA - Vision with Generic Algorithms - homepage:\n" "" "http://hci.iwr.uni-heidelberg.de" )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Imagery|ViGrA") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "vigra_smoothing.h" #include "vigra_edges.h" #include "vigra_morphology.h" #include "vigra_distance.h" #include "vigra_fft.h" #include "vigra_watershed.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CViGrA_Smoothing ); case 1: return( new CViGrA_Edges ); case 2: return( new CViGrA_Morphology ); case 3: return( new CViGrA_Distance ); case 4: return( new CViGrA_Watershed ); case 5: return( new CViGrA_FFT ); case 6: return( new CViGrA_FFT_Inverse ); case 7: return( new CViGrA_FFT_Real ); case 8: return( new CViGrA_FFT_Filter ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/MLB_Interface.h000066400000000000000000000072201224124640700256460ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__MLB_VIGRA_H #define HEADER_INCLUDED__MLB_VIGRA_H //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__MLB_VIGRA_H saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/Makefile.am000066400000000000000000000015161224124640700251410ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif if HAVE_VIGRA DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version -lvigraimpex -lfftw3 pkglib_LTLIBRARIES = libvigra.la libvigra_la_SOURCES =\ vigra.h\ vigra_edges.h\ vigra_smoothing.h\ vigra_distance.h\ vigra_fft.h\ vigra_morphology.h\ vigra_watershed.h\ MLB_Interface.cpp\ vigra.cpp\ MLB_Interface.h\ vigra_distance.cpp\ vigra_fft.cpp\ vigra_smoothing.cpp\ vigra_edges.cpp\ vigra_morphology.cpp\ vigra_watershed.cpp libvigra_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la endif saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/Makefile.in000066400000000000000000000472461224124640700251640ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_images/modules_vigra/vigra DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) @HAVE_VIGRA_TRUE@libvigra_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am__libvigra_la_SOURCES_DIST = vigra.h vigra_edges.h vigra_smoothing.h \ vigra_distance.h vigra_fft.h vigra_morphology.h \ vigra_watershed.h MLB_Interface.cpp vigra.cpp MLB_Interface.h \ vigra_distance.cpp vigra_fft.cpp vigra_smoothing.cpp \ vigra_edges.cpp vigra_morphology.cpp vigra_watershed.cpp @HAVE_VIGRA_TRUE@am_libvigra_la_OBJECTS = MLB_Interface.lo vigra.lo \ @HAVE_VIGRA_TRUE@ vigra_distance.lo vigra_fft.lo \ @HAVE_VIGRA_TRUE@ vigra_smoothing.lo vigra_edges.lo \ @HAVE_VIGRA_TRUE@ vigra_morphology.lo vigra_watershed.lo libvigra_la_OBJECTS = $(am_libvigra_la_OBJECTS) @HAVE_VIGRA_TRUE@am_libvigra_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libvigra_la_SOURCES) DIST_SOURCES = $(am__libvigra_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE @HAVE_VIGRA_TRUE@DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD @HAVE_VIGRA_TRUE@CXX_INCS = -I$(top_srcdir)/src/saga_core @HAVE_VIGRA_TRUE@AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) @HAVE_VIGRA_TRUE@AM_LDFLAGS = -fPIC -shared -avoid-version -lvigraimpex -lfftw3 @HAVE_VIGRA_TRUE@pkglib_LTLIBRARIES = libvigra.la @HAVE_VIGRA_TRUE@libvigra_la_SOURCES = \ @HAVE_VIGRA_TRUE@vigra.h\ @HAVE_VIGRA_TRUE@vigra_edges.h\ @HAVE_VIGRA_TRUE@vigra_smoothing.h\ @HAVE_VIGRA_TRUE@vigra_distance.h\ @HAVE_VIGRA_TRUE@vigra_fft.h\ @HAVE_VIGRA_TRUE@vigra_morphology.h\ @HAVE_VIGRA_TRUE@vigra_watershed.h\ @HAVE_VIGRA_TRUE@MLB_Interface.cpp\ @HAVE_VIGRA_TRUE@vigra.cpp\ @HAVE_VIGRA_TRUE@MLB_Interface.h\ @HAVE_VIGRA_TRUE@vigra_distance.cpp\ @HAVE_VIGRA_TRUE@vigra_fft.cpp\ @HAVE_VIGRA_TRUE@vigra_smoothing.cpp\ @HAVE_VIGRA_TRUE@vigra_edges.cpp\ @HAVE_VIGRA_TRUE@vigra_morphology.cpp\ @HAVE_VIGRA_TRUE@vigra_watershed.cpp @HAVE_VIGRA_TRUE@libvigra_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_images/modules_vigra/vigra/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_images/modules_vigra/vigra/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libvigra.la: $(libvigra_la_OBJECTS) $(libvigra_la_DEPENDENCIES) $(CXXLINK) $(am_libvigra_la_rpath) $(libvigra_la_OBJECTS) $(libvigra_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vigra.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vigra_distance.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vigra_edges.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vigra_fft.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vigra_morphology.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vigra_smoothing.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vigra_watershed.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra.cpp000066400000000000000000000115631224124640700247240ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool Copy_RGBGrid_SAGA_to_VIGRA (CSG_Grid &Grid, BRGBImage &Image, bool bCreate) { if( bCreate ) { Image.resize(Grid.Get_NX(), Grid.Get_NY()); } if( Grid.Get_NX() != Image.width() || Grid.Get_NY() != Image.height() ) { return( false ); } for(int y=0; y rgb(SG_GET_R(Grid.asInt(x, y)), SG_GET_G(Grid.asInt(x, y)), SG_GET_B(Grid.asInt(x, y))); Image(x, y) = rgb; } } SG_UI_Process_Set_Progress(0.0, 1.0); return( true ); } //--------------------------------------------------------- bool Copy_RGBGrid_VIGRA_to_SAGA (CSG_Grid &Grid, BRGBImage &Image, bool bCreate) { if( bCreate ) { Grid.Create(Grid.Get_Type(), Image.width(), Image.height()); } if( Grid.Get_NX() != Image.width() || Grid.Get_NY() != Image.height() ) { return( false ); } for(int y=0; y rgb = Image(x, y); Grid.Set_Value(x, y, SG_GET_RGB(rgb.red(), rgb.green(), rgb.blue())); } } SG_UI_Process_Set_Progress(0.0, 1.0); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra.h000066400000000000000000000130241224124640700243630ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__vigra_H #define HEADER_INCLUDED__vigra_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include //--------------------------------------------------------- using namespace vigra; //--------------------------------------------------------- template bool Copy_Grid_SAGA_to_VIGRA (CSG_Grid &Grid, VIGRA_Image &Image, bool bCreate) { if( bCreate ) { Image.resize(Grid.Get_NX(), Grid.Get_NY()); } if( Grid.Get_NX() != Image.width() || Grid.Get_NY() != Image.height() ) { return( false ); } for(int y=0; y bool Copy_Grid_VIGRA_to_SAGA (CSG_Grid &Grid, VIGRA_Image &Image, bool bCreate) { if( bCreate ) { Grid.Create(Grid.Get_Type(), Image.width(), Image.height()); } if( Grid.Get_NX() != Image.width() || Grid.Get_NY() != Image.height() ) { return( false ); } for(int y=0; y /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CViGrA_Distance::CViGrA_Distance(void) { Set_Name (_TL("ViGrA - Distance")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "References:\n" "ViGrA - Vision with Generic Algorithms\n" "http://hci.iwr.uni-heidelberg.de" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Features"), _TL("Features are all pixels different not representing no-data."), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Distance"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "NORM" , _TL("Type of distance calculation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Chessboard"), _TL("Manhattan"), _TL("Euclidean") ) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CViGrA_Distance::On_Execute(void) { int Norm; CSG_Grid *pInput, *pOutput; pInput = Parameters("INPUT") ->asGrid(); pOutput = Parameters("OUTPUT") ->asGrid(); Norm = Parameters("NORM") ->asInt(); //----------------------------------------------------- vigra::FImage Input, Output(Get_NX(), Get_NY()); Copy_Grid_SAGA_to_VIGRA(*pInput, Input, true); distanceTransform(srcImageRange(Input), destImage(Output), pInput->Get_NoData_Value(), Norm); Copy_Grid_VIGRA_to_SAGA(*pOutput, Output, false); //----------------------------------------------------- pOutput->Multiply(pOutput->Get_Cellsize()); pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s - %s]"), pInput->Get_Name(), Get_Name().c_str(), Parameters("NORM")->asString())); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra_distance.h000066400000000000000000000103331224124640700262350ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra_distance.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra_distance.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__vigra_distance_H #define HEADER_INCLUDED__vigra_distance_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CViGrA_Distance : public CSG_Module_Grid { public: CViGrA_Distance(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__vigra_distance_H saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra_edges.cpp000066400000000000000000000137051224124640700260730ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra_edges.cpp 1282 2011-12-29 17:13:26Z manfred-e $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra_edges.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra_edges.h" //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CViGrA_Edges::CViGrA_Edges(void) { Set_Name (_TL("ViGrA - Edge Detection")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "References:\n" "ViGrA - Vision with Generic Algorithms\n" "http://hci.iwr.uni-heidelberg.de" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Edges"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Detector type"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Canny"), _TL("Shen-Castan") ) ); Parameters.Add_Value( NULL , "SCALE" , _TL("Operator scale"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); Parameters.Add_Value( NULL , "THRESHOLD" , _TL("Gradient threshold"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CViGrA_Edges::On_Execute(void) { int Type; double Scale, Threshold; CSG_Grid *pInput, *pOutput; pInput = Parameters("INPUT") ->asGrid(); pOutput = Parameters("OUTPUT") ->asGrid(); Type = Parameters("TYPE") ->asInt(); Scale = Parameters("SCALE") ->asDouble(); Threshold = Parameters("THRESHOLD") ->asDouble(); //----------------------------------------------------- vigra::FImage Input; vigra::BImage Output(Get_NX(), Get_NY()); Copy_Grid_SAGA_to_VIGRA(*pInput, Input, true); Output = 0; switch( Type ) { default: case 0: // Canny cannyEdgeImage (srcImageRange(Input), destImage(Output), Scale, Threshold, 1); break; case 1: // Shen-Castan differenceOfExponentialEdgeImage(srcImageRange(Input), destImage(Output), Scale, Threshold, 1); break; } //----------------------------------------------------- Copy_Grid_VIGRA_to_SAGA(*pOutput, Output, false); pOutput->Set_NoData_Value(0); pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), Get_Name().c_str())); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra_edges.h000066400000000000000000000103111224124640700255260ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra_edges.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra_edges.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__vigra_edges_H #define HEADER_INCLUDED__vigra_edges_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CViGrA_Edges : public CSG_Module_Grid { public: CViGrA_Edges(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__vigra_edges_H saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra_fft.cpp000066400000000000000000000372071224124640700255660ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra_fft.cpp 1578 2012-12-20 08:29:37Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra_fft.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra_fft.h" //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool Copy_ComplexGrid_SAGA_to_VIGRA (CSG_Grid &Real, CSG_Grid &Imag, FFTWComplexImage &Image, bool bCreate) { if( bCreate ) { Image.resize(Real.Get_NX(), Real.Get_NY()); } if( Real.Get_NX() != Image.width() || Real.Get_NY() != Image.height() || Imag.Get_NX() != Image.width() || Imag.Get_NY() != Image.height() ) { return( false ); } for(int y=0; y(Real.asDouble(x, y), Imag.asDouble(x, y)); } } SG_UI_Process_Set_Progress(0.0, 1.0); return( true ); } //--------------------------------------------------------- bool Copy_ComplexGrid_VIGRA_to_SAGA (CSG_Grid &Real, CSG_Grid &Imag, FFTWComplexImage &Image, bool bCreate) { if( bCreate ) { Real.Create(SG_DATATYPE_Float, Image.width(), Image.height()); Imag.Create(SG_DATATYPE_Float, Image.width(), Image.height()); } if( Real.Get_NX() != Image.width() || Real.Get_NY() != Image.height() || Imag.Get_NX() != Image.width() || Imag.Get_NY() != Image.height() ) { return( false ); } for(int y=0; yhttp://hci.iwr.uni-heidelberg.de" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "REAL" , _TL("Real"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "IMAG" , _TL("Imaginary"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "CENTER" , _TL("Centered"), _TL(""), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CViGrA_FFT::On_Execute(void) { CSG_Grid *pInput, *pReal, *pImag; pInput = Parameters("INPUT") ->asGrid(); pReal = Parameters("REAL") ->asGrid(); pImag = Parameters("IMAG") ->asGrid(); //----------------------------------------------------- vigra::FImage Input; vigra::FFTWComplexImage Output(Get_NX(), Get_NY()); Copy_Grid_SAGA_to_VIGRA(*pInput, Input, true); if( !Parameters("CENTER")->asBool() ) { fourierTransform(srcImageRange(Input) , destImage(Output)); } else { vigra::FFTWComplexImage tmp(Get_NX(), Get_NY()); fourierTransform(srcImageRange(Input) , destImage(tmp)); moveDCToCenter (srcImageRange(tmp) , destImage(Output)); } //----------------------------------------------------- Copy_ComplexGrid_VIGRA_to_SAGA(*pReal, *pImag, Output, false); pReal->Set_Name(CSG_String::Format(SG_T("%s [FFT - %s]"), pInput->Get_Name(), _TL("Real"))); pImag->Set_Name(CSG_String::Format(SG_T("%s [FFT - %s]"), pInput->Get_Name(), _TL("Imaginary"))); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CViGrA_FFT_Inverse::CViGrA_FFT_Inverse(void) { Set_Name (_TL("ViGrA - Fourier Transform Inverse")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "References:\n" "ViGrA - Vision with Generic Algorithms\n" "http://hci.iwr.uni-heidelberg.de" )); Parameters.Add_Grid( NULL , "REAL" , _TL("Real"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "IMAG" , _TL("Imaginary"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "REAL_OUT" , _TL("Real"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "IMAG_OUT" , _TL("Imaginary"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "CENTER" , _TL("Centered"), _TL(""), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CViGrA_FFT_Inverse::On_Execute(void) { CSG_Grid *pReal, *pImag; pReal = Parameters("REAL")->asGrid(); pImag = Parameters("IMAG")->asGrid(); //----------------------------------------------------- vigra::FFTWComplexImage Input, Output(Get_NX(), Get_NY()); Copy_ComplexGrid_SAGA_to_VIGRA(*pReal, *pImag, Input, true); if( !Parameters("CENTER")->asBool() ) { fourierTransformInverse(srcImageRange(Input), destImage(Output)); } else { vigra::FFTWComplexImage tmp(Get_NX(), Get_NY()); moveDCToUpperLeft (srcImageRange(Input), destImage(tmp)); fourierTransformInverse(srcImageRange(tmp) , destImage(Output)); } transformImage(srcImageRange(Output), destImage(Output), std::bind1st(std::multiplies >(), 1.0 / Get_NX() / Get_NY())); //----------------------------------------------------- pReal = Parameters("REAL_OUT")->asGrid(); pImag = Parameters("IMAG_OUT")->asGrid(); Copy_ComplexGrid_VIGRA_to_SAGA(*pReal, *pImag, Output, false); pReal->Set_Name(CSG_String::Format(SG_T("%s [FFT - %s]"), Get_Name().c_str(), _TL("Real"))); pImag->Set_Name(CSG_String::Format(SG_T("%s [FFT - %s]"), Get_Name().c_str(), _TL("Imaginary"))); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CViGrA_FFT_Real::CViGrA_FFT_Real(void) { Set_Name (_TL("ViGrA - Fourier Transform (Real)")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "References:\n" "ViGrA - Vision with Generic Algorithms\n" "http://hci.iwr.uni-heidelberg.de" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CViGrA_FFT_Real::On_Execute(void) { CSG_Grid *pInput, *pOutput; pInput = Parameters("INPUT") ->asGrid(); pOutput = Parameters("OUTPUT") ->asGrid(); //----------------------------------------------------- vigra::FImage Input, Output(Get_NX(), Get_NY()); Copy_Grid_SAGA_to_VIGRA(*pInput, Input, true); // forward cosine transform == reflective boundary conditions fourierTransformRealEE(srcImageRange(Input), destImage(Output), (fftw_real)1.0); //----------------------------------------------------- Copy_Grid_VIGRA_to_SAGA(*pOutput, Output, false); pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s - %s]"), Get_Name().c_str(), pInput->Get_Name())); return( true ); /*/ multiply with a first derivative of Gaussian in x-direction for(int y=0; yhttp://hci.iwr.uni-heidelberg.de" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "REAL" , _TL("Output (real)"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Grid( NULL , "IMAG" , _TL("Output (imaginary)"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "SCALE" , _TL("Size of smoothing filter"), _TL(""), PARAMETER_TYPE_Double, 2.0, 0.0, true ); Parameters.Add_Value( NULL , "POWER" , _TL("Power"), _TL(""), PARAMETER_TYPE_Double, 0.5 ); Parameters.Add_Range( NULL , "RANGE" , _TL("Range"), _TL(""), 0.1, 0.9, 0.0, true ); Parameters.Add_Choice( NULL , "FILTER" , _TL("Filter"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("gaussian"), _TL("power of distance"), _TL("include range"), _TL("exclude range") ) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CViGrA_FFT_Filter::On_Execute(void) { int Filter; double Scale, Power, Range_Min, Range_Max; CSG_Grid *pInput, *pReal, *pImag; pInput = Parameters("INPUT") ->asGrid(); pReal = Parameters("REAL") ->asGrid(); pImag = Parameters("IMAG") ->asGrid(); Scale = Parameters("SCALE") ->asDouble(); Power = Parameters("POWER") ->asDouble(); Filter = Parameters("FILTER") ->asInt(); Range_Min = Parameters("RANGE") ->asRange()->Get_LoVal(); Range_Max = Parameters("RANGE") ->asRange()->Get_HiVal(); //----------------------------------------------------- vigra::FImage Input, Filter_Raw(Get_NX(), Get_NY()), Filter_(Get_NX(), Get_NY()); vigra::FFTWComplexImage Output(Get_NX(), Get_NY()); //----------------------------------------------------- for(int y=0; y Range_Max ? 0.0 : 1.0; break; case 3: Filter_Raw(x, y) = (xx = sqrt(xx*xx + yy*yy)) < Range_Min || xx > Range_Max ? 1.0 : 0.0; break; } } } //----------------------------------------------------- moveDCToUpperLeft(srcImageRange(Filter_Raw), destImage(Filter_)); // applyFourierFilter() expects the filter's DC in the upper left Copy_Grid_SAGA_to_VIGRA(*pInput, Input, true); vigra::applyFourierFilter(srcImageRange(Input), srcImage(Filter_), destImage(Output)); transformImage(srcImageRange(Output), destImage(Output), std::bind1st(std::multiplies >(), 1.0 / Get_NX() / Get_NY())); //----------------------------------------------------- Copy_ComplexGrid_VIGRA_to_SAGA(*pReal, *pImag, Output, false); pReal->Set_Name(CSG_String::Format(SG_T("%s [FFT - %s]"), pInput->Get_Name(), _TL("Real"))); pImag->Set_Name(CSG_String::Format(SG_T("%s [FFT - %s]"), pInput->Get_Name(), _TL("Imaginary"))); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra_fft.h000066400000000000000000000130231224124640700252210ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra_fft.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra_fft.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__vigra_fft_H #define HEADER_INCLUDED__vigra_fft_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CViGrA_FFT : public CSG_Module_Grid { public: CViGrA_FFT(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Fourier Analysis") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CViGrA_FFT_Inverse : public CSG_Module_Grid { public: CViGrA_FFT_Inverse(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Fourier Analysis") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CViGrA_FFT_Real : public CSG_Module_Grid { public: CViGrA_FFT_Real(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Fourier Analysis") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CViGrA_FFT_Filter : public CSG_Module_Grid { public: CViGrA_FFT_Filter(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Fourier Analysis") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__vigra_fft_H saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra_morphology.cpp000066400000000000000000000152141224124640700272000ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra_morphology.cpp 1282 2011-12-29 17:13:26Z manfred-e $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra_morphology.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra_morphology.h" //--------------------------------------------------------- #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CViGrA_Morphology::CViGrA_Morphology(void) { Set_Name (_TL("ViGrA - Basic Morphological Operations")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "References:\n" "ViGrA - Vision with Generic Algorithms\n" "http://hci.iwr.uni-heidelberg.de" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT, SG_DATATYPE_Byte ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Operation"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("Dilation"), _TL("Erosion"), _TL("Median"), _TL("User defined rank") ) ); Parameters.Add_Value( NULL , "RADIUS" , _TL("Radius (cells)"), _TL(""), PARAMETER_TYPE_Int, 1.0, 0.0, true ); Parameters.Add_Value( NULL , "RANK" , _TL("User defined rank"), _TL(""), PARAMETER_TYPE_Double, 0.5, 0.0, true, 1.0, true ); Parameters.Add_Value( NULL , "RESCALE" , _TL("Rescale Values (0-255)"), _TL(""), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CViGrA_Morphology::On_Execute(void) { bool bRescale; int Type, Radius; double Rank; CSG_Grid *pInput, *pOutput, Rescaled; pInput = Parameters("INPUT") ->asGrid(); pOutput = Parameters("OUTPUT") ->asGrid(); Type = Parameters("TYPE") ->asInt(); Radius = Parameters("RADIUS") ->asInt(); Rank = Parameters("RANK") ->asDouble(); bRescale = Parameters("RESCALE") ->asBool(); //----------------------------------------------------- if( bRescale ) { Rescaled.Create(*Get_System(), SG_DATATYPE_Byte); for(long i=0; iasDouble(i) - pInput->Get_ZMin()) * 255.0 / pInput->Get_ZRange()); } pInput = &Rescaled; } //----------------------------------------------------- vigra::BImage Input, Output(Get_NX(), Get_NY()); Copy_Grid_SAGA_to_VIGRA(*pInput, Input, true); switch( Type ) { case 0: // Dilation discDilation (srcImageRange(Input), destImage(Output), Radius); break; case 1: // Erosion discErosion (srcImageRange(Input), destImage(Output), Radius); break; case 2: // Median discMedian (srcImageRange(Input), destImage(Output), Radius); break; case 3: // User defined rank discRankOrderFilter (srcImageRange(Input), destImage(Output), Radius, Rank); break; } //----------------------------------------------------- Copy_Grid_VIGRA_to_SAGA(*pOutput, Output, false); pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), Get_Name().c_str())); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra_morphology.h000066400000000000000000000103471224124640700266470ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra_morphology.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra_morphology.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__vigra_morphology_H #define HEADER_INCLUDED__vigra_morphology_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CViGrA_Morphology : public CSG_Module_Grid { public: CViGrA_Morphology(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__vigra_morphology_H saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra_smoothing.cpp000066400000000000000000000150321224124640700270060ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra_smoothing.cpp 1282 2011-12-29 17:13:26Z manfred-e $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra_smoothing.h" //--------------------------------------------------------- #include #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CViGrA_Smoothing::CViGrA_Smoothing(void) { Set_Name (_TL("ViGrA - Smoothing")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "Based on the example code \"smooth.cxx\" by Ullrich Koethe.\n" "References:\n" "ViGrA - Vision with Generic Algorithms\n" "http://hci.iwr.uni-heidelberg.de" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Output"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Type of smoothing"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("exponential"), _TL("nonlinear"), _TL("gaussian") ) ); Parameters.Add_Value( NULL , "SCALE" , _TL("Size of smoothing filter"), _TL(""), PARAMETER_TYPE_Double, 2.0, 0.0, true ); Parameters.Add_Value( NULL , "EDGE" , _TL("Edge threshold for nonlinear smoothing"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CViGrA_Smoothing::On_Execute(void) { int Type; double Scale, Edge; CSG_Grid *pInput, *pOutput; vigra::FImage Input, Output; pInput = Parameters("INPUT") ->asGrid(); pOutput = Parameters("OUTPUT") ->asGrid(); Type = Parameters("TYPE") ->asInt(); Scale = Parameters("SCALE") ->asDouble(); Edge = Parameters("EDGE") ->asDouble(); Copy_Grid_SAGA_to_VIGRA(*pInput, Input, true); Output.resize(Get_NX(), Get_NY()); //----------------------------------------------------- switch( Type ) { case 0: // apply recursive filter (exponential filter) to color image { recursiveSmoothX(srcImageRange(Input ), destImage(Output), Scale); recursiveSmoothY(srcImageRange(Output), destImage(Output), Scale); break; } case 1: // apply nonlinear diffusion to color image { nonlinearDiffusion(srcImageRange(Input), destImage(Output), vigra::DiffusivityFunctor(Edge), Scale); break; } case 2: // apply Gaussian filter to color image { vigra::FImage tmp(Get_NX(), Get_NY()); vigra::Kernel1D gauss; gauss.initGaussian(Scale); separableConvolveX(srcImageRange(Input) , destImage(tmp), kernel1d(gauss)); separableConvolveY(srcImageRange(tmp), destImage(Output), kernel1d(gauss)); break; } } //----------------------------------------------------- Copy_Grid_VIGRA_to_SAGA(*pOutput, Output, false); pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s - %s]"), pInput->Get_Name(), Get_Name().c_str(), Parameters("TYPE")->asString())); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra_smoothing.h000066400000000000000000000103411224124640700264510ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra_smoothing.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra_smoothing.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__vigra_smoothing_H #define HEADER_INCLUDED__vigra_smoothing_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CViGrA_Smoothing : public CSG_Module_Grid { public: CViGrA_Smoothing(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__vigra_smoothing_H saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra_watershed.cpp000066400000000000000000000247111224124640700267710ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra_watershed.cpp 1282 2011-12-29 17:13:26Z manfred-e $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra_watershed.h" //--------------------------------------------------------- #include #include #include #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CViGrA_Watershed::CViGrA_Watershed(void) { Set_Name (_TL("ViGrA - Watershed Segmentation")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "Note that the watershed algorithm usually results in an " "oversegmentation (i.e., too many regions), but its boundary " "localization is quite good.\n" "Based on the example code \"watershed.cxx\" by Ullrich Koethe.\n" "References:\n" "ViGrA - Vision with Generic Algorithms\n" "http://hci.iwr.uni-heidelberg.de" )); Parameters.Add_Grid( NULL , "INPUT" , _TL("Input"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "OUTPUT" , _TL("Segmentation"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Value( NULL , "SCALE" , _TL("Width of gradient filter"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); Parameters.Add_Value( NULL , "RGB" , _TL("RGB coded data"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "EDGES" , _TL("Edges"), _TL(""), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CViGrA_Watershed::On_Execute(void) { bool bEdges, bRGB; double Scale; CSG_Grid *pInput, *pOutput; pInput = Parameters("INPUT") ->asGrid(); pOutput = Parameters("OUTPUT") ->asGrid(); Scale = Parameters("SCALE") ->asDouble(); bEdges = Parameters("EDGES") ->asBool(); bRGB = Parameters("RGB") ->asBool(); //----------------------------------------------------- if( !bRGB ) { vigra::FImage Input, Output(Get_NX(), Get_NY()); Copy_Grid_SAGA_to_VIGRA(*pInput, Input, true); Segmentation(Input, Output, Scale, bEdges); Copy_Grid_VIGRA_to_SAGA(*pOutput, Output, false); } //----------------------------------------------------- else // perform watershed segmentation on color image { vigra::BRGBImage Input, Output(Get_NX(), Get_NY()); Copy_RGBGrid_SAGA_to_VIGRA(*pInput, Input, true); Segmentation(Input, Output, Scale, bEdges); Copy_RGBGrid_VIGRA_to_SAGA(*pOutput, Output, false); } //----------------------------------------------------- pOutput->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pInput->Get_Name(), Get_Name().c_str())); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // define a functor that calsulates the squared magnitude // of the gradient given the x/y components of the gradient //--------------------------------------------------------- struct GradientSquaredMagnitudeFunctor { float operator()(float const & g1, float const & g2) const { return g1 * g1 + g2 * g2; } float operator()(vigra::RGBValue const & rg1, vigra::RGBValue const & rg2) const { float g1 = rg1.squaredMagnitude(); float g2 = rg2.squaredMagnitude(); return g1 + g2; } }; //--------------------------------------------------------- // generic implementation of the watershed algorithm //--------------------------------------------------------- template void CViGrA_Watershed::Segmentation(TImage_In &Input, TImage_Out &Output, double Scale, bool bEdges) { typedef typename vigra::NumericTraits::RealPromote TmpType; vigra::BasicImage gradientx (Get_NX(), Get_NY()); vigra::BasicImage gradienty (Get_NX(), Get_NY()); vigra::FImage gradientmag (Get_NX(), Get_NY()); vigra::IImage labels (Get_NX(), Get_NY()); //----------------------------------------------------- // calculate the x- and y-components of the image gradient at given scale Process_Set_Text(_TL("calculate gradients")); recursiveFirstDerivativeX (srcImageRange(Input) , destImage(gradientx), Scale); recursiveSmoothY (srcImageRange(gradientx) , destImage(gradientx), Scale); recursiveFirstDerivativeY (srcImageRange(Input) , destImage(gradienty), Scale); recursiveSmoothX (srcImageRange(gradienty) , destImage(gradienty), Scale); //----------------------------------------------------- // transform components into gradient magnitude Process_Set_Text(_TL("calculate gradient magnitude")); combineTwoImages( srcImageRange(gradientx), srcImage(gradienty), destImage(gradientmag), GradientSquaredMagnitudeFunctor() ); //----------------------------------------------------- // find the local minima of the gradient magnitude (might be larger than one pixel) Process_Set_Text(_TL("find local minima")); labels = 0; extendedLocalMinima(srcImageRange(gradientmag), destImage(labels), 1); //----------------------------------------------------- // label the minima just found Process_Set_Text(_TL("label minima")); int max_region_label = labelImageWithBackground(srcImageRange(labels), destImage(labels), false, 0); //----------------------------------------------------- // create a statistics functor for region growing vigra::ArrayOfRegionStatistics >gradstat(max_region_label); //----------------------------------------------------- // perform region growing, starting from the minima of the gradient magnitude; // as the feature (first input) image contains the gradient magnitude, // this calculates the catchment basin of each minimum Process_Set_Text(_TL("perform region growing")); seededRegionGrowing(srcImageRange(gradientmag), srcImage(labels), destImage(labels), gradstat); //----------------------------------------------------- // initialize a functor to determine the average gray-value or color for each region (catchment basin) just found vigra::ArrayOfRegionStatistics >averages(max_region_label); //----------------------------------------------------- // calculate the averages Process_Set_Text(_TL("calculate averages")); inspectTwoImages(srcImageRange(Input), srcImage(labels), averages); //----------------------------------------------------- // write the averages into the destination image (the functor 'averages' acts as a look-up table) transformImage(srcImageRange(labels), destImage(Output), averages); //----------------------------------------------------- // mark the watersheds (region boundaries) black if( bEdges ) { regionImageToEdgeImage(srcImageRange(labels), destImage(Output), vigra::NumericTraits::zero()); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_images/modules_vigra/vigra/vigra_watershed.h000066400000000000000000000105651224124640700264400ustar00rootroot00000000000000/********************************************************** * Version $Id: vigra_watershed.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // VIGRA // // // //-------------------------------------------------------// // // // vigra_watershed.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__vigra_watershed_H #define HEADER_INCLUDED__vigra_watershed_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "vigra.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CViGrA_Watershed : public CSG_Module_Grid { public: CViGrA_Watershed(void); protected: virtual bool On_Execute (void); private: template void Segmentation (TImage_In &Input, TImage_Out &Output, double Scale, bool bEdges); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__vigra_watershed_H saga-2.1.0+dfsg/src/modules_io/000077500000000000000000000000001224124640700162745ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/Makefile.am000066400000000000000000000000671224124640700203330ustar00rootroot00000000000000SUBDIRS = db docs esri_e00 gps gdal grid shapes table saga-2.1.0+dfsg/src/modules_io/Makefile.in000066400000000000000000000424601224124640700203470ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = db docs esri_e00 gps gdal grid shapes table all: all-recursive .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) --gnu src/modules_io/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_io/db/000077500000000000000000000000001224124640700166615ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/db/Makefile.am000066400000000000000000000000711224124640700207130ustar00rootroot00000000000000if WITH_ODBC SUBDIRS = io_odbc else SUBDIRS = endif saga-2.1.0+dfsg/src/modules_io/db/Makefile.in000066400000000000000000000424761224124640700207430ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/db DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = io_odbc DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @WITH_ODBC_FALSE@SUBDIRS = @WITH_ODBC_TRUE@SUBDIRS = io_odbc all: all-recursive .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) --gnu src/modules_io/db/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/db/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_io/db/io_odbc/000077500000000000000000000000001224124640700202575ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/db/io_odbc/MLB_Interface.cpp000066400000000000000000000125041224124640700233570ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1514 2012-11-06 09:47:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_odbc // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2004 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Import/Export - ODBC/OTL") ); case MLB_INFO_Author: return( SG_T("O.Conrad (c) 2010") ); case MLB_INFO_Description: return( _TW( "Database access via Open Data Base Connection (ODBC) interface. " "Based on the OTL (Oracle, Odbc and DB2-CLI Template Library), Version 4.0: " "http://otl.sourceforge.net/" )); case MLB_INFO_Version: return( _TL("1.0") ); case MLB_INFO_Menu_Path: return( _TL("Database") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "get_connection.h" #include "table.h" #include "shapes.h" #include "pgis_shapes.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CGet_Connection ); case 1: return( new CDel_Connection ); case 2: return( new CTransaction ); case 3: return( new CExecute_SQL ); case 4: return( new CTable_Info ); case 5: return( new CTable_Load ); case 6: return( new CTable_Save ); case 7: return( new CTable_Drop ); case 8: return( new CTable_Query ); case 9: return( new CPoints_Load ); case 10: return( new CPoints_Save ); case 11: return( new CPGIS_Shapes_Load ); case 12: return( new CPGIS_Shapes_Save ); case 13: return( new CShapes_Load ); case 14: return( new CShapes_Save ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_io/db/io_odbc/MLB_Interface.h000066400000000000000000000076671224124640700230420ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_odbc // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2004 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__io_odbc_H #define HEADER_INCLUDED__io_odbc_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef io_odbc_EXPORTS #define io_odbc_EXPORT _SAGA_DLL_EXPORT #else #define io_odbc_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__io_odbc_H saga-2.1.0+dfsg/src/modules_io/db/io_odbc/Makefile.am000066400000000000000000000013651224124640700223200ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE DEP_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) -fpermissive $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) $(DEP_LIBS) -avoid-version pkglib_LTLIBRARIES = libio_odbc.la libio_odbc_la_SOURCES =\ get_connection.cpp\ MLB_Interface.cpp\ pgis_shapes.cpp\ shapes.cpp\ table.cpp\ get_connection.h\ MLB_Interface.h\ pgis_shapes.h\ shapes.h\ table.h libio_odbc_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_odbc/libsaga_odbc.la saga-2.1.0+dfsg/src/modules_io/db/io_odbc/Makefile.in000066400000000000000000000450011224124640700223240ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/db/io_odbc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libio_odbc_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la \ $(top_srcdir)/src/saga_core/saga_odbc/libsaga_odbc.la am_libio_odbc_la_OBJECTS = get_connection.lo MLB_Interface.lo \ pgis_shapes.lo shapes.lo table.lo libio_odbc_la_OBJECTS = $(am_libio_odbc_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libio_odbc_la_SOURCES) DIST_SOURCES = $(libio_odbc_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@DEP_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) -fpermissive $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) $(DEP_LIBS) -avoid-version pkglib_LTLIBRARIES = libio_odbc.la libio_odbc_la_SOURCES = \ get_connection.cpp\ MLB_Interface.cpp\ pgis_shapes.cpp\ shapes.cpp\ table.cpp\ get_connection.h\ MLB_Interface.h\ pgis_shapes.h\ shapes.h\ table.h libio_odbc_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(top_srcdir)/src/saga_core/saga_odbc/libsaga_odbc.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_io/db/io_odbc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/db/io_odbc/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libio_odbc.la: $(libio_odbc_la_OBJECTS) $(libio_odbc_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libio_odbc_la_OBJECTS) $(libio_odbc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgis_shapes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_io/db/io_odbc/get_connection.cpp000066400000000000000000000276711224124640700237760ustar00rootroot00000000000000/********************************************************** * Version $Id: get_connection.cpp 1509 2012-11-01 16:39:43Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_odbc // // // //-------------------------------------------------------// // // // Get_Connection.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "get_connection.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGet_Connection::CGet_Connection(void) { Set_Name (_TL("ODBC Connect")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "Connect to ODBC source." )); Parameters.Add_Choice( NULL , "SERVERS" , _TL("Server"), _TL(""), _TL("") ); Parameters.Add_String( NULL , "USERNAME" , _TL("User"), _TL(""), _TL("") ); Parameters.Add_String( NULL , "PASSWORD" , _TL("Password"), _TL(""), SG_T(""), false, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGet_Connection::On_Before_Execution(void) { CSG_String Servers; if( SG_ODBC_Get_Connection_Manager().Get_Servers(Servers) > 0 ) { Parameters("SERVERS")->asChoice()->Set_Items(Servers); return( true ); } Message_Dlg( _TW("No ODBC server available!\n" "Set up an ODBC server first."), _TL("ODBC Database Connection Error") ); return( false ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGet_Connection::On_Execute(void) { CSG_String Server, User, Password; Server = Parameters("SERVERS") ->asString(); User = Parameters("USERNAME") ->asString(); Password = Parameters("PASSWORD") ->asString(); if( SG_ODBC_Get_Connection_Manager().Add_Connection(Server, User, Password) ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("ODBC source connected"))); SG_UI_ODBC_Update(Server); return( true ); } Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("could not connect ODBC source"))); return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CDel_Connection::CDel_Connection(void) { Set_Name (_TL("ODBC Disconnect")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "Disconnect ODBC source." )); Parameters.Add_Choice( NULL , "SERVERS" , _TL("Server"), _TL(""), _TL("") ); Parameters.Add_Choice( NULL , "TRANSACT" , _TL("Transactions"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("rollback"), _TL("commit") ), 1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CDel_Connection::On_Before_Execution(void) { CSG_String Servers; if( SG_ODBC_Get_Connection_Manager().Get_Connections(Servers) > 0 ) { Parameters("SERVERS")->asChoice()->Set_Items(Servers); return( true ); } Message_Dlg( _TL("No ODBC connection available!"), _TL("ODBC Database Connection Error") ); return( false ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CDel_Connection::On_Execute(void) { bool bCommit; CSG_String Server; Server = Parameters("SERVERS") ->asString(); bCommit = Parameters("TRANSACT")->asInt() == 1; if( SG_ODBC_Get_Connection_Manager().Del_Connection(Server, bCommit) ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("ODBC source connected"))); SG_UI_ODBC_Update(Server); return( true ); } Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("could not connect ODBC source"))); return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTransaction::CTransaction(void) { Set_Name (_TL("ODBC Commit/Rollback Transaction")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "Execute a commit or rollback on open transactions with ODBC source." )); Parameters.Add_Choice( NULL , "SERVERS" , _TL("Server"), _TL(""), _TL("") ); Parameters.Add_Choice( NULL , "TRANSACT" , _TL("Transactions"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("rollback"), _TL("commit") ), 1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTransaction::On_Before_Execution(void) { CSG_String Servers; if( SG_ODBC_Get_Connection_Manager().Get_Connections(Servers) > 0 ) { Parameters("SERVERS")->asChoice()->Set_Items(Servers); return( true ); } Message_Dlg( _TL("No ODBC connection available!"), _TL("ODBC Database Connection Error") ); return( false ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CTransaction::On_Execute(void) { CSG_String Server; Server = Parameters("SERVERS") ->asString(); CSG_ODBC_Connection *pConnection = SG_ODBC_Get_Connection_Manager().Get_Connection(Server); if( !pConnection ) { return( false ); } if( Parameters("TRANSACT")->asInt() == 1 ) { if( pConnection->Commit() ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("open transactions committed"))); SG_UI_ODBC_Update(Server); return( true ); } } else { if( pConnection->Rollback() ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("open transactions rollbacked"))); SG_UI_ODBC_Update(Server); return( true ); } } Message_Add(CSG_String::Format(SG_T("%s: %s"), Server.c_str(), _TL("could not commit/rollback transactions."))); return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CExecute_SQL::CExecute_SQL(void) { Set_Name (_TL("ODBC Execute SQL")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Execute SQL commands on a connected ODBC source. " "Separate different commands with a semicolon (\';\'). " )); Parameters.Add_String( NULL , "SQL" , _TL("SQL Statment"), _TL(""), SG_T("CREATE TABLE myTable1 (Col1 VARCHAR(255) PRIMARY KEY, Col2 INTEGER);\n") SG_T("INSERT INTO myTable1 (Col1, Col2) VALUES(\'First Value\', 1);\n") SG_T("DROP TABLE myTable1;\n"), true ); Parameters.Add_Value( NULL , "COMMIT" , _TL("Commit"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( NULL , "STOP" , _TL("Stop on Error"), _TL(""), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CExecute_SQL::On_Execute(void) { if( !Get_Connection() ) { return( false ); } //----------------------------------------------------- bool bCommit = Parameters("COMMIT") ->asBool (); bool bStop = Parameters("STOP") ->asBool (); CSG_String SQL = Parameters("SQL") ->asString(); //----------------------------------------------------- if( SQL.Find(SG_T(';')) < 0 ) { return( Get_Connection()->Execute(SQL, bCommit) ); } //----------------------------------------------------- int nSuccess = 0, nErrors = 0; SQL += SG_T(';'); do { CSG_String s = SQL.BeforeFirst(SG_T(';')); s.Trim(); if( s.Length() > 0 ) { Message_Add(s); if( Get_Connection()->Execute(s, bCommit) ) { nSuccess++; Message_Add(CSG_String::Format(SG_T("...%s!"), _TL("okay")), false); } else { nErrors++; Message_Add(CSG_String::Format(SG_T("...%s!"), _TL("failed"))); if( bStop ) { return( false ); } } } SQL = SQL.AfterFirst(SG_T(';')); } while( SQL.Length() > 0 ); return( nErrors == 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/db/io_odbc/get_connection.h000066400000000000000000000130421224124640700234260ustar00rootroot00000000000000/********************************************************** * Version $Id: get_connection.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_odbc // // // //-------------------------------------------------------// // // // Get_Connection.h // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Get_Connection_H #define HEADER_INCLUDED__Get_Connection_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGet_Connection : public CSG_Module { public: CGet_Connection(void); protected: virtual bool On_Before_Execution (void); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CDel_Connection : public CSG_Module { public: CDel_Connection(void); protected: virtual bool On_Before_Execution (void); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTransaction : public CSG_ODBC_Module { public: CTransaction(void); protected: virtual bool On_Before_Execution (void); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CExecute_SQL : public CSG_ODBC_Module { public: CExecute_SQL(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Get_Connection_H saga-2.1.0+dfsg/src/modules_io/db/io_odbc/pgis_shapes.cpp000066400000000000000000000463521224124640700233020ustar00rootroot00000000000000/********************************************************** * Version $Id: pgis_shapes.cpp 1646 2013-04-10 16:29:00Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_odbc // // // //-------------------------------------------------------// // // // PGIS_Shapes.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "pgis_shapes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPGIS_Shapes_Load::CPGIS_Shapes_Load(void) { Set_Name (_TL("PostGIS Shapes Import")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "Imports shapes from a PostGIS database via ODBC." )); Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "TABLES" , _TL("Tables"), _TL(""), CSG_String::Format(SG_T("%s|"), _TL("--- no table available ---") ) ); } //--------------------------------------------------------- bool CPGIS_Shapes_Load::On_Before_Execution(void) { if( !CSG_ODBC_Module::On_Before_Execution() ) { return( false ); } if( !Get_Connection()->is_PostgreSQL() ) { SG_UI_Dlg_Message(_TL("Not a PostgreSQL database!"), _TL("Database Connection Error")); return( false ); } if( !Get_Connection()->Table_Exists(SG_T("spatial_ref_sys")) || !Get_Connection()->Table_Exists(SG_T("geometry_columns")) ) { SG_UI_Dlg_Message(_TL("Not a valid PostGIS database!"), _TL("Database Connection Error")); return( false ); } CSG_Table Geo_Tables; if( !Get_Connection()->Table_Load(Geo_Tables, SG_T("geometry_columns")) ) { return( false ); } CSG_String s; for(int i=0; iasChoice()->Set_Items(s); return( true ); } //--------------------------------------------------------- bool CPGIS_Shapes_Load::On_Execute(void) { TSG_Vertex_Type tVertex; TSG_Shape_Type tShape; CSG_String Select, Geo_Table, Geo_Type, Geo_Field; CSG_Table Geo_Tables; CSG_Shapes *pShapes; pShapes = Parameters("SHAPES") ->asShapes(); Geo_Table = Parameters("TABLES") ->asString(); Select.Printf(SG_T("SELECT * FROM geometry_columns WHERE f_table_name = '%s'"), Geo_Table.c_str()); if( !Get_Connection()->Table_Load(Geo_Tables, SG_T("geometry_columns"), SG_T("*"), CSG_String::Format(SG_T("f_table_name = '%s'"), Geo_Table.c_str()), SG_T("")) ) { return( false ); } if( Geo_Tables.Get_Count() != 1 ) { return( false ); } Geo_Type = Geo_Tables[0].asString(SG_T("type")); Geo_Field = Geo_Tables[0].asString(SG_T("f_geometry_column")); //----------------------------------------------------- if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Point ) ) { tShape = SHAPE_TYPE_Point; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPoint ) ) { tShape = SHAPE_TYPE_Points; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Line ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiLine ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Polygon ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPolygon ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Point_Z ) ) { tShape = SHAPE_TYPE_Point; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPoint_Z ) ) { tShape = SHAPE_TYPE_Points; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Line_Z ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiLine_Z ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Polygon_Z ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPolygon_Z ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Point_M ) ) { tShape = SHAPE_TYPE_Point; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPoint_M ) ) { tShape = SHAPE_TYPE_Points; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Line_M ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiLine_M ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Polygon_M ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPolygon_M ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Point_ZM ) ) { tShape = SHAPE_TYPE_Point; tVertex = SG_VERTEX_TYPE_XYZM; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPoint_ZM ) ) { tShape = SHAPE_TYPE_Points; tVertex = SG_VERTEX_TYPE_XYZM; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Line_ZM ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZM; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiLine_ZM ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZM; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Polygon_ZM ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZM; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPolygon_ZM ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZM; } else { return( false ); } if( pShapes->Get_Type() != SHAPE_TYPE_Undefined && pShapes->Get_Type() != tShape ) { pShapes = SG_Create_Shapes(tShape, Geo_Table, NULL, tVertex); Parameters("SHAPES")->Set_Value(pShapes); } else { pShapes->Create(tShape, Geo_Table, NULL, tVertex); } //----------------------------------------------------- if( !Get_Connection()->Table_Load(*pShapes, Geo_Table) ) { return( false ); } //----------------------------------------------------- if( 1 ) // WKBinary { CSG_Bytes_Array BLOBs; Select.Printf(SG_T("ST_AsBinary(%s) AS geom"), Geo_Field.c_str()); if( !Get_Connection()->Table_Load_BLOBs(BLOBs, Geo_Table, Select, SG_T(""), SG_T("")) ) { return( false ); } if( BLOBs.Get_Count() != pShapes->Get_Count() ) { return( false ); } for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shapes_OGIS_Converter::from_WKBinary(BLOBs[iShape], pShapes->Get_Shape(iShape)); } } //----------------------------------------------------- else // WKText { CSG_Table Shapes; Select.Printf(SG_T("ST_AsText(%s) AS geom"), Geo_Field.c_str()); if( !Get_Connection()->Table_Load(Shapes, Geo_Table, Select, SG_T(""), SG_T("")) ) { return( false ); } if( Shapes.Get_Count() != pShapes->Get_Count() ) { return( false ); } for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shapes_OGIS_Converter::from_WKText(Shapes[iShape].asString(0), pShapes->Get_Shape(iShape)); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPGIS_Shapes_Save::CPGIS_Shapes_Save(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("PostGIS Shapes Export")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "Exports shapes to a PostGIS database via ODBC." )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Fields( pNode , "PKEY" , _TL("Primary Key"), _TL("") ); Parameters.Add_String( NULL , "NAME" , _TL("Table Name"), _TL("if empty shapes layers's name is used as table name"), SG_T("") ); //----------------------------------------------------- pNode = Parameters.Add_Value( NULL , "CRS_EPSG" , _TL("EPSG Code"), _TL(""), PARAMETER_TYPE_Int, 4326, 2000, true, 32766, true ); if( SG_UI_Get_Window_Main() ) { Parameters.Add_Choice( pNode , "CRS_EPSG_GEOGCS" , _TL("Geographic Coordinate Systems"), _TL(""), SG_Get_Projections().Get_Names_List(SG_PROJ_TYPE_CS_Geographic) ); Parameters.Add_Choice( pNode , "CRS_EPSG_PROJCS" , _TL("Projected Coordinate Systems"), _TL(""), SG_Get_Projections().Get_Names_List(SG_PROJ_TYPE_CS_Projected) ); } //----------------------------------------------------- Parameters.Add_Parameters( NULL , "FLAGS" , _TL("Constraints"), _TL("") ); Parameters.Add_Choice( NULL , "EXISTS" , _TL("If table exists..."), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("abort export"), _TL("replace existing table"), _TL("append records, if table structure allows") ), 0 ); } //--------------------------------------------------------- int CPGIS_Shapes_Save::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SHAPES")) ) { pParameters->Get_Parameter("NAME")->Set_Value(pParameter->asShapes() ? pParameter->asShapes()->Get_Name() : SG_T("")); Set_Constraints(pParameters->Get_Parameter("FLAGS")->asParameters(), pParameter->asShapes()); } //----------------------------------------------------- if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_EPSG_GEOGCS")) || !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("CRS_EPSG_PROJCS")) ) { int i; if( pParameter->asChoice()->Get_Data(i) && (i = SG_Get_Projections().Get_Projection(i).Get_EPSG()) >= 0 ) { pParameters->Get_Parameter("CRS_EPSG")->Set_Value(i); } } return( 0 ); } //--------------------------------------------------------- bool CPGIS_Shapes_Save::On_Before_Execution(void) { if( !CSG_ODBC_Module::On_Before_Execution() ) { return( false ); } if( !Get_Connection()->is_PostgreSQL() ) { SG_UI_Dlg_Message(_TL("Not a PostgreSQL database!"), _TL("Database Connection Error")); return( false ); } if( !Get_Connection()->Table_Exists(SG_T("spatial_ref_sys")) || !Get_Connection()->Table_Exists(SG_T("geometry_columns")) ) { SG_UI_Dlg_Message(_TL("Not a valid PostGIS database!"), _TL("Database Connection Error")); return( false ); } // Parameters("SRID")->asChoice()->Set_Items(SG_Get_Projections().Get_Names_List()); /* if( Parameters("SRID")->asChoice()->Get_Count() > 1 ) return( true ); CSG_Table SRIDs; if( !Get_Connection()->Table_Load(SRIDs, SG_T("spatial_ref_sys")) || SRIDs.Get_Count() == 0 ) { return( false ); } CSG_String s, sID; for(int i=0; iasChoice()->Set_Items(s); /**/ return( true ); } //--------------------------------------------------------- bool CPGIS_Shapes_Save::On_Execute(void) { int SRID; CSG_Shapes *pShapes; CSG_String SQL, Geo_Table, Geo_Type, Geo_Field, sSRID; pShapes = Parameters("SHAPES") ->asShapes(); Geo_Table = Parameters("NAME") ->asString(); if( Geo_Table.Length() == 0 ) Geo_Table = pShapes->Get_Name(); // if( !Parameters("SRID")->asChoice()->Get_Data(SRID) ) // { // SRID = -1; // } SRID = Parameters("CRS_EPSG")->asInt(); sSRID.Printf(SG_T("%d"), SRID); //----------------------------------------------------- switch( pShapes->Get_Vertex_Type() ) { case SG_VERTEX_TYPE_XY: switch( pShapes->Get_Type() ) { default: return( false ); case SHAPE_TYPE_Point: Geo_Type = SG_OGIS_TYPE_STR_Point; Geo_Field = SG_T("geo_point"); break; case SHAPE_TYPE_Points: Geo_Type = SG_OGIS_TYPE_STR_MultiPoint; Geo_Field = SG_T("geo_points"); break; case SHAPE_TYPE_Line: Geo_Type = SG_OGIS_TYPE_STR_MultiLine; Geo_Field = SG_T("geo_line"); break; case SHAPE_TYPE_Polygon: Geo_Type = SG_OGIS_TYPE_STR_MultiPolygon; Geo_Field = SG_T("geo_polygon"); break; } break; case SG_VERTEX_TYPE_XYZ: switch( pShapes->Get_Type() ) { default: return( false ); case SHAPE_TYPE_Point: Geo_Type = SG_OGIS_TYPE_STR_Point_Z; Geo_Field = SG_T("geo_point_z"); break; case SHAPE_TYPE_Points: Geo_Type = SG_OGIS_TYPE_STR_MultiPoint_Z; Geo_Field = SG_T("geo_points_z"); break; case SHAPE_TYPE_Line: Geo_Type = SG_OGIS_TYPE_STR_MultiLine_Z; Geo_Field = SG_T("geo_line_z"); break; case SHAPE_TYPE_Polygon: Geo_Type = SG_OGIS_TYPE_STR_MultiPolygon_Z; Geo_Field = SG_T("geo_polygon_z"); break; } break; case SG_VERTEX_TYPE_XYZM: switch( pShapes->Get_Type() ) { default: return( false ); case SHAPE_TYPE_Point: Geo_Type = SG_OGIS_TYPE_STR_Point_ZM; Geo_Field = SG_T("geo_point_zm"); break; case SHAPE_TYPE_Points: Geo_Type = SG_OGIS_TYPE_STR_MultiPoint_ZM; Geo_Field = SG_T("geo_points_zm"); break; case SHAPE_TYPE_Line: Geo_Type = SG_OGIS_TYPE_STR_MultiLine_ZM; Geo_Field = SG_T("geo_line_zm"); break; case SHAPE_TYPE_Polygon: Geo_Type = SG_OGIS_TYPE_STR_MultiPolygon_ZM; Geo_Field = SG_T("geo_polygon_zm"); break; } break; } //----------------------------------------------------- if( Get_Connection()->Table_Exists(Geo_Table) ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("table already exists"), Geo_Table.c_str())); switch( Parameters("EXISTS")->asInt() ) { case 0: // abort export return( false ); case 1: // replace existing table Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("trying to drop table"), Geo_Table.c_str())); if( !Get_Connection()->Table_Drop(Geo_Table, false) ) { Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed"))); return( false ); } break; case 2: // append records, if table structure allows break; } } //----------------------------------------------------- if( !Get_Connection()->Table_Exists(Geo_Table) && !Get_Connection()->Table_Create(Geo_Table, *pShapes, Get_Constraints(Parameters("FLAGS")->asParameters(), pShapes), false) ) { Get_Connection()->Rollback(); return( false ); } //----------------------------------------------------- SQL.Printf(SG_T("SELECT AddGeometryColumn('%s', '%s', %d, '%s', %d)"), Geo_Table.c_str(), // Geo_Field.c_str(), // SRID, // Geo_Type.Make_Upper().c_str(), // 2 // ); if( !Get_Connection()->Execute(SQL) ) { Get_Connection()->Rollback(); Message_Add(_TL("could not create geometry field")); return( false ); } //----------------------------------------------------- int iShape, iField, nAdded; CSG_String Insert, Fields, sWKT; Fields = Geo_Field; for(iField=0; iFieldGet_Field_Count(); iField++) { Fields += CSG_String(", ") + pShapes->Get_Field_Name(iField); } Insert.Printf(SG_T("INSERT INTO %s (%s) VALUES ("), Geo_Table.c_str(), Fields.c_str()); for(iShape=0, nAdded=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); if( pShape->is_Valid() ) { SQL = Insert; CSG_Shapes_OGIS_Converter::to_WKText(pShape, sWKT); SQL += SG_T("ST_GeomFromText('") + sWKT + SG_T("', ") + sSRID + SG_T(")"); for(iField=0; iFieldGet_Field_Count(); iField++) { CSG_String s = pShape->asString(iField); if( pShapes->Get_Field_Type(iField) == SG_DATATYPE_String ) { s.Replace(SG_T("'"), SG_T("\"")); s = SG_T("'") + s + SG_T("'"); } SQL += SG_T(", ") + s; } SQL += SG_T(")"); if( Get_Connection()->Execute(SQL) ) { nAdded++; } else { Message_Add(CSG_String::Format(SG_T("dropped %d. shape"), iShape)); } } } //----------------------------------------------------- if( nAdded == 0 ) { Get_Connection()->Rollback(); Get_Connection()->Table_Drop(Geo_Table); return( false ); } return( Get_Connection()->Commit() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/db/io_odbc/pgis_shapes.h000066400000000000000000000115641224124640700227440ustar00rootroot00000000000000/********************************************************** * Version $Id: pgis_shapes.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_odbc // // // //-------------------------------------------------------// // // // PGIS_Shapes.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__PGIS_Shapes_H #define HEADER_INCLUDED__PGIS_Shapes_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPGIS_Shapes_Load : public CSG_ODBC_Module { public: CPGIS_Shapes_Load(void); virtual CSG_String Get_MenuPath (void) { return( SG_T("R:PostGIS") ); } protected: virtual bool On_Before_Execution (void); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPGIS_Shapes_Save : public CSG_ODBC_Module { public: CPGIS_Shapes_Save(void); virtual CSG_String Get_MenuPath (void) { return( SG_T("R:PostGIS") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Before_Execution (void); virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__PGIS_Shapes_H saga-2.1.0+dfsg/src/modules_io/db/io_odbc/shapes.cpp000066400000000000000000000400261224124640700222500ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_odbc // // // //-------------------------------------------------------// // // // Shapes.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "get_connection.h" #include "shapes.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoints_Load::CPoints_Load(void) { Set_Name (_TL("Points Import")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "Imports points from a database via ODBC." )); Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_OUTPUT, SHAPE_TYPE_Point ); Parameters.Add_Choice( NULL , "TABLES" , _TL("Tables"), _TL(""), CSG_String::Format(SG_T("%s|"), _TL("--- no table available ---") ) ); } //--------------------------------------------------------- bool CPoints_Load::On_Before_Execution(void) { if( !CSG_ODBC_Module::On_Before_Execution() ) { return( false ); } CSG_String Table(Parameters("TABLES")->asString()); return( true ); } //--------------------------------------------------------- bool CPoints_Load::On_Execute(void) { if( Get_Connection()->is_Connected() ) { CSG_Parameter_Choice *pTables = Parameters("TABLES") ->asChoice(); CSG_Shapes *pShapes = Parameters("POINTS") ->asShapes(); return( Get_Connection()->Table_Load(*pShapes, pTables->asString()) ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CPoints_Save::CPoints_Save(void) { Set_Name (_TL("Points Export")); Set_Author (SG_T("O.Conrad (c) 2009")); Set_Description (_TW( "Exports points to a database via ODBC." )); Parameters.Add_Shapes( NULL , "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); } //--------------------------------------------------------- bool CPoints_Save::On_Execute(void) { if( Get_Connection()->is_Connected() ) { CSG_Shapes *pShapes = Parameters("POINTS") ->asShapes(); return( Get_Connection()->Table_Save(pShapes->Get_Name(), *pShapes) ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Load::CShapes_Load(void) { Set_Name (_TL("Shapes Import")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Imports shapes from a database via ODBC." )); Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "TABLES" , _TL("Tables"), _TL(""), CSG_String::Format(SG_T("%s|"), _TL("--- no table available ---") ) ); } //--------------------------------------------------------- bool CShapes_Load::On_Before_Execution(void) { if( !CSG_ODBC_Module::On_Before_Execution() ) { return( false ); } CSG_String Table(Parameters("TABLES")->asString()); Parameters("TABLES")->asChoice()->Set_Items(Get_Connection()->Get_Tables()); Parameters("TABLES")->Set_Value(Table); return( true ); } //--------------------------------------------------------- bool CShapes_Load::On_Execute(void) { if( !Get_Connection()->is_Connected() ) { return( false ); } TSG_Vertex_Type tVertex; TSG_Shape_Type tShape; CSG_String Select, Geo_Table, Geo_Type, Geo_Field; CSG_Table Geo_Tables; CSG_Shapes *pShapes; pShapes = Parameters("SHAPES") ->asShapes(); Geo_Table = Parameters("TABLES") ->asString(); /* Select.Printf(SG_T("SELECT * FROM geometry_columns WHERE f_table_name = '%s'"), Geo_Table.c_str()); if( !Get_Connection()->Table_Load(Geo_Tables, SG_T("geometry_columns"), SG_T("*"), CSG_String::Format(SG_T("f_table_name = '%s'"), Geo_Table.c_str()), SG_T("")) ) { return( false ); } if( Geo_Tables.Get_Count() != 1 ) { return( false ); } Geo_Type = Geo_Tables[0].asString(SG_T("type")); Geo_Field = Geo_Tables[0].asString(SG_T("f_geometry_column")); //----------------------------------------------------- if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Point ) ) { tShape = SHAPE_TYPE_Point; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPoint ) ) { tShape = SHAPE_TYPE_Points; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Line ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiLine ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Polygon ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPolygon ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XY; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Point_Z ) ) { tShape = SHAPE_TYPE_Point; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPoint_Z ) ) { tShape = SHAPE_TYPE_Points; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Line_Z ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiLine_Z ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Polygon_Z ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPolygon_Z ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Point_M ) ) { tShape = SHAPE_TYPE_Point; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPoint_M ) ) { tShape = SHAPE_TYPE_Points; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Line_M ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiLine_M ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Polygon_M ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPolygon_M ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZ; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Point_ZM ) ) { tShape = SHAPE_TYPE_Point; tVertex = SG_VERTEX_TYPE_XYZM; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPoint_ZM ) ) { tShape = SHAPE_TYPE_Points; tVertex = SG_VERTEX_TYPE_XYZM; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Line_ZM ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZM; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiLine_ZM ) ) { tShape = SHAPE_TYPE_Line; tVertex = SG_VERTEX_TYPE_XYZM; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_Polygon_ZM ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZM; } else if( !Geo_Type.CmpNoCase(SG_OGIS_TYPE_STR_MultiPolygon_ZM ) ) { tShape = SHAPE_TYPE_Polygon; tVertex = SG_VERTEX_TYPE_XYZM; } else { return( false ); } /**/ tShape = SHAPE_TYPE_Point; tVertex = SG_VERTEX_TYPE_XY; Geo_Field = SG_T("geom"); if( pShapes->Get_Type() != SHAPE_TYPE_Undefined && pShapes->Get_Type() != tShape ) { pShapes = SG_Create_Shapes(tShape, Geo_Table, NULL, tVertex); Parameters("SHAPES")->Set_Value(pShapes); } else { pShapes->Create(tShape, Geo_Table, NULL, tVertex); } //----------------------------------------------------- if( !Get_Connection()->Table_Load(*pShapes, Geo_Table, true) ) { return( false ); } //----------------------------------------------------- CSG_Bytes_Array BLOBs; Select.Printf(SG_T("%s"), Geo_Field.c_str()); if( !Get_Connection()->Table_Load_BLOBs(BLOBs, Geo_Table, Select, SG_T(""), SG_T("")) ) { return( false ); } if( BLOBs.Get_Count() != pShapes->Get_Count() ) { return( false ); } CSG_Table t; t.Add_Field(SG_T("geom"), SG_DATATYPE_String); for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_String s = SG_T("01"); for(int i=1; iGet_Shape(iShape)); // CSG_Shapes_OGIS_Converter::from_WKBinary(BLOBs[iShape], pShapes->Get_Shape(iShape)); CSG_Table_Record *pr = t.Add_Record(); pr->Set_Value(0, (const SG_Char *)BLOBs[iShape].Get_Bytes()); } DataObject_Add(SG_Create_Table(t)); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Save::CShapes_Save(void) { Set_Name (_TL("Shapes Export")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Exports shapes to a database via ODBC." )); Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_String( NULL , "NAME" , _TL("Table Name"), _TL("if empty shapes layers's name is used as table name"), SG_T("") ); Parameters.Add_Choice( NULL , "EXISTS" , _TL("If table exists..."), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("abort export"), _TL("replace existing table"), _TL("append records, if table structure allows") ), 0 ); } //--------------------------------------------------------- bool CShapes_Save::On_Execute(void) { if( !Get_Connection()->is_Connected() ) { return( false ); } int iShape, iField, nAdded; CSG_String Insert, Fields, sWKT; CSG_String SQL, Name, Geo_Type, Geo_Field, sSRID; CSG_Shapes *pShapes; pShapes = Parameters("SHAPES") ->asShapes(); Name = Parameters("NAME") ->asString(); if( Name.Length() == 0 ) Name = pShapes->Get_Name(); // if( !Parameters("SRID")->asChoice()->Get_Data(SRID) ) // { // SRID = -1; // } //----------------------------------------------------- if( Get_Connection()->Table_Exists(Name) == true ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("table already exists"), Name.c_str())); switch( Parameters("EXISTS")->asInt() ) { case 0: // abort export return( false ); case 1: // replace existing table Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("trying to drop table"), Name.c_str())); if( !Get_Connection()->Table_Drop(Name, false) ) { Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed"))); return( false ); } break; case 2: // append records, if table structure allows break; } } //----------------------------------------------------- if( Get_Connection()->Table_Exists(Name) == false ) { CSG_Table Structure; Structure.Add_Field(SG_T("GEOM"), SG_DATATYPE_Binary); for(iField=0; iFieldGet_Field_Count(); iField++) { Structure.Add_Field(pShapes->Get_Field_Name(iField), pShapes->Get_Field_Type(iField)); } if( !Get_Connection()->Table_Create(Name, Structure) ) { return( false ); } } //----------------------------------------------------- Fields = SG_T("GEOM"); for(iField=0; iFieldGet_Field_Count(); iField++) { Fields += CSG_String(", ") + pShapes->Get_Field_Name(iField); } Insert.Printf(SG_T("INSERT INTO %s (%s) VALUES ("), Name.c_str(), Fields.c_str()); for(iShape=0, nAdded=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Bytes Bytes; CSG_Shape *pShape = pShapes->Get_Shape(iShape); if( pShape->is_Valid() && CSG_Shapes_OGIS_Converter::to_WKBinary(pShape, Bytes) ) { SQL = Insert; if( Get_Connection()->is_PostgreSQL() ) { // SQL += SG_T("decode('") + Bytes.toHexString() + SG_T("', 'hex')"); SQL += SG_T("'\\x") + Bytes.toHexString() + SG_T("'"); } else { SQL += SG_T("'0x") + Bytes.toHexString() + SG_T("'"); } for(iField=0; iFieldGet_Field_Count(); iField++) { CSG_String s = pShape->asString(iField); if( pShapes->Get_Field_Type(iField) == SG_DATATYPE_String ) { s.Replace(SG_T("'"), SG_T("\"")); s = SG_T("'") + s + SG_T("'"); } SQL += SG_T(", ") + s; } SQL += SG_T(")"); if( Get_Connection()->Execute(SQL) ) { nAdded++; } else { Message_Add(CSG_String::Format(SG_T("dropped %d. shape"), 1 + iShape)); } } } //----------------------------------------------------- if( nAdded == 0 ) { Get_Connection()->Rollback(); Get_Connection()->Table_Drop(Name); return( false ); } return( Get_Connection()->Commit() ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/db/io_odbc/shapes.h000066400000000000000000000130251224124640700217140ustar00rootroot00000000000000/********************************************************** * Version $Id: shapes.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_odbc // // // //-------------------------------------------------------// // // // Shapes.h // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes_H #define HEADER_INCLUDED__Shapes_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoints_Load : public CSG_ODBC_Module { public: CPoints_Load(void); virtual CSG_String Get_MenuPath (void) { return( SG_T("R:Shapes") ); } protected: virtual bool On_Before_Execution (void); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CPoints_Save : public CSG_ODBC_Module { public: CPoints_Save(void); virtual CSG_String Get_MenuPath (void) { return( SG_T("R:Shapes") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Load : public CSG_ODBC_Module { public: CShapes_Load(void); virtual CSG_String Get_MenuPath (void) { return( SG_T("R:Shapes") ); } protected: virtual bool On_Before_Execution (void); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Save : public CSG_ODBC_Module { public: CShapes_Save(void); virtual CSG_String Get_MenuPath (void) { return( SG_T("R:Shapes") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shapes_H saga-2.1.0+dfsg/src/modules_io/db/io_odbc/table.cpp000066400000000000000000000310511224124640700220520ustar00rootroot00000000000000/********************************************************** * Version $Id: table.cpp 1508 2012-11-01 16:13:43Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_odbc // // // //-------------------------------------------------------// // // // Table.cpp // // // // Copyright (C) 2008 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "get_connection.h" #include "table.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Info::CTable_Info(void) { Set_Name (_TL("Table Field Description")); Set_Author (SG_T("O.Conrad (c) 2010")); Set_Description (_TW( "Loads table information from ODBC data source." )); Parameters.Add_Table( NULL , "TABLE" , _TL("Field Description"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "TABLES" , _TL("Tables"), _TL(""), CSG_String::Format(SG_T("%s|"), _TL("--- no table available ---") ) ); } //--------------------------------------------------------- bool CTable_Info::On_Before_Execution(void) { if( !CSG_ODBC_Module::On_Before_Execution() ) { return( false ); } CSG_String Table(Parameters("TABLES")->asString()); Parameters("TABLES")->asChoice()->Set_Items(Get_Connection()->Get_Tables()); Parameters("TABLES")->Set_Value(Table); return( true ); } //--------------------------------------------------------- bool CTable_Info::On_Execute(void) { if( !Get_Connection() ) { return( false ); } CSG_Parameter_Choice *pTables = Parameters("TABLES") ->asChoice(); CSG_Table *pTable = Parameters("TABLE") ->asTable(); CSG_Table tmpTable = Get_Connection()->Get_Field_Desc(pTables->asString()); pTable->Assign(&tmpTable); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Load::CTable_Load(void) { Set_Name (_TL("Table Import")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "Imports a table from a database via ODBC." )); Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_Choice( NULL , "TABLES" , _TL("Tables"), _TL(""), CSG_String::Format(SG_T("%s|"), _TL("--- no table available ---") ) ); } //--------------------------------------------------------- bool CTable_Load::On_Before_Execution(void) { if( !CSG_ODBC_Module::On_Before_Execution() ) { return( false ); } CSG_String Tables(Get_Connection()->Get_Tables()); Parameters("TABLES")->asChoice()->Set_Items(Tables); Parameters("TABLES")->Set_Value(Parameters("TABLES")->asString()); return( Tables.Length() > 0 ); } //--------------------------------------------------------- bool CTable_Load::On_Execute(void) { if( !Get_Connection() ) { return( false ); } CSG_Parameter_Choice *pTables = Parameters("TABLES") ->asChoice(); CSG_Table *pTable = Parameters("TABLE") ->asTable(); return( Get_Connection()->Table_Load(*pTable, pTables->asString()) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Save::CTable_Save(void) { Set_Name (_TL("Table Export")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "Exports a table to a database via ODBC." )); Parameters.Add_Table( NULL , "TABLE" , _TL("Table"), _TL(""), PARAMETER_INPUT ); Parameters.Add_String( NULL , "NAME" , _TL("Table Name"), _TL(""), SG_T("") ); Parameters.Add_Parameters( NULL , "FLAGS" , _TL("Constraints"), _TL("") ); Parameters.Add_Choice( NULL , "EXISTS" , _TL("If table exists..."), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("abort export"), _TL("replace existing table"), _TL("append records, if table structure allows") ), 0 ); } //--------------------------------------------------------- int CTable_Save::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TABLE")) ) { pParameters->Get_Parameter("NAME")->Set_Value(pParameter->asTable() ? pParameter->asTable()->Get_Name() : SG_T("")); Set_Constraints(pParameters->Get_Parameter("FLAGS")->asParameters(), pParameter->asTable()); } return( 0 ); } //--------------------------------------------------------- bool CTable_Save::On_Execute(void) { if( !Get_Connection() ) { return( false ); } bool bResult = false; CSG_Table *pTable = Parameters("TABLE")->asTable(); CSG_String Name = Parameters("NAME" )->asString(); if( Name.Length() == 0 ) Name = pTable->Get_Name(); //----------------------------------------------------- if( Get_Connection()->Table_Exists(Name) ) { Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("table already exists"), Name.c_str())); switch( Parameters("EXISTS")->asInt() ) { case 0: // abort export break; case 1: // replace existing table Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("dropping table"), Name.c_str())); if( !Get_Connection()->Table_Drop(Name, false) ) { Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed"))); } else { bResult = Get_Connection()->Table_Save(Name, *pTable, Get_Constraints(Parameters("FLAGS")->asParameters(), pTable)); } break; case 2: // append records, if table structure allows Message_Add(CSG_String::Format(SG_T("%s: %s"), _TL("appending to existing table"), Name.c_str())); if( !(bResult = Get_Connection()->Table_Insert(Name, *pTable)) ) { Message_Add(CSG_String::Format(SG_T(" ...%s!"), _TL("failed"))); } break; } } else { bResult = Get_Connection()->Table_Save(Name, *pTable, Get_Constraints(Parameters("FLAGS")->asParameters(), pTable)); } //----------------------------------------------------- if( bResult ) { SG_UI_ODBC_Update(Get_Connection()->Get_Server()); } return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Drop::CTable_Drop(void) { Set_Name (_TL("Table Deletion")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "Deletes a table from a database via ODBC." )); Parameters.Add_Choice( NULL , "TABLES" , _TL("Tables"), _TL(""), CSG_String::Format(SG_T("%s|"), _TL("--- no table available ---") ) ); } //--------------------------------------------------------- bool CTable_Drop::On_Before_Execution(void) { if( !CSG_ODBC_Module::On_Before_Execution() ) { return( false ); } CSG_String Table(Parameters("TABLES")->asString()); Parameters("TABLES")->asChoice()->Set_Items(Get_Connection()->Get_Tables()); if( Parameters("TABLES")->asChoice()->Get_Count() == 0 ) { Message_Dlg(_TL("No tables available in database!")); return( false ); } return( true ); } //--------------------------------------------------------- bool CTable_Drop::On_Execute(void) { if( Get_Connection() && Get_Connection()->Table_Drop(Parameters("TABLES")->asChoice()->asString()) ) { SG_UI_ODBC_Update(Get_Connection()->Get_Server()); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CTable_Query::CTable_Query(void) { CSG_Parameter *pNode; Set_Name (_TL("Table from Query")); Set_Author (SG_T("O.Conrad (c) 2008")); Set_Description (_TW( "Import a SQL table from a database via ODBC." )); Parameters.Add_Table( NULL , "TABLE" , _TL("Table from SQL Query"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_String( NULL , "TABLES" , _TL("Tables"), _TL(""), SG_T("") ); Parameters.Add_String( NULL , "FIELDS" , _TL("Fields"), _TL(""), SG_T("*") ); Parameters.Add_String( NULL , "WHERE" , _TL("Where"), _TL(""), SG_T("") ); pNode = Parameters.Add_String( NULL , "GROUP" , _TL("Group by"), _TL(""), SG_T("") ); Parameters.Add_String( pNode , "HAVING" , _TL("Having"), _TL(""), SG_T("") ); Parameters.Add_String( NULL , "ORDER" , _TL("Order by"), _TL(""), SG_T("") ); Parameters.Add_Value( NULL , "DISTINCT" , _TL("Distinct"), _TL(""), PARAMETER_TYPE_Bool, false ); } //--------------------------------------------------------- bool CTable_Query::On_Execute(void) { if( !Get_Connection() ) { return( false ); } CSG_Table *pTable = Parameters("TABLE") ->asTable (); CSG_String Tables = Parameters("TABLES") ->asString(); CSG_String Fields = Parameters("FIELDS") ->asString(); CSG_String Where = Parameters("WHERE") ->asString(); CSG_String Group = Parameters("GROUP") ->asString(); CSG_String Having = Parameters("HAVING") ->asString(); CSG_String Order = Parameters("ORDER") ->asString(); bool bDistinct = Parameters("DISTINCT")->asBool (); return( Get_Connection()->Table_Load(*pTable, Tables, Fields, Where, Group, Having, Order, bDistinct) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/db/io_odbc/table.h000066400000000000000000000142551224124640700215260ustar00rootroot00000000000000/********************************************************** * Version $Id: table.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_odbc // // // //-------------------------------------------------------// // // // Table.h // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Table_H #define HEADER_INCLUDED__Table_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Info : public CSG_ODBC_Module { public: CTable_Info(void); virtual CSG_String Get_MenuPath (void) { return( SG_T("R:Tables") ); } protected: virtual bool On_Before_Execution (void); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Load : public CSG_ODBC_Module { public: CTable_Load(void); virtual CSG_String Get_MenuPath (void) { return( SG_T("R:Tables") ); } protected: virtual bool On_Before_Execution (void); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Save : public CSG_ODBC_Module { public: CTable_Save(void); virtual CSG_String Get_MenuPath (void) { return( SG_T("R:Tables") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Drop : public CSG_ODBC_Module { public: CTable_Drop(void); virtual CSG_String Get_MenuPath (void) { return( SG_T("R:Tables") ); } protected: virtual bool On_Before_Execution (void); virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CTable_Query : public CSG_ODBC_Module { public: CTable_Query(void); virtual CSG_String Get_MenuPath (void) { return( SG_T("R:Tables") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Table_H saga-2.1.0+dfsg/src/modules_io/docs/000077500000000000000000000000001224124640700172245ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/docs/Makefile.am000066400000000000000000000000361224124640700212570ustar00rootroot00000000000000SUBDIRS = docs_html docs_pdf saga-2.1.0+dfsg/src/modules_io/docs/Makefile.in000066400000000000000000000424461224124640700213030ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/docs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = docs_html docs_pdf all: all-recursive .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) --gnu src/modules_io/docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/docs/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_io/docs/docs_html/000077500000000000000000000000001224124640700212005ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/docs/docs_html/CreateWebContent.cpp000066400000000000000000000124351224124640700251050ustar00rootroot00000000000000/********************************************************** * Version $Id: CreateWebContent.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* PhotoLinks.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "CreateWebContent.h" CCreateWebContent::CCreateWebContent(void) { CSG_Parameter *pNode; //----------------------------------------------------- Parameters.Set_Name(_TL("Create Web Content")); Parameters.Set_Description(_TL("")); pNode = Parameters.Add_Shapes(NULL, "SHAPES", _TL("Shapes"), _TL(""), PARAMETER_INPUT); Parameters.Add_Table_Field(pNode, "NAME", _TL("Name Field"), _TL("")); Parameters.Add_FilePath(NULL, "OUTPUTPATH", _TL("Path for HTML Files"), _TL(""), _TL(""), _TL(""), true, true); } CCreateWebContent::~CCreateWebContent(void) {} bool CCreateWebContent::On_Execute(void) { m_bDown = false; m_pShapes = Parameters("SHAPES")->asShapes(); m_iNameField = Parameters("NAME")->asInt(); m_sOutputPath = Parameters("OUTPUTPATH")->asString(); m_pShapes->Add_Field("HTML", SG_DATATYPE_String); m_iField = m_pShapes->Get_Field_Count() - 1; m_Pictures = new std::vector [m_pShapes->Get_Count()]; m_Links = new std::vector [m_pShapes->Get_Count()]; m_LinksDescription = new std::vector [m_pShapes->Get_Count()]; return true ; } bool CCreateWebContent::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode) { int i; int iIndex, iShape; CSG_Rect r; switch( Mode ){ case MODULE_INTERACTIVE_LDOWN: if( m_bDown == false ){ m_bDown = true; m_ptDown = ptWorld; }//if return true ; case MODULE_INTERACTIVE_LUP: if( m_bDown == true ){ m_bDown = false; r.Assign(m_ptDown.Get_X(), m_ptDown.Get_Y(), ptWorld.Get_X(), ptWorld.Get_Y()); if( r.Get_XRange() == 0.0 && r.Get_YRange() == 0.0 ){ m_pShapes->Select(m_pShapes->Get_Shape(m_ptDown), is_Shift()); }//if else{ m_pShapes->Select(r, is_Shift()); }//else DataObject_Update(m_pShapes, true); }//if return true; case MODULE_INTERACTIVE_RDOWN: CSG_String sFileName; CSG_Strings files; CSG_Parameters dlg_files; dlg_files.Add_FilePath(NULL, "FILES", _TL("Files"), _TL(""), _TL("Images|*.bmp;*.jpg;*.png;*.tif|HTML Files|*.htm|All Files|*.*"), NULL, false, false, true); if( Dlg_Parameters(&dlg_files, _TL("Add Link to Files")) && dlg_files("FILES")->asFilePath()->Get_FilePaths(files) ) { for (iShape = 0; iShape < m_pShapes->Get_Selection_Count(); iShape++){ iIndex = m_pShapes->Get_Selection(iShape)->Get_Index(); for (i = 0; i < files.Get_Count(); i++) { sFileName = "file://"; sFileName.Append((CSG_String)files[i]); if (SG_File_Cmp_Extension (files[i],SG_T("htm"))){ m_LinksDescription[iIndex].push_back(SG_File_Get_Name(files[i], true)); m_Links[iIndex].push_back(sFileName); }//if else if ( SG_File_Cmp_Extension (files[i],SG_T("bmp")) || SG_File_Cmp_Extension (files[i],SG_T("jpg")) || SG_File_Cmp_Extension (files[i],SG_T("png")) || SG_File_Cmp_Extension (files[i],SG_T("tif"))){ m_Pictures[iIndex].push_back(sFileName); }//else } sFileName = SG_File_Make_Path(m_sOutputPath.c_str(), m_pShapes->Get_Shape(iIndex)->asString(m_iNameField), SG_T("htm")); m_pShapes->Get_Shape(iIndex)->Set_Value(m_iField, sFileName); } } break; }//switch return false ; }//method bool CCreateWebContent::On_Execute_Finish(void){ int i,j; CSG_String sFileName; CSG_Doc_HTML HTMLDoc; for (i = 0; i < m_pShapes->Get_Count(); i++){ Set_Progress(i, m_pShapes->Get_Count()); const SG_Char **Pictures; if (m_Pictures[i].size() || m_Links[i].size()){ HTMLDoc.Open(m_pShapes->Get_Shape(i)->asString(m_iNameField)); Pictures = new const SG_Char *[m_Pictures[i].size()]; for (j = 0; j < m_Pictures[i].size(); j++){ Pictures[j] = m_Pictures[i].at(j).c_str(); }//for*/ HTMLDoc.AddThumbnails(Pictures, m_Pictures[i].size(), 4); HTMLDoc.AddLineBreak(); for (j = 0; j < m_Links[i].size(); j++){ HTMLDoc.AddHyperlink(m_LinksDescription[i].at(j).c_str(), m_Links[i].at(j).c_str()); HTMLDoc.AddLineBreak(); }//for sFileName = SG_File_Make_Path(m_sOutputPath.c_str(), m_pShapes->Get_Shape(i)->asString(m_iNameField), SG_T("htm")); HTMLDoc.Save(sFileName); }//if }//for return true; }//method saga-2.1.0+dfsg/src/modules_io/docs/docs_html/CreateWebContent.h000066400000000000000000000035511224124640700245510ustar00rootroot00000000000000/********************************************************** * Version $Id: CreateWebContent.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* Photolinks.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #ifndef HEADER_INCLUDED__CreateWebContent_H #define HEADER_INCLUDED__CreateWebContent_H #include "doc_html.h" #include class CCreateWebContent : public CSG_Module_Interactive { public: CCreateWebContent(void); virtual ~CCreateWebContent(void); protected: virtual bool On_Execute(void); virtual bool On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode); virtual bool On_Execute_Finish(void); private: bool m_bDown; CSG_Point m_ptDown; CSG_Shapes *m_pShapes; int m_iField, m_iNameField; CSG_String m_sOutputPath; std::vector *m_Pictures; std::vector *m_Links; std::vector *m_LinksDescription; }; #endif // #ifndef HEADER_INCLUDED__CreateWebContent_H saga-2.1.0+dfsg/src/modules_io/docs/docs_html/MLB_Interface.cpp000066400000000000000000000105201224124640700242740ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_html // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Reports - HTML") ); case MLB_INFO_Author: return( SG_T("SAGA User Group (c) 2010") ); case MLB_INFO_Description: return( _TW( "Reports and document creation in Hypertext Mark Up Language (HTML) format." )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("File|Reports") ); } } //--------------------------------------------------------- #include "CreateWebContent.h" #include "svg_interactive_map.h" //--------------------------------------------------------- CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CCreateWebContent ); case 1: return( new CSVG_Interactive_Map ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_io/docs/docs_html/MLB_Interface.h000066400000000000000000000075661224124640700237610ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_html // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__docs_html__mlb_interface_H #define HEADER_INCLUDED__docs_html__mlb_interface_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef docs_html_EXPORTS #define docs_html_EXPORT _SAGA_DLL_EXPORT #else #define docs_html_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__docs_html__mlb_interface_H saga-2.1.0+dfsg/src/modules_io/docs/docs_html/Makefile.am000066400000000000000000000013171224124640700232360ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libdocs_html.la libdocs_html_la_SOURCES =\ CreateWebContent.cpp\ doc_html.cpp\ doc_svg.cpp\ MLB_Interface.cpp\ svg_interactive_map.cpp\ CreateWebContent.h\ doc_html.h\ doc_svg.h\ MLB_Interface.h\ svg_interactive_map.h libdocs_html_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_io/docs/docs_html/Makefile.in000066400000000000000000000447401224124640700232560ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/docs/docs_html DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libdocs_html_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libdocs_html_la_OBJECTS = CreateWebContent.lo doc_html.lo \ doc_svg.lo MLB_Interface.lo svg_interactive_map.lo libdocs_html_la_OBJECTS = $(am_libdocs_html_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdocs_html_la_SOURCES) DIST_SOURCES = $(libdocs_html_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libdocs_html.la libdocs_html_la_SOURCES = \ CreateWebContent.cpp\ doc_html.cpp\ doc_svg.cpp\ MLB_Interface.cpp\ svg_interactive_map.cpp\ CreateWebContent.h\ doc_html.h\ doc_svg.h\ MLB_Interface.h\ svg_interactive_map.h libdocs_html_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_io/docs/docs_html/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/docs/docs_html/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdocs_html.la: $(libdocs_html_la_OBJECTS) $(libdocs_html_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libdocs_html_la_OBJECTS) $(libdocs_html_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CreateWebContent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/doc_html.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/doc_svg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svg_interactive_map.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_io/docs/docs_html/doc_html.cpp000066400000000000000000000447561224124640700235150ustar00rootroot00000000000000/********************************************************** * Version $Id: doc_html.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_html // // // // // //-------------------------------------------------------// // // // doc_html.cpp // // // // Copyright (C) 2005 by // // Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. // // // // This library is free software; you can redistribute // // it and/or modify it under the terms of the GNU Lesser // // General Public License as published by the Free // // Software Foundation, version 2.1 of the License. // // // // This library 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 Lesser General Public // // License for more details. // // // // You should have received a copy of the GNU Lesser // // General Public License along with this program; if // // not, write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // contact: Victor Olaya // // // // e-mail: volaya@saga-gis.org // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "doc_html.h" //--------------------------------------------------------- #define GRAPH_WIDTH 700 #define GRAPH_HEIGHT 350 #define MAP_WIDTH 700. #define MAP_HEIGHT 700. #define OFFSET_X 50 #define OFFSET_Y 50 //--------------------------------------------------------- #define HTML_CODE_OPENING_1 SG_T("\n") #define HTML_CODE_OPENING_2 SG_T("\n")\ SG_T("\n")\ SG_T("\n")\ SG_T("\n") #define HTML_CODE_CLOSING SG_T("\n") /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Doc_HTML::CSG_Doc_HTML(){} CSG_Doc_HTML::~CSG_Doc_HTML(){} void CSG_Doc_HTML::Open(const SG_Char *Title) { m_sHTMLCode.Clear(); m_sHTMLCode.Append(HTML_CODE_OPENING_1); m_sHTMLCode.Append(Title); m_sHTMLCode.Append(HTML_CODE_OPENING_2); } bool CSG_Doc_HTML::Save(const SG_Char *Filename) { m_sHTMLCode.Append(HTML_CODE_CLOSING); CSG_File Stream(Filename, SG_FILE_W, false); if( Stream.is_Open() ) { Stream.Printf(SG_T("%s"), m_sHTMLCode.c_str()); return true; } return false; } void CSG_Doc_HTML::AddParagraph(const SG_Char *Text) { m_sHTMLCode.Append(SG_T("

")); m_sHTMLCode.Append(Text); m_sHTMLCode.Append(SG_T("

\n")); } void CSG_Doc_HTML::AddLineBreak() { m_sHTMLCode.Append(SG_T("
")); } void CSG_Doc_HTML::AddHeader(const SG_Char *Text, int iOrder) { m_sHTMLCode.Append(SG_T("")); m_sHTMLCode.Append(Text); m_sHTMLCode.Append(SG_T("\n")); } void CSG_Doc_HTML::AddHyperlink(const SG_Char *Text, const SG_Char *URL) { m_sHTMLCode.Append(SG_T("\n")); m_sHTMLCode.Append(Text); m_sHTMLCode.Append(SG_T("\n")); } CSG_String CSG_Doc_HTML::GetHyperlinkCode(const SG_Char *Text, const SG_Char *URL) { CSG_String s; s.Append(SG_T("\n")); s.Append(Text); s.Append(SG_T("\n")); return s; } void CSG_Doc_HTML::AddImage(const SG_Char *Filename) { m_sHTMLCode.Append(SG_T("\n")); } void CSG_Doc_HTML::AddThumbnail(const SG_Char *Filename, int iWidth, bool bIsPercent) { m_sHTMLCode.Append(SG_T("\n")); m_sHTMLCode.Append(SG_T("

\n")); } void CSG_Doc_HTML::AddThumbnails(const SG_Char **Filename, int iImages, int iThumbnailsPerRow) { int i,j; int iImage = 0; int iRows = (int)ceil((double)iImages / (double)iThumbnailsPerRow); int iWidth = (int)(100.0 / (double)iThumbnailsPerRow); m_sHTMLCode.Append(SG_T("\n")); for (i=0; i\n")); for (j=0; j")); AddThumbnail(Filename[iImage], 100, true); iImage++; if (iImage >= iImages){ break; } m_sHTMLCode.Append(SG_T("")); } m_sHTMLCode.Append(SG_T("\n\n")); } m_sHTMLCode.Append(SG_T("\n
\n")); } void CSG_Doc_HTML::StartUnorderedList() { m_sHTMLCode.Append(SG_T("
    \n")); } void CSG_Doc_HTML::StartOrderedList() { m_sHTMLCode.Append(SG_T("
      \n")); } void CSG_Doc_HTML::CloseUnorderedList() { m_sHTMLCode.Append(SG_T("
\n")); } void CSG_Doc_HTML::CloseOrderedList() { m_sHTMLCode.Append(SG_T("\n")); } void CSG_Doc_HTML::AddListElement(const SG_Char *Text) { m_sHTMLCode.Append(SG_T("
  • ")); m_sHTMLCode.Append(Text); m_sHTMLCode.Append(SG_T("
  • \n")); } void CSG_Doc_HTML::AddOrderedList(const SG_Char **Text, int iElements) { StartOrderedList(); for (int i = 0; i < iElements; i++) { AddListElement(Text[i]); } CloseOrderedList(); } void CSG_Doc_HTML::AddUnorderedList(const SG_Char **Text, int iElements) { StartUnorderedList(); for (int i = 0; i < iElements; i++) { AddListElement(Text[i]); } CloseUnorderedList(); } void CSG_Doc_HTML::AddCurve(const SG_Char *Filename, CSG_Points &Data, const SG_Char *Description, int iGraphType, bool bIncludeTableData) { int i; int iMag; int iNumLines; double fMinLine = 0; double fWidth; double fMax, fMin; double fRange, fRangeX; double fStep; double fX, fY, fY2; double fMaxX, fMinX; CSG_String sValue; CSG_String sTableFilename; CSG_Points Points; CSG_Doc_SVG SVG; m_sHTMLCode.Append(SG_T("
    \n")); m_sHTMLCode.Append(SG_T("

    ")); m_sHTMLCode.Append(Description); m_sHTMLCode.Append(SG_T("

    \n")); fMin = fMax = Data[0].y; for (i = 0; i < Data.Get_Count(); i++) { if (Data[i].y > fMax) { fMax = Data[i].y; } if (Data[i].y < fMin) { fMin = Data[i].y; } if (iGraphType == HTML_GRAPH_TYPE_BARS){ fMin = M_GET_MIN(0, fMin); } } fRange = fMax - fMin; fMaxX = Data[Data.Get_Count() - 1].x; fMinX = Data[0].x; fRangeX = fMaxX - fMinX; SVG.Open(GRAPH_WIDTH + OFFSET_X, GRAPH_HEIGHT + OFFSET_Y); if (fMin != fMax){ iMag = (int) (log(fMax - fMin) / log(10.0)); fStep = (int) pow(10.0, (double) iMag); if (fStep == 0) { fStep = 1.; } if (fMin < 0) { iMag = (int) (log(fabs(fMin)) / log(10.0)); fMinLine = -(int) pow(10.0, (double) iMag); } else { fMinLine=(int)(((int)(fMin/fStep)) *fStep); } iNumLines = (int) ((fMax - fMin) / fStep); while (iNumLines < 8) { fStep = fStep / 2.0; iNumLines = (int) ((fMax - fMin) / fStep); } iNumLines = (int) ((fMax - fMinLine) / fStep); } else{ if (fMin > 0) { fStep = fMin = 0; iNumLines = 1; fMinLine = fMax; } else if (fMin < 0) { fStep = 0; fMin = fMin - 1; fMinLine = fMax; } else { return; } } for (i = 0; i < iNumLines; i++) { fY = (fMinLine + fStep * i - fMin) / (fRange) * GRAPH_HEIGHT; fY = GRAPH_HEIGHT - fY; if (fY >= 0 && fY <= GRAPH_HEIGHT) { SVG.Draw_Line(OFFSET_X - 10, fY, GRAPH_WIDTH + OFFSET_X, fY); SVG.Draw_Text(OFFSET_X - 10, fY, SG_Get_String(fMinLine + fStep * i, 1), 0, SG_T("Verdana"), 8, SVG_ALIGNMENT_Right); } } if (iGraphType == HTML_GRAPH_TYPE_BARS) { fWidth = GRAPH_WIDTH / (double) (Data.Get_Count()) ; for (i = 0; i < Data.Get_Count(); i++) { fX = OFFSET_X + i * fWidth; fY = GRAPH_HEIGHT; fY2 = (Data.Get_Y(i) - fMin) / fRange * GRAPH_HEIGHT; fY2 = GRAPH_HEIGHT - fY2; SVG.Draw_Rectangle(fX, fY, fX + fWidth, fY2, 0x660000, 0x000000); } } else { for (i = 0; i < Data.Get_Count(); i++) { fX = OFFSET_X + (Data.Get_X(i) - fMinX) / fRangeX * GRAPH_WIDTH; fY = (Data.Get_Y(i) - fMin) / fRange * GRAPH_HEIGHT; fY = GRAPH_HEIGHT - fY; Points.Add(fX, fY); } SVG.Draw_Line(Points, 4, 0x660000); } if (fMaxX != fMinX) { iMag = (int) (log(fMaxX - fMinX) / log(10.0)); fStep = (double) pow(10.0, (double) iMag); iNumLines = (int) ((fMaxX -fMinX) / fStep); while (iNumLines < 5) { fStep = fStep / 2.0; iNumLines = (int) ((fMaxX-fMinX) / fStep); } fMinLine = (int)(((int)(fMinX/fStep)) * fStep); while (fMinLine = OFFSET_X && fX <= GRAPH_WIDTH + OFFSET_X){ if (fabs(fStep * i +fMinLine) > 100000) { sValue = SG_Get_String(fStep * i +fMinLine); } else { sValue = SG_Get_String(fStep * i + fMinLine, 2, true); } SVG.Draw_Text(fX, GRAPH_HEIGHT + 10, sValue, 0, SG_T("Verdana"), 8, SVG_ALIGNMENT_Center); SVG.Draw_Line(fX, GRAPH_HEIGHT, fX, GRAPH_HEIGHT - 5); } } } SVG.Draw_Line(OFFSET_X, 0, OFFSET_X, GRAPH_HEIGHT, 4); SVG.Draw_Line(OFFSET_X, GRAPH_HEIGHT, OFFSET_X + GRAPH_WIDTH, GRAPH_HEIGHT, 4); SVG.Save(Filename); if (bIncludeTableData) { CSG_Doc_HTML HTMLDoc; HTMLDoc.Open(_TL("Data Table")); sTableFilename = Filename; sTableFilename.Append(SG_T(".htm")); m_sHTMLCode.Append(SG_T("")); m_sHTMLCode.Append(_TL("Data Table")); m_sHTMLCode.Append(SG_T("

    \n")); HTMLDoc._AddBicolumTable(&Data); HTMLDoc.Save(sTableFilename); } }//method void CSG_Doc_HTML::_AddBicolumTable(CSG_Points *pData) { int i; m_sHTMLCode.Append(SG_T("\n")); m_sHTMLCode.Append( SG_T("\n") SG_T("\n") SG_T("\n") ); for (i=0; iGet_Count(); i++) { m_sHTMLCode.Append(SG_T("\n")); m_sHTMLCode.Append(SG_T("")); m_sHTMLCode.Append(SG_T("")); m_sHTMLCode.Append(SG_T("\n\n")); } m_sHTMLCode.Append(SG_T("\n
    XY
    ")); m_sHTMLCode.Append(SG_Get_String(pData->Get_X(i),2)); m_sHTMLCode.Append(SG_T("")); m_sHTMLCode.Append(SG_Get_String(pData->Get_Y(i),2)); m_sHTMLCode.Append(SG_T("
    \n")); m_sHTMLCode.Append(SG_T("

    ")); m_sHTMLCode.Append(_TL("Data Table")); m_sHTMLCode.Append(SG_T("

    \n")); } void CSG_Doc_HTML::AddTable(const SG_Char ***Table, int iRows, int iCols, const SG_Char *Description) { int i,j; int iWidth = (int) (100/iCols); m_sHTMLCode.Append(SG_T("\n")); for (i=0; i\n")); } else { m_sHTMLCode.Append(SG_T("\n")); } for (j=0; j")); try { m_sHTMLCode.Append(Table[i][j]); } catch(...){} m_sHTMLCode.Append(SG_T("")); } m_sHTMLCode.Append(SG_T("\n\n")); } m_sHTMLCode.Append(SG_T("\n
    \n")); m_sHTMLCode.Append(SG_T("

    ")); m_sHTMLCode.Append(Description); m_sHTMLCode.Append(SG_T("

    \n")); } void CSG_Doc_HTML::AddTable(CSG_Table *pTable) { int i,j; int iWidth = (int) (100/pTable->Get_Field_Count()); m_sHTMLCode.Append(SG_T("\n")); m_sHTMLCode.Append(SG_T("\n")); for (i=0; iGet_Field_Count(); i++){ m_sHTMLCode.Append(SG_T("")); } m_sHTMLCode.Append(SG_T("\n\n")); for (i=0; iGet_Record_Count(); i++) { m_sHTMLCode.Append(SG_T("\n")); for (j=0; jGet_Field_Count(); j++){ m_sHTMLCode.Append(SG_T("")); } m_sHTMLCode.Append(SG_T("\n\n")); } m_sHTMLCode.Append(SG_T("\n
    ")); m_sHTMLCode.Append(pTable->Get_Field_Name(i)); m_sHTMLCode.Append(SG_T("
    ")); try { m_sHTMLCode.Append(pTable->Get_Record(i)->asString(j)); } catch(...){} m_sHTMLCode.Append(SG_T("
    \n")); m_sHTMLCode.Append(SG_T("

    ")); m_sHTMLCode.Append(pTable->Get_Name()); m_sHTMLCode.Append(SG_T("

    \n")); } bool CSG_Doc_HTML::_Draw_Shape(CSG_Doc_SVG &SVG, CSG_Shape *pShape, CSG_Rect GlobalRect, int Fill_Color, int Line_Color, int Line_Width, int Point_Width) { if( pShape && pShape->is_Valid() ) { int iPart, iPoint; double x,y; TSG_Point Point; CSG_Points Points; double dWidth, dHeight; double dOffsetX, dOffsetY; if (GlobalRect.Get_XRange() / GlobalRect.Get_YRange() > MAP_WIDTH / MAP_HEIGHT) { dWidth = MAP_WIDTH * .95; dHeight = MAP_HEIGHT / GlobalRect.Get_XRange() * GlobalRect.Get_YRange(); } else{ dHeight = MAP_HEIGHT * .95; dWidth = MAP_WIDTH / GlobalRect.Get_YRange() * GlobalRect.Get_XRange(); } dOffsetX = (MAP_WIDTH - dWidth) / 2.; dOffsetY = (MAP_HEIGHT - dHeight) / 2.; SVG.Draw_Rectangle(0,0,MAP_WIDTH,MAP_HEIGHT,SG_COLOR_NONE,SG_COLOR_BLACK,1); for(iPart=0; iPartGet_Part_Count(); iPart++) { Points.Clear(); for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { Point = pShape->Get_Point(iPoint, iPart); x = dOffsetX + (Point.x - GlobalRect.Get_XMin()) / GlobalRect.Get_XRange() * dWidth; y = (Point.y - GlobalRect.Get_YMin()) / GlobalRect.Get_YRange() * dHeight; y = MAP_HEIGHT - y - dOffsetY; Points.Add(x, y); } switch( pShape->Get_Type() ) { case SHAPE_TYPE_Point: case SHAPE_TYPE_Points: for(iPoint=0; iPointis_Lake(iPart) ) { SVG.Draw_Polygon(Points, SG_COLOR_WHITE, Line_Color, Line_Width); } else { SVG.Draw_Polygon(Points, Fill_Color, Line_Color, Line_Width); } break; } } return( true ); } return( false ); } bool CSG_Doc_HTML::Draw_Shapes(CSG_Shapes *pShapes, const SG_Char *Filename, int Fill_Color, int Line_Color, int Line_Width) { CSG_Doc_SVG SVG; CSG_Rect r; if( pShapes && pShapes->is_Valid()) { r = pShapes->Get_Extent(); SVG.Open((int)MAP_WIDTH, (int)MAP_HEIGHT); for(int iShape=0; iShapeGet_Count(); iShape++) { _Draw_Shape(SVG, pShapes->Get_Shape(iShape), r, Fill_Color, Line_Color, 1, 3); } SVG.Save(Filename); m_sHTMLCode.Append(SG_T("
    \n

    \n")); return( true ); } return( false ); } saga-2.1.0+dfsg/src/modules_io/docs/docs_html/doc_html.h000066400000000000000000000142501224124640700231440ustar00rootroot00000000000000/********************************************************** * Version $Id: doc_html.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_html // // // //-------------------------------------------------------// // // // doc_html.h // // // // Copyright (C) 2005 by // // Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. // // // // This library is free software; you can redistribute // // it and/or modify it under the terms of the GNU Lesser // // General Public License as published by the Free // // Software Foundation, version 2.1 of the License. // // // // This library 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 Lesser General Public // // License for more details. // // // // You should have received a copy of the GNU Lesser // // General Public License along with this program; if // // not, write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__docs_html__doc_html_H #define HEADER_INCLUDED__docs_html__doc_html_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "doc_svg.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define HTML_GRAPH_TYPE_BARS 1 #define HTML_GRAPH_TYPE_LINES 2 #define HTML_COLOR_RANDOM -2 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class docs_html_EXPORT CSG_Doc_HTML { public: CSG_Doc_HTML(void); virtual ~CSG_Doc_HTML(void); void Open (const SG_Char *Title); bool Save (const SG_Char *FileName); void AddCurve (const SG_Char *Filename, CSG_Points &Points, const SG_Char *Description, int iGraphType, bool bIncludeTableData); void AddTable (const SG_Char ***Table, int iRows, int iCols, const SG_Char *Description); void AddTable (CSG_Table *pTable); void AddParagraph (const SG_Char *Text); void AddLineBreak (); void AddHeader (const SG_Char *Text, int iOrder); void AddHyperlink (const SG_Char *Text, const SG_Char *URL); CSG_String GetHyperlinkCode (const SG_Char *Text, const SG_Char *URL); void AddImage (const SG_Char *Filename); void AddThumbnail (const SG_Char *Filename, int iWidth, bool bIsPercent); void AddThumbnails (const SG_Char **Text, int iImages, int iThumbnailsPerRow); void StartUnorderedList (void); void StartOrderedList (void); void CloseUnorderedList (void); void CloseOrderedList (void); void AddListElement (const SG_Char *Text); void AddOrderedList (const SG_Char **Text, int iElement); void AddUnorderedList (const SG_Char **Text, int iElement); bool Draw_Shapes (CSG_Shapes *pShapes, const SG_Char *Filename, int Fill_Color, int Line_Color, int Line_Width); private: CSG_String m_sHTMLCode; bool _Draw_Shape (CSG_Doc_SVG &SVG, CSG_Shape *pShape, CSG_Rect GlobalRect, int Fill_Color, int Line_Color, int Line_Width, int Point_Width); void _AddBicolumTable (CSG_Points *pData); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__docs_html__doc_html_H saga-2.1.0+dfsg/src/modules_io/docs/docs_html/doc_svg.cpp000066400000000000000000000272601224124640700233370ustar00rootroot00000000000000/********************************************************** * Version $Id: doc_svg.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_html // // // // // //-------------------------------------------------------// // // // doc_svg.cpp // // // // Copyright (C) 2005 by // // Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. // // // // This library is free software; you can redistribute // // it and/or modify it under the terms of the GNU Lesser // // General Public License as published by the Free // // Software Foundation, version 2.1 of the License. // // // // This library 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 Lesser General Public // // License for more details. // // // // You should have received a copy of the GNU Lesser // // General Public License along with this program; if // // not, write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // // e-mail: oconrad@saga-gis.org // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "doc_svg.h" #include //--------------------------------------------------------- #define SVG_CODE_OPENING_1 SG_T("\n")\ SG_T("\n")\ SG_T("\n") #define SVG_CODE_CLOSING SG_T("") //--------------------------------------------------------- const SG_Char *g_Unit = SG_T(""); /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Doc_SVG::CSG_Doc_SVG(){} CSG_Doc_SVG::~CSG_Doc_SVG(){} void CSG_Doc_SVG::Open(int iWidth, int iHeight) { m_sSVGCode.Append(SVG_CODE_OPENING_1); m_sSVGCode.Append(SG_Get_String(iWidth,0)); m_sSVGCode.Append(SG_T("\" height=\"")); m_sSVGCode.Append(SG_Get_String(iHeight,0)); m_sSVGCode.Append(SVG_CODE_OPENING_2); m_iWidth = iWidth; m_iHeight = iHeight; } bool CSG_Doc_SVG::Save(const SG_Char *Filename) { m_sSVGCode.Append(SVG_CODE_CLOSING); CSG_File Stream(Filename, SG_FILE_W, false); if( Stream.is_Open() ) { Stream.Printf(SG_T("%s"), m_sSVGCode.c_str()); return true; } return false; } void CSG_Doc_SVG::_AddAttribute(const SG_Char *Attribute, const SG_Char *Value) { m_sSVGCode.Append(Attribute); m_sSVGCode.Append(SG_T("=\"")); m_sSVGCode.Append(Value); m_sSVGCode.Append(SG_T("\" ")); } void CSG_Doc_SVG::_AddAttribute(const SG_Char *Attribute, int iValue) { _AddAttribute(Attribute, SG_Get_String(iValue, 0)); } void CSG_Doc_SVG::_AddAttribute(const SG_Char *Attribute, double dValue) { _AddAttribute(Attribute, SG_Get_String(dValue, 2)); } void CSG_Doc_SVG::Draw_Circle(double x, double y, double Radius, int Fill_Color, int Line_Color, double Line_Width) { CSG_String sWidth; m_sSVGCode.Append(SG_T("\n")); } void CSG_Doc_SVG::Draw_LinkedCircle(double x, double y, double Radius, const SG_Char *Link, int Fill_Color, int Line_Color, double Line_Width) { CSG_String sWidth; CSG_String sLink; m_sSVGCode.Append(SG_T("\n")); } void CSG_Doc_SVG::Draw_Line(double xa, double ya, double xb, double yb, double Width, int Color) { CSG_String sWidth; m_sSVGCode.Append(SG_T("\n")); } void CSG_Doc_SVG::Draw_Line(CSG_Points &Points, double Width, int Color) { int i; CSG_String sPoints; CSG_String sWidth; for (i = 0; i < Points.Get_Count(); i++) { sPoints.Append(SG_Get_String(Points.Get_X(i),2)); sPoints.Append(SG_T(",")); sPoints.Append(SG_Get_String(Points.Get_Y(i),2)); sPoints.Append(SG_T(" ")); } m_sSVGCode.Append(SG_T("\n")); } void CSG_Doc_SVG::Draw_Rectangle(double xa, double ya, double xb, double yb, int Fill_Color, int Line_Color, double Line_Width) { CSG_Points Points; Points.Add(xa, ya); Points.Add(xb, ya); Points.Add(xb, yb); Points.Add(xa, yb); Draw_Polygon(Points, Fill_Color, Line_Color, Line_Width); } void CSG_Doc_SVG::Draw_Rectangle(const CSG_Rect &r, int Fill_Color, int Line_Color, double Line_Width) { Draw_Rectangle(r.Get_XMin(), r.Get_YMin(), r.Get_XMax(), r.Get_YMax(), Fill_Color, Line_Color, Line_Width) ; } void CSG_Doc_SVG::Draw_Polygon(CSG_Points &Points, int Fill_Color, int Line_Color, double Line_Width) { if( Points.Get_Count() > 2 ) { int i; CSG_String sPoints; CSG_String sWidth; for (i = 0; i < Points.Get_Count(); i++) { sPoints.Append(SG_Get_String(Points.Get_X(i),2)); sPoints.Append(SG_T(",")); sPoints.Append(SG_Get_String(Points.Get_Y(i),2)); sPoints.Append(SG_T(" ")); } m_sSVGCode.Append(SG_T("\n")); } } void CSG_Doc_SVG::Draw_LinkedPolygon(CSG_Points &Points, const SG_Char* Link, int Fill_Color, int Line_Color, double Line_Width) { if( Points.Get_Count() > 2 ) { int i; CSG_String sPoints; CSG_String sWidth; CSG_String sLink; for (i = 0; i < Points.Get_Count(); i++) { sPoints.Append(SG_Get_String(Points.Get_X(i),2)); sPoints.Append(SG_T(",")); sPoints.Append(SG_Get_String(Points.Get_Y(i),2)); sPoints.Append(SG_T(" ")); } m_sSVGCode.Append(SG_T("\n")); } } void CSG_Doc_SVG::Draw_Text(double x, double y, const SG_Char *Text, int Color, const SG_Char* Font, double dSize, TSG_SVG_Alignment iAlignment) { CSG_String sAlignments[] = {SG_T(""), SG_T("middle"), SG_T("end")}; CSG_String sSize; sSize.Append(SG_Get_String(dSize,2)); sSize.Append(g_Unit); m_sSVGCode.Append(SG_T("\n")); m_sSVGCode.Append(Text); m_sSVGCode.Append(SG_T("")); } CSG_String CSG_Doc_SVG::_Get_SVGColor(int iColor) { CSG_String s; if (iColor == SG_COLOR_NONE) { return SG_T("none"); } else if (iColor == SG_COLOR_RANDOM) { s.Append(SG_T("rgb(")); s.Append(SG_Get_String((int)(255.0 * (double)rand() / (double)RAND_MAX),0)); s.Append(SG_T(",")); s.Append(SG_Get_String((int)(255.0 * (double)rand() / (double)RAND_MAX),0)); s.Append(SG_T(",")); s.Append(SG_Get_String((int)(255.0 * (double)rand() / (double)RAND_MAX),0)); s.Append(SG_T(")")); return s; } else { s.Append(SG_T("rgb(")); s.Append(SG_Get_String(SG_GET_R(iColor),0)); s.Append(SG_T(",")); s.Append(SG_Get_String(SG_GET_G(iColor),0)); s.Append(SG_T(",")); s.Append(SG_Get_String(SG_GET_B(iColor),0)); s.Append(SG_T(")")); return s; } } saga-2.1.0+dfsg/src/modules_io/docs/docs_html/doc_svg.h000066400000000000000000000140271224124640700230010ustar00rootroot00000000000000/********************************************************** * Version $Id: doc_svg.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_html // // // //-------------------------------------------------------// // // // doc_svg.h // // // // Copyright (C) 2005 by // // Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. // // // // This library is free software; you can redistribute // // it and/or modify it under the terms of the GNU Lesser // // General Public License as published by the Free // // Software Foundation, version 2.1 of the License. // // // // This library 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 Lesser General Public // // License for more details. // // // // You should have received a copy of the GNU Lesser // // General Public License along with this program; if // // not, write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__docs_html__doc_svg_H #define HEADER_INCLUDED__docs_html__doc_svg_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- typedef enum ESG_SVG_Alignment { SVG_ALIGNMENT_Left = 0, SVG_ALIGNMENT_Center, SVG_ALIGNMENT_Right } TSG_SVG_Alignment; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class docs_html_EXPORT CSG_Doc_SVG { public: CSG_Doc_SVG(void); virtual ~CSG_Doc_SVG(void); void Open (int iWidth, int iHeight); bool Save (const SG_Char *FileName); void Draw_Line (double xa, double ya, double xb, double yb , double Width = 1., int Color = SG_COLOR_BLACK); void Draw_Line (CSG_Points &Points , double Width = 1., int Color = SG_COLOR_BLACK); void Draw_Rectangle (double xa, double ya, double xb, double yb , int Fill_Color = SG_COLOR_WHITE, int Line_Color = SG_COLOR_BLACK, double Line_Width = 1.); void Draw_Rectangle (const CSG_Rect &r , int Fill_Color = SG_COLOR_WHITE, int Line_Color = SG_COLOR_BLACK, double Line_Width = 1.); void Draw_Polygon (CSG_Points &Points , int Fill_Color = SG_COLOR_GREEN, int Line_Color = SG_COLOR_BLACK, double Line_Width = 1.); void Draw_LinkedPolygon (CSG_Points &Points, const SG_Char *Link , int Fill_Color = SG_COLOR_GREEN, int Line_Color = SG_COLOR_BLACK, double Line_Width = 1.); void Draw_Circle (double x, double y, double Radius , int Fill_Color = SG_COLOR_RED , int Line_Color = SG_COLOR_BLACK, double Line_Width = 1.); void Draw_LinkedCircle (double x, double y, double Radius, const SG_Char *Link, int Fill_Color = SG_COLOR_RED , int Line_Color = SG_COLOR_BLACK, double Line_Width = 1.); void Draw_Text (double x, double y, const SG_Char *Text, int iColor, const SG_Char* Font, double dSize, TSG_SVG_Alignment Alignment = SVG_ALIGNMENT_Center); protected: CSG_String m_sSVGCode; void _AddAttribute (const SG_Char *Attribute, const SG_Char *Value); void _AddAttribute (const SG_Char *Attribute, int Value); void _AddAttribute (const SG_Char *Attribute, double Value); CSG_String _Get_SVGColor (int iColor); private: int m_iWidth, m_iHeight; }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif //#ifndef HEADER_INCLUDED__docs_html__doc_svg_H saga-2.1.0+dfsg/src/modules_io/docs/docs_html/svg_interactive_map.cpp000066400000000000000000003636771224124640700257630ustar00rootroot00000000000000/********************************************************** * Version $Id: svg_interactive_map.cpp 1261 2011-12-16 15:12:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_html // // // //-------------------------------------------------------// // // // SVG_Interactive_map.cpp // // // // Copyright (C) 2005 by Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // // e-mail: oconrad@saga-gis.org // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "svg_interactive_map.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define MAP_WINDOW_WIDTH 550. #define MAP_WINDOW_HEIGHT 700. /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSVG_Interactive_Map::CSVG_Interactive_Map(void) { Set_Name (_TL("SVG Interactive Map")); Set_Author (SG_T("V.Olaya")); Set_Description (_TW( "" )); Parameters.Add_FilePath( NULL , "FILENAME" , _TL("[FLD] SVG File"), _TL(""), CSG_String::Format(SG_T("%s|*.svg|%s|*.*"), _TL("SVG - Scalable Vector Graphics Files (*.svg)"), _TL("All Files") ), NULL, true, false ); Parameters.Add_Shapes_List( NULL , "LIST" , _TL("Shapes Layers"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Shapes( NULL , "SHAPES" , _TL("[FLD] Index Layer"), _TL(""), PARAMETER_INPUT_OPTIONAL ); } //--------------------------------------------------------- CSVG_Interactive_Map::~CSVG_Interactive_Map(void) {} //--------------------------------------------------------- bool CSVG_Interactive_Map::On_Execute(void) { CSG_String FileName; CSG_Shapes *pIndexLayer; CSVG_Interactive_Map SVG; Process_Set_Text(CSG_String::Format(SG_T("%s..."), _TL("[MSG] Save as Interactive SVG"))); pIndexLayer = Parameters("SHAPES") ->asShapes(); FileName = Parameters("FILENAME") ->asString(); return( SVG.Create_From_Map(Parameters("LIST")->asShapesList(), pIndexLayer, FileName) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSVG_Interactive_Map::Create_From_Map(CSG_Parameter_Shapes_List *pList, CSG_Shapes *pIndexLayer, const SG_Char *Filename) { int i; if( pList->Get_Count() <= 0 ) { return( false ); } //----------------------------------------------------- m_Directory = SG_File_Get_Path(Filename); CSG_Rect r(pList->asShapes(0)->Get_Extent()); for(i=1; iGet_Count(); i++) { r.Union(pList->asShapes(i)->Get_Extent()); } _Add_Opening(r); //----------------------------------------------------- m_sSVGCode.Append(SG_T("\n")); for(i=pList->Get_Count()-1; i>=0; i--) { _Add_Shapes (pList->asShapes(i)); } m_sSVGCode.Append(SG_T("\n\n")); //----------------------------------------------------- _Add_CheckBoxes(pList); _Add_ReferenceMap(pIndexLayer, r); m_sSVGCode.Append(_Get_Code_Closing_1()); if( !Save(Filename) ) { return( false ); } //----------------------------------------------------- _Write_Code(SG_File_Make_Path(m_Directory, SG_T("checkbox") , SG_T("js")), _Get_Code_CheckBox()); _Write_Code(SG_File_Make_Path(m_Directory, SG_T("mapApp") , SG_T("js")), _Get_Code_MapApp ()); _Write_Code(SG_File_Make_Path(m_Directory, SG_T("timer") , SG_T("js")), _Get_Code_Timer ()); _Write_Code(SG_File_Make_Path(m_Directory, SG_T("slider") , SG_T("js")), _Get_Code_Slider ()); _Write_Code(SG_File_Make_Path(m_Directory, SG_T("helper_functions") , SG_T("js")), _Get_Code_Helper ()); _Write_Code(SG_File_Make_Path(m_Directory, SG_T("button") , SG_T("js")), _Get_Code_Buttons ()); _Write_Code(SG_File_Make_Path(m_Directory, SG_T("navigation") , SG_T("js")), CSG_String::Format(SG_T("%s%s"), _Get_Code_Navigation_1(), _Get_Code_Navigation_2())); return( true ); } //--------------------------------------------------------- void CSVG_Interactive_Map::_Write_Code(const CSG_String &FileName, const CSG_String &Code) { CSG_File Stream; if( Stream.Open(FileName, SG_FILE_W, false) ) { Stream.Write(Code); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CSVG_Interactive_Map::_Add_Opening(CSG_Rect r) { CSG_String sViewBox; double Width, Height; double OffsetX, OffsetY; m_sSVGCode.Append(_Get_Opening_Code_1()); m_sSVGCode.Append(SG_Get_String(r.Get_XRange(),2)); m_sSVGCode.Append(SG_T("),")); m_sSVGCode.Append(SG_Get_String(r.Get_XRange() / 400.,2)); m_sSVGCode.Append(_Get_Opening_Code_2()); if (r.Get_XRange() / r.Get_YRange() > MAP_WINDOW_WIDTH / MAP_WINDOW_HEIGHT) { Width = r.Get_XRange(); Height = r.Get_XRange() * MAP_WINDOW_HEIGHT / MAP_WINDOW_WIDTH; } else { Height = r.Get_YRange(); Width = r.Get_YRange() / MAP_WINDOW_HEIGHT * MAP_WINDOW_WIDTH; } OffsetX = (Width - r.Get_XRange()) / 2.; OffsetY = (Height - r.Get_YRange()) / 2.; sViewBox.Append(SG_Get_String(r.Get_XMin() - OffsetX,2)); sViewBox.Append(SG_T(" ")); sViewBox.Append(SG_Get_String(-r.Get_YMax() - OffsetY,2)); sViewBox.Append(SG_T(" ")); sViewBox.Append(SG_Get_String(Width,2)); sViewBox.Append(SG_T(" ")); sViewBox.Append(SG_Get_String(Height,2)); _AddAttribute(SG_T("viewBox"), sViewBox); m_sSVGCode.Append(SG_T(">\n")); m_dWidth = Width; } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CSVG_Interactive_Map::_Add_ReferenceMap(CSG_Shapes *pIndexLayer, CSG_Rect r) { int i; CSG_String sViewBox; double Line_Width, Point_Width; double Width, Height; double OffsetX, OffsetY; CSG_Shape *pShape; if (r.Get_XRange() / r.Get_YRange() > MAP_WINDOW_WIDTH / MAP_WINDOW_HEIGHT) { Width = r.Get_XRange(); Height = r.Get_XRange() * MAP_WINDOW_HEIGHT / MAP_WINDOW_WIDTH; } else { Height = r.Get_YRange(); Width = r.Get_YRange() / MAP_WINDOW_HEIGHT * MAP_WINDOW_WIDTH; } OffsetX = (Width - r.Get_XRange()) / 2.; OffsetY = (Height - r.Get_YRange()) / 2.; sViewBox.Append(SG_Get_String(r.Get_XMin() - OffsetX,2)); sViewBox.Append(SG_T(" ")); sViewBox.Append(SG_Get_String(- r.Get_YMax() - OffsetY,2)); sViewBox.Append(SG_T(" ")); sViewBox.Append(SG_Get_String(Width,2)); sViewBox.Append(SG_T(" ")); sViewBox.Append(SG_Get_String(Height,2)); _AddAttribute(SG_T("viewBox"), sViewBox); m_sSVGCode.Append(_Get_Code_3()); if (pIndexLayer) { m_sSVGCode.Append(SG_T("\n")); for (i = 0; i < pIndexLayer->Get_Count(); i++) { pShape = pIndexLayer->Get_Shape(i); Line_Width = Point_Width = m_dWidth / MAP_WINDOW_WIDTH; Point_Width *= 5; _Add_Shape(pShape, 0, 0, Line_Width, Point_Width); } m_sSVGCode.Append(SG_T("\n")); } m_sSVGCode.Append(_Get_Code_4()); _AddAttribute(SG_T("x"), r.Get_XMin() - OffsetX); _AddAttribute(SG_T("y"), - r.Get_YMax() - OffsetY); _AddAttribute(SG_T("width"), Width); _AddAttribute(SG_T("height"), Height); m_sSVGCode.Append(_Get_Code_5()); } //--------------------------------------------------------- void CSVG_Interactive_Map::_Add_Grid(CSG_Grid *pLayer) { /* CSG_String Filename; wxBitmap BMP; if( pLayer->Get_Image_Grid(BMP) ) { Filename = SG_File_Make_Path(m_Directory.c_str(), pLayer->Get_Name(), SG_T("jpg")); BMP.SaveFile(Filename, wxBITMAP_TYPE_JPEG); m_sSVGCode.Append(SG_T("Get_Name()); _AddAttribute(SG_T("x") , ((CSG_Grid *)pLayer->Get_Object())->Get_XMin()); _AddAttribute(SG_T("y") ,-((CSG_Grid *)pLayer->Get_Object())->Get_YMax()); _AddAttribute(SG_T("width") , ((CSG_Grid *)pLayer->Get_Object())->Get_XRange()); _AddAttribute(SG_T("height") , ((CSG_Grid *)pLayer->Get_Object())->Get_YRange()); _AddAttribute(SG_T("xlink:href") , SG_File_Get_Name(Filename, true)); m_sSVGCode.Append(SG_T("/>")); } /**/ } //--------------------------------------------------------- void CSVG_Interactive_Map::_Add_Shapes(CSG_Shapes *pLayer) { int i; int Line_Color, Fill_Color; double Line_Width, Point_Width; CSG_Shape *pShape; CSG_String sLabel; m_sSVGCode.Append(SG_T("Get_Name()); m_sSVGCode.Append(SG_T("\" >\n")); // int iColorField = pLayer->Get_Color_Field(); m_sSVGCode.Append(SG_T("\n")); for (i = 0; i < pLayer->Get_Count(); i++) { pShape = pLayer->Get_Shape(i); // Line_Color = Fill_Color = pLayer->Get_Classifier()->Get_Class_Color_byValue(pShape->asDouble(iColorField)); Line_Color = SG_COLOR_BLACK; Fill_Color = SG_COLOR_GREEN; Line_Width = Point_Width = m_dWidth / MAP_WINDOW_WIDTH; Point_Width *= 5; _Add_Shape(pShape, Fill_Color, Line_Color, Line_Width, Point_Width); } // if (pLayer->Get_Label_Field() >= 0) { /* m_sSVGCode.Append(SG_T("")); for (i = 0; i < pLayer->Get_Count(); i++) { double dSize; pShape = pLayer->Get_Shape(i); Line_Width = Point_Width = m_dWidth / MAP_WINDOW_WIDTH; sLabel = pShape->asString(pLayer->Get_Label_Field()); switch( pLayer->Get_Parameters()->Get_Parameter(SG_T("LABEL_ATTRIB_SIZE_TYPE"))->asInt() ) { case 0: default: dSize = Line_Width * pLayer->Get_Parameters()->Get_Parameter(SG_T("LABEL_ATTRIB_FONT"))->asFont()->GetPointSize(); _Add_Label(sLabel, pShape, dSize, SG_T("%")); break; case 1: dSize = pLayer->Get_Parameters()->Get_Parameter(SG_T("LABEL_ATTRIB_SIZE"))->asDouble(); _Add_Label(sLabel, pShape, dSize, SG_T("")); break; } } m_sSVGCode.Append(SG_T("\n")); /**/ } m_sSVGCode.Append(SG_T("\n\n")); } //--------------------------------------------------------- void CSVG_Interactive_Map::_Add_Label(const SG_Char* Label, CSG_Shape *pShape, double dSize, const SG_Char* Unit) { int iPoint, iPart; TSG_Point Point; switch( pShape->Get_Type() ) { case SHAPE_TYPE_Point: case SHAPE_TYPE_Points: for(iPoint=0; iPoint < pShape->Get_Point_Count(0); iPoint++) { Point = pShape->Get_Point(iPoint); Draw_Text(100 * Point.x, -100 * Point.y, Label, 0, SG_T("Verdana"), 100 * dSize); } break; case SHAPE_TYPE_Line: ///************/// break; case SHAPE_TYPE_Polygon: for (iPart = 0; iPart < pShape->Get_Part_Count(); iPart++) { if(! ((CSG_Shape_Polygon *)pShape)->is_Lake(iPart) ) { Point = ((CSG_Shape_Polygon *)pShape)->Get_Centroid(iPart); Draw_Text(100 * Point.x, -100 * Point.y, Label, 0, SG_T("Verdana"), 100 * dSize); } } break; } } //--------------------------------------------------------- bool CSVG_Interactive_Map::_Add_Shape(CSG_Shape *pShape, int Fill_Color, int Line_Color, double Line_Width, double Point_Width) { if( pShape && pShape->is_Valid() ) { int iPart, iPoint; TSG_Point Point; CSG_Points Points; for(iPart=0; iPartGet_Part_Count(); iPart++) { Points.Clear(); for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { Point = pShape->Get_Point(iPoint, iPart); Points.Add(Point.x, Point.y); } switch( pShape->Get_Type() ) { case SHAPE_TYPE_Point: case SHAPE_TYPE_Points: for(iPoint=0; iPointis_Lake(iPart) ) { Draw_Polygon(Points, -1, 0, 0.01); } else { Draw_Polygon(Points, Fill_Color, 0, 0.01); } break; } } return( true ); } return( false ); } //--------------------------------------------------------- void CSVG_Interactive_Map::_Add_CheckBoxes(CSG_Parameter_Shapes_List *pList) { int i; CSG_String s; int x,y; int iRow = 1; m_sSVGCode.Append(_Get_Code_1()); // 2* open m_sSVGCode.Append(_TL("Layers")); m_sSVGCode.Append(SG_T("\n")); for (i = 0; i < pList->Get_Count(); i++) { y = iRow * 30; if (i % 2) { x = 200; iRow++; } else { x = 0; } m_sSVGCode.Append(SG_T("\n")); m_sSVGCode.Append(SG_T("asShapes(i)->Get_Name()); _AddAttribute(SG_T("id"), s); _AddAttribute(SG_T("xlink:href"), SG_T("#checkBoxRect")); s = SG_T("checkBoxScript(evt,'"); s.Append(pList->asShapes(i)->Get_Name()); s.Append(SG_T("');")); _AddAttribute(SG_T("onclick"), s); m_sSVGCode.Append(SG_T("/>\n")); m_sSVGCode.Append(SG_T("asShapes(i)->Get_Name()); _AddAttribute(SG_T("id"), s); _AddAttribute(SG_T("xlink:href"), SG_T("#checkBoxCross")); _AddAttribute(SG_T("visibility"), SG_T("visible")); m_sSVGCode.Append(SG_T("/>\n")); m_sSVGCode.Append(SG_T("\n")); } m_sSVGCode.Append(SG_T("\n")); iRow = 1; for (i = 0; i < pList->Get_Count(); i++) { y = iRow * 30 + 6; if (i % 2) { x = 212; iRow++; } else { x = 12; } m_sSVGCode.Append(SG_T("")); m_sSVGCode.Append(pList->asShapes(i)->Get_Name()); m_sSVGCode.Append(SG_T("\n")); } m_sSVGCode.Append(SG_T("\n")); m_sSVGCode.Append(_Get_Code_2()); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- const char * CSVG_Interactive_Map::_Get_Opening_Code_1(void) { return( "\n" "\n" "\n" "\n" "\n" "]>\n" "\n" "\n" " \n" "\n" " " ); } //--------------------------------------------------------- const char * CSVG_Interactive_Map::_Get_Code_4(void) { return( " \n" " \n " " \n" " \n" ); } //--------------------------------------------------------- const char * CSVG_Interactive_Map::_Get_Code_Closing_1(void) { return( " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- const char * CSVG_Interactive_Map::_Get_Code_CheckBox(void) { return( "function checkBoxScript(evt,myLayer) { //checkBox for toggling layers an contextMenue\n" " var myLayerObj = document.getElementById(myLayer);\n" " var myCheckCrossObj = document.getElementById(\"checkCross\"+myLayer);\n" " var myCheckCrossVisibility = myCheckCrossObj.getAttributeNS(null,\"visibility\"));\n" " if (evt.type == \"click\" && evt.detail == 1) {\n" " if (myCheckCrossVisibility == \"visible\")) {\n" " myLayerObj.setAttributeNS(null,\"visibility\"),\"hidden\"));\n" " myCheckCrossObj.setAttributeNS(null,\"visibility\"),\"hidden\"));\n" " //you can do if/else or switch statements to set different actions on activating a checkbox here\n" " //myLayer holds the currentLayer name\n" " }\n" " else {\n" " myLayerObj.setAttributeNS(null,\"visibility\"),\"visible\"));\n" " myCheckCrossObj.setAttributeNS(null,\"visibility\"),\"visible\"));\n" " }\n" " }\n" "}\n" "\n" ); } //--------------------------------------------------------- const char * CSVG_Interactive_Map::_Get_Code_MapApp(void) { return( "//holds data on window size\n" "function mapApp() {\n" " if (!document.documentElement.getScreenCTM) {\n" " this.resetFactors();\n" " //add resize event to document element\n" " document.documentElement.addEventListener(\"SVGResize\"),this,false);\n" " }\n" "}\n" "\n" "mapApp.prototype.handleEvent = function(evt) {\n" " if (evt.type == \"SVGResize\")) {\n" " this.resetFactors();\n" " }\n" "}\n" "\n" "mapApp.prototype.resetFactors = function() {\n" " if (!document.documentElement.getScreenCTM) {\n" " //case for viewers that don't support .getScreenCTM, such as ASV3\n" " //calculate ratio and offset values of app window\n" " var viewBoxArray = document.documentElement.getAttributeNS(null,\"viewBox\")).split(\" \"));\n" " var myRatio = viewBoxArray[2]/viewBoxArray[3];\n" " if ((window.innerWidth/window.innerHeight) > myRatio) { //case window is more wide than myRatio\n" " this.scaleFactor = viewBoxArray[3] / window.innerHeight;\n" " }\n" " else { //case window is more tall than myRatio\n" " this.scaleFactor = viewBoxArray[2] / window.innerWidth;\n" " }\n" " this.offsetX = (window.innerWidth - viewBoxArray[2] * 1 / this.scaleFactor) / 2;\n" " this.offsetY = (window.innerHeight - viewBoxArray[3] * 1 / this.scaleFactor) / 2;\n" " }\n" "}\n" "\n" "mapApp.prototype.calcCoord = function(evt,ctmNode) {\n" " var svgPoint = document.documentElement.createSVGPoint();\n" " svgPoint.x = evt.clientX;\n" " svgPoint.y = evt.clientY;\n" " if (!document.documentElement.getScreenCTM) {\n" " //case ASV3 a. Corel\n" " svgPoint.x = (svgPoint.x - this.offsetX) * this.scaleFactor;\n" " svgPoint.y = (svgPoint.y - this.offsetY) * this.scaleFactor;\n" " //undo the effect of transformations\n" " if (ctmNode) {\n" " var ctm = getTransformToRootElement(ctmNode).inverse();\n" " }\n" " else {\n" " var ctm = getTransformToRootElement(evt.target).inverse();\n" " }\n" " svgPoint = svgPoint.matrixTransform(ctm);\n" "\n" " }\n" " else {\n" " if (ctmNode) {\n" " var matrix = ctmNode.getScreenCTM();\n" " }\n" " else {\n" " var matrix = evt.target.getScreenCTM();\n" " }\n" " svgPoint = svgPoint.matrixTransform(matrix.inverse());\n" " }\n" " return svgPoint;\n" "}\n" "\n" ); } //--------------------------------------------------------- const char * CSVG_Interactive_Map::_Get_Code_Timer(void) { return( "// source/credits: \"Algorithm\": http://www.codingforums.com/showthread.php?s=&threadid=10531\n" "// The constructor should be called with\n" "// the parent object (optional, defaults to window).\n" "\n" "function Timer(){\n" " this.obj = (arguments.length)?arguments[0]:window;\n" " return this;\n" "}\n" "\n" "// The set functions should be called with:\n" "// - The name of the object method (as a string) (required)\n" "// - The millisecond delay (required)\n" "// - Any number of extra arguments, which will all be\n" "// passed to the method when it is evaluated.\n" "\n" "Timer.prototype.setInterval = function(func, msec){\n" " var i = Timer.getNew();\n" " var t = Timer.buildCall(this.obj, i, arguments);\n" " Timer.set[i].timer = window.setInterval(t,msec);\n" " return i;\n" "}\n" "Timer.prototype.setTimeout = function(func, msec){\n" " var i = Timer.getNew();\n" " Timer.buildCall(this.obj, i, arguments);\n" " Timer.set[i].timer = window.setTimeout(\"Timer.callOnce(\"+i+\"));\"),msec);\n" " return i;\n" "}\n" "\n" "// The clear functions should be called with\n" "// the return value from the equivalent set function.\n" "\n" "Timer.prototype.clearInterval = function(i){\n" " if(!Timer.set[i]) return;\n" " window.clearInterval(Timer.set[i].timer);\n" " Timer.set[i] = null;\n" "}\n" "Timer.prototype.clearTimeout = function(i){\n" " if(!Timer.set[i]) return;\n" " window.clearTimeout(Timer.set[i].timer);\n" " Timer.set[i] = null;\n" "}\n" "\n" "// Private data\n" "\n" "Timer.set = new Array();\n" "Timer.buildCall = function(obj, i, args){\n" " var t = \"\");\n" " Timer.set[i] = new Array();\n" " if(obj != window){\n" " Timer.set[i].obj = obj;\n" " t = \"Timer.set[\"+i+\"].obj.\");\n" " }\n" " t += args[0]+\"(\");\n" " if(args.length > 2){\n" " Timer.set[i][0] = args[2];\n" " t += \"Timer.set[\"+i+\"][0]\");\n" " for(var j=1; (j+2) \n" "Version 1.1, 2004-11-18\n" "neumann@karto.baug.ethz.ch\n" "http://www.carto.net/\n" "http://www.carto.net/neumann/\n" "\n" "Credits: numerous people on svgdevelopers@yahoogroups.com\n" "\n" "This ECMA script library is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU Lesser General Public\n" "License as published by the Free Software Foundation; either\n" "version 2.1 of the License, or (at your option) any later version.\n" "\n" "This library is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" "Lesser General Public License for more details.\n" "\n" "You should have received a copy of the GNU Lesser General Public\n" "License along with this library (http://www.carto.net/papers/svg/resources/lesser_gpl.txt); if not, write to the Free Software\n" "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n" "\n" "----\n" "\n" "original document site: http://www.carto.net/papers/svg/resources/helper_functions.js\n" "Please contact the author in case you want to use code or ideas commercially.\n" "If you use this code, please include this copyright header, the included full\n" "LGPL 2.1 text and read the terms provided in the LGPL 2.1 license\n" "(http://www.gnu.org/copyleft/lesser.txt)\n" "\n" "-------------------------------\n" "\n" "Please report bugs and send improvements to neumann@karto.baug.ethz.ch\n" "If you use these scripts, please link to the original (http://www.carto.net/papers/svg/navigationTools/)\n" "somewhere in the source-code-comment or the \"about\" of your project and give credits, thanks!\n" "\n" "*/\n" "\n" "//global variables necessary to create elements in these namespaces, do not delete them!!!!\n" "var svgNS = \"http://www.w3.org/2000/svg\");\n" "var xlinkNS = \"http://www.w3.org/1999/xlink\");\n" "var cartoNS = \"http://www.carto.net/attrib\");\n" "var attribNS = \"http://www.carto.net/attrib\");\n" "var batikNS = \"http://xml.apache.org/batik/ext\");\n" "\n" "/* ----------------------- helper functions to calculate stuff ---------------- */\n" "/* ---------------------------------------------------------------------------- */\n" "function toPolarDir(xdiff,ydiff) { // Subroutine for calculating polar Coordinates\n" " direction = (Math.atan2(ydiff,xdiff));\n" " //result is angle in radian\n" " return(direction);\n" "}\n" "\n" "function toPolarDist(xdiff,ydiff) { // Subroutine for calculating polar Coordinates\n" " distance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n" " return(distance);\n" "}\n" "\n" "function toRectX(direction,distance) { // Subroutine for calculating cartesic coordinates\n" " x = distance * Math.cos(direction);\n" " y = distance * Math.sin(direction);\n" " return(x);\n" "}\n" "\n" "function toRectY(direction,distance) { // Subroutine for calculating cartesic coordinates\n" " x = distance * Math.cos(direction);\n" " y = distance * Math.sin(direction);\n" " return(y);\n" "}\n" "\n" "//Converts degrees to radians.\n" "function DegToRad(deg) {\n" " return (deg / 180.0 * Math.PI);\n" "}\n" "\n" "//Converts radians to degrees.\n" "function RadToDeg(rad) {\n" " return (rad / Math.PI * 180.0);\n" "}\n" "\n" "//converts decimal degrees to degree/minutes/seconds\n" "function dd2dms(dd) {\n" " var minutes = (dd - Math.floor(dd)) * 60;\n" " var seconds = (minutes - Math.floor(minutes)) * 60;\n" " var minutes = Math.floor(minutes);\n" " var degrees = Math.floor(dd);\n" " return {deg:degrees,min:minutes,sec:seconds};\n" "}\n" "\n" "//converts degree/minutes/seconds to decimal degrees\n" "function dms2dd(deg,min,sec) {\n" " return deg + (min / 60) + (sec / 3600);\n" "}\n" "\n" "//log functions that do not exist in Math object\n" "function log(x,b) {\n" " if(b==null) b=Math.E;\n" " return Math.log(x)/Math.log(b);\n" "}\n" "\n" "//gets 4 z-values (4 corners), a position, delta x and delty and a cellsize as input and returns interpolated z-value\n" "function intBilinear(za,zb,zc,zd,xpos,ypos,ax,ay,cellsize) { //bilinear interpolation function\n" " e = (xpos - ax) / cellsize;\n" " f = (ypos - ay) / cellsize;\n" "\n" " //calculation of weights\n" " wa = (1 - e) * (1 - f);\n" " wb = e * (1 - f);\n" " wc = e * f;\n" " wd = f * (1 - e);\n" "\n" " height_interpol = wa * zc + wb * zd + wc * za + wd * zb;\n" "\n" " return (height_interpol); \n" "}\n" "\n" "//test if point is left of or right of, result is 1 (leftof) or 0 (rightof)\n" "function leftOfTest(pointx,pointy,linex1,liney1,linex2,liney2) {\n" " result = (liney1 - pointy) * (linex2 - linex1) - (linex1 - pointx) * (liney2 - liney1);\n" " if (result < 0) {\n" " leftof = 1; //case left of\n" " }\n" " else {\n" " leftof = 0; //case left of \n" " }\n" " return(leftof);\n" "}\n" "\n" "//input is point coordinate, and 2 line coordinates\n" "function distFromLine(xpoint,ypoint,linex1,liney1,linex2,liney2) {\n" " dx = linex2 - linex1;\n" " dy = liney2 - liney1;\n" " distance = (dy * (xpoint - linex1) - dx * (ypoint - liney1)) / Math.sqrt(Math.pow(dx,2) + Math.pow(dy,2));\n" " return(distance);\n" "}\n" "\n" "//converts radian value to degrees\n" "function radian2deg(radian) {\n" " deg = radian / Math.PI * 180;\n" " return(deg);\n" "}\n" "\n" "//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is angle in radian\n" "//Formula: Acos from Scalaproduct of the two vectors divided by ( norm (deutsch Betrag) vector 1 by norm vector 2\n" "//see http://www.mathe-online.at/mathint/vect2/i.html#Winkel\n" "function angleBetwTwoLines(a1,a2,b1,b2) {\n" " angle = Math.acos((a1 * b1 + a2 * b2) / (Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2)) * Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2))));\n" " return(angle);\n" "}\n" "\n" "//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is new vector c2 returned as array\n" "//Formula: Vektor a divided by Norm Vector a (Betrag) plus Vektor b divided by Norm Vector b (Betrag)\n" "//see http://www.mathe-online.at/mathint/vect1/i.html#Winkelsymmetrale\n" "function calcBisectorVector(a1,a2,b1,b2) {\n" " betraga = Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2));\n" " betragb = Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2));\n" " c = new Array();\n" " c[0] = a1 / betraga + b1 / betragb;\n" " c[1] = a2 / betraga + b2 / betragb;\n" " return(c);\n" "}\n" "\n" "//input is two vectors (a1,a2 is vector a, b1,b2 is vector b), output is angle in radian\n" "//Formula: Vektor a divided by Norm Vector a (Betrag) plus Vektor b divided by Norm Vector b (Betrag)\n" "//see http://www.mathe-online.at/mathint/vect1/i.html#Winkelsymmetrale\n" "function calcBisectorAngle(a1,a2,b1,b2) {\n" " betraga = Math.sqrt(Math.pow(a1,2) + Math.pow(a2,2));\n" " betragb = Math.sqrt(Math.pow(b1,2) + Math.pow(b2,2));\n" " c1 = a1 / betraga + b1 / betragb;\n" " c2 = a2 / betraga + b2 / betragb;\n" " angle = toPolarDir(c1,c2);\n" " return(angle);\n" "}\n" "\n" "function intersect2lines(line1x1,line1y1,line1x2,line1y2,line2x1,line2y1,line2x2,line2y2) {\n" " //formula see http://astronomy.swin.edu.au/~pbourke/geometry/lineline2d/\n" " var result = new Array();\n" " var denominator = (line2y2 - line2y1)*(line1x2 - line1x1) - (line2x2 - line2x1)*(line1y2 - line1y1);\n" " if (denominator == 0) {\n" " alert(\"lines are parallel\"));\n" " }\n" " else {\n" " ua = ((line2x2 - line2x1)*(line1y1 - line2y1) - (line2y2 - line2y1)*(line1x1 - line2x1)) / denominator;\n" " ub = ((line1x2 - line1x1)*(line1y1 - line2y1) - (line1y2 - line1y1)*(line1x1 - line2x1)) / denominator;\n" " }\n" " result[\"x\"] = line1x1 + ua * (line1x2 - line1x1);\n" " result[\"y\"] = line1y1 + ua * (line1y2 - line1y1);\n" " return(result);\n" "}\n" "\n" "/* ----------------------- helper function to sort arrays ---------------- */\n" "/* ----------------------------------------------------------------------- */\n" "//my own sort function, uses only first part of string (population value)\n" "function mySort(a,b) {\n" " var myResulta = a.split(\"+\"));\n" " var myResultb = b.split(\"+\"));\n" " if (parseFloat(myResulta[0]) < parseFloat(myResultb[0])) {\n" " return 1;\n" " }\n" " else {\n" " return -1;\n" " }\n" "}\n" "\n" "/* ----------------------- helper function format number strings -------------- */\n" "/* ---------------------------------------------------------------------------- */\n" "//formatting number strings\n" "//this function add's \"'\" to a number every third digit\n" "function formatNumberString(myString) {\n" " //check if of type string, if number, convert it to string\n" " if (typeof(myString) == \"number\")) {\n" " myTempString = myString.toString();\n" " }\n" " else {\n" " myTempString = myString;\n" " }\n" " var myNewString=\"\");\n" " //if it contains a comma, it will be split\n" " var splitResults = myTempString.split(\".\"));\n" " var myCounter= splitResults[0].length;\n" " if (myCounter > 3) {\n" " while(myCounter > 0) {\n" " if (myCounter > 3) {\n" " myNewString = \"),\" + splitResults[0].substr(myCounter - 3,3) + myNewString;\n" " }\n" " else {\n" " myNewString = splitResults[0].substr(0,myCounter) + myNewString;\n" " }\n" " myCounter -= 3;\n" " }\n" " }\n" " else {\n" " myNewString = splitResults[0];\n" " }\n" " //concatenate if it contains a comma\n" " if (splitResults[1]) {\n" " myNewString = myNewString + \".\" + splitResults[1];\n" " }\n" " return myNewString;\n" "}\n" "\n" "//function for status Bar\n" "function statusChange(statusText) {\n" " document.getElementById(\"statusText\")).firstChild.nodeValue = \"Statusbar: \" + statusText;\n" "}\n" "\n" "//scale an object\n" "function scaleObject(evt,factor) {\n" "//reference to the currently selected object\n" " var element = evt.currentTarget;\n" " var myX = element.getAttributeNS(null,\"x\"));\n" " var myY = element.getAttributeNS(null,\"y\"));\n" " var newtransform = \"scale(\" + factor + \")) translate(\" + (myX * 1 / factor - myX) + \" \" + (myY * 1 / factor - myY) +\"))\");\n" " element.setAttributeNS(null,'transform', newtransform);\n" "}\n" "\n" "//this code is copied from Kevin Lindsey\n" "//http://www.kevlindev.com/tutorials/basics/transformations/toUserSpace/index.htm\n" "function getTransformToRootElement(node) {\n" " try {\n" " //this part is for fully conformant players\n" " var CTM = node.getTransformToElement(document.documentElement);\n" " }\n" " catch (ex) {\n" " //this part is for ASV3 or other non-conformant players\n" " // Initialize our CTM the node's Current Transformation Matrix\n" " var CTM = node.getCTM();\n" " // Work our way through the ancestor nodes stopping at the SVG Document\n" " while ( ( node = node.parentNode ) != document ) {\n" " // Multiply the new CTM to the one with what we have accumulated so far\n" " CTM = node.getCTM().multiply(CTM);\n" " }\n" " }\n" " return CTM;\n" "}\n" "\n" "//calculate HSV 2 RGB: HSV (h 0 to 360, sat and val are between 0 and 1), RGB between 0 and 255\n" "function hsv2rgb(hue,sat,val) {\n" " //alert(\"Hue:\"+hue);\n" " var rgbArr = new Array();\n" " if ( sat == 0) {\n" " rgbArr[\"red\"] = Math.round(val * 255);\n" " rgbArr[\"green\"] = Math.round(val * 255);\n" " rgbArr[\"blue\"] = Math.round(val * 255);\n" " }\n" " else {\n" " var h = hue / 60;\n" " var i = Math.floor(h);\n" " var f = h - i;\n" " if (i % 2 == 0) {\n" " f = 1 - f;\n" " }\n" " var m = val * (1 - sat); \n" " var n = val * (1 - sat * f);\n" " switch(i) {\n" " case 0:\n" " rgbArr[\"red\"] = val;\n" " rgbArr[\"green\"] = n;\n" " rgbArr[\"blue\"] = m;\n" " break;\n" " case 1:\n" " rgbArr[\"red\"] = n;\n" " rgbArr[\"green\"] = val;\n" " rgbArr[\"blue\"] = m;\n" " break;\n" " case 2:\n" " rgbArr[\"red\"] = m;\n" " rgbArr[\"green\"] = val;\n" " rgbArr[\"blue\"] = n;\n" " break;\n" " case 3:\n" " rgbArr[\"red\"] = m;\n" " rgbArr[\"green\"] = n;\n" " rgbArr[\"blue\"] = val;\n" " break;\n" " case 4:\n" " rgbArr[\"red\"] = n;\n" " rgbArr[\"green\"] = m;\n" " rgbArr[\"blue\"] = val;\n" " break;\n" " case 5:\n" " rgbArr[\"red\"] = val;\n" " rgbArr[\"green\"] = m;\n" " rgbArr[\"blue\"] = n;\n" " break;\n" " case 6:\n" " rgbArr[\"red\"] = val;\n" " rgbArr[\"green\"] = n;\n" " rgbArr[\"blue\"] = m;\n" " break;\n" " }\n" " rgbArr[\"red\"] = Math.round(rgbArr[\"red\"] * 255);\n" " rgbArr[\"green\"] = Math.round(rgbArr[\"green\"] * 255);\n" " rgbArr[\"blue\"] = Math.round(rgbArr[\"blue\"] * 255);\n" " }\n" " return rgbArr;\n" "}\n" "\n" "//calculate rgb to hsv values\n" "function rgb2hsv (red,green,blue) {\n" " //input between 0 and 255 --> normalize to 0 to 1\n" " //result = \n" " var hsvArr = new Array();\n" " red = red / 255;\n" " green = green / 255;\n" " blue = blue / 255;\n" " myMax = Math.max(red, Math.max(green,blue));\n" " myMin = Math.min(red, Math.min(green,blue));\n" " v = myMax;\n" " if (myMax > 0) {\n" " s = (myMax - myMin) / myMax;\n" " }\n" " else {\n" " s = 0;\n" " }\n" " if (s > 0) {\n" " myDiff = myMax - myMin;\n" " rc = (myMax - red) / myDiff;\n" " gc = (myMax - green) / myDiff;\n" " bc = (myMax - blue) / myDiff;\n" " if (red == myMax) {\n" " h = (bc - gc) / 6;\n" " }\n" " if (green == myMax) {\n" " h = (2 + rc - bc) / 6;\n" " }\n" " if (blue == myMax) {\n" " h = (4 + gc - rc) / 6;\n" " }\n" " }\n" " else {\n" " h = 0;\n" " }\n" " if (h < 0) {\n" " h += 1;\n" " }\n" " hsvArr[\"hue\"] = Math.round(h * 360);\n" " hsvArr[\"sat\"] = s;\n" " hsvArr[\"val\"] = v;\n" " return hsvArr;\n" "}\n" "\n" "//populate an array that can be addressed by both a key or an index nr\n" "function assArrayPopulate(arrayKeys,arrayValues) {\n" " var returnArray = new Array();\n" " if (arrayKeys.length != arrayValues.length) {\n" " alert(\"error: arrays do not have same length!\"));\n" " }\n" " else {\n" " for (i=0;i 0) {\n" " this.init(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset);\n" " }\n" "}\n" "\n" "button.prototype.init = function(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset) {\n" " this.groupId = groupId; //the group id where all new content is appended to\n" " this.functionToCall = functionToCall; //function to be called if button was pressed\n" " this.buttonType = buttonType; //button type: currently either \"rect\" or \"ellipse\"\n" " this.buttonText = buttonText; //default value to be filled in when textbox is created\n" " this.buttonSymbolId = buttonSymbolId; //id to a symbol to be used as a button graphics\n" " this.x = x; //left of button rectangle\n" " this.y = y; //top of button rectangle\n" " this.width = width; //button rectangle width\n" " this.height = height; //button rectangle height\n" " this.fontSize = fontSize; //font size in user units/pixels\n" " this.fontFamily = fontFamily; //font family for text element, can be an empty string for image buttons\n" " this.textFill = textFill; //the fill color of the text for text buttons, can be an empty string for image buttons\n" " this.buttonFill = buttonFill; //the fill color of the button rectangle or ellipse\n" " this.shadeLightFill = shadeLightFill; //light fill color simulating 3d effect\n" " this.shadeDarkFill = shadeDarkFill; //dark fill color simulating 3d effect\n" " this.shadowOffset = shadowOffset; //shadow offset in viewBox units\n" " this.buttonGroup = document.getElementById(this.groupId); //reference to the button group node\n" " this.upperLeftLine = null; //later a reference to the upper left line simulating 3d effect\n" " this.buttonRect = null; //later a reference to the button area (rect)\n" " this.buttonTextElement = null; //later a reference to the button text\n" " this.buttonSymbolInstance = null; //later a reference to the button symbol\n" " this.deActivateRect = null; //later a reference to a rectangle that can be used to deactivate the button\n" " this.activated = true; //a property indicating if button is activated or not\n" " this.lowerRightLine = null; //later a reference to the lower right line simulating 3d effect\n" " this.createButton(); //method to initialize button\n" " this.timer = new Timer(this); //a Timer instance for calling the functionToCall\n" " this.timerMs = 200; //a constant of this object that is used in conjunction with the timer - functionToCall is called after 200 ms\n" "}\n" "\n" "//create button\n" "button.prototype.createButton = function() {\n" " //create upper left button line or ellipse\n" " if (this.buttonType == \"rect\")) {\n" " this.upperLeftShadow = document.createElementNS(svgNS,\"rect\"));\n" " this.upperLeftShadow.setAttributeNS(null,\"x\"),this.x - this.shadowOffset);\n" " this.upperLeftShadow.setAttributeNS(null,\"y\"),this.y - this.shadowOffset);\n" " this.upperLeftShadow.setAttributeNS(null,\"width\"),this.width);\n" " this.upperLeftShadow.setAttributeNS(null,\"height\"),this.height);\n" " this.upperLeftShadow.setAttributeNS(null,\"points\"),this.x+\"),\"+(this.y+this.height)+\" \"+this.x+\"),\"+this.y+\" \"+(this.x+this.width)+\"),\"+this.y);\n" " }\n" " else if (this.buttonType == \"ellipse\")) {\n" " this.upperLeftShadow = document.createElementNS(svgNS,\"ellipse\"));\n" " this.upperLeftShadow.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5 - this.shadowOffset);\n" " this.upperLeftShadow.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5 - this.shadowOffset);\n" " this.upperLeftShadow.setAttributeNS(null,\"rx\"),this.width * 0.5);\n" " this.upperLeftShadow.setAttributeNS(null,\"ry\"),this.height * 0.5);\n" " }\n" " else {\n" " alert(\"buttonType '\"+this.buttonType+\"' not supported. You need to specify 'rect' or 'ellipse'\"));\n" " }\n" " this.upperLeftShadow.setAttributeNS(null,\"fill\"),this.shadeLightFill);\n" " this.buttonGroup.appendChild(this.upperLeftShadow);\n" "\n" " //create lower right button line or ellipse\n" " if (this.buttonType == \"rect\")) {\n" " this.lowerRightShadow = document.createElementNS(svgNS,\"rect\"));\n" " this.lowerRightShadow.setAttributeNS(null,\"x\"),this.x + this.shadowOffset);\n" " this.lowerRightShadow.setAttributeNS(null,\"y\"),this.y + this.shadowOffset);\n" " this.lowerRightShadow.setAttributeNS(null,\"width\"),this.width);\n" " this.lowerRightShadow.setAttributeNS(null,\"height\"),this.height);\n" " this.lowerRightShadow.setAttributeNS(null,\"points\"),this.x+\"),\"+(this.y+this.height)+\" \"+this.x+\"),\"+this.y+\" \"+(this.x+this.width)+\"),\"+this.y);\n" " }\n" " else if (this.buttonType == \"ellipse\")) {\n" " this.lowerRightShadow = document.createElementNS(svgNS,\"ellipse\"));\n" " this.lowerRightShadow.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5 + this.shadowOffset);\n" " this.lowerRightShadow.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5 + this.shadowOffset);\n" " this.lowerRightShadow.setAttributeNS(null,\"rx\"),this.width * 0.5);\n" " this.lowerRightShadow.setAttributeNS(null,\"ry\"),this.height * 0.5);\n" " }\n" " this.lowerRightShadow.setAttributeNS(null,\"fill\"),this.shadeDarkFill);\n" " this.buttonGroup.appendChild(this.lowerRightShadow);\n" "\n" " //create buttonRect\n" " if (this.buttonType == \"rect\")) {\n" " this.buttonRect = document.createElementNS(svgNS,\"rect\"));\n" " this.buttonRect.setAttributeNS(null,\"x\"),this.x);\n" " this.buttonRect.setAttributeNS(null,\"y\"),this.y);\n" " this.buttonRect.setAttributeNS(null,\"width\"),this.width);\n" " this.buttonRect.setAttributeNS(null,\"height\"),this.height);\n" " }\n" " else if (this.buttonType == \"ellipse\")) {\n" " this.buttonRect = document.createElementNS(svgNS,\"ellipse\"));\n" " this.buttonRect.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5);\n" " this.buttonRect.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5);\n" " this.buttonRect.setAttributeNS(null,\"rx\"),this.width * 0.5);\n" " this.buttonRect.setAttributeNS(null,\"ry\"),this.height * 0.5);\n" " }\n" " this.buttonRect.setAttributeNS(null,\"fill\"),this.buttonFill);\n" " this.buttonRect.setAttributeNS(null,\"cursor\"),\"pointer\"));\n" " this.buttonRect.addEventListener(\"mousedown\"),this,false);\n" " this.buttonRect.addEventListener(\"mouseup\"),this,false);\n" " this.buttonRect.addEventListener(\"click\"),this,false);\n" " this.buttonGroup.appendChild(this.buttonRect);\n" " \n" " if (this.buttonText != undefined) {\n" " //create text element and add clipping path attribute\n" " this.buttonTextElement = document.createElementNS(svgNS,\"text\"));\n" " this.buttonTextElement.setAttributeNS(null,\"x\"),(this.x + this.width / 2));\n" " this.buttonTextElement.setAttributeNS(null,\"y\"),(this.y + this.height - ((this.height - this.fontSize) / 1.75)));\n" " this.buttonTextElement.setAttributeNS(null,\"fill\"),this.textFill);\n" " this.buttonTextElement.setAttributeNS(null,\"font-family\"),this.fontFamily);\n" " this.buttonTextElement.setAttributeNS(null,\"font-size\"),this.fontSize+\"px\"));\n" " this.buttonTextElement.setAttributeNS(null,\"pointer-events\"),\"none\"));\n" " this.buttonTextElement.setAttributeNS(null,\"text-anchor\"),\"middle\"));\n" " this.buttonTextElement.setAttributeNS(\"http://www.w3.org/XML/1998/namespace\"),\"space\"),\"preserve\"));\n" " var textboxTextContent = document.createTextNode(this.buttonText);\n" " this.buttonTextElement.appendChild(textboxTextContent);\n" " this.buttonGroup.appendChild(this.buttonTextElement);\n" " }\n" " \n" " if (this.buttonSymbolId != undefined) {\n" " this.buttonSymbolInstance = document.createElementNS(svgNS,\"use\"));\n" " this.buttonSymbolInstance.setAttributeNS(null,\"x\"),(this.x + this.width / 2));\n" " this.buttonSymbolInstance.setAttributeNS(null,\"y\"),(this.y + this.height / 2));\n" " this.buttonSymbolInstance.setAttributeNS(xlinkNS,\"href\"),\"#\"+this.buttonSymbolId);\n" " this.buttonSymbolInstance.setAttributeNS(null,\"pointer-events\"),\"none\"));\n" " this.buttonGroup.appendChild(this.buttonSymbolInstance);\n" " }\n" " \n" " //create rectangle to deactivate the button\n" " if (this.buttonType == \"rect\")) {\n" " this.deActivateRect = document.createElementNS(svgNS,\"rect\"));\n" " this.deActivateRect.setAttributeNS(null,\"x\"),this.x - this.shadowOffset);\n" " this.deActivateRect.setAttributeNS(null,\"y\"),this.y - this.shadowOffset);\n" " this.deActivateRect.setAttributeNS(null,\"width\"),this.width + this.shadowOffset * 2);\n" " this.deActivateRect.setAttributeNS(null,\"height\"),this.height + this.shadowOffset * 2);\n" " }\n" " else if (this.buttonType == \"ellipse\")) {\n" " this.deActivateRect = document.createElementNS(svgNS,\"ellipse\"));\n" " this.deActivateRect.setAttributeNS(null,\"cx\"),this.x + this.width * 0.5);\n" " this.deActivateRect.setAttributeNS(null,\"cy\"),this.y + this.height * 0.5);\n" " this.deActivateRect.setAttributeNS(null,\"rx\"),this.width * 0.5 + this.shadowOffset);\n" " this.deActivateRect.setAttributeNS(null,\"ry\"),this.height * 0.5 + this.shadowOffset);\n" " }\n" " \n" " this.deActivateRect.setAttributeNS(null,\"fill\"),\"white\"));\n" " this.deActivateRect.setAttributeNS(null,\"fill-opacity\"),\"0.5\"));\n" " this.deActivateRect.setAttributeNS(null,\"stroke\"),\"none\"));\n" " this.deActivateRect.setAttributeNS(null,\"display\"),\"none\"));\n" " this.deActivateRect.setAttributeNS(null,\"cursor\"),\"default\"));\n" " this.buttonGroup.appendChild(this.deActivateRect);\n" "}\n" "\n" "//remove all textbox elements\n" "button.prototype.removeButton = function() {\n" " this.buttonGroup.removeChild(this.upperLeftShadow);\n" " this.buttonGroup.removeChild(this.lowerRightShadow);\n" " this.buttonGroup.removeChild(this.buttonRect);\n" " if (this.buttonTextElement) {\n" " this.buttonGroup.removeChild(this.buttonTextElement); \n" " }\n" " if (this.buttonSymbolInstance) {\n" " this.buttonGroup.removeChild(this.buttonSymbolInstance); \n" " }\n" " this.buttonGroup.removeChild(this.deActivateRect);\n" "}\n" "\n" "//click on and write in textbox\n" "button.prototype.handleEvent = function(evt) {\n" " if (evt.type == \"mousedown\")) {\n" " this.togglePressed(\"pressed\"));\n" " document.documentElement.addEventListener(\"mouseup\"),this,false); \n" " }\n" " if (evt.type == \"mouseup\")) {\n" " this.togglePressed(\"released\"));\n" " document.documentElement.removeEventListener(\"mouseup\"),this,false); \n" " }\n" " if (evt.type == \"click\")) {\n" " //for some strange reasons I could not forward the evt object here ;-(, the code below using a literal is a workaround\n" " //attention: only some of the evt properties are forwarded here, you can add more, if you need them\n" " var timerEvt = {x:evt.clientX,y:evt.clientY,type:evt.type,detail:evt.detail,timeStamp:evt.timeStamp}\n" " this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt)\n" " }\n" "}\n" "\n" "button.prototype.togglePressed = function(type) {\n" " if (type == \"pressed\")) {\n" " this.upperLeftShadow.setAttributeNS(null,\"fill\"),this.shadeDarkFill); \n" " this.lowerRightShadow.setAttributeNS(null,\"fill\"),this.shadeLightFill);\n" " }\n" " if (type == \"released\")) {\n" " this.upperLeftShadow.setAttributeNS(null,\"fill\"),this.shadeLightFill); \n" " this.lowerRightShadow.setAttributeNS(null,\"fill\"),this.shadeDarkFill); \n" " }\n" "}\n" "\n" "button.prototype.fireFunction = function(evt) {\n" " if (typeof(this.functionToCall) == \"function\")) {\n" " if (this.buttonTextElement) {\n" " this.functionToCall(this.groupId,evt,this.buttonText);\n" " }\n" " if (this.buttonSymbolInstance) {\n" " this.functionToCall(this.groupId,evt);\n" " }\n" " }\n" " if (typeof(this.functionToCall) == \"object\")) {\n" " if (this.buttonTextElement) {\n" " this.functionToCall.buttonPressed(this.groupId,evt,this.buttonText);\n" " }\n" " if (this.buttonSymbolInstance) {\n" " this.functionToCall.buttonPressed(this.groupId,evt);\n" " }\n" " }\n" " if (typeof(this.functionToCall) == undefined) {\n" " return; \n" " }\n" "}\n" "\n" "button.prototype.getTextValue = function() {\n" " return this.buttonText;\n" "} \n" "\n" "button.prototype.setTextValue = function(value) {\n" " this.buttonText = value;\n" " this.buttonTextElement.firstChild.nodeValue=this.buttonText;\n" "}\n" "\n" "button.prototype.activate = function(value) {\n" " this.deActivateRect.setAttributeNS(null,\"display\"),\"none\"));\n" " this.activated = true;\n" "}\n" "\n" "button.prototype.deactivate = function(value) {\n" " this.deActivateRect.setAttributeNS(null,\"display\"),\"inherit\"));\n" " this.activated = false;\n" "}\n" "\n" "//switchbutton\n" "//initialize inheritance\n" "switchbutton.prototype = new button();\n" "switchbutton.prototype.constructor = switchbutton;\n" "switchbutton.superclass = button.prototype;\n" "\n" "function switchbutton(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset) {\n" " if (arguments.length > 0) {\n" " this.init(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset);\n" " }\n" "}\n" "\n" "switchbutton.prototype.init = function(groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset) {\n" " switchbutton.superclass.init.call(this,groupId,functionToCall,buttonType,buttonText,buttonSymbolId,x,y,width,height,fontSize,fontFamily,textFill,buttonFill,shadeLightFill,shadeDarkFill,shadowOffset);\n" " this.on = false;\n" "}\n" "\n" "//overwriting handleEventcode\n" "switchbutton.prototype.handleEvent = function(evt) {\n" " //for some strange reasons I could not forward the evt object here ;-(, the code below using a literal is a workaround\n" " //attention: only some of the evt properties are forwarded here, you can add more, if you need them\n" " var timerEvt = {x:evt.clientX,y:evt.clientY,type:evt.type,detail:evt.detail,timeStamp:evt.timeStamp}\n" " if (evt.type == \"click\")) {\n" " if (this.on) {\n" " this.on = false;\n" " this.togglePressed(\"released\"));\n" " this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt);\n" " }\n" " else {\n" " this.on = true;\n" " this.togglePressed(\"pressed\")); \n" " this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt);\n" " }\n" " }\n" "}\n" "\n" "switchbutton.prototype.getSwitchValue = function() {\n" " return this.on;\n" "}\n" "\n" "switchbutton.prototype.setSwitchValue = function(onOrOff,firefunction) {\n" " this.on = onOrOff;\n" " //artificial timer event - don't use the values!\n" " var timerEvt = {x:0,y:0,type:\"click\"),detail:1,timeStamp:0}\n" " if (this.on) {\n" " this.togglePressed(\"pressed\"));\n" " if (firefunction) {\n" " this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt);\n" " }\n" " }\n" " else {\n" " this.togglePressed(\"released\")); \n" " if (firefunction) {\n" " this.timer.setTimeout(\"fireFunction\"),this.timerMs,timerEvt)\n" " }\n" " }\n" "}\n" "\n" "//overwriting fireFunction code\n" "switchbutton.prototype.fireFunction = function(evt) {\n" " if (typeof(this.functionToCall) == \"function\")) {\n" " if (this.buttonTextElement) {\n" " this.functionToCall(this.groupId,evt,this.on,this.buttonText);\n" " }\n" " if (this.buttonSymbolInstance) {\n" " this.functionToCall(this.groupId,evt,this.on);\n" " }\n" " }\n" " if (typeof(this.functionToCall) == \"object\")) {\n" " if (this.buttonTextElement) {\n" " this.functionToCall.buttonPressed(this.groupId,evt,this.on,this.buttonText);\n" " }\n" " if (this.buttonSymbolInstance) {\n" " this.functionToCall.buttonPressed(this.groupId,evt,this.on);\n" " }\n" " }\n" " if (typeof(this.functionToCall) == undefined) {\n" " return; \n" " }\n" "}\n" "\n" ); } //--------------------------------------------------------- const char * CSVG_Interactive_Map::_Get_Code_Navigation_1(void) { return( "/*\n" "Scripts for SVG only webmapping application navigation tools\n" "Copyright (C) <2005> \n" "Version 1.1, 2005-10-05\n" "neumann@karto.baug.ethz.ch\n" "http://www.carto.net/\n" "http://www.carto.net/neumann/\n" "\n" "Credits: numerous people on svgdevelopers@yahoogroups.com\n" "\n" "This ECMA script library is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU Lesser General Public\n" "License as published by the Free Software Foundation; either\n" "version 2.1 of the License, or (at your option) any later version.\n" "\n" "This library is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" "Lesser General Public License for more details.\n" "\n" "You should have received a copy of the GNU Lesser General Public\n" "License along with this library (http://www.carto.net/papers/svg/navigationTools/lesser_gpl.txt); if not, write to the Free Software\n" "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n" "\n" "----\n" "\n" "current version: 1.1\n" "\n" "version history:\n" "1.0 initial version\n" "1.01 (2005-02-15) added cleanUp() method to map and dragObj objects, some fixes in the documentation\n" "1.02 (2005-02-20) fixed problems with double clicks, the second click of a double click is now ignored, using the evt.detail property\n" "1.03 (2005-02-22) introduced timestamp and nrLayerToLoad array for dynamic loading (getUrl)\n" "1.04 (2005-09-15) introduced a few changes with coordinate calculation to support MozillaSVG, introduced epsg and unitsFactor property based on a suggestion by Bruce Rindahl\n" "1.1 (2005-10-05) introduced button object (see button.js file), introduced zoom and pan \"modes\" for repeated actions in the same mode, introduced history of map extents with the ability to go back and forth in the list of previous map extents, some internal changes in the code (e.g. less global variables), added experimental support for the batik SVG 1.2 \"static\" attribute to improve performance while panning the map, added cursors to give better status feedback\n" "\n" "original document site: http://www.carto.net/papers/svg/navigationTools/\n" "Please contact the author in case you want to use code or ideas commercially.\n" "If you use this code, please include this copyright header, the included full\n" "LGPL 2.1 text and read the terms provided in the LGPL 2.1 license\n" "(http://www.gnu.org/copyleft/lesser.txt)\n" "\n" "-------------------------------\n" "\n" "Please report bugs and send improvements to neumann@karto.baug.ethz.ch\n" "If you use these scripts, please link to the original (http://www.carto.net/papers/svg/navigationTools/)\n" "somewhere in the source-code-comment or the \"about\" of your project and give credits, thanks!\n" "\n" "*/\n" "\n" "//constructor: holds data on map and initializes various references\n" "function map(mapName,maxWidth,minWidth,zoomFact,nrDecimals,epsg,units,unitsFactor,showCoords,coordXId,coordYId,dynamicLayers,digiLayers,activeDigiLayer) {\n" " this.mapName = mapName; //id of svg element containing the map geometry\n" " this.mapSVG = document.getElementById(this.mapName); //reference to nested SVG element holding the map-graphics\n" " this.mainMapGroup = document.getElementById(this.mapName+\"Group\")); //group within mainmap - to be transformed when panning manually\n" " this.dynamicLayers = dynamicLayers; //an associative array holding ids of values that are loaded from the web server dynamically (.getUrl())\n" " this.nrLayerToLoad = 0; //statusVariable to indicate how many layers are still to load\n" " this.maxWidth = maxWidth; //max map width\n" " this.minWidth = minWidth; //min map width, after zooming in\n" " this.zoomFact = zoomFact; //ratio to zoom in or out in relation to previous viewBox\n" " this.digiLayers = digiLayers; //references to digiLayers (for digitizing tools)\n" " this.activeDigiLayer = activeDigiLayer; //active Digi Layer, key is final group id where geometry should be copied to after digitizing\n" " this.pixXOffset = parseFloat(this.mapSVG.getAttributeNS(null,\"x\"))); //offset from left margin of outer viewBox\n" " this.pixYOffset = parseFloat(this.mapSVG.getAttributeNS(null,\"y\"))); //offset from top margin of outer viewBox\n" " var viewBoxArray = this.mapSVG.getAttributeNS(null,\"viewBox\")).split(\" \"));\n" " this.curxOrig = parseFloat(viewBoxArray[0]); //holds the current xOrig\n" " this.curyOrig = parseFloat(viewBoxArray[1]); //holds the current yOrig\n" " this.curWidth = parseFloat(viewBoxArray[2]); //holds the current map width\n" " this.curHeight = parseFloat(viewBoxArray[3]); //holds the current map height\n" " this.pixWidth = parseFloat(this.mapSVG.getAttributeNS(null,\"width\"))); //holds width of the map in pixel coordinates\n" " this.pixHeight = parseFloat(this.mapSVG.getAttributeNS(null,\"height\"))); //holds height of the map in pixel coordinates\n" " this.pixSize = this.curWidth / this.pixWidth; //size of a screen pixel in map units\n" " this.zoomVal = this.maxWidth / this.curWidth * 100; //zoomVal in relation to initial zoom\n" " this.nrDecimals = nrDecimals; //nr of decimal places to be displayed for show coordinates or accuracy when working with digitizing\n" " this.epsg = epsg; //epsg projection code - can be used for building URL strings for loading data from a WMS or spatial database, if you don't need it just input any number\n" " this.navStatus = \"info\"); //to indicate status in navigation, default is \"info\"), no navigation mode active\n" " this.units = units; //holds a string with map units, e.g. \"m\"), alternatively String.fromCharCode(176) for degrees\n" " this.unitsFactor = unitsFactor; //a factor for unit conversion. Can be used f.e. to output feet coordinates when data is meter, If you don't need a conversion, just use a factor of 1\n" " this.showCoords = showCoords;\n" " //initialize array of timestamp/layertoLoad values\n" " this.nrLayerToLoad = new Array();\n" " this.timestamp = null; //holds the timestamp after a zoom or pan occured\n" " //initialize coordinate display if showCoords == true\n" " if (this.showCoords == true) {\n" " //add event listener for coordinate display\n" " this.mapSVG.addEventListener(\"mousemove\"),this,false);\n" " if (typeof(coordXId) == \"string\")) {\n" " this.coordXText = document.getElementById(coordXId).firstChild;\n" " }\n" " else {\n" " alert(\"Error: coordXId needs to be an id of type string\"));\n" " }\n" " if (typeof(coordYId) == \"string\")) {\n" " this.coordYText = document.getElementById(coordYId).firstChild;\n" " }\n" " else {\n" " alert(\"Error: coordYId needs to be an id of type string\"));\n" " }\n" " }\n" " //a new array containing map extents\n" " this.mapExtents = new Array();\n" " this.mapExtents.push({xmin:this.curxOrig,ymin:((this.curyOrig + this.curHeight) * -1),xmax:(this.curxOrig + this.curWidth),ymax:(this.curyOrig * -1)});\n" " this.curMapExtentIndex = 0;\n" " //create background-element to receive events for showing coordinates\n" " //this rect is also used for manual zooming and panning\n" " this.backgroundRect = document.createElementNS(svgNS,\"rect\"));\n" " this.backgroundRect.setAttributeNS(null,\"x\"),this.curxOrig);\n" " this.backgroundRect.setAttributeNS(null,\"y\"),this.curyOrig);\n" " this.backgroundRect.setAttributeNS(null,\"width\"),this.curWidth);\n" " this.backgroundRect.setAttributeNS(null,\"height\"),this.curHeight);\n" " this.backgroundRect.setAttributeNS(null,\"fill\"),\"none\"));\n" " this.backgroundRect.setAttributeNS(null,\"stroke\"),\"none\"));\n" " this.backgroundRect.setAttributeNS(null,\"pointer-events\"),\"fill\"));\n" " this.backgroundRect.setAttributeNS(null,\"id\"),\"mapBackgroundRect\"));\n" " this.backgroundRect.addEventListener(\"mousedown\"),this,false);\n" " this.backgroundRect.addEventListener(\"mousemove\"),this,false);\n" " this.backgroundRect.addEventListener(\"mouseup\"),this,false);\n" " this.backgroundRect.addEventListener(\"mouseout\"),this,false);\n" " this.backgroundRect.addEventListener(\"click\"),this,false);\n" " this.mainMapGroup.insertBefore(this.backgroundRect,this.mainMapGroup.firstChild);\n" " //determine if viewer is capable of getScreenCTM\n" " if (document.documentElement.getScreenCTM) {\n" " this.getScreenCTM = true;\n" " }\n" " else {\n" " this.getScreenCTM = false; \n" " }\n" "}\n" "\n" "//resets viewBox of main map after zooming and panning\n" "map.prototype.newViewBox = function(refRectId,history) {\n" " var myRefRect = document.getElementById(refRectId);\n" " this.curxOrig = parseFloat(myRefRect.getAttributeNS(null,\"x\")));\n" " this.curyOrig = parseFloat(myRefRect.getAttributeNS(null,\"y\")));\n" " this.curWidth = parseFloat(myRefRect.getAttributeNS(null,\"width\")));\n" " this.curHeight = parseFloat(myRefRect.getAttributeNS(null,\"height\")));\n" " var myViewBoxString = this.curxOrig + \" \" + this.curyOrig + \" \" + this.curWidth + \" \" + this.curHeight;\n" " this.pixSize = this.curWidth / this.pixWidth;\n" " this.zoomVal = this.maxWidth / this.curWidth * 100;\n" " this.mapSVG.setAttributeNS(null,\"viewBox\"),myViewBoxString);\n" " myMapApp.zoomSlider.setValue(this.curWidth);\n" " loadProjectSpecific();\n" " if (history) {\n" " this.mapExtents.push({xmin:this.curxOrig,ymin:((this.curyOrig + this.curHeight) * -1),xmax:(this.curxOrig + this.curWidth),ymax:(this.curyOrig * -1)});\n" " this.curMapExtentIndex = (this.mapExtents.length - 1);\n" " }\n" " this.checkButtons();\n" "}\n" "\n" "map.prototype.backwardExtent = function() {\n" " if (this.curMapExtentIndex != 0) {\n" " this.curMapExtentIndex--;\n" " this.setNewViewBox(this.mapExtents[this.curMapExtentIndex].xmin,this.mapExtents[this.curMapExtentIndex].ymin,this.mapExtents[this.curMapExtentIndex].xmax,this.mapExtents[this.curMapExtentIndex].ymax,false);\n" " }\n" "}\n" "\n" "map.prototype.forwardExtent = function() {\n" " if (this.mapExtents.length != (this.curMapExtentIndex + 1)) {\n" " this.curMapExtentIndex++;\n" " this.setNewViewBox(this.mapExtents[this.curMapExtentIndex].xmin,this.mapExtents[this.curMapExtentIndex].ymin,this.mapExtents[this.curMapExtentIndex].xmax,this.mapExtents[this.curMapExtentIndex].ymax,false);\n" " }\n" "}\n" "\n" "map.prototype.checkButtons = function() {\n" " //check extent history\n" " if (this.curMapExtentIndex == 0) {\n" " if (myMapApp.buttons[\"backwardExtent\"].activated) {\n" " myMapApp.buttons[\"backwardExtent\"].deactivate();\n" " }\n" " }\n" " else {\n" " if (!myMapApp.buttons[\"backwardExtent\"].activated) {\n" " myMapApp.buttons[\"backwardExtent\"].activate();\n" " } \n" " }\n" " if (this.mapExtents.length == (this.curMapExtentIndex + 1)) {\n" " if (myMapApp.buttons[\"forwardExtent\"].activated) {\n" " myMapApp.buttons[\"forwardExtent\"].deactivate();\n" " }\n" " }\n" " else {\n" " if (!myMapApp.buttons[\"forwardExtent\"].activated) {\n" " myMapApp.buttons[\"forwardExtent\"].activate();\n" " } \n" " }\n" " \n" " //maximum map width reached, cannot zoom out further\n" " if (this.curWidth >= this.maxWidth) {\n" " if (myMapApp.buttons[\"zoomOut\"].activated) {\n" " myMapApp.buttons[\"zoomOut\"].deactivate();\n" " }\n" " if (myMapApp.buttons[\"zoomFull\"].activated) {\n" " myMapApp.buttons[\"zoomFull\"].deactivate();\n" " }\n" " if (myMapApp.buttons[\"panManual\"].activated) {\n" " myMapApp.buttons[\"panManual\"].deactivate();\n" " }\n" " if (myMapApp.buttons[\"recenterMap\"].activated) {\n" " myMapApp.buttons[\"recenterMap\"].deactivate();\n" " }\n" " if (!myMapApp.buttons[\"zoomIn\"].activated) {\n" " myMapApp.buttons[\"zoomIn\"].activate();\n" " }\n" " if (!myMapApp.buttons[\"zoomManual\"].activated) {\n" " myMapApp.buttons[\"zoomManual\"].activate();\n" " }\n" " }\n" " //minimum map width reached, cannot zoom in further\n" " else if (this.curWidth <= this.minWidth) {\n" " if (myMapApp.buttons[\"zoomIn\"].activated) {\n" " myMapApp.buttons[\"zoomIn\"].deactivate();\n" " }\n" " if (myMapApp.buttons[\"zoomManual\"].activated) {\n" " myMapApp.buttons[\"zoomManual\"].deactivate();\n" " }\n" " if (!myMapApp.buttons[\"zoomOut\"].activated) {\n" " myMapApp.buttons[\"zoomOut\"].activate();\n" " }\n" " if (!myMapApp.buttons[\"zoomFull\"].activated) {\n" " myMapApp.buttons[\"zoomFull\"].activate();\n" " }\n" " if (!myMapApp.buttons[\"panManual\"].activated) {\n" " myMapApp.buttons[\"panManual\"].activate();\n" " }\n" " if (!myMapApp.buttons[\"recenterMap\"].activated) {\n" " myMapApp.buttons[\"recenterMap\"].activate();\n" " } \n" " }\n" " //in between\n" " else {\n" " if (!myMapApp.buttons[\"zoomIn\"].activated) {\n" " myMapApp.buttons[\"zoomIn\"].activate();\n" " }\n" " if (!myMapApp.buttons[\"zoomManual\"].activated) {\n" " myMapApp.buttons[\"zoomManual\"].activate();\n" " }\n" " if (!myMapApp.buttons[\"zoomOut\"].activated) {\n" " myMapApp.buttons[\"zoomOut\"].activate();\n" " }\n" " if (!myMapApp.buttons[\"zoomFull\"].activated) {\n" " myMapApp.buttons[\"zoomFull\"].activate();\n" " }\n" " if (!myMapApp.buttons[\"panManual\"].activated) {\n" " myMapApp.buttons[\"panManual\"].activate();\n" " }\n" " if (!myMapApp.buttons[\"recenterMap\"].activated) {\n" " myMapApp.buttons[\"recenterMap\"].activate();\n" " } \n" " } \n" "}\n" "\n" "map.prototype.setNewViewBox = function(xmin,ymin,xmax,ymax,history) {\n" " //check if within constraints\n" " if (xmin < myMapApp.refMapDragger.constrXmin) {\n" " xmin = myMapApp.refMapDragger.constrXmin;\n" " }\n" " if (xmax > myMapApp.refMapDragger.constrXmax) {\n" " xmax = myMapApp.refMapDragger.constrXmin;\n" " }\n" " if (ymin < (myMapApp.refMapDragger.constrYmax * -1)) {\n" " ymin = myMapApp.refMapDragger.constrYmax * -1;\n" " }\n" " if (ymax > (myMapApp.refMapDragger.constrYmin * -1)) {\n" " ymax = myMapApp.refMapDragger.constrYmin * -1;\n" " }\n" " \n" " var origWidth = xmax - xmin;\n" " var origHeight = ymax - ymin;\n" " var myRatio = this.curWidth/this.curHeight;\n" " \n" " if (origWidth / origHeight > myRatio) { //case rect is more wide than ratio\n" " var newWidth = origWidth;\n" " var newHeight = origWidth * 1 / myRatio;\n" " ymin = (ymax + (newHeight - origHeight) / 2) * -1;\n" " }\n" " else {\n" " var newHeight = origHeight;\n" " var newWidth = newHeight * myRatio;\n" " xmin = xmin - (newWidth - origWidth) / 2;\n" " ymin = ymax * -1;\n" " }\n" " //check if within constraints\n" " if (xmin < myMapApp.refMapDragger.constrXmin) {\n" " xmin = myMapApp.refMapDragger.constrXmin;\n" " }\n" " if (ymin < myMapApp.refMapDragger.constrYmin) {\n" " ymin = myMapApp.refMapDragger.constrYmin;\n" " }\n" " if ((xmin + newWidth) > myMapApp.refMapDragger.constrXmax) {\n" " xmin = myMapApp.refMapDragger.constrXmax - newWidth;\n" " }\n" " if ((ymin + newHeight) > myMapApp.refMapDragger.constrYmax) {\n" " ymin = myMapApp.refMapDragger.constrYmax - newHeight;\n" " } \n" " myMapApp.refMapDragger.newView(xmin,ymin,newWidth,newHeight);\n" " this.newViewBox(myMapApp.refMapDragger.dragId,history);\n" "}\n" "\n" "//handles events associated with navigation\n" "map.prototype.handleEvent = function(evt) {\n" " var callerId = evt.currentTarget.getAttributeNS(null,\"id\"));\n" " if (callerId.match(/\\bzoomBgRectManual/)) {\n" " this.zoomManDragRect(evt);\n" " }\n" " if (callerId.match(/\\bzoomBgRectRecenter/)) {\n" " this.recenterFinally(evt);\n" " }\n" " if (callerId.match(/\\bbgPanManual/)) {\n" " this.panManualFinally(evt);\n" " }\n" " if (callerId == \"mainMap\" && evt.type == \"mousemove\")) {\n" " if (this.navStatus != \"panmanualActive\")) {\n" " this.showCoordinates(evt);\n" " }\n" " }\n" "}\n" "\n" "//calcs coordinates; relies on myMapApp to handle different window sizes and resizing of windows\n" "map.prototype.calcCoord = function(evt) {\n" " //with getScreenCTM the values are already in the inner coordinate system\n" " if (!this.getScreenCTM) {\n" " var coords = myMapApp.calcCoord(evt,this.mapSVG);\n" " coords.x = this.curxOrig + (coords.x - this.pixXOffset) * this.pixSize;\n" " coords.y = (this.curyOrig + (coords.y - this.pixYOffset) * this.pixSize);\n" " }\n" " else { \n" " var coords = myMapApp.calcCoord(evt,this.mainMapGroup);\n" " }\n" " return coords;\n" "}\n" "\n" "//displays x and y coordinates in two separate text elements\n" "map.prototype.showCoordinates = function(evt) {\n" " var mapCoords = this.calcCoord(evt);\n" " this.coordXText.nodeValue = \"X: \" + formatNumberString((mapCoords.x * this.unitsFactor).toFixed(this.nrDecimals)) + this.units;\n" " this.coordYText.nodeValue = \"Y: \" + formatNumberString((mapCoords.y * this.unitsFactor * -1).toFixed(this.nrDecimals)) + this.units;\n" "}\n" "\n" "//checks for and removes temporary rectangle objects\n" "map.prototype.stopNavModes = function() {\n" " if (this.navStatus != \"info\")) {\n" " if (this.navStatus == \"zoomManual\")) {\n" " myMapApp.buttons[\"zoomManual\"].setSwitchValue(false,false);\n" " }\n" " if (this.navStatus == \"panmanual\" || this.navStatus == \"panmanualActive\")) {\n" " myMapApp.buttons[\"panManual\"].setSwitchValue(false,false);\n" " }\n" " if (this.navStatus == \"recenter\")) {\n" " myMapApp.buttons[\"recenterMap\"].setSwitchValue(false,false);\n" " }\n" " this.backgroundRect.setAttributeNS(null,\"id\"),\"mapBackgroundRect\"));\n" " myMapApp.buttons[\"infoButton\"].setSwitchValue(true,false);\n" " this.navStatus = \"info\");\n" " this.mapSVG.setAttributeNS(null,\"cursor\"),\"crosshair\"));\n" " statusChange(\"Mode: Infomode\"));\n" " this.mainMapGroup.insertBefore(this.backgroundRect,this.mainMapGroup.firstChild);\n" " }\n" "}\n" "\n" "//starts manual zooming mode\n" "map.prototype.zoomManual = function(evt) {\n" " if (Math.round(myMainMap.curWidth) > myMainMap.minWidth && evt.detail == 1) {\n" " this.navStatus = \"zoomManual\");\n" " this.backgroundRect.setAttributeNS(null,\"id\"),\"zoomBgRectManual\")); \n" " this.mainMapGroup.appendChild(this.backgroundRect);\n" " this.mapSVG.setAttributeNS(null,\"cursor\"),\"se-resize\"));\n" " statusChange(\"Click and drag rectangle for new map extent.\"));\n" " }\n" "}\n" "\n" "//manages manual zooming by drawing a rectangle\n" "map.prototype.zoomManDragRect = function(evt) {\n" " var mapCoords = this.calcCoord(evt);\n" " var myX = mapCoords.x;\n" " var myY = mapCoords.y;\n" " var myYXFact = this.curHeight / this.curWidth;\n" " if (evt.type == \"mousedown\")) {\n" " this.manZoomActive = 1;\n" " this.zoomRect = document.createElementNS(svgNS,\"rect\"));\n" " var myLineWidth = this.curWidth * 0.003;\n" " this.zoomRect.setAttributeNS(null,\"id\"),\"zoomRect\"));\n" " this.zoomRect.setAttributeNS(null,\"fill\"),\"white\"));\n" " this.zoomRect.setAttributeNS(null,\"fill-opacity\"),\"0.5\"));\n" " this.zoomRect.setAttributeNS(null,\"stroke\"),\"dimgray\"));\n" " this.zoomRect.setAttributeNS(null,\"stroke-width\"),myLineWidth);\n" " this.zoomRect.setAttributeNS(null,\"stroke-dasharray\"),(myLineWidth*3)+\"),\"+myLineWidth);\n" " this.zoomRect.setAttributeNS(null,\"pointer-events\"),\"none\"));\n" " this.zoomRect.setAttributeNS(null,\"x\"),myX);\n" " this.zoomRect.setAttributeNS(null,\"y\"),myY);\n" " this.zoomRect.setAttributeNS(null,\"width\"),this.minWidth);\n" " this.zoomRect.setAttributeNS(null,\"height\"),this.minWidth * myYXFact);\n" " this.mainMapGroup.appendChild(this.zoomRect);\n" " this.zoomRectOrigX = myX;\n" " this.zoomRectOrigY = myY;\n" " }\n" " if (evt.type == \"mousemove\" && this.manZoomActive == 1) {\n" " var myZoomWidth = myX - this.zoomRectOrigX;\n" " if (myZoomWidth < 0) {\n" " if (Math.abs(myZoomWidth) < this.minWidth) {\n" " this.zoomRect.setAttributeNS(null,\"x\"),this.zoomRectOrigX - this.minWidth);\n" " this.zoomRect.setAttributeNS(null,\"y\"),this.zoomRectOrigY - this.minWidth * myYXFact);\n" " this.zoomRect.setAttributeNS(null,\"width\"),this.minWidth);\n" " this.zoomRect.setAttributeNS(null,\"height\"),this.minWidth * myYXFact);\n" " }\n" " else {\n" " this.zoomRect.setAttributeNS(null,\"x\"),myX);\n" " this.zoomRect.setAttributeNS(null,\"y\"),this.zoomRectOrigY - Math.abs(myZoomWidth) * myYXFact);\n" " this.zoomRect.setAttributeNS(null,\"width\"),Math.abs(myZoomWidth));\n" " this.zoomRect.setAttributeNS(null,\"height\"),Math.abs(myZoomWidth) * myYXFact); \n" " }\n" " }\n" " else {\n" " this.zoomRect.setAttributeNS(null,\"x\"),this.zoomRectOrigX);\n" " this.zoomRect.setAttributeNS(null,\"y\"),this.zoomRectOrigY);\n" " if (myZoomWidth < this.minWidth) {\n" " this.zoomRect.setAttributeNS(null,\"width\"),this.minWidth);\n" " this.zoomRect.setAttributeNS(null,\"height\"),this.minWidth * myYXFact); \n" " }\n" " else {\n" " this.zoomRect.setAttributeNS(null,\"width\"),myZoomWidth);\n" " this.zoomRect.setAttributeNS(null,\"height\"),myZoomWidth * myYXFact);\n" " }\n" " }\n" " }\n" " if ((evt.type == \"mouseup\" || evt.type == \"mouseout\")) && this.manZoomActive == 1) {\n" " this.manZoomActive = 0;\n" " if (parseFloat(this.zoomRect.getAttributeNS(null,\"width\"))) > this.curWidth * 0.02) {\n" " myMapApp.refMapDragger.newView(parseFloat(this.zoomRect.getAttributeNS(null,\"x\"))),parseFloat(this.zoomRect.getAttributeNS(null,\"y\"))),parseFloat(this.zoomRect.getAttributeNS(null,\"width\"))),parseFloat(this.zoomRect.getAttributeNS(null,\"height\"))));\n" " this.newViewBox(myMapApp.refMapDragger.dragId,true);\n" " }\n" " this.mainMapGroup.removeChild(this.zoomRect);\n" " statusChange(\"Mode: Manual Zooming\"));\n" " }\n" "}\n" "\n" "//initializes recentering mode\n" "map.prototype.recenter = function(evt) {\n" " if (evt.detail == 1) {\n" " this.navStatus = \"recenter\");\n" " this.backgroundRect.setAttributeNS(null,\"id\"),\"zoomBgRectRecenter\")); \n" " this.mainMapGroup.appendChild(this.backgroundRect);\n" " this.mapSVG.setAttributeNS(null,\"cursor\"),\"pointer\"));\n" " statusChange(\"Click in map to define new map center.\"));\n" " }\n" "}\n" "\n" "//finishes recentering after mouse-click\n" "map.prototype.recenterFinally = function(evt) {\n" " if (evt.type == \"click\")) {\n" " var mapCoords = this.calcCoord(evt);\n" " var myX = mapCoords.x;\n" " var myY = mapCoords.y;\n" " var myNewX = myX - this.curWidth / 2;\n" " var myNewY = myY - this.curHeight / 2;\n" " \n" " //check if within constraints\n" " if (myNewX < myMapApp.refMapDragger.constrXmin) {\n" " myNewX = myMapApp.refMapDragger.constrXmin;\n" " }\n" " if (myNewY < myMapApp.refMapDragger.constrYmin) {\n" " myNewY = myMapApp.refMapDragger.constrYmin;\n" " }\n" " if ((myNewX + this.curWidth) > myMapApp.refMapDragger.constrXmax) {\n" " myNewX = myMapApp.refMapDragger.constrXmax - this.curWidth;\n" " }\n" " if ((myNewY + this.curHeight) > myMapApp.refMapDragger.constrYmax) {\n" " myNewY = myMapApp.refMapDragger.constrYmax - this.curHeight;\n" " }\n" " myMapApp.refMapDragger.newView(myNewX,myNewY,this.curWidth,this.curHeight);\n" " this.newViewBox(myMapApp.refMapDragger.dragId,true);\n" " statusChange(\"Mode: Recentering Map\"));\n" " }\n" "}\n" "\n" "//initializes manual panning\n" "map.prototype.panManual = function(evt) {\n" " if (evt.detail == 1) {\n" " this.navStatus = \"panmanual\");\n" " this.backgroundRect.setAttributeNS(null,\"id\"),\"bgPanManual\")); \n" " this.mainMapGroup.appendChild(this.backgroundRect);\n" " this.mapSVG.setAttributeNS(null,\"cursor\"),\"move\"));\n" " statusChange(\"Mouse down and move to pan the map\"));\n" " }\n" "}\n" "\n" "//manages and finishes manual panning\n" "map.prototype.panManualFinally = function(evt) {\n" " if (evt.type == \"mousedown\")) {\n" " this.navStatus = \"panmanualActive\");\n" " this.panCoords = this.calcCoord(evt);\n" " this.panCoorX = this.panCoords.x;\n" " this.panCoorY = this.panCoords.y;\n" " this.diffX = 0;\n" " this.diffY = 0;\n" " this.mainMapGroup.setAttributeNS(batikNS,\"static\"),\"true\"));\n" " }\n" " if (evt.type == \"mousemove\" && this.navStatus == \"panmanualActive\")) {\n" " var mapCoords = this.calcCoord(evt);\n" " if (this.getScreenCTM) {\n" " this.diffX = this.panCoorX - mapCoords.x + this.diffX;\n" " this.diffY = this.panCoorY - mapCoords.y + this.diffY;\n" " }\n" " else {\n" " this.diffX = this.panCoorX - mapCoords.x;\n" " this.diffY = this.panCoorY - mapCoords.y; \n" " }\n" " var myNewX = this.curxOrig + this.diffX;\n" " var myNewY = this.curyOrig + this.diffY;\n" " //check if within constraints\n" " if (myNewX < myMapApp.refMapDragger.constrXmin) {\n" " var myNewXTemp = myMapApp.refMapDragger.constrXmin;\n" " this.diffX = this.diffX + (myNewXTemp - myNewX);\n" " myNewX = myNewXTemp;\n" " }\n" " if (myNewY < myMapApp.refMapDragger.constrYmin) {\n" " var myNewYTemp = myMapApp.refMapDragger.constrYmin;\n" " this.diffY = this.diffY + (myNewYTemp - myNewY);\n" " myNewY = myNewYTemp;\n" " }\n" " if ((myNewX + this.curWidth) > myMapApp.refMapDragger.constrXmax) {\n" " var myNewXTemp = myMapApp.refMapDragger.constrXmax - this.curWidth;\n" " this.diffX = this.diffX + (myNewXTemp - myNewX);\n" " myNewX = myNewXTemp;\n" " }\n" " if ((myNewY + this.curHeight) > myMapApp.refMapDragger.constrYmax) {\n" " var myNewYTemp = myMapApp.refMapDragger.constrYmax - this.curHeight;\n" " this.diffY = this.diffY + (myNewYTemp - myNewY);\n" " myNewY = myNewYTemp;\n" " } \n" " var transformString = \"translate(\"+(this.diffX * -1) +\"),\"+(this.diffY * -1)+\"))\");\n" " this.mainMapGroup.setAttributeNS(null,\"transform\"),transformString);\n" " myMapApp.refMapDragger.newView(myNewX,myNewY,this.curWidth,this.curHeight);\n" " }\n" " if ((evt.type == \"mouseup\" || evt.type == \"mouseout\")) && this.navStatus == \"panmanualActive\")) {\n" " this.navStatus = \"panmanual\");\n" " this.mainMapGroup.setAttributeNS(batikNS,\"static\"),\"false\"));\n" " this.mainMapGroup.setAttributeNS(null,\"transform\"),\"translate(0,0)\"));\n" " this.newViewBox(myMapApp.refMapDragger.dragId,true); \n" " statusChange(\"Mode: Manual Panning\")); \n" " }\n" "}\n" "\n" "//remove all temporarily added elements and event listeners\n" "map.prototype.cleanUp = function() {\n" " //remove background rect\n" " this.backgroundRect.parentNode.removeChild(this.backgroundRect);\n" " //remove eventlisteners\n" " if (this.showCoords == true) {\n" " //add event listener for coordinate display\n" " this.mapSVG.removeEventListener(\"mousemove\"),this,false);\n" " }\n" "\n" "}\n" "\n" "//make an element (rectangle) draggable within constraints\n" "function dragObj(dragId,referenceMap,myDragSymbol,dragSymbThreshold,showCoords,coordXId,coordYId,mainMapObj) {\n" " this.dragId = dragId;\n" " this.myDragger = document.getElementById(this.dragId);\n" " this.myRefMap = document.getElementById(referenceMap);\n" " this.myDragSymbol = document.getElementById(myDragSymbol); \n" " this.dragSymbThreshold = dragSymbThreshold;\n" " var viewBox = this.myRefMap.getAttributeNS(null,\"viewBox\")).split(\" \"));\n" " this.constrXmin = parseFloat(viewBox[0]);\n" " this.constrYmin = parseFloat(viewBox[1]);\n" " this.constrXmax = this.constrXmin + parseFloat(viewBox[2]);\n" " this.constrYmax = this.constrYmin + parseFloat(viewBox[3]);\n" " this.refMapX = parseFloat(this.myRefMap.getAttributeNS(null,\"x\")));\n" " this.refMapY = parseFloat(this.myRefMap.getAttributeNS(null,\"y\")));\n" " this.refMapWidth = parseFloat(this.myRefMap.getAttributeNS(null,\"width\")));\n" " this.pixSize = (this.constrXmax - this.constrXmin) / this.refMapWidth;\n" " this.mainMapObj = mainMapObj;\n" " //initialize coordinate display if showCoords == true\n" " this.showCoords = showCoords;\n" " if (this.showCoords == true) {\n" " if (typeof(coordXId) == \"string\")) {\n" " this.coordXText = document.getElementById(coordXId).firstChild;\n" " }\n" " else {\n" " alert(\"Error: coordXId needs to be an id of type string\"));\n" " }\n" " if (typeof(coordYId) == \"string\")) {\n" " this.coordYText = document.getElementById(coordYId).firstChild;\n" " }\n" " else {\n" " alert(\"Error: coordYId needs to be an id of type string\"));\n" " }\n" " }\n" " //determine if viewer is capable of getScreenCTM\n" " if (document.documentElement.getScreenCTM) {\n" " this.getScreenCTM = true;\n" " }\n" " else {\n" " this.getScreenCTM = false; \n" " }\n" " this.status = false;\n" "}\n" "\n" "dragObj.prototype.calcCoord = function(evt) {\n" " //with getScreenCTM the values are already in the inner coordinate system but without using the outer offset\n" " var coordPoint = myMapApp.calcCoord(evt,this.myRefMap);\n" " if (!this.getScreenCTM) {\n" " coordPoint.x = this.constrXmin + (coordPoint.x - this.refMapX) * this.pixSize;\n" " coordPoint.y = this.constrYmin + (coordPoint.y - this.refMapY) * this.pixSize;\n" " }\n" " return coordPoint;\n" "}\n" "\n" "dragObj.prototype.handleEvent = function(evt) {\n" " if (evt.type == \"mousemove\")) {\n" " var mapCoords = this.calcCoord(evt);\n" " this.coordXText.nodeValue = \"X: \" + formatNumberString(mapCoords.x.toFixed(this.mainMapObj.nrDecimals)) + this.mainMapObj.units;\n" " this.coordYText.nodeValue = \"Y: \" + formatNumberString((mapCoords.y * -1).toFixed(this.mainMapObj.nrDecimals)) + this.mainMapObj.units;\n" " }\n" " this.drag(evt);\n" "}\n" "\n" "dragObj.prototype.newView = function(x,y,width,height) {\n" " this.myDragger.setAttributeNS(null,\"x\"),x);\n" " this.myDragger.setAttributeNS(null,\"y\"),y);\n" " this.myDragger.setAttributeNS(null,\"width\"),width);\n" " this.myDragger.setAttributeNS(null,\"height\"),height);\n" " this.myDragSymbol.setAttributeNS(null,\"x\"),(x + width/2));\n" " this.myDragSymbol.setAttributeNS(null,\"y\"),(y + height/2));\n" " if (width < this.dragSymbThreshold) {\n" " this.myDragSymbol.setAttributeNS(null,\"visibility\"),\"visible\"));\n" " }\n" " else {\n" " this.myDragSymbol.setAttributeNS(null,\"visibility\"),\"hidden\")); \n" " }\n" "}\n" "\n" ); } //--------------------------------------------------------- const char * CSVG_Interactive_Map::_Get_Code_Navigation_2(void) { return( "//this method was previously called \"resizeDragger\" - now renamed to .getSliderVal\n" "//this method receives values from the zoom slider\n" "dragObj.prototype.getSliderVal = function(status,sliderGroupName,width) {\n" " var myX = parseFloat(this.myDragger.getAttributeNS(null,\"x\")));\n" " var myY = parseFloat(this.myDragger.getAttributeNS(null,\"y\")));\n" " var myWidth = parseFloat(this.myDragger.getAttributeNS(null,\"width\")));\n" " var myHeight = parseFloat(this.myDragger.getAttributeNS(null,\"height\")));\n" " var myCenterX = myX + myWidth / 2;\n" " var myCenterY = myY + myHeight / 2;\n" " var myRatio = myHeight / myWidth;\n" " var toMoveX = myCenterX - width / 2;\n" " var toMoveY = myCenterY - width * myRatio / 2;\n" " if (toMoveX < this.constrXmin) {\n" " toMoveX = this.constrXmin;\n" " }\n" " if ((toMoveX + width) > this.constrXmax) {\n" " toMoveX = this.constrXmax - width;\n" " }\n" " if (toMoveY < this.constrYmin) {\n" " toMoveY = this.constrYmin;\n" " }\n" " if ((toMoveY + width * myRatio) > this.constrYmax) {\n" " toMoveY = this.constrYmax - width * myRatio;\n" " }\n" " this.newView(toMoveX,toMoveY,width,width * myRatio);\n" " if (status == \"release\")) {\n" " myMainMap.stopNavModes();\n" " this.mainMapObj.newViewBox(this.dragId,true);\n" " }\n" "}\n" "\n" "dragObj.prototype.drag = function(evt) {\n" " if (evt.type == \"mousedown\")) {\n" " this.myRefMap.setAttributeNS(null,\"cursor\"),\"move\"));\n" " this.status = true;\n" " }\n" " if ((evt.type == \"mousemove\" || evt.type == \"mousedown\")) && this.status == true) {\n" " var coords = this.calcCoord(evt);\n" " var newEvtX = coords.x;\n" " var newEvtY = coords.y;\n" " var myX = parseFloat(this.myDragger.getAttributeNS(null,\"x\")));\n" " var myY = parseFloat(this.myDragger.getAttributeNS(null,\"y\")));\n" " var myWidth = parseFloat(this.myDragger.getAttributeNS(null,\"width\")));\n" " var myHeight = parseFloat(this.myDragger.getAttributeNS(null,\"height\")));\n" " var toMoveX = newEvtX - myWidth / 2;\n" " var toMoveY = newEvtY - myHeight / 2;\n" " if (toMoveX < this.constrXmin) {\n" " toMoveX = this.constrXmin;\n" " }\n" " if ((toMoveX + myWidth) > this.constrXmax) {\n" " toMoveX = this.constrXmax - myWidth;\n" " }\n" " if (toMoveY < this.constrYmin) {\n" " toMoveY = this.constrYmin;\n" " }\n" " if ((toMoveY + myHeight) > this.constrYmax) {\n" " toMoveY = this.constrYmax - myHeight;\n" " }\n" " this.newView(toMoveX,toMoveY,myWidth,myHeight);\n" " }\n" " if ((evt.type == \"mouseup\" || evt.type == \"mouseout\")) && this.status == true) {\n" " this.status = false;\n" " if (evt.detail == 1) { //second click is ignored\n" " this.myRefMap.setAttributeNS(null,\"cursor\"),\"crosshair\"));\n" " this.mainMapObj.newViewBox('dragRectForRefMap',true);\n" " }\n" " }\n" "}\n" "\n" "dragObj.prototype.zoom = function(inOrOut) {\n" " var myOldX = this.myDragger.getAttributeNS(null,\"x\"));\n" " var myOldY = this.myDragger.getAttributeNS(null,\"y\"));\n" " var myOldWidth = this.myDragger.getAttributeNS(null,\"width\"));\n" " var myOldHeight = this.myDragger.getAttributeNS(null,\"height\"));\n" " switch (inOrOut) {\n" " case \"in\":\n" " var myNewX = parseFloat(myOldX) + myOldWidth / 2 - (myOldWidth * this.mainMapObj.zoomFact * 0.5);\n" " var myNewY = parseFloat(myOldY) + myOldHeight / 2 - (myOldHeight * this.mainMapObj.zoomFact * 0.5);\n" " var myNewWidth = myOldWidth * this.mainMapObj.zoomFact;\n" " var myNewHeight = myOldHeight * this.mainMapObj.zoomFact;\n" " if (myNewWidth < this.mainMapObj.minWidth) {\n" " var myYXFact = this.mainMapObj.curHeight / this.mainMapObj.curWidth;\n" " myNewWidth = this.mainMapObj.minWidth;\n" " myNewHeight = myNewWidth * myYXFact;\n" " myNewX = parseFloat(myOldX) + myOldWidth / 2 - (myNewWidth * 0.5);\n" " myNewY = parseFloat(myOldY) + myOldHeight / 2 - (myNewHeight * 0.5);\n" " }\n" " break;\n" " case \"out\":\n" " var myNewX = parseFloat(myOldX) + myOldWidth / 2 - (myOldWidth * (1 + this.mainMapObj.zoomFact) * 0.5);\n" " var myNewY = parseFloat(myOldY) + myOldHeight / 2 - (myOldHeight * (1 + this.mainMapObj.zoomFact) * 0.5);\n" " var myNewWidth = myOldWidth * (1 + this.mainMapObj.zoomFact);\n" " var myNewHeight = myOldHeight * (1 + this.mainMapObj.zoomFact);\n" " break;\n" " default:\n" " var myNewX = this.constrXmin;\n" " var myNewY = this.constrYmin;\n" " var myNewWidth = this.constrXmax - this.constrXmin;\n" " var myNewHeight = this.constrYmax - this.constrYmin;\n" " break;\n" " } \n" " //check if within constraints\n" " if (myNewWidth > (this.constrXmax - this.constrXmin)) {\n" " myNewWidth = this.constrXmax - this.constrXmin;\n" " }\n" " if (myNewHeight > (this.constrYmax - this.constrYmin)) {\n" " myNewHeight = this.constrYmax - this.constrYmin;\n" " }\n" " if (myNewX < this.constrXmin) {\n" " myNewX = this.constrXmin;\n" " }\n" " if (myNewY < this.constrYmin) {\n" " myNewY = this.constrYmin;\n" " }\n" " if ((myNewX + myNewWidth) > this.constrXmax) {\n" " myNewX = this.constrXmax - myNewWidth;\n" " }\n" " if ((myNewY + myNewHeight) > this.constrYmax) {\n" " myNewY = this.constrYmax - myNewHeight;\n" " }\n" " this.newView(myNewX,myNewY,myNewWidth,myNewHeight);\n" " this.mainMapObj.newViewBox(this.dragId,true);\n" "}\n" "\n" "dragObj.prototype.pan = function (myX,myY,howmuch) {\n" " //get values from draggable rectangle\n" " var xulcorner = parseFloat(this.myDragger.getAttributeNS(null,\"x\")));\n" " var yulcorner = parseFloat(this.myDragger.getAttributeNS(null,\"y\")));\n" " var width = parseFloat(this.myDragger.getAttributeNS(null,\"width\")));\n" " var height = parseFloat(this.myDragger.getAttributeNS(null,\"height\")));\n" "\n" " //set values of draggable rectangle\n" " var rectXulcorner = xulcorner + howmuch * width * myX;\n" " var rectYulcorner = yulcorner + howmuch * height * myY;\n" " //check if within constraints\n" " if (rectXulcorner < this.constrXmin) {\n" " rectXulcorner = this.constrXmin;\n" " }\n" " if (rectYulcorner < this.constrYmin) {\n" " rectYulcorner = this.constrYmin;\n" " }\n" " if ((rectXulcorner + width) > this.constrXmax) {\n" " rectXulcorner = this.constrXmax - width;\n" " }\n" " if ((rectYulcorner + height) > this.constrYmax) {\n" " rectYulcorner = this.constrYmax - height;\n" " }\n" " this.newView(rectXulcorner,rectYulcorner,width,height);\n" "\n" " //set viewport of main map\n" " if ((xulcorner != rectXulcorner) || (yulcorner != rectYulcorner)) {\n" " this.mainMapObj.newViewBox(this.dragId,true);\n" " }\n" "\n" " statusChange(\"map ready ...\"));\n" "}\n" "\n" "//remove all temporarily used elements and event listeners\n" "dragObj.prototype.cleanUp = function() {\n" " //remove eventlisteners\n" " if (this.showCoords == true) {\n" " //add event listener for coordinate display\n" " this.myRefMap.removeEventListener(\"mousemove\"),this,false);\n" " }\n" "}\n" "\n" "function zoomIt(evt,inOrOut) {\n" " if (evt.detail == 1) { //only react on first click, double click: second click is ignored\n" " if (inOrOut == \"in\")) {\n" " if (Math.round(myMainMap.curWidth) > myMainMap.minWidth) {\n" " myMapApp.refMapDragger.zoom(\"in\"));\n" " }\n" " else {\n" " statusChange(\"Maximum zoom factor reached. Cannot zoom in any more.\"));\n" " }\n" " }\n" " if (inOrOut == \"out\")) {\n" " if (Math.round(myMainMap.curWidth) < myMainMap.maxWidth) {\n" " myMapApp.refMapDragger.zoom(\"out\"));\n" " }\n" " else {\n" " statusChange(\"Minimum zoom factor reached. Cannot zoom out any more.\"));\n" " }\n" " }\n" " if (inOrOut == \"full\")) {\n" " if (Math.round(myMainMap.curWidth) < myMainMap.maxWidth) {\n" " myMapApp.refMapDragger.zoom(\"full\"));\n" " }\n" " else {\n" " statusChange(\"Full view already reached.\"));\n" " }\n" " }\n" " }\n" "}\n" "\n" "//this function starts various zoom actions or map extent history functions\n" "function zoomImageButtons(id,evt) {\n" " myMainMap.stopNavModes();\n" " if (id == \"zoomIn\")) {\n" " zoomIt(evt,'in');\n" " }\n" " if (id == \"zoomOut\")) {\n" " zoomIt(evt,'out');\n" " }\n" " if (id == \"zoomFull\")) {\n" " zoomIt(evt,'full');\n" " }\n" " if (id == \"backwardExtent\")) {\n" " myMainMap.backwardExtent();\n" " }\n" " if (id == \"forwardExtent\")) {\n" " myMainMap.forwardExtent();\n" " }\n" "}\n" "\n" "//this function starts various interactive zoom or pan modes\n" "function zoomImageSwitchButtons(id,evt,onOrOff) {\n" " myMainMap.stopNavModes();\n" " if (onOrOff) {\n" " if (id == \"infoButton\")) {\n" " \n" " }\n" " else {\n" " if (id == \"zoomManual\")) {\n" " myMainMap.zoomManual(evt);\n" " }\n" " if (id == \"panManual\")) {\n" " myMainMap.panManual(evt);\n" " }\n" " if (id == \"recenterMap\")) {\n" " myMainMap.recenter(evt);\n" " }\n" " if (myMapApp.buttons[\"infoButton\"].getSwitchValue()) {\n" " myMapApp.buttons[\"infoButton\"].setSwitchValue(false,false);\n" " }\n" " }\n" " }\n" " else {\n" " if (id == \"infoButton\")) {\n" " myMapApp.buttons[\"infoButton\"].setSwitchValue(true,false);\n" " }\n" " }\n" "}\n" "\n" "//alert map extent\n" "function showExtent() {\n" " with(myMainMap) {\n" " alert(\n" " \"Xmin=\"+curxOrig.toFixed(nrDecimals)+units+\n" " \"); Xmax=\"+(curxOrig + curWidth).toFixed(nrDecimals)+units+\n" " \"\\nYmin=\"+((curyOrig + curHeight) * -1).toFixed(nrDecimals) +units+\n" " \"); Ymax=\"+(curyOrig*-1).toFixed(nrDecimals)+units+\n" " \"\\nWidth=\"+curWidth.toFixed(nrDecimals)+units+\n" " \"); Height=\"+curHeight.toFixed(nrDecimals)+units);\n" " }\n" "}\n" "\n" ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/docs/docs_html/svg_interactive_map.h000066400000000000000000000126761224124640700254160ustar00rootroot00000000000000/********************************************************** * Version $Id: svg_interactive_map.h 1261 2011-12-16 15:12:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_html // // // //-------------------------------------------------------// // // // SVG_Interactive_map.cpp // // // // Copyright (C) 2005 by Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // contact: Victor Olaya // // // // e-mail: volaya@saga-gis.org // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef _HEADER_INCLUDED__SAGA_GUI__svg_interactive_map_H #define _HEADER_INCLUDED__SAGA_GUI__svg_interactive_map_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "doc_svg.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CSVG_Interactive_Map : public CSG_Doc_SVG, public CSG_Module { public: CSVG_Interactive_Map(void); virtual ~CSVG_Interactive_Map(void); protected: virtual bool On_Execute(void); private: CSG_String m_Directory; double m_dWidth; bool Create_From_Map (CSG_Parameter_Shapes_List *pList, CSG_Shapes *pIndexLayer, const SG_Char *Filename); void _Write_Code (const CSG_String &FileName, const CSG_String &Code); void _Add_Opening (CSG_Rect r); void _Add_CheckBoxes (CSG_Parameter_Shapes_List *pList); void _Add_Shapes (CSG_Shapes *pLayer); bool _Add_Shape (CSG_Shape *pShape, int Fill_Color, int Line_Color, double Line_Width, double Point_Width); void _Add_Grid (CSG_Grid *pLayer); void _Add_ReferenceMap (CSG_Shapes *pIndexLayer, CSG_Rect r); void _Add_Label (const SG_Char* Label, CSG_Shape *pShape, double dSize, const SG_Char* Unit); const char * _Get_Opening_Code_1 (void); const char * _Get_Opening_Code_2 (void); const char * _Get_Code_1 (void); const char * _Get_Code_2 (void); const char * _Get_Code_3 (void); const char * _Get_Code_4 (void); const char * _Get_Code_5 (void); const char * _Get_Code_Closing_1 (void); const char * _Get_Code_CheckBox (void); const char * _Get_Code_MapApp (void); const char * _Get_Code_Timer (void); const char * _Get_Code_Slider (void); const char * _Get_Code_Helper (void); const char * _Get_Code_Buttons (void); const char * _Get_Code_Navigation_1 (void); const char * _Get_Code_Navigation_2 (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef _HEADER_INCLUDED__SAGA_GUI__svg_interactive_map_H saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/000077500000000000000000000000001224124640700210055ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/MLB_Interface.cpp000066400000000000000000000107101224124640700241020ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_pdf // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Reports - PDF") ); case MLB_INFO_Author: return( SG_T("SAGA User Group (c) 2010") ); case MLB_INFO_Description: return( _TW( "Reports in Portable Document Format (PDF). PDF export is based on " "libharu." )); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("File|Reports") ); } } //--------------------------------------------------------- #include "Shapes_Report.h" #include "Shapes_Summary.h" #include "Profile_Cross_Sections.h" //--------------------------------------------------------- CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CShapes_Report ); case 1: return( new CShapes_Summary ); case 2: return( new CProfile_Cross_Sections ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/MLB_Interface.h000066400000000000000000000075601224124640700235600ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_pdf // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2010 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__docs_pdf__mlb_interface_H #define HEADER_INCLUDED__docs_pdf__mlb_interface_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef docs_pdf_EXPORTS #define docs_pdf_EXPORT _SAGA_DLL_EXPORT #else #define docs_pdf_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__docs_pdf__mlb_interface_H saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/Makefile.am000066400000000000000000000014101224124640700230350ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif if HAVE_HARU DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(DISABLELIBHARU) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version $(HARU_LIB) pkglib_LTLIBRARIES = libdocs_pdf.la libdocs_pdf_la_SOURCES =\ doc_pdf.cpp\ MLB_Interface.cpp\ Profile_Cross_Sections.cpp\ Shapes_Report.cpp\ Shapes_Summary.cpp\ doc_pdf.h\ MLB_Interface.h\ Profile_Cross_Sections.h\ Shapes_Report.h\ Shapes_Summary.h libdocs_pdf_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la endif saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/Makefile.in000066400000000000000000000461761224124640700230700ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/docs/docs_pdf DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) @HAVE_HARU_TRUE@libdocs_pdf_la_DEPENDENCIES = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am__libdocs_pdf_la_SOURCES_DIST = doc_pdf.cpp MLB_Interface.cpp \ Profile_Cross_Sections.cpp Shapes_Report.cpp \ Shapes_Summary.cpp doc_pdf.h MLB_Interface.h \ Profile_Cross_Sections.h Shapes_Report.h Shapes_Summary.h @HAVE_HARU_TRUE@am_libdocs_pdf_la_OBJECTS = doc_pdf.lo \ @HAVE_HARU_TRUE@ MLB_Interface.lo Profile_Cross_Sections.lo \ @HAVE_HARU_TRUE@ Shapes_Report.lo Shapes_Summary.lo libdocs_pdf_la_OBJECTS = $(am_libdocs_pdf_la_OBJECTS) @HAVE_HARU_TRUE@am_libdocs_pdf_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdocs_pdf_la_SOURCES) DIST_SOURCES = $(am__libdocs_pdf_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE @HAVE_HARU_TRUE@DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD @HAVE_HARU_TRUE@CXX_INCS = -I$(top_srcdir)/src/saga_core @HAVE_HARU_TRUE@AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(DISABLELIBHARU) $(GOMPFLAGS) @HAVE_HARU_TRUE@AM_LDFLAGS = -fPIC -shared -avoid-version $(HARU_LIB) @HAVE_HARU_TRUE@pkglib_LTLIBRARIES = libdocs_pdf.la @HAVE_HARU_TRUE@libdocs_pdf_la_SOURCES = \ @HAVE_HARU_TRUE@doc_pdf.cpp\ @HAVE_HARU_TRUE@MLB_Interface.cpp\ @HAVE_HARU_TRUE@Profile_Cross_Sections.cpp\ @HAVE_HARU_TRUE@Shapes_Report.cpp\ @HAVE_HARU_TRUE@Shapes_Summary.cpp\ @HAVE_HARU_TRUE@doc_pdf.h\ @HAVE_HARU_TRUE@MLB_Interface.h\ @HAVE_HARU_TRUE@Profile_Cross_Sections.h\ @HAVE_HARU_TRUE@Shapes_Report.h\ @HAVE_HARU_TRUE@Shapes_Summary.h @HAVE_HARU_TRUE@libdocs_pdf_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_io/docs/docs_pdf/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/docs/docs_pdf/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdocs_pdf.la: $(libdocs_pdf_la_OBJECTS) $(libdocs_pdf_la_DEPENDENCIES) $(CXXLINK) $(am_libdocs_pdf_la_rpath) $(libdocs_pdf_la_OBJECTS) $(libdocs_pdf_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Profile_Cross_Sections.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shapes_Report.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shapes_Summary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/doc_pdf.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/Profile_Cross_Sections.cpp000066400000000000000000001273631224124640700261450ustar00rootroot00000000000000/********************************************************** * Version $Id: Profile_Cross_Sections.cpp 1230 2011-11-22 11:12:10Z oconrad $ *********************************************************/ /******************************************************************************* CrossSections.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Profile_Cross_Sections.h" /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define OFFSET_X 100 #define OFFSET_Y 50 #define TABLE_WIDTH 450 #define TABLE_LANDSCAPE_WIDTH 680 #define TABLE_OFFSET_X 70 #define TABLE_CELLPAD 10 #define SECTIONS_PER_PAGE 3 #define CROSS_SECTION_HEIGHT 200 #define CROSS_SECTION_WIDTH 400 #define PROFILE_HEIGHT 320 #define PROFILE_WIDTH 1000 #define GUITAR_LEYEND_WIDTH 50 #define GUITAR_LEYEND_HEIGHT 230 #define GUITAR_WIDTH PROFILE_WIDTH #define GUITAR_HEIGHT GUITAR_LEYEND_HEIGHT #define SEPARATION 35 #define VOLUMES_TABLE_COLUMNS 7 #define VOLUMES_TABLE_COLUMN_WIDTH ((596 - 2 * OFFSET_X) / VOLUMES_TABLE_COLUMNS) #define VOLUMES_TABLE_ROW_HEIGHT 20 #define VOLUMES_TABLE_HEADER_SEPARATION 35 #define VOLUMES_TABLE_MAX_ROWS 30 #define SLOPE_RATIO (1. / 3.) #define LONG_SEGMENT 5000. /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //Compute the dot product AB ? BC double dot(double *A, double *B, double *C){ double AB[2],BC[2]; AB[0] = B[0]-A[0]; AB[1] = B[1]-A[1]; BC[0] = C[0]-B[0]; BC[1] = C[1]-B[1]; double dot = AB[0] * BC[0] + AB[1] * BC[1]; return dot; } //--------------------------------------------------------- //Compute the cross product AB x AC double cross(double *A, double *B, double *C){ double AB[2],AC[2]; AB[0] = B[0]-A[0]; AB[1] = B[1]-A[1]; AC[0] = C[0]-A[0]; AC[1] = C[1]-A[1]; double cross = AB[0] * AC[1] - AB[1] * AC[0]; return cross; } //--------------------------------------------------------- //Compute the distance from A to B double distance(double *A, double *B){ double d1 = A[0] - B[0]; double d2 = A[1] - B[1]; return sqrt(d1*d1+d2*d2); } //--------------------------------------------------------- //Compute the distance from AB to C double linePointDist(double *A, double *B, double *C){ double dist = cross(A,B,C) / distance(A,B); return fabs(dist); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define SLOPE_TRANSITION 1 #define DITCH_WIDTH 1 CProfile_Cross_Sections_PDF::CProfile_Cross_Sections_PDF(){} CProfile_Cross_Sections_PDF::~CProfile_Cross_Sections_PDF(){} void CProfile_Cross_Sections_PDF::AddCrossSections(TSG_Point ** pCrossSections, double *pHeight, TSG_Point * pRoadSection, int iSections, int iCrossSectionPoints, int iRoadPoints){ int i,j; std::vector ModifiedRoadSection; std::vector ModifiedCrossSection; TSG_Point *pModifiedRoadSection; TSG_Point *pModifiedCrossSection; int iCrossSectionPointsB; int iRoadPointsB; Add_Page_Title (_TL("Cross Sections"), PDF_TITLE_01, PDF_PAGE_SIZE_A4, PDF_PAGE_ORIENTATION_PORTRAIT); for (i = 0; i < iSections; i++){ m_iOffsetY = OFFSET_Y + (int)(CROSS_SECTION_HEIGHT * 1.1 * (i % SECTIONS_PER_PAGE)); if (m_iOffsetY == OFFSET_Y){ Add_Page(); }//if iCrossSectionPointsB = iCrossSectionPoints; iRoadPointsB = iRoadPoints; AdjustSections(pCrossSections[i], pRoadSection, ModifiedCrossSection, ModifiedRoadSection, pHeight[i], iCrossSectionPointsB, iRoadPointsB); pModifiedCrossSection = new TSG_Point [iCrossSectionPointsB]; pModifiedRoadSection = new TSG_Point [iRoadPointsB]; for (j = 0; j < iCrossSectionPointsB; j++){ pModifiedCrossSection[j] = ModifiedCrossSection[j]; }//for for (j = 0; j < iRoadPointsB; j++){ pModifiedRoadSection[j] = ModifiedRoadSection[j]; }//for AddCrossSection(pModifiedCrossSection, pModifiedRoadSection, iCrossSectionPointsB, iRoadPointsB); delete [] pModifiedRoadSection; delete [] pModifiedCrossSection; }//for }//method void CProfile_Cross_Sections_PDF::AddCrossSection(TSG_Point * pCrossSection, TSG_Point * pRoadSection, int iCrossSectionPoints, int iRoadPoints){ int i; int iMag; int iNumLines; int iFirstPoint, iLastPoint; double fMinLine = 0; double fMaxY, fMinY; double fMaxX, fMinX; double fStep; double fX, fY; double fOffsetX; double fDifX, fDifY; double fRatio; double fHeight; CSG_String sValue; CSG_Points Points; iFirstPoint = 0; iLastPoint = iCrossSectionPoints - 1; for (i = 1; i < iCrossSectionPoints; i++) { if (pCrossSection[i].x > pRoadSection[0].x){ iFirstPoint = i - 1; break; }//if }//for for (i = 1; i < iCrossSectionPoints; i++) { if (pCrossSection[i].x > pRoadSection[iRoadPoints - 1].x){ iLastPoint = i; break; }//if }//for fMinX = pCrossSection[iFirstPoint].x; fMaxX = pCrossSection[iLastPoint].x; fDifX = fMaxX - fMinX; fMaxY = pCrossSection[0].y; fMinY = pCrossSection[0].y; for (i = iFirstPoint ; i < iLastPoint + 1; i++) { if (pCrossSection[i].y > fMaxY) { fMaxY = pCrossSection[i].y; }// if if (pCrossSection[i].y < fMinY) { fMinY = pCrossSection[i].y; }// if }//for for (i = 0; i < iRoadPoints; i++) { if (pRoadSection[i].y > fMaxY) { fMaxY = pRoadSection[i].y; }// if if (pRoadSection[i].y < fMinY) { fMinY = pRoadSection[i].y; }// if }//for fDifY = fMaxY - fMinY; fRatio = (fDifX / fDifY) / (CROSS_SECTION_WIDTH / CROSS_SECTION_HEIGHT); if (fRatio > 1){ fMaxY = fMaxY + fDifY / 2. * (fRatio - 1.); fMinY = fMinY - fDifY / 2. * (fRatio - 1.); }//if else{ fMaxX = fMaxX + fDifX / 2. * (1. / fRatio - 1.); fMinX = fMinX - fDifX / 2. * (1. / fRatio - 1.); }//else fMaxX = fMaxX + fDifX * .05; fMinX = fMinX - fDifX * .05; fMaxY = fMaxY + fDifY * .05; fMinY = fMinY - fDifY * .05; iMag = (int) (log(fMaxY - fMinY) / log(10.0)); fStep = (double) ((int) pow(10.0, (double) iMag)); if (fStep == 0){ fStep = 1.; }//if if (fMinY < 0) { iMag = (int) (log(fabs(fMinY)) / log(10.0)); fMinLine = -(int) pow(10.0, (double) iMag); }// if else { fMinLine=(int)(((int)(fMinY/fStep)) *fStep); }//else iNumLines = (int) ((fMaxY - fMinY) / fStep); while (iNumLines < 8) { fStep = fStep / 2.0; iNumLines = (int) ((fMaxY - fMinY) / fStep); }// while iNumLines = (int) ((fMaxY - fMinLine) / fStep); fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin(); //horizontal lines for (i = 0; i < iNumLines; i++) { fY = m_iOffsetY + CROSS_SECTION_HEIGHT - ((fMinLine + fStep * i - fMinY) / (fMaxY - fMinY)) * CROSS_SECTION_HEIGHT; if (fY <= m_iOffsetY + CROSS_SECTION_HEIGHT && fY >= m_iOffsetY) { fY = fHeight - fY; sValue = SG_Get_String(fMinLine + fStep * (double) i); Draw_Text(OFFSET_X - 10, fY, SG_Get_String(fMinLine + fStep * (double) i).c_str(), 9, PDF_STYLE_TEXT_ALIGN_H_RIGHT); Draw_Line(OFFSET_X, fY, OFFSET_X - 5, fY, 0); }// if }// for iMag = (int) (log(fMaxX - fMinX) / log(10.0)); fStep = (double) pow(10.0, (double) iMag); iNumLines = (int) ((fMaxX-fMinX) / fStep); while (iNumLines < 3) { fStep = fStep / 2.0; iNumLines = (int) ((fMaxX-fMinX) / fStep); }// while fMinLine = (int)(((int)(fMinX/fStep)) * fStep); while (fMinLine= OFFSET_X && fX < OFFSET_X + CROSS_SECTION_WIDTH){ if (fabs(fStep * (double)i+fMinLine) > 100000) { sValue = SG_Get_String(fStep * (double)i+fMinLine); }// if else { sValue = SG_Get_String(fStep * (double)i+fMinLine, 2, true); }// else Draw_Line (fX, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT, fX, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT - 10); Draw_Text(fX, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT - 15, SG_Get_String(fMinLine + fStep * (double) i).c_str(), 9, PDF_STYLE_TEXT_ALIGN_H_CENTER | PDF_STYLE_TEXT_ALIGN_V_TOP ); }//if }// for //axis Draw_Line (OFFSET_X, fHeight - m_iOffsetY, OFFSET_X, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT, 2); Draw_Line (OFFSET_X, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT, OFFSET_X + CROSS_SECTION_WIDTH, fHeight - m_iOffsetY - CROSS_SECTION_HEIGHT, 2); //cross sections fY = m_iOffsetY + CROSS_SECTION_HEIGHT - CROSS_SECTION_HEIGHT * ((pCrossSection[iFirstPoint].y - fMinY) / (fMaxY - fMinY)); fY = fHeight - fY; fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pCrossSection[iFirstPoint].x - fMinX) / (fMaxX - fMinX)); Points.Add(fX,fY); for (i = iFirstPoint + 1; i < iLastPoint + 1; i++) { fY = m_iOffsetY + CROSS_SECTION_HEIGHT - CROSS_SECTION_HEIGHT * ((pCrossSection[i].y - fMinY) / (fMaxY - fMinY)); fY = fHeight - fY; fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pCrossSection[i].x - fMinX) / (fMaxX - fMinX)); Points.Add(fX,fY); if (pCrossSection[i].x > fMaxX){ break; }//if }// for Draw_Line(Points, 2, 0x00bb00); fY = m_iOffsetY + CROSS_SECTION_HEIGHT - CROSS_SECTION_HEIGHT * ((pRoadSection[0].y - fMinY) / (fMaxY - fMinY)); fY = fHeight - fY; fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pRoadSection[0].x - fMinX) / (fMaxX - fMinX)); Points.Clear(); Points.Add(fX,fY); for (i = 1; i < iRoadPoints; i++) { fY = m_iOffsetY + CROSS_SECTION_HEIGHT - CROSS_SECTION_HEIGHT * ((pRoadSection[i].y - fMinY) / (fMaxY - fMinY)); fY = fHeight - fY; fX = OFFSET_X + CROSS_SECTION_WIDTH * ((pRoadSection[i].x - fMinX) / (fMaxX - fMinX)); Points.Add(fX,fY); }// for Draw_Line(Points, 0, 0x0000bb); }//method void CProfile_Cross_Sections_PDF::AddVolumesTable(TSG_Point * pProfile, TSG_Point ** pCrossSections, double *pHeight, TSG_Point * pRoadSection, int iSections, int iCrossSectionPoints, int iRoadPoints){ int i,j; int iRow; int iRowsWritten = 0; double fDist; double fX,fY; double fXBox, fYBox; double fIn, fOut; double fInPrev, fOutPrev; double fVolume; double fHeight; CSG_String sHeader[] = {_TL("Section"),_TL("Dist."),_TL("Area +"),_TL("Area -"),_TL("Partial D."),_TL("Vol. +"), _TL("Vol. -")}; Add_Page_Title(_TL("Volumes"), PDF_TITLE_01); fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin(); for (i = 0; i < iSections; i++){ iRow = iRowsWritten % VOLUMES_TABLE_MAX_ROWS; if (iRow == 0){ Add_Page(); Draw_Rectangle(OFFSET_X, fHeight - OFFSET_Y, OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * VOLUMES_TABLE_COLUMNS, fHeight - OFFSET_Y - VOLUMES_TABLE_ROW_HEIGHT); fY = OFFSET_Y + VOLUMES_TABLE_ROW_HEIGHT * .6; fY = fHeight - fY; for (j = 0; j < VOLUMES_TABLE_COLUMNS; j++){ fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * j + VOLUMES_TABLE_COLUMN_WIDTH / 2.; Draw_Text(fX, fY, sHeader[j].c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER); fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * (j + 1); Draw_Line(fX, fHeight - OFFSET_Y, fX, fHeight - (OFFSET_Y + VOLUMES_TABLE_ROW_HEIGHT), 0); }//for if (i){ i--; }//if }//if for (j = 0; j < 4; j++){ fYBox = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * iRow; fYBox = fHeight - fYBox; fXBox = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * j; Draw_Rectangle(fXBox, fYBox, fXBox + VOLUMES_TABLE_COLUMN_WIDTH, fYBox - VOLUMES_TABLE_ROW_HEIGHT); }//for fDist = pProfile[i].x; fY = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * (iRow + .6); fY = fHeight - fY; fX = OFFSET_X + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.; Draw_Text(fX, fY, SG_Get_String(i,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER); fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.; Draw_Text(fX, fY, SG_Get_String(fDist,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER); CalculateAreas(pCrossSections[i], pRoadSection, pHeight[i], iCrossSectionPoints, iRoadPoints,fIn, fOut); fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 2 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.; Draw_Text(fX, fY, SG_Get_String(fIn,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER); fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 3 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.; Draw_Text(fX, fY, SG_Get_String(fOut,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER); if (iRow > 0){ for (j = 4; j < 7; j++){ fYBox = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * (iRow - .5); fYBox = fHeight - fYBox; fXBox = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * j; Draw_Rectangle(fXBox, fYBox, fXBox + VOLUMES_TABLE_COLUMN_WIDTH, fYBox - VOLUMES_TABLE_ROW_HEIGHT); }//for fY = OFFSET_Y + VOLUMES_TABLE_HEADER_SEPARATION + VOLUMES_TABLE_ROW_HEIGHT * (iRow + .1) ; fY = fHeight - fY; fDist = (pProfile[i].x - pProfile[i-1].x); fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 4 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.; Draw_Text(fX, fY, SG_Get_String(fDist,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER); fVolume = (pProfile[i].x - pProfile[i-1].x) * (fIn + fInPrev) / 2.; fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 5 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.; Draw_Text(fX, fY, SG_Get_String(fVolume,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER); fVolume = (pProfile[i].x - pProfile[i-1].x) * (fOut + fOutPrev) / 2.; fX = OFFSET_X + VOLUMES_TABLE_COLUMN_WIDTH * 6 + (VOLUMES_TABLE_COLUMN_WIDTH) / 2.; Draw_Text(fX, fY, SG_Get_String(fVolume,0).c_str(), 10, PDF_STYLE_TEXT_ALIGN_H_CENTER); }//if fInPrev = fIn; fOutPrev = fOut; iRowsWritten++; }//for }//Method void CProfile_Cross_Sections_PDF::AdjustSections(TSG_Point * pCrossSection, TSG_Point * pRoadSection, std::vector &ModifiedCrossSection, std::vector &ModifiedRoadSection, double fHeight, int &iCrossSectionPoints, int &iRoadPoints){ bool bDitchAdded; int i,j; int iSgn; int iRoadPointsToAdd = 0; int iCrossSectionPointsToAdd = 0; double fX, fY; TSG_Point P; ModifiedCrossSection.clear(); ModifiedRoadSection.clear(); //left half for (i = 0 ; i < iCrossSectionPoints - 1; i++){ if (pCrossSection[i].x < pRoadSection[0].x && pCrossSection[i+1].x >= pRoadSection[0].x){ break; }//if }//for if (i == iCrossSectionPoints - 1){ if (pRoadSection[0].y + fHeight < pCrossSection[0].y){ P.x = pRoadSection[0].x - 2* DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH - fabs(pCrossSection[0].y - pRoadSection[0].y - fHeight) / SLOPE_RATIO; P.y = pCrossSection[0].y - fHeight; ModifiedRoadSection.push_back(P); P.y = pCrossSection[0].y; ModifiedCrossSection.push_back(P); iCrossSectionPointsToAdd++; iRoadPointsToAdd++; P.x = pRoadSection[0].x - 2* DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH; P.y = pRoadSection[0].y; ModifiedRoadSection.push_back(P); iRoadPointsToAdd++; P.x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH; P.y = pRoadSection[0].y - DITCH_WIDTH / SLOPE_TRANSITION; ModifiedRoadSection.push_back(P); iRoadPointsToAdd++; P.x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION; ModifiedRoadSection.push_back(P); iRoadPointsToAdd++; }//if P.x = pRoadSection[0].x - fabs(pCrossSection[0].y - pRoadSection[0].y - fHeight) / SLOPE_RATIO; P.y = pCrossSection[0].y - fHeight; ModifiedRoadSection.push_back(P); P.y = pCrossSection[0].y; ModifiedCrossSection.push_back(P); iCrossSectionPointsToAdd++; iRoadPointsToAdd++; }//if else{ bDitchAdded = false; for (j = 0; j < 4; j++){ //4 dummy points ModifiedRoadSection.push_back(pRoadSection[0]); }//for for (j = i ; j >= 0; j--){ if (ModifiedRoadSection[1].y + fHeight > pCrossSection[j+1].y){ iSgn = -1; }//if else{ iSgn = 1; }//else Intersect_Lines(ModifiedRoadSection[1].x, ModifiedRoadSection[1].y + fHeight, ModifiedRoadSection[1].x - LONG_SEGMENT / SLOPE_RATIO, ModifiedRoadSection[1].y + LONG_SEGMENT * iSgn + fHeight, pCrossSection[j].x, pCrossSection[j].y, pCrossSection[j+1].x, pCrossSection[j+1].y, fX,fY); if (pCrossSection[j].x < fX && pCrossSection[j+1].x >= fX){ if (iSgn == 1){ if(!bDitchAdded){ ModifiedRoadSection[1].x = pRoadSection[0].x - 2* DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH; ModifiedRoadSection[1].y = pRoadSection[0].y; iRoadPointsToAdd++; ModifiedRoadSection[2].x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION - DITCH_WIDTH; ModifiedRoadSection[2].y = pRoadSection[0].y - DITCH_WIDTH / SLOPE_TRANSITION; iRoadPointsToAdd++; ModifiedRoadSection[3].x = pRoadSection[0].x - DITCH_WIDTH * SLOPE_TRANSITION; ModifiedRoadSection[3].y = pRoadSection[0].y - DITCH_WIDTH / SLOPE_TRANSITION; iRoadPointsToAdd++; j = i + 1; bDitchAdded = true; }//if else{ ModifiedRoadSection[0].x = fX; ModifiedRoadSection[0].y = fY - fHeight; iRoadPointsToAdd++; break; }//else }//if else{ ModifiedRoadSection[0].x = fX; ModifiedRoadSection[0].y = fY - fHeight; iRoadPointsToAdd++; break; }//else }//if }//for if (j < 0){ ModifiedRoadSection[0].x = pRoadSection[0].x - fabs(pCrossSection[0].y - pRoadSection[0].y - fHeight) / SLOPE_RATIO; ModifiedRoadSection[0].y = pCrossSection[0].y - fHeight; P.x = ModifiedRoadSection[0].x; P.y = pCrossSection[0].y; ModifiedCrossSection.push_back(P); iCrossSectionPointsToAdd++; iRoadPointsToAdd++; }//if*/ }//else //add the central points for (i = 0; i < iCrossSectionPoints; i++){ ModifiedCrossSection.push_back(pCrossSection[i]); }//for ModifiedRoadSection.resize(iRoadPoints + iRoadPointsToAdd); for (i = 0; i < iRoadPoints; i++){ ModifiedRoadSection[i + iRoadPointsToAdd].x = pRoadSection[i].x; ModifiedRoadSection[i + iRoadPointsToAdd].y = pRoadSection[i].y; }//for for (i = 0; i < iRoadPoints + iRoadPointsToAdd; i++){ ModifiedRoadSection[i].x = ModifiedRoadSection[i].x; ModifiedRoadSection[i].y = ModifiedRoadSection[i].y + fHeight; }//for iRoadPoints += iRoadPointsToAdd; iCrossSectionPoints += iCrossSectionPointsToAdd; // right half for (i = 0 ; i < iCrossSectionPoints - 1; i++){ if (ModifiedCrossSection[i].x < ModifiedRoadSection[iRoadPoints-1].x && ModifiedCrossSection[i+1].x >= ModifiedRoadSection[iRoadPoints-1].x){ break; }//if }//for if (i == iCrossSectionPoints - 1){ if (ModifiedRoadSection[iRoadPoints-1].y + fHeight < ModifiedCrossSection[iCrossSectionPoints-1].y){ P.x = ModifiedRoadSection[iRoadPoints-1].x + DITCH_WIDTH * SLOPE_TRANSITION; P.y = ModifiedRoadSection[iRoadPoints-1].y - DITCH_WIDTH / SLOPE_TRANSITION; ModifiedRoadSection.push_back(P); iRoadPoints++; P.x = ModifiedRoadSection[iRoadPoints-2].x + DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH; ModifiedRoadSection.push_back(P); iRoadPoints++; P.x = ModifiedRoadSection[iRoadPoints-3].x + 2* DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH; P.y = ModifiedRoadSection[iRoadPoints-3].y; ModifiedRoadSection.push_back(P); iRoadPoints++; }//if P.x = ModifiedRoadSection[iRoadPoints-1].x + fabs(ModifiedCrossSection[iCrossSectionPoints-1].y - ModifiedRoadSection[iRoadPoints-1].y) / SLOPE_RATIO; P.y = ModifiedCrossSection[iCrossSectionPoints-1].y ; ModifiedRoadSection.push_back(P); ModifiedCrossSection.push_back(P); iCrossSectionPoints++; iRoadPoints++; }//if else{ bDitchAdded = false; for (j = i ; j < iCrossSectionPoints - 1; j++){ if (ModifiedRoadSection[iRoadPoints-1].y > ModifiedCrossSection[j].y){ iSgn = -1; }//if else{ iSgn = 1; }//else if (iSgn == 1 && !bDitchAdded){ P.x = ModifiedRoadSection[iRoadPoints-1].x + DITCH_WIDTH * SLOPE_TRANSITION; P.y = ModifiedRoadSection[iRoadPoints-1].y - DITCH_WIDTH / SLOPE_TRANSITION; ModifiedRoadSection.push_back(P); iRoadPoints++; P.x = ModifiedRoadSection[iRoadPoints-2].x + DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH; ModifiedRoadSection.push_back(P); iRoadPoints++; P.x = ModifiedRoadSection[iRoadPoints-3].x + 2* DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH; P.y = ModifiedRoadSection[iRoadPoints-3].y; ModifiedRoadSection.push_back(P); iRoadPoints++; if (ModifiedRoadSection[iRoadPoints-1].y > ModifiedCrossSection[j].y){ iSgn = -1; }//if else{ iSgn = 1; }//else bDitchAdded = true; }//if Intersect_Lines(ModifiedRoadSection[iRoadPoints-1].x, ModifiedRoadSection[iRoadPoints-1].y, ModifiedRoadSection[iRoadPoints-1].x + LONG_SEGMENT / SLOPE_RATIO, ModifiedRoadSection[iRoadPoints-1].y + LONG_SEGMENT * iSgn, ModifiedCrossSection[j].x, ModifiedCrossSection[j].y, ModifiedCrossSection[j+1].x, ModifiedCrossSection[j+1].y, fX,fY); if (ModifiedCrossSection[j].x < fX && ModifiedCrossSection[j+1].x >= fX){ P.x = fX; P.y = fY; ModifiedRoadSection.push_back(P); iRoadPoints++; break; }//if }//for if (j == iCrossSectionPoints - 1){ if (ModifiedRoadSection[iRoadPoints-1].y + fHeight < ModifiedCrossSection[iCrossSectionPoints-1].y && !bDitchAdded){ P.x = ModifiedRoadSection[iRoadPoints-1].x + DITCH_WIDTH * SLOPE_TRANSITION; P.y = ModifiedRoadSection[iRoadPoints-1].y - DITCH_WIDTH / SLOPE_TRANSITION; ModifiedRoadSection.push_back(P); iRoadPoints++; P.x = ModifiedRoadSection[iRoadPoints-2].x + DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH; ModifiedRoadSection.push_back(P); iRoadPoints++; P.x = ModifiedRoadSection[iRoadPoints-3].x + 2* DITCH_WIDTH * SLOPE_TRANSITION + DITCH_WIDTH; P.y = ModifiedRoadSection[iRoadPoints-3].y; ModifiedRoadSection.push_back(P); iRoadPoints++; }//if P.x = ModifiedRoadSection[iRoadPoints-1].x + fabs(ModifiedCrossSection[iCrossSectionPoints-1].y - ModifiedRoadSection[iRoadPoints-1].y) / SLOPE_RATIO; P.y = ModifiedCrossSection[iCrossSectionPoints-1].y ; ModifiedRoadSection.push_back(P); ModifiedCrossSection.push_back(P); iCrossSectionPoints++; iRoadPoints++; }//if*/ }//else }//method void CProfile_Cross_Sections_PDF::Intersect_Lines(double x0,double y0,double x1,double y1, double x2,double y2,double x3,double y3, double &xi,double &yi){ double a1,b1,c1, a2,b2,c2, det_inv, m1,m2; if ((x1-x0)!=0) m1 = (y1-y0)/(x1-x0); else m1 = (double)1e+10; if ((x3-x2)!=0) m2 = (y3-y2)/(x3-x2); else m2 = (double)1e+10; a1 = m1; a2 = m2; b1 = -1; b2 = -1; c1 = (y0-m1*x0); c2 = (y2-m2*x2); det_inv = 1/(a1*b2 - a2*b1); xi=((b1*c2 - b2*c1)*det_inv); yi=((a2*c1 - a1*c2)*det_inv); } //method void CProfile_Cross_Sections_PDF::CalculateAreas(TSG_Point * pCrossSection, TSG_Point * pRoadSection, double fHeight, int iCrossSectionPoints, int iRoadPoints, double &fPositiveArea, double &fNegativeArea){ int i; CSG_Shapes *pRoadShapes, *pCrossSectionShapes, *pResultShapes; CSG_Shape *pRoadShape, *pCrossSectionShape, *pResultShape; pResultShapes = new CSG_Shapes; pResultShapes->Create(SHAPE_TYPE_Polygon); pResultShape = pResultShapes->Add_Shape(); pRoadShapes = new CSG_Shapes; pRoadShapes->Create(SHAPE_TYPE_Polygon); pRoadShape = pRoadShapes->Add_Shape(); pCrossSectionShapes = new CSG_Shapes; pCrossSectionShapes->Create(SHAPE_TYPE_Polygon); pCrossSectionShape = pCrossSectionShapes->Add_Shape(); for (i = 0; i < iRoadPoints; i++){ pRoadShape->Add_Point(pRoadSection[i].x, pRoadSection[i].y + fHeight); }//for pRoadShape->Add_Point(pRoadSection[iRoadPoints-1].x + LONG_SEGMENT / SLOPE_RATIO, pRoadSection[iRoadPoints-1].y + fHeight + LONG_SEGMENT); pRoadShape->Add_Point(pRoadSection[0].x - LONG_SEGMENT / SLOPE_RATIO, pRoadSection[0].y + fHeight + LONG_SEGMENT); for (i = 0; i < iCrossSectionPoints; i++){ pCrossSectionShape->Add_Point(pCrossSection[i].x, pCrossSection[i].y); }//for pCrossSectionShape->Add_Point(pCrossSection[iCrossSectionPoints-1].x + LONG_SEGMENT / SLOPE_RATIO, pCrossSection[iCrossSectionPoints-1].y - LONG_SEGMENT); pCrossSectionShape->Add_Point(pCrossSection[0].x - LONG_SEGMENT / SLOPE_RATIO, pCrossSection[0].y - LONG_SEGMENT); if (SG_Polygon_Intersection(pCrossSectionShape, pRoadShape, pResultShape)){ fNegativeArea = ((CSG_Shape_Polygon*)pResultShape)->Get_Area(); }//if else{ fNegativeArea = 0; }//else pCrossSectionShape->Del_Parts(); pRoadShape->Del_Parts(); pResultShape->Del_Parts(); for (i = 0; i < iRoadPoints; i++){ pRoadShape->Add_Point(pRoadSection[i].x, pRoadSection[i].y + fHeight); }//for pRoadShape->Add_Point(pRoadSection[iRoadPoints-1].x + LONG_SEGMENT / SLOPE_RATIO, pRoadSection[iRoadPoints-1].y + fHeight - LONG_SEGMENT); pRoadShape->Add_Point(pRoadSection[0].x - LONG_SEGMENT / SLOPE_RATIO, pRoadSection[0].y + fHeight - LONG_SEGMENT); for (i = 0; i < iCrossSectionPoints; i++){ pCrossSectionShape->Add_Point(pCrossSection[i].x, pCrossSection[i].y); }//for pCrossSectionShape->Add_Point(pCrossSection[iCrossSectionPoints-1].x + LONG_SEGMENT / SLOPE_RATIO, pCrossSection[iCrossSectionPoints-1].y + LONG_SEGMENT); pCrossSectionShape->Add_Point(pCrossSection[0].x - LONG_SEGMENT / SLOPE_RATIO, pCrossSection[0].y + LONG_SEGMENT); if (SG_Polygon_Intersection(pCrossSectionShape, pRoadShape, pResultShape)){ fPositiveArea = ((CSG_Shape_Polygon*)pResultShape)->Get_Area(); }//if else{ fPositiveArea = 0; }//else delete pRoadShapes; delete pCrossSectionShapes; delete pResultShapes; }//method void CProfile_Cross_Sections_PDF::AddLongitudinalProfile(TSG_Point * pProfile, double *pHeight, int iNumPoints){ int i; int iMag; int iNumLines; double fMinLine = 0; double fMaxY, fMinY; double fMaxX, fMinX; double fStep; double fX, fY; double fOffsetX; CSG_String sValue; CSG_Points Points; double fHeight; Add_Page_Title(_TL("Longitudinal Profile"), PDF_TITLE_01); Add_Page(PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE); fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin(); m_iOffsetY = 50; fMaxY = pProfile[0].y; fMinY = pProfile[0].y; for (i = 0; i < iNumPoints; i++) { if (pProfile[i].y > fMaxY) { fMaxY = pProfile[i].y; }// if if (pProfile[i].y < fMinY) { fMinY = pProfile[i].y; }// if if (pHeight[i] > fMaxY) { fMaxY = pHeight[i]; }// if if (pHeight[i] < fMinY) { fMinY = pHeight[i]; }// if }//for iMag = (int) (log(fMaxY - fMinY) / log(10.0)); fStep = (double) ((int) pow(10.0, (double) iMag)); if (fStep == 0){ fStep = 1.; }//if if (fMinY < 0) { iMag = (int) (log(fabs(fMinY)) / log(10.0)); fMinLine = -(int) pow(10.0, (double) iMag); }// if else { fMinLine=(int)(((int)(fMinY/fStep)) *fStep); }//else iNumLines = (int) ((fMaxY - fMinY) / fStep); while (iNumLines < 8) { fStep = fStep / 2.0; iNumLines = (int) ((fMaxY - fMinY) / fStep); }// while iNumLines = (int) ((fMaxY - fMinLine) / fStep); fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin(); for (i = 0; i < iNumLines; i++) { fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION; fY = m_iOffsetY + PROFILE_HEIGHT - ((fMinLine + fStep * i - fMinY) / (fMaxY - fMinY)) * PROFILE_HEIGHT; if (fY <= m_iOffsetY + PROFILE_HEIGHT && fY >= m_iOffsetY) { fY = fHeight - fY; sValue = SG_Get_String(fMinLine + fStep * (double) i); Draw_Text(fX - 10, fY, SG_Get_String(fMinLine + fStep * (double) i).c_str(), 9, PDF_STYLE_TEXT_ALIGN_H_RIGHT); Draw_Line(fX, fY, fX - 5, fY, 0); }// if }// for fMinX = pProfile[0].x; fMaxX = pProfile[iNumPoints - 1].x; iMag = (int) (log(fMaxX - fMinX) / log(10.0)); fStep = (double) pow(10.0, (double) iMag); iNumLines = (int) ((fMaxX-fMinX) / fStep); while (iNumLines < 3) { fStep = fStep / 2.0; iNumLines = (int) ((fMaxX-fMinX) / fStep); }// while fMinLine = (int)(((int)(fMinX/fStep)) * fStep); while (fMinLine=OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION && fX < OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + PROFILE_WIDTH){ if (fabs(fStep * (double)i+fMinLine) > 100000) { sValue = SG_Get_String(fStep * (double)i+fMinLine); }// if else { sValue = SG_Get_String(fStep * (double)i+fMinLine, 2, true); }// else Draw_Text(fX, fHeight - m_iOffsetY - PROFILE_HEIGHT - 15, SG_Get_String(fMinLine + fStep * (double) i).c_str(), 9, PDF_STYLE_TEXT_ALIGN_H_CENTER | PDF_STYLE_TEXT_ALIGN_V_TOP); Draw_Line(fX, fHeight - m_iOffsetY - PROFILE_HEIGHT, fX, fHeight - m_iOffsetY - PROFILE_HEIGHT - 10, 0); }//if }// for Draw_Line(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, fHeight - m_iOffsetY, OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, fHeight - m_iOffsetY - PROFILE_HEIGHT, 2); Draw_Line(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, fHeight - m_iOffsetY - PROFILE_HEIGHT, OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + PROFILE_WIDTH, fHeight - m_iOffsetY - PROFILE_HEIGHT, 2); fY = m_iOffsetY + PROFILE_HEIGHT - PROFILE_HEIGHT * ((pProfile[0].y - fMinY) / (fMaxY - fMinY)); fY = fHeight - fY; fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + PROFILE_WIDTH * ((pProfile[0].x - fMinX) / (fMaxX - fMinX)); Points.Add(fX, fY); for (i = 1; i < iNumPoints; i++) { fY = m_iOffsetY + PROFILE_HEIGHT - PROFILE_HEIGHT * ((pProfile[i].y - fMinY) / (fMaxY - fMinY)); fY = fHeight - fY; fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + PROFILE_WIDTH * ((pProfile[i].x - fMinX) / (fMaxX - fMinX)); Points.Add(fX, fY); }// for Draw_Line(Points, 2, 0x00bb00); Points.Clear(); fY = m_iOffsetY + PROFILE_HEIGHT - PROFILE_HEIGHT * ((pHeight[0] - fMinY) / (fMaxY - fMinY)); fY = fHeight - fY; fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + PROFILE_WIDTH * ((pProfile[0].x - fMinX) / (fMaxX - fMinX)); Points.Add(fX,fY); for (i = 1; i < iNumPoints; i++) { fY = m_iOffsetY + PROFILE_HEIGHT - PROFILE_HEIGHT * ((pHeight[i] - fMinY) / (fMaxY - fMinY)); fY = fHeight - fY; fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + PROFILE_WIDTH * ((pProfile[i].x - fMinX) / (fMaxX - fMinX)); Points.Add(fX, fY); }// for Draw_Line(Points, 2, 0x0000bb); DrawGuitar(pProfile, pHeight, iNumPoints); }//method void CProfile_Cross_Sections_PDF::DrawGuitar(TSG_Point *pProfile, double *pHeight, int iNumPoints){ int i; double fY; double fMinX, fMaxX; double fDif; CSG_String sValue; CSG_String sField [] = {"Distancia","Dist. Parcial.", "Elevacion del terreno", "Elevacin de la calzada", " ", " "}; double fHeight; fMinX = pProfile[0].x; fMaxX = pProfile[iNumPoints - 1].x; fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin(); for (i = 0; i < 7; i++){ fY = m_iOffsetY + PROFILE_HEIGHT + SEPARATION + GUITAR_LEYEND_HEIGHT / 6 * i; fY = fHeight - fY; Draw_Line(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION, fY, OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + GUITAR_WIDTH, fY, 0, 0x880000); if (i){ Draw_Text(OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION - 10, fY + GUITAR_LEYEND_HEIGHT / 13, sField[i-1].c_str(), 9, PDF_STYLE_TEXT_ALIGN_V_CENTER | PDF_STYLE_TEXT_ALIGN_H_RIGHT); }//if }//for AddGuitarValue(0, 0, fMinX, fMaxX, 1); for (i = 0; i < iNumPoints; i++) { AddGuitarValue(pProfile[i].x, pProfile[i].x / 1000, fMinX, fMaxX, 0); if (i){ AddGuitarValue(pProfile[i].x, pProfile[i].x / 1000 - pProfile[i-1].x / 1000, fMinX, fMaxX, 1); }//if fDif = pProfile[i].y - pHeight[i]; AddGuitarValue(pProfile[i].x, pProfile[i].y, fMinX, fMaxX, 2); AddGuitarValue(pProfile[i].x, pHeight[i], fMinX, fMaxX, 3); if (fDif > 0){ AddGuitarValue(pProfile[i].x, fDif, fMinX, fMaxX, 4); }//if else{ AddGuitarValue(pProfile[i].x, fDif, fMinX, fMaxX, 5); }//else }// for }//method void CProfile_Cross_Sections_PDF::AddGuitarValue(double fXValue, double fValue, double fMinX, double fMaxX, int iLine){ double fX,fY; double fHeight; fHeight = Get_Size_Page().Get_YMax() - Get_Size_Page().Get_YMin(); fX = OFFSET_Y + GUITAR_LEYEND_WIDTH + SEPARATION + PROFILE_WIDTH * ((fXValue - fMinX) / (fMaxX - fMinX)); fY = m_iOffsetY + PROFILE_HEIGHT + SEPARATION + GUITAR_LEYEND_HEIGHT / 6 * (iLine + 1); fY = fHeight - fY; Draw_Line(fX, fY, fX, fY + 3, 0, 0x880000); fY += 3; fX += 3; Draw_Text(fX, fY, SG_Get_String(fValue, 2).c_str(), 8, 0, 3.14159/2.); fY = m_iOffsetY + PROFILE_HEIGHT + SEPARATION + GUITAR_LEYEND_HEIGHT / 6 * iLine; fY = fHeight - fY; fX -= 3; Draw_Line(fX, fY, fX, fY - 3, 0, 0x880000); }//method /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CProfile_Cross_Sections::CProfile_Cross_Sections(void){ CSG_Parameter *pNode; Parameters.Set_Name(_TL("Terrain Path Cross Sections")); Parameters.Set_Description(_TW("(c) 2004 Victor Olaya. Cross Sections")); Parameters.Add_Grid(NULL, "DEM", _TL("DEM"), _TL("Digital Terrain Model"), PARAMETER_INPUT); Parameters.Add_Shapes(NULL, "LINES", _TL("Path"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Line); Parameters.Add_Shapes(NULL, "SECTIONS", _TL("Cross Sections"), _TL(""), PARAMETER_OUTPUT); Parameters.Add_Value(NULL, "NUMPOINTS", _TL("Number of points"), _TL("Number of points on each side of the section"), PARAMETER_TYPE_Int, 10, 1, true); Parameters.Add_Value(NULL, "INTERVAL", _TL("Interval"), _TL("Interval between points (in grid units)."), PARAMETER_TYPE_Double, 10); Parameters.Add_Value(NULL, "STEP", _TL("n"), _TL("Draw a section each n points"), PARAMETER_TYPE_Int, 2); pNode = Parameters.Add_Node(NULL, "PDFNODE", _TL("PDF Documents"), _TL("")); Parameters.Add_Value(pNode, "PDF", _TL("Create PDF Documents"), _TL(""), PARAMETER_TYPE_Bool, true); Parameters.Add_FilePath(pNode, "OUTPUTPATH", _TL("Folder for PDF Files"), _TL(""), _TL(""), _TL(""), true, true); Parameters.Add_Value(pNode, "WIDTH", _TL("Road Width"), _TL(""), PARAMETER_TYPE_Double, 5.); Parameters.Add_Value(pNode, "SLOPE", _TL("Side Slope"), _TL(""), PARAMETER_TYPE_Double, .5); Parameters.Add_Value(pNode, "THRESHOLD", _TL("Height Threshold"), _TL("Height threshold for optimal profile calculation"), PARAMETER_TYPE_Double, .5); }//constructor CProfile_Cross_Sections::~CProfile_Cross_Sections(void){} bool CProfile_Cross_Sections::On_Execute(void){ CSG_Shapes *pLines; CSG_Shape *pShape, *pSection; CSG_Grid *pDEM; TSG_Point Point, Point2; double fInterval; double fStepX, fStepY; int iNumPoints; int i,j,k; int iPoint; int iField = 0; int iStep; double dX, dY; double dX2, dY2; double dDistance; double dHeight; bool bCopy; m_pSections = Parameters("SECTIONS")->asShapes(); pLines = Parameters("LINES")->asShapes(); pDEM = Parameters("DEM")->asGrid(); fInterval = (double) Parameters("INTERVAL")->asDouble(); iNumPoints = Parameters("NUMPOINTS")->asInt(); iStep = Parameters("STEP")->asInt(); if(pLines == m_pSections){ bCopy = true; m_pSections = SG_Create_Shapes(); }//if else{ bCopy = false; }//else m_pSections->Create(SHAPE_TYPE_Line, _TL("Cross Sections")); for (i = iNumPoints; i > 0; i--){ m_pSections->Add_Field(CSG_String::Format(SG_T("-%s"), SG_Get_String(fInterval * i, 2).c_str()), SG_DATATYPE_Double); }//for m_pSections->Add_Field("0", SG_DATATYPE_Double); for (i = 1; i < iNumPoints +1; i++){ m_pSections->Add_Field(SG_Get_String(fInterval * i).c_str(), SG_DATATYPE_Double); }//for for(i=0; iGet_Count() && Set_Progress(i, pLines->Get_Count()); i++){ pShape = pLines->Get_Shape(i); for(j=0; jGet_Part_Count(); j++){ for(k=0; kGet_Point_Count(j)-1; k+=iStep){ Point = pShape->Get_Point(k,j); Point2 = pShape->Get_Point(k+1,j); dDistance = sqrt(pow(Point2.x - Point.x,2) + pow(Point2.y - Point.y,2)); dX = (Point.x + Point2.x) / 2.; dY = (Point.y + Point2.y) / 2.; fStepX = (Point2.y - Point.y) / dDistance * fInterval; fStepY = -(Point2.x - Point.x) / dDistance * fInterval; pSection = m_pSections->Add_Shape(); pSection->Add_Point(dX + iNumPoints * fStepX, dY + iNumPoints * fStepY); pSection->Add_Point(dX - iNumPoints * fStepX, dY - iNumPoints * fStepY); iField = 0; for (iPoint = iNumPoints; iPoint > 0; iPoint--){ dX2 = dX - iPoint * fStepX; dY2 = dY - iPoint * fStepY; dHeight = pDEM->Get_Value(dX2, dY2); pSection->Set_Value(iField, dHeight); iField++; }//for dHeight = pDEM->Get_Value(dX, dY); pSection->Set_Value(iField, dHeight); iField++; for (iPoint = 1; iPoint < iNumPoints +1; iPoint++){ dX2 = dX + iPoint * fStepX; dY2 = dY + iPoint * fStepY; dHeight = pDEM->Get_Value(dX2, dY2); pSection->Set_Value(iField, dHeight); iField++; }//for*/ }//for }//for }//for if (Parameters("PDF")->asBool()){ CreatePDFDocs(); }//if if(bCopy){ pLines->Assign(m_pSections); delete(m_pSections); }//if return true; }// method void CProfile_Cross_Sections::CreatePDFDocs(){ CSG_String sFilePath; if (Parameters("OUTPUTPATH")->asString()){ m_DocEngine.Open(_TL("SECTIONS")); sFilePath = SG_File_Make_Path(Parameters("OUTPUTPATH")->asString(), _TL("Sections"), _TL("pdf")); }//if else{ Message_Add(_TL("\n** Error : Invalid parameters **\n")); return; }//else AddLongitudinalProfiles(); AddCrossSections(); if (m_DocEngine.Save(sFilePath)){ if (!m_DocEngine.Close()){ Message_Add(_TL("\n\n ** Error : Could not close PDF engine ** \n\n")); } }//if else{ Message_Add(_TL("\n\n ** Error : Could not save PDF file ** \n\n")); }//else }//method void CProfile_Cross_Sections::AddLongitudinalProfiles(){ int i,j,k; int iIndex = 0; int iNumPoints = Parameters("NUMPOINTS")->asInt(); int iStep = Parameters("STEP")->asInt(); int iFirstPoint = 0; int iLastPoint; int iSections; double fX1, fY1, fX2, fY2; double fDistance, fDistanceSum = 0; double fDist; double fThreshold = (double)Parameters("THRESHOLD")->asDouble(); bool bValid; CSG_Shape *pShape; CSG_Table *pTable; TSG_Point Point, Point2; CSG_Shapes* pLines = Parameters("LINES")->asShapes(); pTable = m_pSections; iSections = pTable->Get_Record_Count(); m_pProfile = new TSG_Point[iSections]; for(i=0; iGet_Count() && Set_Progress(i, pLines->Get_Count()); i++){ pShape = pLines->Get_Shape(i); for(j=0; jGet_Part_Count(); j++){ Point = pShape->Get_Point(0,j); for(k=0; kGet_Point_Count(j)-1; k+=iStep){ Point2 = pShape->Get_Point(k,j); fDistance = sqrt(pow(Point2.x - Point.x,2) + pow(Point2.y - Point.y,2)); m_pProfile[iIndex].x = fDistanceSum + fDistance / 2.; m_pProfile[iIndex].y = pTable->Get_Record(iIndex)->asFloat(iNumPoints); fDistanceSum += fDistance; iIndex++; Point.x = Point2.x; Point.y = Point2.y; }//for }//for }//for*/ m_pHeight = new double[iSections]; for (i = 0; i < iSections; i++){ m_pHeight[i] = 1500; } iLastPoint = iSections - 1; while(iFirstPoint != iSections - 1){ fX1 = m_pProfile[iFirstPoint].x; fY1 = m_pProfile[iFirstPoint].y; fX2 = m_pProfile[iLastPoint].x; fY2 = m_pProfile[iLastPoint].y; bValid = true; for (i = iFirstPoint; i < iLastPoint; i++){ fDist = CalculatePointLineDist(fX1,fY1,fX2,fY2, m_pProfile[i].x, m_pProfile[i].y); if (fDist > fThreshold){ iLastPoint--; bValid = false; break; }//if }//for if (bValid){ for (j = iFirstPoint; j < iLastPoint + 1; j++){ m_pHeight[j] = m_pProfile[iFirstPoint].y + (m_pProfile[j].x - m_pProfile[iFirstPoint].x) / (m_pProfile[iLastPoint].x - m_pProfile[iFirstPoint].x) * (m_pProfile[iLastPoint].y - m_pProfile[iFirstPoint].y); }//for iFirstPoint = iLastPoint; iLastPoint = iSections - 1; }//if }//while m_DocEngine.AddLongitudinalProfile(m_pProfile, m_pHeight, iSections); }//method double CProfile_Cross_Sections::CalculatePointLineDist(double fX1, double fY1, double fX2, double fY2, double fPX, double fPY){ double *pA, *pB, *pC; pA = new double[2]; pA[0] = fX1; pA[1] = fY1; pB = new double[2]; pB[0] = fX2; pB[1] = fY2; pC = new double[2]; pC[0] = fPX; pC[1] = fPY; return linePointDist(pA, pB, pC); }//method void CProfile_Cross_Sections::AddCrossSections(){ int i,j; int iRoadPoints; int iNumPoints = Parameters("NUMPOINTS")->asInt(); double fInterval = (double) Parameters("INTERVAL")->asDouble(); CSG_Table *pTable; TSG_Point *pRoadSection; TSG_Point **pCrossSections; double dWidth = Parameters("WIDTH")->asDouble(); pRoadSection = new TSG_Point [2]; pRoadSection[0].x = -dWidth / 2.; pRoadSection[0].y = 0; pRoadSection[1].x = dWidth / 2.; pRoadSection[1].y = 0; pTable = m_pSections; pCrossSections = new TSG_Point *[pTable->Get_Record_Count()]; for (i = 0; i < pTable->Get_Record_Count(); i++){ pCrossSections[i] = new TSG_Point [pTable->Get_Field_Count()]; for (j = 0; j < pTable->Get_Field_Count(); j++){ pCrossSections[i][j].x = -fInterval * iNumPoints + fInterval * j; pCrossSections[i][j].y = pTable->Get_Record(i)->asFloat(j); }//for }//for iRoadPoints = 2; m_DocEngine.AddCrossSections(pCrossSections, m_pHeight, pRoadSection, pTable->Get_Record_Count(), pTable->Get_Field_Count(), iRoadPoints); m_DocEngine.AddVolumesTable(m_pProfile, pCrossSections, m_pHeight, pRoadSection, pTable->Get_Record_Count(), pTable->Get_Field_Count(), iRoadPoints); }//method /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/Profile_Cross_Sections.h000066400000000000000000000063671224124640700256120ustar00rootroot00000000000000/********************************************************** * Version $Id: Profile_Cross_Sections.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* CrossSections.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ //--------------------------------------------------------- #include "doc_pdf.h" #include /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CProfile_Cross_Sections_PDF : public CSG_Doc_PDF { public: CProfile_Cross_Sections_PDF(); ~CProfile_Cross_Sections_PDF(); void AddCrossSections(TSG_Point **,double*,TSG_Point *,int,int,int); void AddLongitudinalProfile(TSG_Point *, double*, int); void AddVolumesTable(TSG_Point *,TSG_Point **,double*,TSG_Point *,int,int,int); private: char *m_pPath; int m_iCanvasHeight; int m_iTableWidth; int m_iOffsetY; CSG_String m_sName; void AddCrossSection(TSG_Point *,TSG_Point *,int,int); void DrawGuitar(TSG_Point *,double*, int); void AddGuitarValue(double,double,double,double,int); void AdjustSections(TSG_Point *,TSG_Point *,std::vector&,std::vector&,double,int&,int&); void Intersect_Lines(double,double,double,double,double,double,double,double,double&,double&); void CalculateAreas(TSG_Point*,TSG_Point*,double,int,int,double&,double&); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CProfile_Cross_Sections : public CSG_Module_Grid { public: CProfile_Cross_Sections(void); virtual ~CProfile_Cross_Sections(void); protected: bool On_Execute(void); private: CProfile_Cross_Sections_PDF m_DocEngine; CSG_Shapes *m_pSections; double *m_pHeight; TSG_Point *m_pProfile; void CreatePDFDocs(); void AddLongitudinalProfiles(); void AddCrossSections(); double CalculatePointLineDist(double,double,double,double,double,double); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/Shapes_Report.cpp000066400000000000000000000522551224124640700243000ustar00rootroot00000000000000/********************************************************** * Version $Id: Shapes_Report.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Tools // // // //-------------------------------------------------------// // // // Shapes_Report.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad, Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "doc_pdf.h" #include "Shapes_Report.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Report::CShapes_Report(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("Shapes Report")); Set_Author (SG_T("(c) 2005 by O.Conrad, V.Olaya")); Set_Description (_TW( "" )); //----------------------------------------------------- pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "SUBTITLE" , _TL("Subtitle"), _TL("") ); Parameters.Add_FilePath( NULL , "FILENAME" , _TL("PDF File"), _TL(""), _TL("PDF Files (*.pdf)|*.pdf|All Files|*.*"), _TL(""), true, false ); Parameters.Add_Choice( NULL , "PAPER_SIZE" , _TL("Paper Format"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("A4 Portrait"), _TL("A4 Landscape"), _TL("A3 Portrait"), _TL("A3 Landscape") ) ); Parameters.Add_Value( pNode , "COLOR_LINE" , _TL("Line Color"), _TL(""), PARAMETER_TYPE_Color, SG_COLOR_BLACK ); Parameters.Add_Value( pNode , "COLOR_FILL" , _TL("Fill Color"), _TL(""), PARAMETER_TYPE_Color, SG_COLOR_GREEN ); //----------------------------------------------------- pNode = Parameters.Add_Node(NULL, "NODE_LAYOUT" , _TL("Layout"), _TL("")); Parameters.Add_Choice( pNode , "LAYOUT_MODE" , _TL("Layout"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("horizontal"), _TL("vertical") ), 1 ); Parameters.Add_Value( pNode , "LAYOUT_BREAK", _TL("Map/Table Size Ratio [%]"), _TL(""), PARAMETER_TYPE_Double, 50.0, 0.0, true, 100.0, true ); //----------------------------------------------------- pNode = Parameters.Add_Node(NULL, "NODE_TABLE" , _TL("Attribute Table"), _TL("")); Parameters.Add_Value( pNode , "COLUMNS" , _TL("Columns"), _TL("Number of atttribute table columns."), PARAMETER_TYPE_Int, 2, 1, true ); Parameters.Add_Choice( pNode , "CELL_MODE" , _TL("Cell Sizes"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("fit to page"), _TL("fixed cell height") ) ); Parameters.Add_Value( pNode , "CELL_HEIGHT" , _TL("Cell Height"), _TL(""), PARAMETER_TYPE_Int, 8, 1, true ); } //--------------------------------------------------------- CShapes_Report::~CShapes_Report(void) { } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Report::On_Execute(void) { int Page_Orientation; TSG_PDF_Page_Size Page_Size; CSG_String FileName(Parameters("FILENAME") ->asString()); CSG_Doc_PDF PDF; //----------------------------------------------------- m_pShapes = Parameters("SHAPES") ->asShapes(); m_iSubtitle = Parameters("SUBTITLE") ->asInt(); m_Color_Line = Parameters("COLOR_LINE") ->asColor(); m_Color_Fill = Parameters("COLOR_FILL") ->asColor(); m_nColumns = Parameters("COLUMNS") ->asInt(); switch( Parameters("CELL_MODE")->asInt() ) { default: case 0: m_Cell_Height = 0; break; case 1: m_Cell_Height = Parameters("CELL_HEIGHT")->asDouble(); break; } switch( Parameters("PAPER_SIZE")->asInt() ) { default: case 0: Page_Size = PDF_PAGE_SIZE_A4; Page_Orientation = PDF_PAGE_ORIENTATION_PORTRAIT; break; // A4 Portrait case 1: Page_Size = PDF_PAGE_SIZE_A4; Page_Orientation = PDF_PAGE_ORIENTATION_LANDSCAPE; break; // A4 Landscape case 2: Page_Size = PDF_PAGE_SIZE_A3; Page_Orientation = PDF_PAGE_ORIENTATION_PORTRAIT; break; // A3 Portrait case 3: Page_Size = PDF_PAGE_SIZE_A3; Page_Orientation = PDF_PAGE_ORIENTATION_LANDSCAPE; break; // A3 Landscape } //----------------------------------------------------- if( FileName.Length() > 0 && PDF.Open(Page_Size, Page_Orientation, CSG_String::Format(SG_T("%s: %s"), _TL("Summary"), m_pShapes->Get_Name())) ) { double d = Parameters("LAYOUT_BREAK")->asDouble(); switch( Parameters("LAYOUT_MODE")->asInt() ) { default: case 0: // horizontal PDF.Layout_Add_Box( 0, 0, 100, 5, "TITLE"); PDF.Layout_Add_Box( 0, 5, d, 100, "SHAPE"); PDF.Layout_Add_Box( d, 5, 100, 100, "TABLE"); break; case 1: // vertical PDF.Layout_Add_Box( 0, 0, 100, 5, "TITLE"); PDF.Layout_Add_Box( 0, 5, 100, d, "SHAPE"); PDF.Layout_Add_Box( 0, d, 100, 100, "TABLE"); break; } m_pPDF = &PDF; m_rTitle = PDF.Layout_Get_Box("TITLE"); m_rShape = PDF.Layout_Get_Box("SHAPE"); m_rTable = PDF.Layout_Get_Box("TABLE"); return( Add_Shapes() && PDF.Save(FileName) ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CShapes_Report::Add_Shapes(void) { if( m_pShapes && m_pShapes->is_Valid() && m_pPDF && m_pPDF->Add_Page() ) { bool bAddAll; CSG_Rect r(m_rShape), rWorld(m_pShapes->Get_Extent()); CSG_String Title; CSG_Strings sLeft, sRight; //------------------------------------------------- m_pPDF->Draw_Text(m_rTitle.Get_XCenter(), m_rTitle.Get_YCenter(), _TL("Overview"), (int)(0.7 * m_rTitle.Get_YRange()), PDF_STYLE_TEXT_ALIGN_H_CENTER|PDF_STYLE_TEXT_ALIGN_V_CENTER|PDF_STYLE_TEXT_UNDERLINE); //------------------------------------------------- r.Deflate(10, false); rWorld.Inflate(5, true); m_pPDF->Draw_Shapes (r, m_pShapes, PDF_STYLE_POLYGON_FILLSTROKE, m_Color_Fill, m_Color_Line, 0, &rWorld); m_pPDF->Draw_Graticule(r, rWorld, 10); //------------------------------------------------- sLeft .Add(CSG_String::Format(SG_T("%s:") , _TL("Name"))); sRight .Add(CSG_String::Format(SG_T("%s") , m_pShapes->Get_Name())); sLeft .Add(CSG_String::Format(SG_T("%s:") , _TL("Count"))); sRight .Add(CSG_String::Format(SG_T("%d") , m_pShapes->Get_Count())); m_pPDF->Draw_Text(m_rTable.Get_XMin() , m_rTable.Get_YMax(), sLeft , 8, PDF_STYLE_TEXT_ALIGN_H_LEFT|PDF_STYLE_TEXT_ALIGN_V_TOP); m_pPDF->Draw_Text(m_rTable.Get_XCenter(), m_rTable.Get_YMax(), sRight, 8, PDF_STYLE_TEXT_ALIGN_H_LEFT|PDF_STYLE_TEXT_ALIGN_V_TOP); //------------------------------------------------- bAddAll = m_pShapes->Get_Selection_Count() == 0; for(int iShape=0; iShapeGet_Count() && Set_Progress(iShape, m_pShapes->Get_Count()); iShape++) { if( bAddAll || m_pShapes->Get_Record(iShape)->is_Selected() ) { Title.Printf(SG_T("%s: %s"), m_pShapes->Get_Field_Name(m_iSubtitle), m_pShapes->Get_Shape(iShape)->asString(m_iSubtitle)); Add_Shape(m_pShapes->Get_Shape(iShape), Title); } } return( true ); } return( false ); } //--------------------------------------------------------- bool CShapes_Report::Add_Shape(CSG_Shape *pShape, const SG_Char *Title) { if( m_pPDF && m_pPDF->Is_Ready_To_Draw() && pShape && pShape->is_Valid() && m_pPDF->Add_Page() ) { CSG_Rect r(m_rShape), rWorld(pShape->Get_Extent()); //------------------------------------------------- m_pPDF->Add_Outline_Item(Title); m_pPDF->Draw_Text(m_rTitle.Get_XCenter(), m_rTitle.Get_YCenter(), Title, (int)(0.7 * m_rTitle.Get_YRange()), PDF_STYLE_TEXT_ALIGN_H_CENTER|PDF_STYLE_TEXT_ALIGN_V_CENTER|PDF_STYLE_TEXT_UNDERLINE); r.Deflate(10, false); rWorld.Inflate(5, true); m_pPDF->Draw_Shape (r, pShape, PDF_STYLE_POLYGON_FILLSTROKE, m_Color_Fill, m_Color_Line, 0, &rWorld); m_pPDF->Draw_Graticule (r, rWorld, 10); //------------------------------------------------- if( pShape->Get_Table()->Get_Field_Count() > 0 ) { CSG_Table_Record *pRecord; CSG_Table Table; Table.Set_Name(_TL("Attributes")); Table.Add_Field(_TL("Attribute"), SG_DATATYPE_String); Table.Add_Field(_TL("Value") , SG_DATATYPE_String); for(int iField=0; iFieldGet_Table()->Get_Field_Count(); iField++) { pRecord = Table.Add_Record(); pRecord->Set_Value(0, pShape->Get_Table()->Get_Field_Name(iField)); pRecord->Set_Value(1, pShape->asString(iField)); } m_pPDF->Draw_Table(m_rTable, &Table, m_nColumns, m_Cell_Height, 0.0); } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// /*/--------------------------------------------------------- void CWKSP_Map::SaveAs_PDF_Indexed(void) { static CSG_Parameters Parameters(NULL, LNG("[CAP] Save to PDF"), LNG(""), NULL, false); //----------------------------------------------------- if( Parameters.Get_Count() == 0 ) { Parameters.Add_FilePath( NULL , "FILENAME" , LNG("[FLD] PDF Document"), LNG(""), CSG_String::Format( wxT("%s (*.pdf)|*pdf|") wxT("%s|*.*"), LNG("PDF Files"), LNG("All Files") ), NULL, true, false ); Parameters.Add_Choice( NULL , "PAPER_SIZE" , LNG("[FLD] Paper Format"), LNG(""), CSG_String::Format(wxT("%s|%s|%s|%s|"), LNG("A4 Portrait"), LNG("A4 Landscape"), LNG("A3 Portrait"), LNG("A3 Landscape") ) ); Parameters.Add_String( NULL , "NAME" , LNG("[FLD] Title"), LNG(""), LNG("") ); Parameters.Add_Shapes( NULL , "SHAPES" , LNG("[FLD] Shapes"), LNG(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Table_Field( Parameters("SHAPES") , "FIELD" , LNG("[FLD] Attribute"), LNG("") ); // Parameters.Add_Grid( // NULL , "GRID" , LNG("[FLD] Grid"), // LNG(""), // PARAMETER_INPUT_OPTIONAL // ); Parameters.Add_FilePath( NULL , "FILEICON" , LNG("[FLD] Icon"), LNG(""), CSG_String::Format(wxT("%s|*.png;*.jpg|%s|*.png|%s|*.jpg|%s|*.*"), LNG("All Recognised Files"), LNG("PNG Files"), LNG("JPG Files"), LNG("All Files") ), NULL, false, false ); Parameters.Add_Value( NULL , "ROUNDSCALE" , LNG("[FLD] Round Scale"), LNG(""), PARAMETER_TYPE_Bool, true ); } //----------------------------------------------------- if( DLG_Parameters(&Parameters) ) { bool bResult, bRoundScale; int iField; CSG_String Name, FileName, FileName_Icon, FilePath_Maps; CSG_Rect rOverview, rMap; CSG_Shapes *pShapes; // CSG_Grid *pGrid; CSG_Doc_PDF PDF; MSG_General_Add(CSG_String::Format(wxT("%s..."), LNG("[MSG] Save to PDF")), true, true); bResult = false; Name = Parameters("NAME") ->asString(); if( Name.Length() < 1 ) Name = LNG("Maps"); FileName = Parameters("FILENAME") ->asString(); FileName_Icon = Parameters("FILEICON") ->asString(); pShapes = Parameters("SHAPES") ->asShapes(); // pGrid = Parameters("GRID") ->asGrid(); iField = Parameters("FIELD") ->asInt(); bRoundScale = Parameters("ROUNDSCALE") ->asBool(); switch( Parameters("PAPER_SIZE")->asInt() ) { default: case 0: PDF.Open(PDF_PAGE_SIZE_A4, PDF_PAGE_ORIENTATION_PORTRAIT , Name); break; // A4 Portrait case 1: PDF.Open(PDF_PAGE_SIZE_A4, PDF_PAGE_ORIENTATION_LANDSCAPE, Name); break; // A4 Landscape case 2: PDF.Open(PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_PORTRAIT , Name); break; // A3 Portrait case 3: PDF.Open(PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE, Name); break; // A3 Landscape } //------------------------------------------------- if( PDF.Is_Open() ) { PDF.Layout_Set_Box_Space(5, false); PDF.Layout_Add_Box( 0.0, 0.0, 100.0, 75.0, "MAP"); PDF.Layout_Add_Box( 0.0, 75.0, 50.0, 100.0, "DIVISIONS"); PDF.Layout_Add_Box( 50.0, 75.0, 60.0, 80.0, "ICON"); PDF.Layout_Add_Box( 60.0, 75.0, 100.0, 80.0, "TITLE"); PDF.Layout_Add_Box( 50.0, 80.0, 100.0, 100.0, "DESCRIPTION"); FilePath_Maps = SG_File_Make_Path(SG_File_Get_Path(FileName), SG_File_Get_Name(FileName, false)); rOverview = pShapes ? pShapes->Get_Extent() : Get_Extent(); // rOverview = pShapes ? pShapes->Get_Extent() : (pGrid ? pGrid->Get_Extent() : Get_Extent()); //--------------------------------------------- // PDF.Draw_Text (PDF.Layout_Get_Box("TITLE").Get_XMin(), PDF.Layout_Get_Box("TITLE").Get_YCenter(), LNG("This is a Test!!!"), 24); // PDF.Draw_Rectangle (PDF.Layout_Get_Box("DIVISIONS")); // PDF.Draw_Grid (PDF.Layout_Get_Box("DIVISIONS"), Parameters("GRID")->asGrid(), CSG_Colors(), 0.0, 0.0, 0, &rOverview); // PDF.Draw_Shapes (PDF.Layout_Get_Box("DIVISIONS"), pShapes, PDF_STYLE_POLYGON_STROKE, SG_COLOR_GREEN, SG_COLOR_BLACK, 1, &rOverview); // PDF.Draw_Graticule (PDF.Layout_Get_Box("DIVISIONS"), rOverview); //--------------------------------------------- Draw_PDF(&PDF, FilePath_Maps, -1, FileName_Icon, Name, rOverview, bRoundScale, iField, pShapes); if( pShapes ) { for(int i=0; iGet_Count() && SG_UI_Process_Set_Progress(i, pShapes->Get_Count()); i++) { Draw_PDF(&PDF, FilePath_Maps, i, FileName_Icon, Name, pShapes->Get_Shape(i)->Get_Extent(), bRoundScale, iField, pShapes); } } //--------------------------------------------- PROCESS_Set_Okay(true); Set_Buisy_Cursor(true); bResult = PDF.Save(FileName); Set_Buisy_Cursor(false); } MSG_General_Add(bResult ? LNG("[MSG] okay") : LNG("[MSG] failed"), false, false, bResult ? SG_UI_MSG_STYLE_SUCCESS : SG_UI_MSG_STYLE_FAILURE); } } //--------------------------------------------------------- void CWKSP_Map::Draw_PDF(CSG_Doc_PDF *pPDF, const wxChar *FilePath_Maps, int Image_ID, const wxChar *FileName_Icon, const wxChar *Title, CSG_Rect rWorld, bool bRoundScale, int iField, CSG_Shapes *pShapes) { int FrameSize_1 = 20, FrameSize_2 = 10; double d, e, Scale, Ratio; CSG_String FileName, Description, s; CSG_Rect rBox; wxRect rBMP; wxBitmap BMP; wxMemoryDC dc; if( pPDF && rWorld.Get_XRange() > 0.0 && rWorld.Get_YRange() > 0.0 && pPDF->Add_Page() ) { rWorld.Inflate(5.0, true); //------------------------------------------------- rBox = pPDF->Layout_Get_Box("MAP"); rBox.Deflate(FrameSize_1, false); rBMP = wxRect(0, 0, (int)rBox.Get_XRange(), (int)rBox.Get_YRange()); BMP.Create(rBMP.GetWidth(), rBMP.GetHeight()); dc.SelectObject(BMP); dc.SetBackground(*wxWHITE_BRUSH); dc.Clear(); if( bRoundScale ) { Scale = rWorld.Get_XRange() / (pPDF->Get_Page_To_Meter() * (double)rBMP.GetWidth()); // if( Scale > 1000 ) // { Ratio = ((ceil(Scale / 1000.)) / (Scale / 1000.) - 1); rWorld.Inflate(Ratio * 100, true); // } } Scale = rWorld.Get_XRange() / (pPDF->Get_Page_To_Meter() * rBMP.GetWidth()); Draw_Map(dc, rWorld, 1.0, rBMP, false); dc.SelectObject(wxNullBitmap); SG_Dir_Create(FilePath_Maps); FileName = SG_File_Make_Path(FilePath_Maps, CSG_String::Format(wxT("image_%03d"), Image_ID + 1), wxT("png")); BMP.SaveFile(FileName.c_str(), wxBITMAP_TYPE_PNG); pPDF->Draw_Image (rBox, FileName); pPDF->Draw_Graticule(rBox, rWorld, FrameSize_1); //------------------------------------------------- rBox = pPDF->Layout_Get_Box("ICON"); if( FileName_Icon ) { pPDF->Draw_Image(rBox, FileName_Icon); } else { pPDF->Draw_Rectangle(rBox); } //------------------------------------------------- rBox = pPDF->Layout_Get_Box("DIVISIONS"); pPDF->Draw_Rectangle(rBox); if( pShapes ) { CSG_Rect rShapes(pShapes->Get_Extent()); rShapes.Inflate(5.0, true); rBox.Deflate(FrameSize_2, false); pPDF->Draw_Graticule(rBox, rShapes, FrameSize_2); pPDF->Draw_Shapes(rBox, pShapes, PDF_STYLE_POLYGON_FILLSTROKE, SG_COLOR_GREEN, SG_COLOR_BLACK, 0, &rShapes); if( Image_ID >= 0 && Image_ID < pShapes->Get_Count() ) { pPDF->Draw_Shape(rBox, pShapes->Get_Shape(Image_ID), PDF_STYLE_POLYGON_FILLSTROKE, SG_COLOR_YELLOW, SG_COLOR_RED, 1, &rShapes); } } //------------------------------------------------- rBox = pPDF->Layout_Get_Box("TITLE"); pPDF->Draw_Text(rBox.Get_XMin(), rBox.Get_YCenter(), Title, 20, PDF_STYLE_TEXT_ALIGN_H_LEFT|PDF_STYLE_TEXT_ALIGN_V_CENTER|PDF_STYLE_TEXT_UNDERLINE); //------------------------------------------------- rBox = pPDF->Layout_Get_Box("DESCRIPTION"); Description.Append(CSG_String::Format(wxT("%d. %s\n"), Image_ID + 2, LNG("Map"))); if( pShapes && Image_ID >= 0 && Image_ID < pShapes->Get_Count() ) { switch( pShapes->Get_Type() ) { default: break; case SHAPE_TYPE_Line: d = ((CSG_Shape_Line *)pShapes->Get_Shape(Image_ID))->Get_Length(); e = d > 1000.0 ? 1000.0 : 1.0; s = d > 1000.0 ? wxT("km") : wxT("m"); Description.Append(CSG_String::Format(wxT("%s: %f%s\n"), LNG("Length") , d / e, s.c_str())); break; case SHAPE_TYPE_Polygon: d = ((CSG_Shape_Polygon *)pShapes->Get_Shape(Image_ID))->Get_Area(); e = d > 1000000.0 ? 1000000.0 : (d > 10000.0 ? 10000.0 : 1.0); s = d > 1000000.0 ? wxT("km\xc2\xb2") : (d > 10000.0 ? wxT("ha") : wxT("m\xc2\xb2")); Description.Append(CSG_String::Format(wxT("%s: %f%s\n"), LNG("Area") , d / e, s.c_str())); d = ((CSG_Shape_Polygon *)pShapes->Get_Shape(Image_ID))->Get_Perimeter(); e = d > 1000.0 ? 1000.0 : 1.0; s = d > 1000.0 ? wxT("km") : wxT("m"); Description.Append(CSG_String::Format(wxT("%s: %f%s\n"), LNG("Perimeter") , d / e, s.c_str())); Description.Append(CSG_String::Format(wxT("%s: %d\n") , LNG("Parts") , ((CSG_Shape_Polygon *)pShapes->Get_Shape(Image_ID))->Get_Part_Count())); break; } if( iField >= 0 && iField < pShapes->Get_Field_Count() ) { Description.Append(CSG_String::Format(wxT("%s: %s\n"), pShapes->Get_Field_Name(iField), pShapes->Get_Shape(Image_ID)->asString(iField))); } } Description.Append(CSG_String::Format(wxT("%s 1:%s"), LNG("Scale"), SG_Get_String(Scale, 2).c_str())); pPDF->Draw_Text(rBox.Get_XMin(), rBox.Get_YMax(), Description, 12, PDF_STYLE_TEXT_ALIGN_H_LEFT|PDF_STYLE_TEXT_ALIGN_V_TOP); } }/**/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/Shapes_Report.h000066400000000000000000000107511224124640700237400ustar00rootroot00000000000000/********************************************************** * Version $Id: Shapes_Report.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_Tools // // // //-------------------------------------------------------// // // // Shapes_Report.h // // // // Copyright (C) 2005 by // // Olaf Conrad, Victor Olaya // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Shapes_Report_H #define HEADER_INCLUDED__Shapes_Report_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Report : public CSG_Module { public: CShapes_Report(void); virtual ~CShapes_Report(void); protected: virtual bool On_Execute (void); private: int m_iSubtitle, m_nColumns, m_Color_Line, m_Color_Fill; double m_Cell_Height; CSG_Rect m_rTitle, m_rShape, m_rTable; CSG_Shapes *m_pShapes; class CSG_Doc_PDF *m_pPDF; bool Add_Shapes (void); bool Add_Shape (CSG_Shape *pShape, const SG_Char *Title); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Shapes_Report_H saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/Shapes_Summary.cpp000066400000000000000000000374411224124640700244620ustar00rootroot00000000000000/********************************************************** * Version $Id: Shapes_Summary.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* Summarize.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "Shapes_Summary.h" #define VERY_LARGE_NUMBER 9999999999. CSG_String sParam[] = {"[Sum]", "[Mean]", "[Variance]", "[Minimum]", "[Maximum]"}; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define PDF_PAGE_WIDTH_A4 596 #define PDF_PAGE_HEIGHT_A4 842 #define PDF_PAGE_WIDTH_A3 PDF_PAGE_HEIGHT_A4 #define PDF_PAGE_HEIGHT_A3 (sqrt(2.) * PDF_PAGE_HEIGHT_A4) #define OFFSET_X 50 #define OFFSET_Y 50 #define LINE_SPACEMENT 12 #define SUMMARY_LAYOUT_HEADER 50 #define MAX_SUMMARY_LAYOUT_HEIGHT (PDF_PAGE_WIDTH_A3 - 2 * OFFSET_Y - LINE_SPACEMENT) #define MAX_SUMMARY_LAYOUT_WIDTH MAX_SUMMARY_LAYOUT_HEIGHT #define SUMMARY_LAYOUT_SEPARATION 30 #define MAX_SUMMARY_TABLE_WIDTH (PDF_PAGE_HEIGHT_A3 - 2 * OFFSET_X - MAX_SUMMARY_LAYOUT_WIDTH - SUMMARY_LAYOUT_SEPARATION) #define MAX_ROWS_IN_SUMMARY_LAYOUT (MAX_SUMMARY_LAYOUT_HEIGHT / TABLE_CELL_HEIGHT) #define SUMMARY_STATISTICS_GRAPH_HEIGHT 120 #define SUMMARY_STATISTICS_GRAPH_WIDTH (PDF_PAGE_WIDTH_A4 - 2 * OFFSET_X) #define SUMMARY_STATISTICS_GRAPH_SEPARATION 120 #define GRATICULE_SEPARATION 20 #define SUMMARY_TABLE_CELL_HEIGHT 13.0 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif CShapes_Summary_PDF::CShapes_Summary_PDF(){ }//constructor CShapes_Summary_PDF::~CShapes_Summary_PDF(){} void CShapes_Summary_PDF::AddClassSummaryPage(CSG_Shapes *pShapes, CSG_Table *pTable, int iClass, CSG_String sTitle){ int i; double fPaperHeight; double fRealWidth, fRealHeight; double fX, fY; CSG_Table *pClassTable; CSG_Table_Record *pRecord; CSG_Rect CanvasExtent, TableExtent; TSG_Rect Extent; Add_Page(PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE); Add_Outline_Item(sTitle.c_str()); fPaperHeight = Get_Size_Page().Get_YRange(); Draw_Text(PDF_PAGE_HEIGHT_A3 - OFFSET_X, fPaperHeight - OFFSET_Y, sTitle, 25, PDF_STYLE_TEXT_ALIGN_H_RIGHT, 0.0, SG_GET_RGB(0, 0, 0)); Draw_Line(OFFSET_X, fPaperHeight - OFFSET_Y - 5, PDF_PAGE_HEIGHT_A3 - OFFSET_X, fPaperHeight - OFFSET_Y - 5, 4 ); Extent = pShapes->Get_Extent(); fRealWidth = Extent.xMax - Extent.xMin; fRealHeight = Extent.yMax - Extent.yMin; CanvasExtent.Assign(OFFSET_X, OFFSET_Y, OFFSET_X + MAX_SUMMARY_LAYOUT_WIDTH, OFFSET_Y + MAX_SUMMARY_LAYOUT_HEIGHT); _Fit_Rectangle(CanvasExtent, fRealWidth / fRealHeight, true); CanvasExtent.Deflate(GRATICULE_SEPARATION, false); Draw_Shapes(CanvasExtent, pShapes); CanvasExtent.Inflate(GRATICULE_SEPARATION, false); /*CanvasExtent.xMin = OFFSET_X + (MAX_SUMMARY_LAYOUT_WIDTH - fWidth) / 2. - GRATICULE_SEPARATION; CanvasExtent.xMax = CanvasExtent.xMin + fWidth + 2 * GRATICULE_SEPARATION; CanvasExtent.yMin = OFFSET_Y + (MAX_SUMMARY_LAYOUT_HEIGHT - fHeight) / 2. - GRATICULE_SEPARATION; CanvasExtent.yMax = CanvasExtent.yMin + fHeight + 2* GRATICULE_SEPARATION;*/ Draw_Graticule(CanvasExtent, Extent); pClassTable = SG_Create_Table(); pClassTable->Add_Field(_TL("Field"), SG_DATATYPE_String ); pClassTable->Add_Field(_TL("Value"), SG_DATATYPE_Double); for (i = 0; i < pTable->Get_Field_Count(); i++){ pRecord = pClassTable->Add_Record(); pRecord->Set_Value(0, pTable->Get_Field_Name(i)); pRecord->Set_Value(1, pTable->Get_Record(iClass)->asDouble(i)); } fY = fPaperHeight - OFFSET_Y - SUMMARY_LAYOUT_HEADER; fX = PDF_PAGE_HEIGHT_A3 - OFFSET_X - MAX_SUMMARY_TABLE_WIDTH; TableExtent.Assign(fX, fY, fX + MAX_SUMMARY_TABLE_WIDTH, OFFSET_Y); Draw_Table(TableExtent, pClassTable, SUMMARY_TABLE_CELL_HEIGHT, 0.0); }//method void CShapes_Summary_PDF::AddSummaryStatisticsPage(CSG_Table* pTable){ int i,j; double fX, fY; double fPaperHeight; CSG_Points Data; CSG_String *pNames; CSG_Rect r; fPaperHeight = Get_Size_Page().Get_YRange(); pNames = new CSG_String [pTable->Get_Record_Count()]; for (i = 0; i < pTable->Get_Record_Count(); i++){ pNames[i] = pTable->Get_Record(i)->asString(0); }//for for (i = 1; i < pTable->Get_Field_Count(); i++){ if ((i-1)%3 == 0){ Add_Page(); }//if Data.Clear(); for (j = 0; j < pTable->Get_Record_Count(); j++){ Data.Add(0.0, pTable->Get_Record(j)->asDouble(i)); }//for fY = OFFSET_Y + ((i-1)%3) * (SUMMARY_STATISTICS_GRAPH_HEIGHT + SUMMARY_STATISTICS_GRAPH_SEPARATION); fY = fPaperHeight - fY; fX = OFFSET_X; Draw_Text(fX, fY + 10, pTable->Get_Field_Name(i), 14); r.Assign(fX, fY - 25 - SUMMARY_STATISTICS_GRAPH_HEIGHT, fX + SUMMARY_STATISTICS_GRAPH_WIDTH, fY - 25 ); AddBarGraphStatistics(Data, pNames, r); }//for*/ }//method void CShapes_Summary_PDF::AddBarGraphStatistics(CSG_Points &Data, CSG_String *pNames, const CSG_Rect &r){ int i; int iMag; int iNumLines; double fMinLine = 0; double fWidth; double fMax, fMin; double fStep; double fX, fY; double fPaperHeight; double fAngle; CSG_String sValue; CSG_Points Points; fPaperHeight = Get_Size_Page().Get_YRange(); fMin = fMax = Data[0].y; for (i = 0; i < Data.Get_Count(); i++){ if (Data[i].y > fMax){ fMax = Data[i].y; } if (Data[i].y < fMin){ fMin = Data[i].y; } fMin = M_GET_MIN(0, fMin); } if (fMin != fMax){ iMag = (int) (log(fMax - fMin) / log(10.0)); fStep = (pow(10.0, (double) iMag)); if (fStep == 0){ fStep = 1.; } fMinLine= (long)(((long)(fMin/fStep)) *fStep); iNumLines = (int) ((fMax - fMin) / fStep); while (iNumLines < 8){ fStep = fStep / 2.0; iNumLines = (int) ((fMax - fMin) / fStep); } iNumLines = (int) ((fMax - fMinLine) / fStep); } else{ fStep = fMin = 0; iNumLines = 1; fMinLine = fMax; } for (i = 0; i < iNumLines; i++) { fY = r.Get_YMin() + ((fMinLine + fStep * i - fMin) / (fMax - fMin)) * r.Get_YRange(); if (fY <= r.Get_YMax() && fY >= r.Get_YMin()) { Draw_Line(r.Get_XMin(), fY, r.Get_XMax(), fY); } } fWidth = (double) r.Get_XRange() / (double) (Data.Get_Count()); for (i = 0; i < Data.Get_Count(); i++) { fX = r.Get_XMin() + i * fWidth; fY = r.Get_YMin(); //fY = fPaperHeight - fY; Draw_Rectangle(fX, fY, fX + fWidth, fY + r.Get_YRange() * ((Data[i].y - fMin) / (fMax - fMin)), PDF_STYLE_POLYGON_FILLSTROKE, 0xaa0000); } fAngle = 3.14159/ 180 * 60; for (i = 0; i < Data.Get_Count(); i++) { fX = r.Get_XMin() + i * fWidth + fWidth / 2.; Draw_Text(fX - 5, fY - 5, pNames[i], 9, PDF_STYLE_TEXT_ALIGN_V_TOP|PDF_STYLE_TEXT_ALIGN_H_RIGHT, fAngle); Draw_Line(fX, fY, fX, fY - 5, 1); } Draw_Line(r.Get_XMin(), r.Get_YMin(), r.Get_XMin(), r.Get_YMax(), 4); Draw_Line(r.Get_XMin(), r.Get_YMin(), r.Get_XMax(), r.Get_YMin(), 4); }//method /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CShapes_Summary::CShapes_Summary(void){ CSG_Parameter *pNode; CSG_String sName; Parameters.Set_Name(_TL("Shapes Summary Report")); Parameters.Set_Description(_TW("(c) 2004 by Victor Olaya. summary.")); pNode = Parameters.Add_Shapes(NULL, "SHAPES", _TL("Shapes"), _TL(""), PARAMETER_INPUT); Parameters.Add_Table_Field(pNode, "FIELD", _TL("Field"), _TL("")); Parameters.Add_Table(NULL, "TABLE", _TL("Summary Table"), _TL(""), PARAMETER_OUTPUT); pNode = Parameters.Add_Node(NULL, "PDFNODE", _TL("PDF Docs"), _TL("")); Parameters.Add_Value(pNode, "PDF", _TL("Create PDF Docs"), _TL("Create PDF Docs"), PARAMETER_TYPE_Bool, true); Parameters.Add_FilePath(pNode, "OUTPUTPATH", _TL("Folder"), _TL("Folder"), _TL(""), _TL(""), true, true); m_pExtraParameters = Add_Parameters("EXTRA", _TL("Field for Summary"), _TL("")); }//constructor CShapes_Summary::~CShapes_Summary(void) {} bool CShapes_Summary::On_Execute(void){ int i,j; CSG_Table *pShapesTable; CSG_Parameter **pExtraParameter; CSG_String sName, sFilePath; m_iField = Parameters("FIELD")->asInt(); m_pShapes = Parameters("SHAPES")->asShapes(); m_pTable = Parameters("TABLE")->asTable(); pShapesTable = m_pShapes; m_bIncludeParam = new bool [pShapesTable->Get_Field_Count() * 5]; pExtraParameter = new CSG_Parameter* [pShapesTable->Get_Field_Count() * 5]; for (i = 0; i < pShapesTable->Get_Field_Count(); i++){ for (j = 0; j < 5; j++){ if( SG_Data_Type_is_Numeric(pShapesTable->Get_Field_Type(i)) ) { //is numeric field sName = pShapesTable->Get_Field_Name(i); sName.Append(sParam[j]); pExtraParameter[i * 5 + j] = m_pExtraParameters->Add_Value(NULL, SG_Get_String(i * 5 + j,0).c_str(), sName.c_str(), _TL(""), PARAMETER_TYPE_Bool, false); m_bIncludeParam[i * 5 + j] = true; }//if else{ m_bIncludeParam[i * 5 + j] = false; }//else }//for }//for if(Dlg_Parameters("EXTRA")){ for (i = 0; i < pShapesTable->Get_Field_Count() * 5; i++){ sName = SG_Get_String(i,0); if (m_bIncludeParam[i]){ m_bIncludeParam[i] = Get_Parameters("EXTRA")->Get_Parameter(sName.c_str())->asBool(); }//if }//for Summarize(); if (Parameters("PDF")->asBool()){ if (Parameters("OUTPUTPATH")->asString()){ sName = _TL("Summary_"); sName.Append(m_pShapes->Get_Name()); m_DocEngine.Open(PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE, sName); CreatePDFDocs(); sFilePath = SG_File_Make_Path(Parameters("OUTPUTPATH")->asString(), sName, SG_T("pdf")); if (m_DocEngine.Save(sFilePath)){ if (!m_DocEngine.Close()){ Message_Add(_TL("\n\n ** Error : Could not close PDF engine ** \n\n")); } }//if else{ Message_Add(_TL("\n\n ** Error : Could not save PDF file ** \n\n")); }//else }//if }//if m_pExtraParameters->Destroy(); delete [] m_bIncludeParam; return true; }//if m_pExtraParameters->Destroy(); delete [] m_bIncludeParam; return false; }//method void CShapes_Summary::CreatePDFDocs(){ CSG_Shapes *pShapes; CSG_Shape *pShape; CSG_Table *pShapesTable; int i,j; m_DocEngine.Add_Page_Title (_TL("Summary"), PDF_TITLE_01, PDF_PAGE_SIZE_A3, PDF_PAGE_ORIENTATION_LANDSCAPE); pShapesTable = m_pShapes; pShapes = new CSG_Shapes(); for (i = 0; i < (int)m_ClassesID.size(); i++){ Set_Progress(i,m_ClassesID.size()); pShapes->Create(m_pShapes->Get_Type()); for (j = 0; j < m_pShapes->Get_Count(); j++){ if (m_pClasses[j] == i){ pShape = pShapes->Add_Shape(); pShape->Assign(m_pShapes->Get_Shape(j)); }//if }//for m_DocEngine.AddClassSummaryPage(pShapes, m_pTable, i, m_ClassesID[i]); }//for if (m_pTable->Get_Record_Count() > 1){ m_DocEngine.Add_Page_Title (_TL("Statistics"), PDF_TITLE_01, PDF_PAGE_SIZE_A4, PDF_PAGE_ORIENTATION_PORTRAIT); m_DocEngine.AddSummaryStatisticsPage(m_pTable); }//if delete pShapes; }//method void CShapes_Summary::Summarize(){ int i,j; CSG_Table *pShapesTable; CSG_Table_Record *pRecord; CSG_String sName; float *pSum; float *pMin; float *pMax; float *pVar; float fValue; float fMean; int iLastField = -1; int iField; int iParam; m_ClassesID.clear(); pShapesTable = m_pShapes; m_pClasses = new int[pShapesTable->Get_Record_Count()]; for (i = 0; i < pShapesTable->Get_Record_Count(); i++){ pRecord = pShapesTable->Get_Record(i); sName = pRecord->asString(m_iField); for (j = 0; j < (int)m_ClassesID.size(); j++){ if (!m_ClassesID[j].CmpNoCase(sName)){ m_pClasses[i] = j; break; }//if }//for if (j == m_ClassesID.size()){ m_pClasses[i] = j; m_ClassesID.push_back(sName); }//if }//for m_pTable->Create((CSG_Table*)NULL); m_pTable->Set_Name(_TL("Summary Table")); m_pTable->Add_Field(_TL("Class"), SG_DATATYPE_String); m_pTable->Add_Field(_TL("Count"), SG_DATATYPE_Int); m_pCount = new int[m_ClassesID.size()]; pSum = new float[m_ClassesID.size()]; pMax = new float[m_ClassesID.size()]; pMin = new float[m_ClassesID.size()]; pVar = new float[m_ClassesID.size()]; for (i = 0; i < (int)m_ClassesID.size(); i++){ m_pCount[i] = 0; }//for for (i = 0; i < pShapesTable->Get_Record_Count(); i++){ m_pCount[m_pClasses[i]]++; }//for for (i = 0; i < (int)m_ClassesID.size(); i++){ pRecord = m_pTable->Add_Record(); sName = m_ClassesID[i]; pRecord->Set_Value(0,sName.c_str()); pRecord->Set_Value(1,m_pCount[i]); }//for for (i = 0; i < pShapesTable->Get_Field_Count() * 5; i++){ if (m_bIncludeParam[i]){ iField = (int) (i / 5); iParam = i % 5; sName = pShapesTable->Get_Field_Name(iField); sName.Append(sParam[iParam]); m_pTable->Add_Field(sName.c_str(), SG_DATATYPE_Double); if (iField != iLastField){ for (j = 0; j < (int)m_ClassesID.size(); j++){ pSum[j] = 0; pMax[j] = -(float)VERY_LARGE_NUMBER; pMin[j] = (float)VERY_LARGE_NUMBER; pVar[j] = 0; }//for for (j = 0; j < pShapesTable->Get_Record_Count(); j++){ pRecord = pShapesTable->Get_Record(j); fValue = pRecord->asFloat(iField); pSum[m_pClasses[j]] += fValue; pVar[m_pClasses[j]] += (fValue * fValue); if (fValue > pMax[m_pClasses[j]]){ pMax[m_pClasses[j]] = fValue; }//if if (fValue < pMin[m_pClasses[j]]){ pMin[m_pClasses[j]] = fValue; }//if }//for }//if iField = m_pTable->Get_Field_Count() - 1; for (j = 0; j < (int)m_ClassesID.size(); j++){ pRecord = m_pTable->Get_Record(j); switch (iParam){ case 0: //sum pRecord->Set_Value(iField, pSum[j]); break; case 1: //average pRecord->Set_Value(iField, pSum[j] / (float) m_pCount[j]); break; case 2: //variance fMean = pSum[j] / (float) m_pCount[j]; pRecord->Set_Value(iField, pVar[j] / (float) m_pCount[j] - fMean * fMean); break; case 3: //min pRecord->Set_Value(iField, pMin[j]); break; case 4: //max pRecord->Set_Value(iField, pMax[j]); break; default: break; }//switch }//for }//if }//for }//method /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/Shapes_Summary.h000066400000000000000000000055221224124640700241220ustar00rootroot00000000000000/********************************************************** * Version $Id: Shapes_Summary.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* Summarize.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "doc_pdf.h" #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Summary_PDF : public CSG_Doc_PDF { public: CShapes_Summary_PDF(); virtual ~CShapes_Summary_PDF(); void AddClassSummaryPage(CSG_Shapes*, CSG_Table*, int, CSG_String); void AddSummaryStatisticsPage(CSG_Table* pTable); private: void AddBarGraphStatistics(CSG_Points &, CSG_String*, const CSG_Rect &); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CShapes_Summary : public CSG_Module { public: CShapes_Summary(void); virtual ~CShapes_Summary(void); protected: virtual bool On_Execute(void); private: int m_iField; CSG_Shapes *m_pShapes; CSG_Table *m_pTable; bool *m_bIncludeParam; std::vector m_ClassesID; int *m_pClasses; int *m_pCount; CSG_Parameters *m_pExtraParameters; CShapes_Summary_PDF m_DocEngine; void Summarize(); void CreatePDFDocs(); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/doc_pdf.cpp000066400000000000000000001442051224124640700231150ustar00rootroot00000000000000/********************************************************** * Version $Id: doc_pdf.cpp 1261 2011-12-16 15:12:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_pdf // // // //-------------------------------------------------------// // // // doc_pdf.cpp // // // // Copyright (C) 2005 by // // Victor Olaya, Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. // // // // This library is free software; you can redistribute // // it and/or modify it under the terms of the GNU Lesser // // General Public License as published by the Free // // Software Foundation, version 2.1 of the License. // // // // This library 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 Lesser General Public // // License for more details. // // // // You should have received a copy of the GNU Lesser // // General Public License along with this program; if // // not, write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // // e-mail: oconrad@saga-gis.org // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef _SAGA_DONOTUSE_HARU /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "doc_pdf.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define PDF_PAGE_WIDTH_A4 595.276 #define PDF_PAGE_HEIGHT_A4 841.89 #define PDF_PAGE_HEIGHT_A4_M 0.297 #define PDF_PAGE_WIDTH_A3 PDF_PAGE_HEIGHT_A4 #define PDF_PAGE_HEIGHT_A3 (PDF_PAGE_HEIGHT_A4 * sqrt(2.0)) #define PDF_METER_TO_POINT (PDF_PAGE_HEIGHT_A4 / PDF_PAGE_HEIGHT_A4_M) #define PDF_POINT_TO_METER (PDF_PAGE_HEIGHT_A4_M / PDF_PAGE_HEIGHT_A4) //--------------------------------------------------------- #define PDF_GET_R(c) (float)(SG_GET_R(c) / 255.0) #define PDF_GET_G(c) (float)(SG_GET_G(c) / 255.0) #define PDF_GET_B(c) (float)(SG_GET_B(c) / 255.0) /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Doc_PDF::CSG_Doc_PDF(void) { m_pPDF = NULL; Layout_Set_Box_Space(5, false); Open(); } //--------------------------------------------------------- CSG_Doc_PDF::CSG_Doc_PDF(TSG_PDF_Page_Size Size, int Orientation, const SG_Char *Title) { m_pPDF = NULL; Layout_Set_Box_Space(5, false); Open(Size, Orientation, Title); } //--------------------------------------------------------- CSG_Doc_PDF::~CSG_Doc_PDF(void) { Close(); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- const SG_Char * CSG_Doc_PDF::Get_Version(void) { static CSG_String s = CSG_String::Format(SG_T("Haru Free PDF Library, Version %s"), HPDF_VERSION_TEXT); return( s ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::Open(const SG_Char *Title) { return( Open(PDF_PAGE_SIZE_A4, PDF_PAGE_ORIENTATION_PORTRAIT, Title) ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Open(TSG_PDF_Page_Size Size, int Orientation, const SG_Char *Title) { if( Close() ) { m_pPDF = HPDF_New(NULL, NULL); m_pOutline_Last_Level_0 = NULL; m_pOutline_Last_Level_1 = NULL; m_pOutline_Last_Level_2 = NULL; Set_Size_Page(Size, Orientation); if( Title && *Title ) { Add_Page_Title(Title); } return( true ); } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Close(void) { if( m_pPDF ) { try { HPDF_Free(m_pPDF); } catch(...) { return( false ); } } m_pPDF = NULL; m_pPage = NULL; m_nPages = 0; return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::Save(const SG_Char *FileName) { if( m_pPDF && m_nPages > 0 && SG_Dir_Create(SG_File_Get_Path(FileName)) ) { try { return( HPDF_SaveToFile(m_pPDF, CSG_String(FileName)) == HPDF_OK ); } catch(...) {} } SG_UI_Msg_Add_Error(_TL("[ERR] Could not save PDF file.")); return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- double CSG_Doc_PDF::Get_Page_To_Meter(void) { return( PDF_POINT_TO_METER ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- struct _HPDF_Dict_Rec * CSG_Doc_PDF::_Get_Font(TSG_PDF_Font_Type Font) { switch( Font ) { default: case PDF_FONT_Helvetica: return( HPDF_GetFont(m_pPDF, "Helvetica" , NULL) ); case PDF_FONT_Helvetica_Bold: return( HPDF_GetFont(m_pPDF, "Helvetica-Bold" , NULL) ); case PDF_FONT_Helvetica_Oblique: return( HPDF_GetFont(m_pPDF, "Helvetica-Oblique" , NULL) ); case PDF_FONT_Helvetica_BoldOblique: return( HPDF_GetFont(m_pPDF, "Helvetica-BoldOblique", NULL) ); case PDF_FONT_Times_Roman: return( HPDF_GetFont(m_pPDF, "Times-Roman" , NULL) ); case PDF_FONT_Times_Bold: return( HPDF_GetFont(m_pPDF, "Times-Bold" , NULL) ); case PDF_FONT_Times_Italic: return( HPDF_GetFont(m_pPDF, "Times-Italic" , NULL) ); case PDF_FONT_Times_BoldItalic: return( HPDF_GetFont(m_pPDF, "Times-BoldItalic" , NULL) ); case PDF_FONT_Courier: return( HPDF_GetFont(m_pPDF, "Courier" , NULL) ); case PDF_FONT_Courier_Bold: return( HPDF_GetFont(m_pPDF, "Courier-Bold" , NULL) ); case PDF_FONT_Courier_Oblique: return( HPDF_GetFont(m_pPDF, "Courier-Oblique" , NULL) ); case PDF_FONT_Courier_BoldOblique: return( HPDF_GetFont(m_pPDF, "Courier-BoldOblique" , NULL) ); case PDF_FONT_Symbol: return( HPDF_GetFont(m_pPDF, "Symbol" , NULL) ); case PDF_FONT_ZapfDingbats: return( HPDF_GetFont(m_pPDF, "ZapfDingbats" , NULL) ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::Layout_Add_Box(double xMin_Percent, double yMin_Percent, double xMax_Percent, double yMax_Percent, const CSG_String &ID) { if( m_Boxes_Percent.Add(xMin_Percent, yMin_Percent, xMax_Percent, yMax_Percent) ) { m_Boxes.Add(); m_Boxes_ID.Add(ID); _Layout_Set_Box(m_Boxes.Get_Count() - 1); return( true ); } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Layout_Add_Box(const CSG_Rect &Box_Percent, const CSG_String &ID) { return( Layout_Add_Box(Box_Percent.Get_XMin(), Box_Percent.Get_YMin(), Box_Percent.Get_XMax(), Box_Percent.Get_YMax(), ID) ); } //--------------------------------------------------------- const CSG_Rect & CSG_Doc_PDF::Layout_Get_Box(const CSG_String &ID) { for(int i=0; i= 0 && iBox < m_Boxes.Get_Count() && iBox < m_Boxes_Percent.Get_Count() ) { m_Boxes[iBox].Assign( m_Size_Margins.Get_XMin() + 0.01 * m_Boxes_Percent[iBox].Get_XMin() * m_Size_Margins.Get_XRange(), m_Size_Margins.Get_YMax() - 0.01 * m_Boxes_Percent[iBox].Get_YMax() * m_Size_Margins.Get_YRange(), m_Size_Margins.Get_XMin() + 0.01 * m_Boxes_Percent[iBox].Get_XMax() * m_Size_Margins.Get_XRange(), m_Size_Margins.Get_YMax() - 0.01 * m_Boxes_Percent[iBox].Get_YMin() * m_Size_Margins.Get_YRange() ); m_Boxes[iBox].Deflate(m_Boxes_Space, m_Boxes_Space_bPercent); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::_Fit_Rectangle(double &x, double &y, double &dx, double &dy, double XToY_Ratio, bool bShrink) { if( XToY_Ratio != 0.0 && dx != 0.0 && dy != 0.0 ) { if( XToY_Ratio > dx / dy ) { if( bShrink ) { XToY_Ratio = dx / XToY_Ratio; y += (dy - XToY_Ratio) / 2.0; dy = XToY_Ratio; } else { XToY_Ratio = dy * XToY_Ratio; x -= (dx - XToY_Ratio) / 2.0; dx = XToY_Ratio; } } else { if( bShrink ) { XToY_Ratio = dy * XToY_Ratio; x += (dx - XToY_Ratio) / 2.0; dx = XToY_Ratio; } else { XToY_Ratio = dx / XToY_Ratio; y -= (dy - XToY_Ratio) / 2.0; dy = XToY_Ratio; } } return( true ); } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::_Fit_Rectangle(CSG_Rect &r, double XToY_Ratio, bool bShrink) { double x, y, dx, dy; x = r.Get_XMin(); y = r.Get_YMin(); dx = r.Get_XRange(); dy = r.Get_YRange(); if( _Fit_Rectangle(x, y, dx, dy, XToY_Ratio, bShrink) ) { r.Assign(x, y, x + dx, y + dy); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::_Add_Outline_Item(const SG_Char *Title, struct _HPDF_Dict_Rec *pPage, TSG_PDF_Title_Level Level) { if( m_pPDF && pPage ) { HPDF_Outline pOutlineItem = NULL; switch( Level ) { case PDF_TITLE: pOutlineItem = m_pOutline_Last_Level_0 = HPDF_CreateOutline(m_pPDF, NULL, CSG_String(Title), NULL); break; case PDF_TITLE_01: if( m_pOutline_Last_Level_0 ) { pOutlineItem = m_pOutline_Last_Level_1 = HPDF_CreateOutline(m_pPDF, m_pOutline_Last_Level_0, CSG_String(Title), NULL); } break; case PDF_TITLE_02: if( m_pOutline_Last_Level_1 ) { pOutlineItem = m_pOutline_Last_Level_2 = HPDF_CreateOutline(m_pPDF, m_pOutline_Last_Level_1, CSG_String(Title), NULL); } break; case PDF_TITLE_NONE: if( m_pOutline_Last_Level_2 ) { pOutlineItem = HPDF_CreateOutline(m_pPDF, m_pOutline_Last_Level_2, CSG_String(Title), NULL); } break; } if( pOutlineItem ) { if( pPage ) { struct _HPDF_Array_Rec *pDestination = HPDF_Page_CreateDestination(pPage); HPDF_Destination_SetFit (pDestination); HPDF_Outline_SetDestination (pOutlineItem, pDestination); } return( true ); } } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Add_Outline_Item(const SG_Char *Title) { return( _Add_Outline_Item(Title, m_pPage, _Get_Lowest_Outline_Level()) ); } //--------------------------------------------------------- TSG_PDF_Title_Level CSG_Doc_PDF::_Get_Lowest_Outline_Level(void) { if( m_pOutline_Last_Level_2 ) { return( PDF_TITLE_NONE ); } else if( m_pOutline_Last_Level_1 ) { return( PDF_TITLE_02 ); } else if( m_pOutline_Last_Level_0 ) { return( PDF_TITLE_01 ); } return( PDF_TITLE ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::Add_Page(void) { return( Add_Page(m_Size_Paper.Get_XRange(), m_Size_Paper.Get_YRange()) ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Add_Page(TSG_PDF_Page_Size Size, int Orientation) { if( Add_Page() ) { return( Set_Size_Page(Size, Orientation) ); } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Add_Page(double Width, double Height) { if( m_pPDF ) { m_nPages++; m_pPage = HPDF_AddPage(m_pPDF); Set_Size_Page(Width, Height); HPDF_Page_SetRGBStroke (m_pPage, 0.0, 0.0, 0.0); HPDF_Page_SetRGBFill (m_pPage, 1.0, 1.0, 1.0); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::Set_Size_Page(TSG_PDF_Page_Size Size, int Orientation) { double Width, Height; switch( Size ) { case PDF_PAGE_SIZE_A4: default: Width = PDF_PAGE_WIDTH_A4; Height = PDF_PAGE_HEIGHT_A4; break; case PDF_PAGE_SIZE_A3: Width = PDF_PAGE_WIDTH_A3; Height = PDF_PAGE_HEIGHT_A3; break; } //----------------------------------------------------- if( Orientation == PDF_PAGE_ORIENTATION_LANDSCAPE ) { double a; a = Width; Width = Height; Height = a; } return( Set_Size_Page(Width, Height) ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Set_Size_Page(double Width, double Height) { if( Width > 0.0 && Height > 0.0 ) { m_Size_Paper.Assign(0.0, 0.0, Width, Height); m_Size_Margins = m_Size_Paper; m_Size_Margins.Deflate(10.0, false); _Layout_Set_Boxes(); if( m_pPage ) { HPDF_Page_SetWidth (m_pPage, (float)m_Size_Paper.Get_XRange()); HPDF_Page_SetHeight (m_pPage, (float)m_Size_Paper.Get_YRange()); } } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::Add_Page_Title(const SG_Char *Title, TSG_PDF_Title_Level Level, TSG_PDF_Page_Size Size, int Orientation) { bool bLine, bDestination, bPage; int FontSize; //----------------------------------------------------- if( Add_Page() ) { if( m_nPages % 2 - 1 ) { Add_Page(); } if( Size != PDF_PAGE_SIZE_PREVIOUS || Orientation != PDF_PAGE_ORIENTATION_PREVIOUS ) { Set_Size_Page(Size, Orientation); } //------------------------------------------------- switch( Level ) { case PDF_TITLE: FontSize = 26; bLine = true; bDestination = true; bPage = true; break; case PDF_TITLE_01: FontSize = 22; bLine = true; bDestination = false; bPage = true; break; case PDF_TITLE_02: FontSize = 20; bLine = false; bDestination = false; bPage = false; break; } _Add_Outline_Item(Title, m_pPage, Level); //------------------------------------------------- Draw_Text(Get_Margins().Get_XCenter(), Get_Margins().Get_YCenter(), Title, FontSize, PDF_STYLE_TEXT_ALIGN_H_CENTER, 0.0, SG_GET_RGB(0, 0, 0)); //------------------------------------------------- if( bLine ) { double y = Get_Margins().Get_YCenter() - 25.0; Draw_Line(Get_Margins().Get_XMin(), y, Get_Margins().Get_XMax(), y, 5, SG_GET_RGB(0, 0, 0), PDF_STYLE_LINE_END_ROUND); } if( bPage ) { Add_Page(); } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::_Set_Style_FillStroke(int Style, int Fill_Color, int Line_Color, int Line_Width) { if( Is_Ready_To_Draw() ) { if( Style & PDF_STYLE_POLYGON_STROKE ) { if( Style & PDF_STYLE_LINE_END_ROUND ) { HPDF_Page_SetLineCap(m_pPage, HPDF_ROUND_END); } else if( Style & PDF_STYLE_LINE_END_SQUARE ) { HPDF_Page_SetLineCap(m_pPage, HPDF_PROJECTING_SCUARE_END); } else // if( Style & PDF_STYLE_LINE_END_BUTT ) { HPDF_Page_SetLineCap(m_pPage, HPDF_BUTT_END); } if( Style & PDF_STYLE_LINE_JOIN_ROUND ) { HPDF_Page_SetLineJoin(m_pPage, HPDF_ROUND_JOIN); } else if( Style & PDF_STYLE_LINE_JOIN_BEVEL ) { HPDF_Page_SetLineJoin(m_pPage, HPDF_BEVEL_JOIN); } else // if( Style & PDF_STYLE_LINE_JOIN_MITER ) { HPDF_Page_SetLineJoin(m_pPage, HPDF_MITER_JOIN); } HPDF_Page_SetRGBStroke (m_pPage, PDF_GET_R(Line_Color), PDF_GET_G(Line_Color), PDF_GET_B(Line_Color)); HPDF_Page_SetLineWidth (m_pPage, (float)Line_Width); } //------------------------------------------------- if( Style & PDF_STYLE_POLYGON_FILL ) { HPDF_Page_SetRGBFill(m_pPage, PDF_GET_R(Fill_Color), PDF_GET_G(Fill_Color), PDF_GET_B(Fill_Color)); } return( true ); } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Draw_Point(double x, double y, double Width, int Style, int Fill_Color, int Line_Color, int Line_Width) { if( Is_Ready_To_Draw() ) { Width /= 2.0; //------------------------------------------------- // if( Style & PDF_STYLE_POINT_CIRCLE ) { } // else // if( Style & PDF_STYLE_POINT_SQUARE ) { return( Draw_Rectangle(x - Width, y - Width, x + Width, y + Width, Style, Fill_Color, Line_Color, Line_Width) ); } } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Draw_Line(double xa, double ya, double xb, double yb, int Width, int Color, int Style) { CSG_Points Points; Points.Add(xa, ya); Points.Add(xb, yb); return( Draw_Line(Points, Width, Color, Style) ); } bool CSG_Doc_PDF::Draw_Line(CSG_Points &Points, int Width, int Color, int Style) { if( Points.Get_Count() > 1 && _Set_Style_FillStroke(Style|PDF_STYLE_POLYGON_STROKE, 0, Color, Width) ) { HPDF_Page_MoveTo(m_pPage, (float)Points[0].x, (float)Points[0].y); for(int i=1; i 2 && _Set_Style_FillStroke(Style, Fill_Color, Line_Color, Line_Width) ) { HPDF_Page_MoveTo(m_pPage, (float)Points[0].x, (float)Points[0].y); for(int i=1; i 0 ) { for(int i=0; i= 0 ) { Strings.Add(String.Left(n)); String.Remove(0, n + 1); } if( Strings.Get_Count() > 0 ) { if( String.Length() > 0 ) { Strings.Add(String); } return( Draw_Text(x, y, Strings, Size, Style, Angle, Color, Font) ); } return( _Draw_Text(x, y, Text, Size, Style, Angle, Color, Font) ); } //--------------------------------------------------------- bool CSG_Doc_PDF::_Draw_Text(double x, double y, const SG_Char *Text, int Size, int Style, double Angle, int Color, TSG_PDF_Font_Type Font) { float Width, Height; if( m_pPage && Text && *Text != '\0' ) { double ax, ay, bx, by; HPDF_Page_SetFontAndSize(m_pPage, _Get_Font(Font), (float)Size); HPDF_Page_SetTextRenderingMode(m_pPage, HPDF_FILL_THEN_STROKE); HPDF_Page_SetLineWidth (m_pPage, 0); HPDF_Page_SetRGBStroke (m_pPage, PDF_GET_R(Color), PDF_GET_G(Color), PDF_GET_B(Color)); HPDF_Page_SetRGBFill (m_pPage, PDF_GET_R(Color), PDF_GET_G(Color), PDF_GET_B(Color)); Width = HPDF_Page_TextWidth(m_pPage, CSG_String(Text)) * (float)cos(Angle); Height = HPDF_Page_TextWidth(m_pPage, CSG_String(Text)) * (float)sin(Angle) + Size; //------------------------------------------------- if( Style & PDF_STYLE_TEXT_ALIGN_H_CENTER ) { ax = x - HPDF_Page_TextWidth(m_pPage, CSG_String(Text)) / 2.0; } else if( Style & PDF_STYLE_TEXT_ALIGN_H_RIGHT ) { ax = x - HPDF_Page_TextWidth(m_pPage, CSG_String(Text)); } else { ax = x; } bx = ax + HPDF_Page_TextWidth(m_pPage, CSG_String(Text)); if( Style & PDF_STYLE_TEXT_ALIGN_V_CENTER ) { ay = y - Size / 2.0; } else if( Style & PDF_STYLE_TEXT_ALIGN_V_TOP ) { ay = y - Size; } else { ay = y; } by = ay; //------------------------------------------------- HPDF_Page_BeginText(m_pPage); if( Angle != 0.0 ) { double dSin, dCos, dx, dy; dSin = sin(-Angle); dCos = cos(-Angle), dx = ax - x, dy = ay - y; ax = x + dCos * dx + dSin * dy; ay = y - dSin * dx + dCos * dy; dx = bx - x, dy = by - y; bx = x + dCos * dx + dSin * dy; by = y - dSin * dx + dCos * dy; dSin = sin(Angle); dCos = cos(Angle), HPDF_Page_SetTextMatrix(m_pPage, (float)dCos, (float)dSin, -(float)dSin, (float)dCos, (float)ax, (float)ay); } else { HPDF_Page_MoveTextPos(m_pPage, (float)ax, (float)ay); } HPDF_Page_ShowText(m_pPage, CSG_String(Text)); HPDF_Page_EndText(m_pPage); //------------------------------------------------- if( Style & PDF_STYLE_TEXT_UNDERLINE ) { double dx, dy; dy = 0.2 * Size * (ax - bx) / SG_Get_Distance(ax, ay, bx, by); dx = -0.2 * Size * (ay - by) / SG_Get_Distance(ax, ay, bx, by); Draw_Line(ax + dx, ay + dy, bx + dx, by + dy, (int)(0.1 * Size), Color); } if( Style & PDF_STYLE_TEXT_STROKE ) { double dx, dy; dy = -0.4 * Size * (ax - bx) / SG_Get_Distance(ax, ay, bx, by); dx = 0.4 * Size * (ay - by) / SG_Get_Distance(ax, ay, bx, by); Draw_Line(ax + dx, ay + dy, bx + dx, by + dy, (int)(0.1 * Size), Color); } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::Draw_Image(double x, double y, double dx, double dy, const SG_Char *FileName) { bool bKeepRatio = true; double nx, ny; HPDF_Image pImage = NULL; //----------------------------------------------------- if( m_pPage && SG_File_Exists(FileName) && dx > 0.0 && dy > 0.0 ) { if( SG_File_Cmp_Extension(FileName, SG_T("png")) ) { try { pImage = HPDF_LoadPngImageFromFile (m_pPDF, CSG_String(FileName)); } catch(...) {} } else if( SG_File_Cmp_Extension(FileName, SG_T("jpg")) ) { try { pImage = HPDF_LoadJpegImageFromFile(m_pPDF, CSG_String(FileName)); } catch(...) {} } } //----------------------------------------------------- if( pImage && (nx = HPDF_Image_GetWidth(pImage)) > 0 && (ny = HPDF_Image_GetHeight(pImage)) > 0 ) { if( bKeepRatio ) { _Fit_Rectangle(x, y, dx, dy, nx / ny, true); } HPDF_Page_DrawImage(m_pPage, pImage, (float)x, (float)y, (float)dx, (float)dy); return( true ); } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Draw_Image(const CSG_Rect &r, const SG_Char *FileName) { return( Draw_Image(r.Get_XMin(), r.Get_YMin(), r.Get_XRange(), r.Get_YRange(), FileName) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::Draw_Graticule(const CSG_Rect &r, const CSG_Rect &rWorld, int Size) { if( Is_Ready_To_Draw() ) { CSG_Rect rRuler, rFrame(r); rFrame.Inflate(Size, false); Draw_Rectangle(rFrame, PDF_STYLE_POLYGON_STROKE); Draw_Rectangle(r , PDF_STYLE_POLYGON_STROKE); rRuler.Assign(r.Get_XMin(), r.Get_YMax(), r.Get_XMax(), rFrame.Get_YMax()); _Draw_Ruler(rRuler, rWorld.Get_XMin(), rWorld.Get_XMax() , true , true , false); rRuler.Assign(r.Get_XMin(), r.Get_YMin(), r.Get_XMax(), rFrame.Get_YMin()); _Draw_Ruler(rRuler, 0.0 , rWorld.Get_XRange(), true , true , true); rRuler.Assign(r.Get_XMin(), r.Get_YMin(), rFrame.Get_XMin(), r.Get_YMax()); _Draw_Ruler(rRuler, rWorld.Get_YMin(), rWorld.Get_YMax() , false, false, false); rRuler.Assign(r.Get_XMax(), r.Get_YMin(), rFrame.Get_XMax(), r.Get_YMax()); _Draw_Ruler(rRuler, 0.0 , rWorld.Get_YRange(), false, false, true); return( true ); } return( false ); } //--------------------------------------------------------- #define RULER_TEXT_SPACE 4 //--------------------------------------------------------- bool CSG_Doc_PDF::_Draw_Ruler(const CSG_Rect &r, double zMin, double zMax, bool bHorizontal, bool bAscendent, bool bTickAtTop) { int Decimals, FontSize; double xOff, yOff, Width, Height, Height_Tick, z, dz, zToDC, zDC, zPos, tPos; CSG_String s; //----------------------------------------------------- Width = bHorizontal ? r.Get_XRange() : r.Get_YRange(); Height = bHorizontal ? r.Get_YRange() : r.Get_XRange(); if( Is_Ready_To_Draw() && zMin < zMax && Width > 0 && Height > 0 ) { xOff = r.Get_XMin(); yOff = r.Get_YMax(); FontSize = (int)(0.45 * (double)Height); HPDF_Page_SetFontAndSize(m_pPage, _Get_Font(PDF_FONT_DEFAULT), (float)FontSize); Height_Tick = (int)(0.3 * (double)Height); //------------------------------------------------- zToDC = (double)Width / (zMax - zMin); dz = pow(10.0, floor(log10(zMax - zMin)) - 1.0); Decimals = dz >= 1.0 ? 0 : (int)fabs(log10(dz)); s.Printf(SG_T("%.*f"), Decimals, zMax); zDC = HPDF_Page_TextWidth(m_pPage, CSG_String(s)); while( zToDC * dz < zDC + RULER_TEXT_SPACE ) { dz *= 2; } //------------------------------------------------- z = dz * floor(zMin / dz); if( z < zMin ) z += dz; for(; z<=zMax; z+=dz) { s.Printf(SG_T("%.*f"), Decimals, z); zDC = bAscendent ? zToDC * (z - zMin) : Width - zToDC * (z - zMin); if( bHorizontal ) { zPos = xOff + zDC; if( bTickAtTop ) { tPos = yOff; Draw_Line(zPos, tPos - Height_Tick, zPos, yOff); Draw_Text(zPos, tPos - Height_Tick, s, FontSize, PDF_STYLE_TEXT_ALIGN_H_CENTER|PDF_STYLE_TEXT_ALIGN_V_TOP, 0.0); } else { tPos = yOff - Height; Draw_Line(zPos, tPos + Height_Tick, zPos, tPos); Draw_Text(zPos, tPos + Height_Tick, s, FontSize, PDF_STYLE_TEXT_ALIGN_H_CENTER|PDF_STYLE_TEXT_ALIGN_V_BOTTOM, 0.0); } } else { zPos = yOff - zDC; if( bTickAtTop ) { tPos = xOff; Draw_Line(tPos + Height_Tick, zPos, tPos, zPos); Draw_Text(tPos + Height_Tick, zPos, s, FontSize, PDF_STYLE_TEXT_ALIGN_H_CENTER|PDF_STYLE_TEXT_ALIGN_V_TOP, M_DEG_TO_RAD * 90.0); } else { tPos = xOff + Height; Draw_Line(tPos - Height_Tick, zPos, tPos, zPos); Draw_Text(tPos - Height_Tick, zPos, s, FontSize, PDF_STYLE_TEXT_ALIGN_H_CENTER|PDF_STYLE_TEXT_ALIGN_V_BOTTOM, M_DEG_TO_RAD * 90.0); } } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::_Draw_Table(CSG_Rect r, CSG_Table *pTable, int iRecord, int nRecords, double CellHeight, double HeaderHeightRel) { int iField, dyFont, dyFont_Hdr; double xPos, yPos, dxPos, dyPos, dyPos_Hdr, xSpace, ySpace, ySpace_Hdr; bool bAddHeader; CSG_Table_Record *pRecord; if( pTable && pTable->is_Valid() && iRecord < pTable->Get_Record_Count() ) { // Draw_Text(r.Get_XMin(), r.Get_YMax(), pTable->Get_Name(), 16); // the table's name should not be drawn here... dxPos = r.Get_XRange() / pTable->Get_Field_Count(); if( HeaderHeightRel < 1.0 ) HeaderHeightRel = 1.0; dyPos = CellHeight > 0.0 ? CellHeight : r.Get_YRange() / (nRecords + HeaderHeightRel); dyPos_Hdr = dyPos * HeaderHeightRel; dyFont = (int)(0.75 * dyPos); dyFont_Hdr = (int)(0.75 * dyPos_Hdr); ySpace = 0.1 * dyPos; ySpace_Hdr = 0.1 * dyPos_Hdr; xSpace = ySpace; nRecords += iRecord; if( nRecords > pTable->Get_Record_Count() ) { nRecords = pTable->Get_Record_Count(); } //------------------------------------------------- for(yPos=r.Get_YMax(), bAddHeader=true; iRecordGet_Field_Count(); iField++, xPos+=dxPos) { Draw_Rectangle(xPos, yPos, xPos + dxPos, yPos - dyPos_Hdr, PDF_STYLE_POLYGON_FILLSTROKE, SG_COLOR_GREY_LIGHT, SG_COLOR_BLACK, 0); Draw_Text(xPos + xSpace, yPos - ySpace_Hdr, pTable->Get_Field_Name(iField), dyFont_Hdr, PDF_STYLE_TEXT_ALIGN_H_LEFT|PDF_STYLE_TEXT_ALIGN_V_TOP); } yPos -= dyPos_Hdr; bAddHeader = false; } //--------------------------------------------- pRecord = pTable->Get_Record(iRecord); for(iField=0, xPos=r.Get_XMin(); iFieldGet_Field_Count(); iField++, xPos+=dxPos) { Draw_Rectangle(xPos, yPos, xPos + dxPos, yPos - dyPos, PDF_STYLE_POLYGON_STROKE, SG_COLOR_WHITE, SG_COLOR_BLACK, 0); Draw_Text(xPos + xSpace, yPos - ySpace, pRecord->asString(iField), dyFont, PDF_STYLE_TEXT_ALIGN_H_LEFT|PDF_STYLE_TEXT_ALIGN_V_TOP); } } return( true ); } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Draw_Table(const CSG_Rect &r, CSG_Table *pTable, double CellHeight, double HeaderHeightRel) { if( pTable && pTable->is_Valid() ) { return( _Draw_Table(r, pTable, 0, pTable->Get_Record_Count(), CellHeight, HeaderHeightRel) ); } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Draw_Table(const CSG_Rect &r, CSG_Table *pTable, int nColumns, double CellHeight, double HeaderHeightRel) { if( pTable && pTable->is_Valid() && nColumns > 1 ) { int nRecords; double dx, dxSpace; CSG_Rect rColumn(r), rTable(r); dxSpace = 4; rTable.Inflate(dxSpace, 0.0, false); dx = rTable.Get_XRange() / (double)nColumns; nRecords = pTable->Get_Record_Count() / nColumns; for(int i=0, iRecord=0; iis_Valid() ) { int iPart, iPoint; TSG_Point Point; CSG_Points Points; for(iPart=0; iPartGet_Part_Count(); iPart++) { Points.Clear(); for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { Point = pShape->Get_Point(iPoint, iPart); Point.x = r.Get_XMin() + World2PDF * (Point.x - xMin); Point.y = r.Get_YMin() + World2PDF * (Point.y - yMin); Points.Add(Point.x, Point.y); } switch( pShape->Get_Type() ) { case SHAPE_TYPE_Point: case SHAPE_TYPE_Points: for(iPoint=0; iPointis_Lake(iPart) ) { Draw_Polygon(Points, PDF_STYLE_POLYGON_FILLSTROKE, SG_COLOR_WHITE, Line_Color, Line_Width); } else { Draw_Polygon(Points, Style, Fill_Color, Line_Color, Line_Width); } break; } } return( true ); } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Draw_Shape(const CSG_Rect &r, CSG_Shape *pShape, int Style, int Fill_Color, int Line_Color, int Line_Width, CSG_Rect *prWorld) { double World2PDF; CSG_Rect rWorld, rFit; if( pShape && pShape->is_Valid() && r.Get_XRange() > 0.0 && r.Get_YRange() > 0.0 ) { rWorld = prWorld ? *prWorld : pShape->Get_Extent(); if( rWorld.Get_XRange() > 0.0 && rWorld.Get_YRange() > 0.0 ) { _Fit_Rectangle(rFit = r, rWorld.Get_XRange() / rWorld.Get_YRange(), true); World2PDF = rFit.Get_XRange() / rWorld.Get_XRange(); _Draw_Shape(rFit, pShape, rWorld.Get_XMin(), rWorld.Get_YMin(), World2PDF, Style, Fill_Color, Line_Color, Line_Width, Line_Width); return( true ); } } return( false ); } //--------------------------------------------------------- bool CSG_Doc_PDF::Draw_Shapes(const CSG_Rect &r, CSG_Shapes *pShapes, int Style, int Fill_Color, int Line_Color, int Line_Width, CSG_Rect *prWorld) { double World2PDF; CSG_Rect rWorld, rFit; if( pShapes && pShapes->is_Valid() && r.Get_XRange() > 0.0 && r.Get_YRange() > 0.0 ) { rWorld = prWorld ? *prWorld : pShapes->Get_Extent(); if( rWorld.Get_XRange() > 0.0 && rWorld.Get_YRange() > 0.0 ) { _Fit_Rectangle(rFit = r, rWorld.Get_XRange() / rWorld.Get_YRange(), true); World2PDF = rFit.Get_XRange() / rWorld.Get_XRange(); for(int iShape=0; iShapeGet_Count(); iShape++) { _Draw_Shape(rFit, pShapes->Get_Shape(iShape), rWorld.Get_XMin(), rWorld.Get_YMin(), World2PDF, Style, Fill_Color, Line_Color, Line_Width, Line_Width); } return( true ); } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_Doc_PDF::Draw_Grid(const CSG_Rect &r, CSG_Grid *pGrid, const CSG_Colors &Colors, double zMin, double zMax, int Style, CSG_Rect *prWorld) { double x, y, z, d, xFit, yFit, dFit; CSG_Rect rWorld, rFit; if( Is_Ready_To_Draw() && pGrid && pGrid->is_Valid() && pGrid->Get_ZRange() > 0.0 ) { rWorld = prWorld ? *prWorld : pGrid->Get_Extent(); if( rWorld.Get_XRange() > 0.0 && rWorld.Get_YRange() > 0.0 ) { _Fit_Rectangle(rFit = r, rWorld.Get_XRange() / rWorld.Get_YRange(), true); dFit = 1.0; d = dFit * (rWorld.Get_XRange() / rFit.Get_XRange()); if( zMin >= zMax ) { zMin = pGrid->Get_ZMin(); zMax = pGrid->Get_ZMax(); } zMax = Colors.Get_Count() / (zMax - zMin); for(y=rWorld.Get_YMin(), yFit=rFit.Get_YMin(); yFitGet_Extent().Get_YMax(); y++, yFit+=dFit, y+=d) { for(x=rWorld.Get_XMin(), xFit=rFit.Get_XMin(); xFitGet_Extent().Get_XMax(); x++, xFit+=dFit, x+=d) { if( pGrid->Get_Value(x, y, z) ) { Draw_Point(xFit, yFit, dFit, PDF_STYLE_POINT_SQUARE|PDF_STYLE_POLYGON_FILL, Colors.Get_Color((int)(zMax * (z - zMin)))); } } } return( true ); } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CSG_Doc_PDF::Draw_Curve(CSG_Points &Data, const CSG_Rect &r, int iGraphType) { /* int i; int iMag; int iNumLines; int iNumData; float fMinLine = 0; float fWidth; float fMax, fMin; float fStep; float fX, fY; float fMaxX, fMinX; float fOffsetX; CSG_String sValue; CSG_Points Points; fMin = fMax = Data[0].y; for (i = 0; i < Data.Get_Count(); i++) { if (Data[i].y > fMax) { fMax = Data[i].y; } if (Data[i].y < fMin) { fMin = Data[i].y; } if (iGraphType == PDF_GRAPH_TYPE_BARS){ fMin = M_GET_MIN(0, fMin); } } if (fMin != fMax){ iMag = (int) (log(fMax - fMin) / log(10.0)); fStep = (float) ((int) pow(10.0, (double) iMag)); if (fStep == 0) { fStep = 1.; } if (fMin < 0) { iMag = (int) (log(fabs(fMin)) / log(10.0)); fMinLine = -(int) pow(10.0, (double) iMag); } else { fMinLine=(int)(((int)(fMin/fStep)) *fStep); } iNumLines = (int) ((fMax - fMin) / fStep); while (iNumLines < 8) { fStep = fStep / 2.0; iNumLines = (int) ((fMax - fMin) / fStep); } iNumLines = (int) ((fMax - fMinLine) / fStep); } else{ if (fMin > 0) { fStep = fMin = 0; iNumLines = 1; fMinLine = fMax; } else if (fMin < 0) { fStep = 0; fMin = fMin - 1; fMinLine = fMax; } else { return; } } for (i = 0; i < iNumLines; i++) { fY = r.Get_YMax() - ((fMinLine + fStep * i - fMin) / (fMax - fMin)) * r.Get_YRange(); if (fY <= r.Get_YMax() && fY >= r.Get_YMin()) { fY = HPDF_Page_Height() - fY; } } if (iGraphType == PDF_GRAPH_TYPE_BARS) { fWidth = (float) r.Get_XRange() / (float) (Data.Get_Count()); for (i = 0; i < Data.Get_Count(); i++) { fX = r.Get_XMin() + i * fWidth; fY = r.Get_YMax(); fY = HPDF_Page_Height() - fY; Draw_Rectangle(fX, fY, fX + fWidth, fY - r.Get_YRange() * ((Data[i].y - fMin) / (fMax - fMin)), PDF_STYLE_POLYGON_FILLSTROKE, 0x660000); } } else { fWidth = (float) r.Get_XRange() / (float) (Data.Get_Count() - 1); fY = r.Get_YMin() + r.Get_YRange() - r.Get_YRange() * ((Data[0].y - fMin) / (fMax - fMin)); fY = HPDF_Page_Height() - fY; Points.Add(r.Get_XMin(), fY); for (i = 1; i < Data.Get_Count(); i++) { fY = r.Get_YMin() + r.Get_YRange() - r.Get_YRange() * ((Data[i].y - fMin) / (fMax - fMin)); fY = HPDF_Page_Height() - fY; Points.Add(r.Get_XMin() + i * fWidth, fY); } Draw_Line(Points, 3, 0x660000); } fMaxX = Data[Data.Get_Count() - 1].x; fMinX = Data[0].x; if (fMaxX != fMinX) { iMag = (int) (log(fMaxX - fMinX) / log(10.0)); fStep = (float) pow(10.0, (double) iMag); iNumData = (int) ((fMaxX-fMinX) / fStep); while (iNumData < 3) { fStep = fStep / 2.0; iNumData = (int) ((fMaxX-fMinX) / fStep); } fMinLine = (int)(((int)(fMinX/fStep)) * fStep); while (fMinLine= r.Get_XMin() && fX < r.Get_XMin() + r.Get_XRange()){ if (fabs(fStep * (float)i +fMinLine) > 100000) { sValue = SG_Get_String(fStep * (float)i +fMinLine); } else { sValue = SG_Get_String(fStep * (float)i + fMinLine, 2, true); } Draw_Text(fX, fY, sValue, 9, PDF_STYLE_TEXT_ALIGN_H_RIGHT); Draw_Line(fX, fY, fX, fY - 10, 1); } } } Draw_Line(r.Get_XMin(), HPDF_Page_Height() - r.Get_YMin(), r.Get_XMin(), HPDF_Page_Height() - r.Get_YMax(), 4); Draw_Line(r.Get_XMin(), HPDF_Page_Height() - r.Get_YMax(), r.Get_XMax(), HPDF_Page_Height() - r.Get_YMax(), 4); */ } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #else // #ifndef _SAGA_DONOTUSE_HARU #include "doc_pdf.h" //--------------------------------------------------------- const SG_Char * CSG_Doc_PDF::Get_Version(void) { return( NULL ); } CSG_Doc_PDF::CSG_Doc_PDF(void) { m_pPDF = NULL; } CSG_Doc_PDF::CSG_Doc_PDF(TSG_PDF_Page_Size Size, int Orientation, const SG_Char *Title) { m_pPDF = NULL; } CSG_Doc_PDF::~CSG_Doc_PDF(void) {} void CSG_Doc_PDF::Layout_Set_Box_Space(double Space, bool bPercent) {} void CSG_Doc_PDF::_Layout_Set_Boxes(void) {} void CSG_Doc_PDF::_Layout_Set_Box(int iBox) {} double CSG_Doc_PDF::Get_Page_To_Meter(void) { return( 1.0 ); } struct _HPDF_Dict_Rec * CSG_Doc_PDF::_Get_Font(TSG_PDF_Font_Type Font) { return( NULL ); } const CSG_Rect & CSG_Doc_PDF::Layout_Get_Box(const SG_Char *ID) { return( m_Size_Margins ); } TSG_PDF_Title_Level CSG_Doc_PDF::_Get_Lowest_Outline_Level(void) { return( PDF_TITLE_NONE ); } bool CSG_Doc_PDF::Open(const SG_Char *Title) { return( false ); } bool CSG_Doc_PDF::Open(TSG_PDF_Page_Size Size, int Orientation, const SG_Char *Title) { return( false ); } bool CSG_Doc_PDF::Close(void) { return( false ); } bool CSG_Doc_PDF::Save(const SG_Char *FileName) { return( false ); } bool CSG_Doc_PDF::Layout_Add_Box(double xMin_Percent, double yMin_Percent, double xMax_Percent, double yMax_Percent, const SG_Char *ID) { return( false ); } bool CSG_Doc_PDF::Layout_Add_Box(const CSG_Rect &Box_Percent, const SG_Char *ID) { return( false ); } bool CSG_Doc_PDF::_Fit_Rectangle(double &x, double &y, double &dx, double &dy, double XToY_Ratio, bool bShrink) { return( false ); } bool CSG_Doc_PDF::_Fit_Rectangle(CSG_Rect &r, double XToY_Ratio, bool bShrink) { return( false ); } bool CSG_Doc_PDF::_Add_Outline_Item(const SG_Char *Title, struct _HPDF_Dict_Rec *pPage, TSG_PDF_Title_Level Level) { return( false ); } bool CSG_Doc_PDF::Add_Outline_Item(const SG_Char *Title) { return( false ); } bool CSG_Doc_PDF::Add_Page(void) { return( false ); } bool CSG_Doc_PDF::Add_Page(TSG_PDF_Page_Size Size, int Orientation) { return( false ); } bool CSG_Doc_PDF::Add_Page(double Width, double Height) { return( false ); } bool CSG_Doc_PDF::Set_Size_Page(TSG_PDF_Page_Size Size, int Orientation) { return( false ); } bool CSG_Doc_PDF::Set_Size_Page(double Width, double Height) { return( false ); } bool CSG_Doc_PDF::Add_Page_Title(const SG_Char *Title, TSG_PDF_Title_Level Level, TSG_PDF_Page_Size Size, int Orientation) { return( false ); } bool CSG_Doc_PDF::_Set_Style_FillStroke(int Style, int Fill_Color, int Line_Color, int Line_Width) { return( false ); } bool CSG_Doc_PDF::Draw_Point(double x, double y, double Width, int Style, int Fill_Color, int Line_Color, int Line_Width) { return( false ); } bool CSG_Doc_PDF::Draw_Line(double xa, double ya, double xb, double yb, int Width, int Color, int Style) { return( false ); } bool CSG_Doc_PDF::Draw_Line(CSG_Points &Points, int Width, int Color, int Style) { return( false ); } bool CSG_Doc_PDF::Draw_Rectangle(double xa, double ya, double xb, double yb, int Style, int Fill_Color, int Line_Color, int Line_Width) { return( false ); } bool CSG_Doc_PDF::Draw_Rectangle(const CSG_Rect &r, int Style, int Fill_Color, int Line_Color, int Line_Width) { return( false ); } bool CSG_Doc_PDF::Draw_Polygon(CSG_Points &Points, int Style, int Fill_Color, int Line_Color, int Line_Width) { return( false ); } bool CSG_Doc_PDF::Draw_Text(double x, double y, CSG_Strings &Text, int Size, int Style, double Angle, int Color, TSG_PDF_Font_Type Font) { return( false ); } bool CSG_Doc_PDF::Draw_Text(double x, double y, const SG_Char *Text, int Size, int Style, double Angle, int Color, TSG_PDF_Font_Type Font) { return( false ); } bool CSG_Doc_PDF::_Draw_Text(double x, double y, const SG_Char *Text, int Size, int Style, double Angle, int Color, TSG_PDF_Font_Type Font) { return( false ); } bool CSG_Doc_PDF::Draw_Image(double x, double y, double dx, double dy, const SG_Char *FileName) { return( false ); } bool CSG_Doc_PDF::Draw_Image(const CSG_Rect &r, const SG_Char *FileName) { return( false ); } bool CSG_Doc_PDF::Draw_Graticule(const CSG_Rect &r, const CSG_Rect &rWorld, int Size) { return( false ); } bool CSG_Doc_PDF::_Draw_Ruler(const CSG_Rect &r, double zMin, double zMax, bool bHorizontal, bool bAscendent, bool bTickAtTop) { return( false ); } bool CSG_Doc_PDF::_Draw_Table(CSG_Rect r, CSG_Table *pTable, int iRecord, int nRecords, double CellHeight, double HeaderHeightRel) { return( false ); } bool CSG_Doc_PDF::Draw_Table(const CSG_Rect &r, CSG_Table *pTable, double CellHeight, double HeaderHeightRel) { return( false ); } bool CSG_Doc_PDF::Draw_Table(const CSG_Rect &r, CSG_Table *pTable, int nColumns, double CellHeight, double HeaderHeightRel) { return( false ); } bool CSG_Doc_PDF::_Draw_Shape(CSG_Rect r, CSG_Shape *pShape, double xMin, double yMin, double World2PDF, int Style, int Fill_Color, int Line_Color, int Line_Width, int Point_Width) { return( false ); } bool CSG_Doc_PDF::Draw_Shape(const CSG_Rect &r, CSG_Shape *pShape, int Style, int Fill_Color, int Line_Color, int Line_Width, CSG_Rect *prWorld) { return( false ); } bool CSG_Doc_PDF::Draw_Shapes(const CSG_Rect &r, CSG_Shapes *pShapes, int Style, int Fill_Color, int Line_Color, int Line_Width, CSG_Rect *prWorld) { return( false ); } bool CSG_Doc_PDF::Draw_Grid(const CSG_Rect &r, CSG_Grid *pGrid, const CSG_Colors &Colors, double zMin, double zMax, int Style, CSG_Rect *prWorld) { return( false ); } void CSG_Doc_PDF::Draw_Curve(CSG_Points &Data, const CSG_Rect &r, int iGraphType) {} #endif // #else // #ifndef _SAGA_DONOTUSE_HARU /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/docs/docs_pdf/doc_pdf.h000066400000000000000000000321751224124640700225640ustar00rootroot00000000000000/********************************************************** * Version $Id: doc_pdf.h 1261 2011-12-16 15:12:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // docs_pdf // // // //-------------------------------------------------------// // // // doc_pdf.h // // // // Copyright (C) 2005 by // // Victor Olaya, Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. // // // // This library is free software; you can redistribute // // it and/or modify it under the terms of the GNU Lesser // // General Public License as published by the Free // // Software Foundation, version 2.1 of the License. // // // // This library 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 Lesser General Public // // License for more details. // // // // You should have received a copy of the GNU Lesser // // General Public License along with this program; if // // not, write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // // e-mail: oconrad@saga-gis.org // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__doc_pdf_H #define HEADER_INCLUDED__doc_pdf_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define PDF_TABLE_CELL_HEIGHT_DEFAULT 20.0 #define PDF_TABLE_HEADER_HEIGHT 40.0 //--------------------------------------------------------- #define PDF_PAGE_ORIENTATION_PREVIOUS -1 #define PDF_PAGE_ORIENTATION_PORTRAIT 0 #define PDF_PAGE_ORIENTATION_LANDSCAPE 1 //--------------------------------------------------------- #define PDF_STYLE_POINT_CIRCLE 0x00000001 #define PDF_STYLE_POINT_SQUARE 0x00000002 #define PDF_STYLE_LINE_END_BUTT 0x00000004 #define PDF_STYLE_LINE_END_ROUND 0x00000008 #define PDF_STYLE_LINE_END_SQUARE 0x00000010 #define PDF_STYLE_LINE_JOIN_MITER 0x00000020 #define PDF_STYLE_LINE_JOIN_ROUND 0x00000040 #define PDF_STYLE_LINE_JOIN_BEVEL 0x00000080 #define PDF_STYLE_POLYGON_STROKE 0x00000100 #define PDF_STYLE_POLYGON_FILL 0x00000200 #define PDF_STYLE_POLYGON_FILLSTROKE (PDF_STYLE_POLYGON_STROKE|PDF_STYLE_POLYGON_FILL) //--------------------------------------------------------- #define PDF_STYLE_TEXT_ALIGN_H_LEFT 0x00000001 #define PDF_STYLE_TEXT_ALIGN_H_CENTER 0x00000002 #define PDF_STYLE_TEXT_ALIGN_H_RIGHT 0x00000004 #define PDF_STYLE_TEXT_ALIGN_V_TOP 0x00000008 #define PDF_STYLE_TEXT_ALIGN_V_CENTER 0x00000010 #define PDF_STYLE_TEXT_ALIGN_V_BOTTOM 0x00000020 #define PDF_STYLE_TEXT_UNDERLINE 0x00000040 #define PDF_STYLE_TEXT_STROKE 0x00000080 //---------------------------------------------------------- #define PDF_GRAPH_TYPE_BARS 1 #define PDF_GRAPH_TYPE_LINES 2 /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- typedef enum ESG_PDF_Font_Type { PDF_FONT_DEFAULT = 0, PDF_FONT_Helvetica = 0, PDF_FONT_Helvetica_Bold, PDF_FONT_Helvetica_Oblique, PDF_FONT_Helvetica_BoldOblique, PDF_FONT_Times_Roman, PDF_FONT_Times_Bold, PDF_FONT_Times_Italic, PDF_FONT_Times_BoldItalic, PDF_FONT_Courier, PDF_FONT_Courier_Bold, PDF_FONT_Courier_Oblique, PDF_FONT_Courier_BoldOblique, PDF_FONT_Symbol, PDF_FONT_ZapfDingbats } TSG_PDF_Font_Type; //--------------------------------------------------------- typedef enum ESG_PDF_Page_Size { PDF_PAGE_SIZE_A4 = 1, PDF_PAGE_SIZE_A3, PDF_PAGE_SIZE_PREVIOUS } TSG_PDF_Page_Size; //--------------------------------------------------------- typedef enum ESG_PDF_Title_Level { PDF_TITLE = 0, PDF_TITLE_01, PDF_TITLE_02, PDF_TITLE_NONE } TSG_PDF_Title_Level; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class docs_pdf_EXPORT CSG_Doc_PDF { public: CSG_Doc_PDF(void); CSG_Doc_PDF(TSG_PDF_Page_Size Size, int Orientation = PDF_PAGE_ORIENTATION_PORTRAIT, const SG_Char *Title = NULL); virtual ~CSG_Doc_PDF(void); static const SG_Char * Get_Version (void); bool Open (TSG_PDF_Page_Size Size = PDF_PAGE_SIZE_A4, int Orientation = PDF_PAGE_ORIENTATION_PORTRAIT, const SG_Char *Title = NULL); bool Open (const SG_Char *Title); bool Close (void); bool Save (const SG_Char *FileName); bool Is_Open (void) { return( m_pPDF != NULL ); } bool Is_Ready_To_Draw (void) { return( m_pPDF != NULL ); } static double Get_Page_To_Meter (void); bool Add_Page (void); bool Add_Page (TSG_PDF_Page_Size Size, int Orientation = PDF_PAGE_ORIENTATION_PORTRAIT); bool Add_Page (double Width, double Height); bool Add_Page_Title (const SG_Char *Title, TSG_PDF_Title_Level Level = PDF_TITLE, TSG_PDF_Page_Size Size = PDF_PAGE_SIZE_PREVIOUS, int Orientation = PDF_PAGE_ORIENTATION_PREVIOUS); bool Add_Outline_Item (const SG_Char *Title); bool Set_Size_Page (TSG_PDF_Page_Size Size, int Orientation = PDF_PAGE_ORIENTATION_PORTRAIT); bool Set_Size_Page (double Width, double Height); const CSG_Rect & Get_Size_Page (void) { return( m_Size_Paper ); } const CSG_Rect & Get_Margins (void) { return( m_Size_Margins ); } void Layout_Set_Box_Space (double Space, bool bPercent); bool Layout_Add_Box (double xMin_Percent, double yMin_Percent, double xMax_Percent, double yMax_Percent, const CSG_String &ID = ""); bool Layout_Add_Box (const CSG_Rect &Box_Percent, const CSG_String &ID = ""); const CSG_Rect & Layout_Get_Box (int iBox) { return( iBox >= 0 && iBox < m_Boxes.Get_Count() ? m_Boxes[iBox] : m_Size_Margins ); } const CSG_Rect & Layout_Get_Box (const CSG_String &ID = ""); bool Draw_Point (double x, double y, double Width, int Style = PDF_STYLE_POINT_SQUARE|PDF_STYLE_POLYGON_FILLSTROKE, int Fill_Color = SG_COLOR_WHITE, int Line_Color = SG_COLOR_BLACK, int Line_Width = 0); bool Draw_Line (double xa, double ya, double xb, double yb , int Width = 0, int Color = SG_COLOR_BLACK, int Style = 0); bool Draw_Line (CSG_Points &Points , int Width = 0, int Color = SG_COLOR_BLACK, int Style = 0); bool Draw_Rectangle (double xa, double ya, double xb, double yb , int Style = PDF_STYLE_POLYGON_FILLSTROKE, int Fill_Color = SG_COLOR_WHITE, int Line_Color = SG_COLOR_BLACK, int Line_Width = 0); bool Draw_Rectangle (const CSG_Rect &r , int Style = PDF_STYLE_POLYGON_FILLSTROKE, int Fill_Color = SG_COLOR_WHITE, int Line_Color = SG_COLOR_BLACK, int Line_Width = 0); bool Draw_Polygon (CSG_Points &Points , int Style = PDF_STYLE_POLYGON_FILLSTROKE, int Fill_Color = SG_COLOR_GREEN, int Line_Color = SG_COLOR_BLACK, int Line_Width = 0); bool Draw_Text (double x, double y, const SG_Char *Text, int Size, int Style = PDF_STYLE_TEXT_ALIGN_H_LEFT|PDF_STYLE_TEXT_ALIGN_V_TOP, double Angle = 0.0, int Color = SG_COLOR_BLACK, TSG_PDF_Font_Type Font = PDF_FONT_DEFAULT); bool Draw_Text (double x, double y, CSG_Strings &Text, int Size, int Style = PDF_STYLE_TEXT_ALIGN_H_LEFT|PDF_STYLE_TEXT_ALIGN_V_TOP, double Angle = 0.0, int Color = SG_COLOR_BLACK, TSG_PDF_Font_Type Font = PDF_FONT_DEFAULT); bool Draw_Image (double x, double y, double dx, double dy , const SG_Char *FileName); bool Draw_Image (const CSG_Rect &r , const SG_Char *FileName); bool Draw_Graticule (const CSG_Rect &r, const CSG_Rect &rWorld, int Size = 10); void Draw_Curve (CSG_Points &Data, const CSG_Rect &r, int iGraphType); bool Draw_Table (const CSG_Rect &r, CSG_Table *pTable , double CellHeight = 0.0, double HeaderHeightRel = 1.5); bool Draw_Table (const CSG_Rect &r, CSG_Table *pTable, int nColumns , double CellHeight = 0.0, double HeaderHeightRel = 1.5); bool Draw_Shape (const CSG_Rect &r, CSG_Shape *pShape , int Style = PDF_STYLE_POLYGON_FILLSTROKE, int Fill_Color = SG_COLOR_GREEN, int Line_Color = SG_COLOR_BLACK, int Line_Width = 0, CSG_Rect *prWorld = NULL); bool Draw_Shapes (const CSG_Rect &r, CSG_Shapes *pShapes, int Style = PDF_STYLE_POLYGON_FILLSTROKE, int Fill_Color = SG_COLOR_GREEN, int Line_Color = SG_COLOR_BLACK, int Line_Width = 0, CSG_Rect *prWorld = NULL); bool Draw_Grid (const CSG_Rect &r, CSG_Grid *pGrid, const CSG_Colors &Colors, double zMin = 0.0, double zMax = 0.0, int Style = 0, CSG_Rect *prWorld = NULL); protected: bool _Fit_Rectangle (double &x, double &y, double &dx, double &dy, double XToY_Ratio, bool bShrink); bool _Fit_Rectangle (CSG_Rect &r, double XToY_Ratio, bool bShrink); bool _Add_Outline_Item (const SG_Char *Title, struct _HPDF_Dict_Rec *pPage, TSG_PDF_Title_Level Level = PDF_TITLE); bool _Draw_Ruler (const CSG_Rect &r, double zMin, double zMax, bool bHorizontal, bool bAscendent, bool bTickAtTop); bool _Draw_Text (double x, double y, const SG_Char *Text, int Size, int Style, double Angle, int Color, TSG_PDF_Font_Type Font); bool _Draw_Table (CSG_Rect r, CSG_Table *pTable, int iRecord, int nRecords, double CellHeight, double HeaderHeightRel); bool _Draw_Shape (CSG_Rect r, CSG_Shape *pShape, double xMin, double yMin, double World2PDF, int Style = PDF_STYLE_POLYGON_FILLSTROKE, int Fill_Color = SG_COLOR_GREEN, int Line_Color = SG_COLOR_BLACK, int Line_Width = 0, int Point_Width = 5); TSG_PDF_Title_Level _Get_Lowest_Outline_Level (void); private: bool m_Boxes_Space_bPercent; int m_nPages; double m_Boxes_Space; CSG_Rect m_Size_Paper, m_Size_Margins; CSG_Rects m_Boxes_Percent, m_Boxes; CSG_Strings m_Boxes_ID; struct _HPDF_Doc_Rec *m_pPDF; struct _HPDF_Dict_Rec *m_pPage; struct _HPDF_Dict_Rec *m_pOutline_Last_Level_0, *m_pOutline_Last_Level_1, *m_pOutline_Last_Level_2; struct _HPDF_Dict_Rec * _Get_Font (TSG_PDF_Font_Type Font); void _Layout_Set_Boxes (void); void _Layout_Set_Box (int iBox); bool _Set_Style_FillStroke (int Style, int Fill_Color, int Line_Color, int Line_Width); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__doc_pdf_H saga-2.1.0+dfsg/src/modules_io/esri_e00/000077500000000000000000000000001224124640700177025ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/esri_e00/Makefile.am000066400000000000000000000000271224124640700217350ustar00rootroot00000000000000SUBDIRS = io_esri_e00 saga-2.1.0+dfsg/src/modules_io/esri_e00/Makefile.in000066400000000000000000000424531224124640700217570ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/esri_e00 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = io_esri_e00 all: all-recursive .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) --gnu src/modules_io/esri_e00/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/esri_e00/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/000077500000000000000000000000001224124640700217775ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/ESRI_E00_Import.cpp000066400000000000000000001165361224124640700252170ustar00rootroot00000000000000/********************************************************** * Version $Id: ESRI_E00_Import.cpp 1367 2012-04-05 08:42:24Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // ESRI_E00.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "ESRI_E00_Import.h" /////////////////////////////////////////////////////////// // // // Import // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CESRI_E00_Import::CESRI_E00_Import(void) { //----------------------------------------------------- // 1. info_Table... Set_Name (_TL("Import ESRI E00 File")); Set_Author (SG_T("(c) 2004 by O.Conrad")); Set_Description (_TW( "Import data sets from ESRI's E00 interchange format.\n\n" "This import filter is based on the E00 format analysis of the GRASS GIS module " "\'m.in.e00\' written by Michel J. Wurtz. Go to the " "GRASS GIS Hompage " "for more information.\n" "The \'E00Compr\' library " "written by Daniel Morissette has been used for e00 file access, so that " "compressed e00 files also can be read.\n") ); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Table_List( NULL , "TABLES" , _TL("Tables"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Shapes_List( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_Table_Output( NULL , "TABLE" , _TL("Table"), _TL("") ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), _TL("ESRI E00 Files|*.e00|All Files|*.*"), NULL, false, false, true ); Parameters.Add_Value( NULL , "BBND" , _TL("Import Extents"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "BTIC" , _TL("Import Tick Points"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Value( NULL , "BTABLES" , _TL("Import Tables"), _TL(""), PARAMETER_TYPE_Bool, false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CESRI_E00_Import::On_Execute(void) { int nLoaded = 0; m_bBnd = Parameters("BBND") ->asBool(); m_bTic = Parameters("BTIC") ->asBool(); m_bTables = Parameters("BTABLES") ->asBool(); m_pTables = Parameters("TABLES") ->asTableList(); m_pShapes = Parameters("SHAPES") ->asShapesList(); m_pGrids = Parameters("GRIDS") ->asGridList(); m_pTables ->Del_Items(); m_pShapes ->Del_Items(); m_pGrids ->Del_Items(); CSG_Strings fNames; if( Parameters("FILE")->asFilePath()->Get_FilePaths(fNames) && fNames.Get_Count() > 0 ) { for(int i=0; i 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- const char * CESRI_E00_Import::E00_Read_Line(void) { const char *line = E00ReadNextLine(m_hReadPtr); if( line == NULL ) { FILE *fp = fopen(SG_File_Make_Path(NULL, m_e00_Name, CSG_String::Format(SG_T("e%02d"), m_iFile + 1)), "rb"); if( fp ) { m_iFile++; int nInputLineNo = m_hReadPtr->nInputLineNo; E00ReadRewind(m_hReadPtr); fclose(m_hReadPtr->fp); m_hReadPtr->fp = fp; m_hReadPtr->nInputLineNo = nInputLineNo - 1; line = E00ReadNextLine(m_hReadPtr); } } return( line ); } //--------------------------------------------------------- bool CESRI_E00_Import::E00_Goto_Line(int iLine) { if( m_hReadPtr ) { if( m_iFile == 0 ) { E00ReadRewind(m_hReadPtr); } else { E00ReadClose(m_hReadPtr); m_hReadPtr = E00ReadOpen(m_e00_Name); m_iFile = 0; } while( E00_Read_Line() && m_hReadPtr->nInputLineNo < iLine ); return( m_hReadPtr->nInputLineNo == iLine ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CESRI_E00_Import::Load(const CSG_String &FileName) { bool bResult = false; const char *Line; m_hReadPtr = NULL; m_e00_Name = FileName; m_iFile = 0; //----------------------------------------------------- if( (m_hReadPtr = E00ReadOpen(m_e00_Name)) == NULL ) { Error_Set(CSG_String::Format(SG_T("%s: %s"), _TL("file not found") , FileName.c_str())); } else if( (Line = E00_Read_Line()) == NULL ) { Error_Set(CSG_String::Format(SG_T("%s: %s"), _TL("invalid E00 file"), FileName.c_str())); } else if( strncmp(Line, "EXP", 3) ) { Error_Set(CSG_String::Format(SG_T("%s: %d"), _TL("invalid E00 file"), FileName.c_str())); } //----------------------------------------------------- else { bResult = Load(); } //----------------------------------------------------- if( m_hReadPtr ) { E00ReadClose(m_hReadPtr); } return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CESRI_E00_Import::Load(void) { const char *line; int prec_grd, prec_arc, prec_lab, prec_pal; long current_line, offset_grd = 0, offset_arc = 0, offset_lab = 0, offset_pal = 0; double scale = 1.0; TSG_Shape_Type shape_type; CSG_Grid *pGrid; CSG_Shapes *pShapes; //----------------------------------------------------- m_pPAT = NULL; m_pAAT = NULL; //----------------------------------------------------- while( (line = E00_Read_Line()) != NULL && strncmp(line, "EOS", 3) ) { current_line = m_hReadPtr->nInputLineNo; // GRID SECTION if( !strncmp(line, "GRD ", 5) ) { offset_grd = current_line; prec_grd = line[5] - '2'; skip("EOG"); continue; } // ARC SECTION if( !strncmp(line, "ARC ", 5) ) { offset_arc = current_line; prec_arc = line[5] - '2'; skip_arc(prec_arc); continue; } // POLYGON TOPOLOGY if( !strncmp(line, "PAL ", 5) || !strncmp(line, "PFF ", 5) ) { offset_pal = current_line; prec_pal = line[5] - '2'; skip_pal(prec_pal); continue; } // CENTROID SECTION if( !strncmp(line, "CNT ", 5) ) { skip_dat(); continue; } // LABEL SECTION if( !strncmp(line, "LAB ", 5)) { offset_lab = current_line; prec_lab = line[5] - '2'; skip_lab(prec_lab); continue; } // INFO SECTION if( !strncmp(line, "IFO ", 5) ) { info_Get_Tables(); continue; } // PROJECTION INFOS if( !strncmp(line, "PRJ ", 5) ) { scale = getproj(); continue; } // Annotations (text). To be imported ? Does anybody have an idea ? if( !strncmp(line, "TXT ", 5) ) { skip_txt(line[5] - '2'); continue; } // Mask description ? Noting to do with it if( !strncmp(line, "MSK ", 5) ) { skip_msk(); continue; } // TOLERANCE SECTION. Should we really use it ? if( !strncmp(line, "TOL ", 5) ) { skip_dat(); continue; } // UNKNOW KEYWORD SECTION. Don't know what to do with. Does anybody have an idea? if( !strncmp(line, "LNK ", 5) ) { skip("END OF LINK DATA"); continue; } // SPATIAL INDEX SECTION. Noting to do with it if( !strncmp(line, "SIN ", 5) ) { skip("EOX"); continue; } // Line pattern and palette. Shade pattern and palette end same as e00 archive ! if( !strncmp(line, "CLN ", 5) || !strncmp(line, "CSH ", 5) ) { skip("EOS"); continue; } // Font description ? Noting to do with it if( !strncmp(line, "FNT ", 5) ) { skip("EOF"); continue; } // PLOT SECTION. Why should we import it ? if( !strncmp(line, "PLT ", 5) ) { skip("EOP"); continue; } // LOG SECTION. Nothing to do with it if( !strncmp(line, "LOG ", 5) ) { skip("EOL"); continue; } if( !strncmp(line, "RPL ", 5) // Specific to regions. Contains PAL formated data for each subclass || !strncmp(line, "RXP ", 5) // Specific to regions. Seems to link regions IDs to PAL polygons IDs || !strncmp(line, "TX6 ", 5) // Other kind of annotations not same termination. Other differences ? || !strncmp(line, "TX7 ", 5) ) // Very close from TX6. So same questions and same rules... { skip("JABBERWOCKY"); continue; } } //----------------------------------------------------- switch( m_pPAT ? (m_pAAT ? 3 : 2) : (m_pAAT ? 1 : 0) ) { case 0: default: shape_type = offset_arc != 0 ? SHAPE_TYPE_Line : SHAPE_TYPE_Point; break; case 1: // m_pAAT shape_type = SHAPE_TYPE_Line; break; case 2: // m_pPAT shape_type = offset_arc != 0 ? SHAPE_TYPE_Polygon : SHAPE_TYPE_Point; break; case 3: // m_pAAT && m_pPAT shape_type = offset_pal != 0 || offset_lab != 0 ? SHAPE_TYPE_Polygon : SHAPE_TYPE_Line; break; } //----------------------------------------------------- // Extracting useful information as noted before... //----------------------------------------------------- if( offset_grd > 0 ) { E00_Goto_Line(offset_grd); if( (pGrid = getraster (prec_grd, scale)) != NULL ) { pGrid->Set_Name(SG_File_Get_Name(m_e00_Name, false)); m_pGrids->Add_Item(pGrid); } } //----------------------------------------------------- if( offset_arc != 0 ) { E00_Goto_Line(offset_arc); if( (pShapes = getarcs (prec_arc, scale, shape_type)) != NULL ) { pShapes->Set_Name(SG_File_Get_Name(m_e00_Name, false)); m_pShapes->Add_Item(pShapes); } } //----------------------------------------------------- if( offset_lab != 0 && shape_type == SHAPE_TYPE_Point ) { E00_Goto_Line(offset_lab); if( (pShapes = getsites (prec_lab, scale)) != NULL ) { pShapes->Set_Name(SG_File_Get_Name(m_e00_Name, false)); m_pShapes->Add_Item(pShapes); } } //----------------------------------------------------- if( offset_lab != 0 && shape_type != SHAPE_TYPE_Point ) { E00_Goto_Line(offset_lab); if( (pShapes = getlabels(prec_lab, scale)) != NULL ) { pShapes->Set_Name(SG_File_Get_Name(m_e00_Name, false)); m_pShapes->Add_Item(pShapes); } } //----------------------------------------------------- if( !m_bTables ) { if( m_pPAT ) delete(m_pPAT); if( m_pAAT ) delete(m_pAAT); } return( true ); } /////////////////////////////////////////////////////////// // // // Grid // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Grid * CESRI_E00_Import::getraster(int prec, double scale) { const char *line; int x, y, ix; long rows, cols, depth, p[5]; float f[5]; double xres, yres, xmin, ymin, xmax, ymax, nul_val, d[3]; CSG_Grid *pGrid; //----------------------------------------------------- if( (line = E00_Read_Line()) == NULL ) return( NULL ); // sscanf(line, "%ld%ld%ld", &cols, &rows, &depth, &nul_val); sscanf(line, "%ld%ld%ld%lf", &cols, &rows, &depth, &nul_val); if( (line = E00_Read_Line()) == NULL ) return( NULL ); sscanf(line, "%lf%lf", &xres, &yres); if( (line = E00_Read_Line()) == NULL ) return( NULL ); sscanf(line, "%lf%lf", &xmin, &ymin); if( (line = E00_Read_Line()) == NULL ) return( NULL ); sscanf(line, "%lf%lf", &xmax, &ymax); xmax = xmax * scale; xmin = xmin * scale; ymax = ymax * scale; ymin = ymin * scale; xres = xres * scale; yres = yres * scale; xmin += xres / 2.0; // SAGA treats xmin/ymin as "pixel-as-point" and not as "pixel-as-area" ymin += yres / 2.0; if( depth == 2 && prec ) { depth = 3; } //----------------------------------------------------- switch( depth ) { default: pGrid = NULL; break; //----------------------------------------------------- case 1: pGrid = SG_Create_Grid(SG_DATATYPE_Int, cols, rows, xres, xmin, ymin); pGrid->Set_NoData_Value(nul_val); for(y=0; ySet_Value(x + ix, y, p[ix]); } } } } break; //----------------------------------------------------- case 2: pGrid = SG_Create_Grid(SG_DATATYPE_Float, cols, rows, xres, xmin, ymin); pGrid->Set_NoData_Value(nul_val); for(y=0; ySet_Value(x + ix, y, f[ix]); } } } } break; //----------------------------------------------------- case 3: pGrid = SG_Create_Grid(SG_DATATYPE_Double, cols, rows, xres, xmin, ymin); pGrid->Set_NoData_Value(nul_val); for(y=0; ySet_Value(x + ix, y, d[ix]); } } } } break; } //----------------------------------------------------- skip("EOG"); return( pGrid ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define ARC_FNODE 2 #define ARC_TNODE 3 #define ARC_LPOL 4 #define ARC_RPOL 5 //--------------------------------------------------------- CSG_Shapes * CESRI_E00_Import::getarcs(int prec, double scale, TSG_Shape_Type &shape_type) { const char *line; int covnum, cov_id, fnode, tnode, lpol, rpol, nPoints, iPoint; double x_buf[2], y_buf[2]; CSG_Shape *pShape; CSG_Shapes *pShapes; //----------------------------------------------------- pShapes = SG_Create_Shapes(shape_type); pShapes->Add_Field("ID" , SG_DATATYPE_Int); pShapes->Add_Field("ID#" , SG_DATATYPE_Int); pShapes->Add_Field("FNODE" , SG_DATATYPE_Int); pShapes->Add_Field("TNODE" , SG_DATATYPE_Int); pShapes->Add_Field("LPOL" , SG_DATATYPE_Int); pShapes->Add_Field("RPOL" , SG_DATATYPE_Int); Set_Progress(0, 100); //----------------------------------------------------- do { Process_Set_Text(CSG_String::Format(SG_T("Loaded arcs: %d"), pShapes->Get_Count())); if( (line = E00_Read_Line()) == NULL ) { covnum = -1; } else { sscanf(line, "%d %d %d %d %d %d %d", &covnum, &cov_id, &fnode, &tnode, &lpol, &rpol, &nPoints); } if( covnum != -1 ) { pShape = pShapes->Add_Shape(); pShape->Set_Value(0 , covnum); pShape->Set_Value(1 , cov_id); pShape->Set_Value(ARC_FNODE , fnode); pShape->Set_Value(ARC_TNODE , tnode); pShape->Set_Value(ARC_LPOL , lpol); pShape->Set_Value(ARC_RPOL , rpol); //--------------------------------------------- if( prec ) // double precision : 1 coord pair / line { for(iPoint=0; iPointAdd_Point(x_buf[0] * scale, y_buf[0] * scale); } } } //--------------------------------------------- else // single precision : 2 x,y pairs / line { for(iPoint=0; iPointAdd_Point(x_buf[0] * scale, y_buf[0] * scale); if( iPoint + 1 < nPoints ) { pShape->Add_Point(x_buf[1] * scale, y_buf[1] * scale); } } } } } } while( covnum != -1 && line && Process_Get_Okay(false) ); //----------------------------------------------------- if( pShapes->Get_Count() == 0 ) { delete(pShapes); shape_type = SHAPE_TYPE_Point; return( NULL ); } if( shape_type == SHAPE_TYPE_Polygon ) { pShapes = Arcs2Polygons(pShapes); Assign_Attributes(pShapes); } return( pShapes ); } //--------------------------------------------------------- CSG_Shapes * CESRI_E00_Import::Arcs2Polygons(CSG_Shapes *pArcs) { int iArc, nArcs, id; CSG_Shapes *pPolygons; //----------------------------------------------------- Process_Set_Text(_TL("Arcs to polygons")); pPolygons = SG_Create_Shapes(SHAPE_TYPE_Polygon); pPolygons->Add_Field("ID", SG_DATATYPE_Int); nArcs = pArcs->Get_Count(); //----------------------------------------------------- while( (iArc = pArcs->Get_Count() - 1) >= 0 && Set_Progress(nArcs - iArc - 1, nArcs) ) { id = pArcs->Get_Shape(iArc)->asInt(ARC_LPOL); if( id == pArcs->Get_Shape(iArc)->asInt(ARC_RPOL) ) { pArcs->Del_Shape(iArc); } else if( id > 1 ) { Arcs2Polygon(pArcs, pPolygons, id); } if( (iArc = pArcs->Get_Count() - 1) >= 0 ) { id = pArcs->Get_Shape(iArc)->asInt(ARC_RPOL); if( id > 1 ) { Arcs2Polygon(pArcs, pPolygons, id); } } } //----------------------------------------------------- delete( pArcs ); pPolygons->Make_Clean(); return( pPolygons ); } //--------------------------------------------------------- void CESRI_E00_Import::Arcs2Polygon(CSG_Shapes *pArcs, CSG_Shapes *pPolygons, int id) { int iShape, iPart, iPoint; CSG_Shape *pArc, *pShape; CSG_Shapes Arcs; //----------------------------------------------------- Arcs.Create(SHAPE_TYPE_Line); Arcs.Add_Field("FNODE", SG_DATATYPE_Int); Arcs.Add_Field("TNODE", SG_DATATYPE_Int); //----------------------------------------------------- for(iShape=pArcs->Get_Count()-1; iShape>=0; iShape--) { pShape = pArcs->Get_Shape(iShape); if( id == pShape->asInt(ARC_LPOL) ) { pArc = Arcs.Add_Shape(); pArc->Set_Value(0, pShape->asInt(ARC_FNODE)); pArc->Set_Value(1, pShape->asInt(ARC_TNODE)); for(iPoint=0; iPointGet_Point_Count(0); iPoint++) { pArc->Add_Point(pShape->Get_Point(iPoint, 0), 0); } if( pShape->asInt(ARC_RPOL) <= 1 ) { pArcs->Del_Shape(iShape); } else { pShape->Set_Value(ARC_LPOL, 1); } } else if( id == pShape->asInt(ARC_RPOL) ) { pArc = Arcs.Add_Shape(); pArc->Set_Value(1, pShape->asInt(ARC_FNODE)); pArc->Set_Value(0, pShape->asInt(ARC_TNODE)); for(iPoint=pShape->Get_Point_Count(0)-1; iPoint>=0; iPoint--) { pArc->Add_Point(pShape->Get_Point(iPoint, 0), 0); } if( pShape->asInt(ARC_LPOL) <= 1 ) { pArcs->Del_Shape(iShape); } else { pShape->Set_Value(ARC_RPOL, 1); } } } //----------------------------------------------------- if( Arcs.Get_Count() > 0 ) { iPart = 0; pShape = pPolygons->Add_Shape(); pShape->Set_Value(0, id); while( (pArc = Arcs.Get_Shape(0)) != NULL ) { do { for(iPoint=0; iPointGet_Point_Count(0); iPoint++) { pShape->Add_Point(pArc->Get_Point(iPoint, 0, false), iPart); } int fNode = pArc->asInt(0); int tNode = pArc->asInt(1); Arcs.Del_Shape(pArc); pArc = NULL; if( fNode != tNode ) { for(iShape=0; iShapeasInt(1) ) { pArc = Arcs.Get_Shape(iShape); } } } } while( pArc ); iPart++; } } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Shapes * CESRI_E00_Import::getlabels(int prec, double scale) // shape_type: LINE or AREA { const char *line; int num, id; // coverage-# and coverage-ID double x, y; CSG_Shapes *pShapes; CSG_Shape *pShape; pShapes = SG_Create_Shapes(SHAPE_TYPE_Point); pShapes->Add_Field("ID#" , SG_DATATYPE_Int); pShapes->Add_Field("ID" , SG_DATATYPE_Int); while( (line = E00_Read_Line()) != NULL ) { sscanf(line, "%d %d %lf %lf", &id, &num, &x, &y); if( id == -1 ) { break; } else { pShape = pShapes->Add_Shape(); pShape->Add_Point(x * scale, y * scale); pShape->Set_Value(0, num); pShape->Set_Value(1, id); //--------------------------------------------- E00_Read_Line(); // 4 values to skip if( prec ) { E00_Read_Line(); // on 2nd line when double precision } } } if( pShapes->Get_Count() <= 0 ) { delete( pShapes ); pShapes = NULL; } return( pShapes ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Shapes * CESRI_E00_Import::getsites(int prec, double scale) { const char *line; int id; double x, y; CSG_Shape *pShape; CSG_Shapes *pShapes; pShapes = SG_Create_Shapes(SHAPE_TYPE_Point); pShapes->Add_Field("ID", SG_DATATYPE_Int); while( (line = E00_Read_Line()) != NULL ) { sscanf(line, "%d %*d %lf %lf", &id, &x, &y); if( id == -1 ) { break; } pShape = pShapes->Add_Shape(); pShape->Add_Point(x * scale, y * scale); pShape->Set_Value(0, id); //------------------------------------------------- E00_Read_Line(); // 4 values to skip if( prec ) { E00_Read_Line(); // on 2nd line when double precision } } if( pShapes->Get_Count() <= 0 ) { delete( pShapes ); pShapes = NULL; } else { Assign_Attributes(pShapes); } return( pShapes ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- double CESRI_E00_Import::getproj(void) { const char *line; double scale = 1.0; while( (line = E00_Read_Line()) != NULL && strncmp(line, "EOP", 3) ) { if( !strncmp(line, "Units", 5) ) { sscanf(line + 6, "%lf", &scale); } } scale = 1.0 / scale; return( scale ); } /////////////////////////////////////////////////////////// // // // info section // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- struct info_Field { char Name[18]; // name of item int Position, // position in data line Size, // size for reading Type; // type of data }; //--------------------------------------------------------- struct info_Table { char Name[34], AI[4]; // XX if Arc/info file, spaces otherwise int uFields, // number of usable items in this table nFields, // number of items in this table ldr; // length of data record long nRecords, // number of data records length; // total length for one data line struct info_Field *Field; // One per field... }; //--------------------------------------------------------- // [06.06.2006] ESRI E00 Import crash fix, James Flemer int CESRI_E00_Import::info_Get_Tables(void) { const char *line; char tmp[12], *p; int i; CSG_String s; CSG_Table *pTable; struct info_Table info; //----------------------------------------------------- while( (line = E00_Read_Line()) != NULL && strncmp(line, "EOI", 3) ) { strncpy(info.Name, line, 32); info.Name[32] = 0; p = strchr(info.Name, ' '); if( p != NULL ) *p = 0; p = strchr(info.Name, '.'); if( p == 0 ) p = info.Name; else p++; s = p; strncpy(info.AI , line + 32, 2); info.AI[2] = 0; strncpy(tmp , line + 34, 4); tmp[ 4] = 0; info.uFields = atoi(tmp); strncpy(tmp , line + 38, 4); tmp[ 4] = 0; info.nFields = atoi(tmp); strncpy(tmp , line + 42, 4); tmp[ 4] = 0; info.ldr = atoi(tmp); strncpy(tmp , line + 46, 11); tmp[11] = 0; info.nRecords = atol(tmp); info.length = 0; info.Field = (struct info_Field *)malloc(info.nFields * sizeof(struct info_Field)); //--------------------------------------------- for(i=0; iAdd_Field("XMIN", SG_DATATYPE_Double); pShapes->Add_Field("YMIN", SG_DATATYPE_Double); pShapes->Add_Field("XMAX", SG_DATATYPE_Double); pShapes->Add_Field("YMAX", SG_DATATYPE_Double); CSG_Table_Record *pRecord = pTable->Get_Record(0); CSG_Shape *pShape = pShapes->Add_Shape(); pShape->Set_Value(0, pRecord->asDouble(0)); pShape->Set_Value(1, pRecord->asDouble(1)); pShape->Set_Value(2, pRecord->asDouble(2)); pShape->Set_Value(3, pRecord->asDouble(3)); pShape->Add_Point(pRecord->asDouble(0), pRecord->asDouble(1)); pShape->Add_Point(pRecord->asDouble(0), pRecord->asDouble(3)); pShape->Add_Point(pRecord->asDouble(2), pRecord->asDouble(3)); pShape->Add_Point(pRecord->asDouble(2), pRecord->asDouble(1)); m_pShapes->Add_Item(pShapes); } delete(pTable); } //--------------------------------------------- else if( !s.CmpNoCase(SG_T("tic")) ) // tick marks { if( m_bTic ) { CSG_Shapes *pShapes = SG_Create_Shapes(SHAPE_TYPE_Point, SG_T("Tick Points")); pShapes->Add_Field("ID", SG_DATATYPE_Int); pShapes->Add_Field("X" , SG_DATATYPE_Double); pShapes->Add_Field("Y" , SG_DATATYPE_Double); for(i=0; iGet_Record_Count(); i++) { CSG_Table_Record *pRecord = pTable->Get_Record(i); CSG_Shape *pShape = pShapes->Add_Shape(); pShape->Set_Value(0, pRecord->asInt (0)); pShape->Set_Value(1, pRecord->asDouble(1)); pShape->Set_Value(2, pRecord->asDouble(2)); pShape->Add_Point(pRecord->asDouble(1), pRecord->asDouble(2)); } m_pShapes->Add_Item(pShapes); } delete(pTable); } //--------------------------------------------- else if( m_bTables ) { m_pTables->Add_Item(pTable); } //--------------------------------------------- else if( pTable != m_pPAT && pTable != m_pAAT ) { delete(pTable); } } } //----------------------------------------------------- // 0 if none, 1 if AAT, 2 if PAT, 3 if both return( m_pPAT ? (m_pAAT ? 3 : 2) : (m_pAAT ? 1 : 0) ); } //--------------------------------------------------------- CSG_Table * CESRI_E00_Import::info_Get_Table(struct info_Table info) { char *buffer_record, *buffer_item; int iRecord, iField; CSG_Table *pTable; CSG_Table_Record *pRecord; //----------------------------------------------------- Process_Set_Text(CSG_String(info.Name)); buffer_record = (char *)malloc(info.length + 3); buffer_item = (char *)malloc(info.length + 3); pTable = SG_Create_Table(); pTable->Set_Name(CSG_String(info.Name)); //----------------------------------------------------- for(iField=0; iFieldAdd_Field(info.Field[iField].Name, SG_DATATYPE_Double); break; case 50: // short / long pTable->Add_Field(info.Field[iField].Name, SG_DATATYPE_Int); break; case 40: // float pTable->Add_Field(info.Field[iField].Name, SG_DATATYPE_Double); break; case 10: // short pTable->Add_Field(info.Field[iField].Name, SG_DATATYPE_Int); break; default: // string pTable->Add_Field(info.Field[iField].Name, SG_DATATYPE_String); break; } } //----------------------------------------------------- for(iRecord=0; iRecordAdd_Record(); for(iField=0; iFieldGet_Field_Type(iField) ) { default: pRecord->Set_Value(iField, atof(buffer_item)); break; case SG_DATATYPE_Int: pRecord->Set_Value(iField, atoi(buffer_item)); break; case SG_DATATYPE_String: pRecord->Set_Value(iField, CSG_String(buffer_item)); break; } } } //----------------------------------------------------- free(buffer_record); free(buffer_item); return( pTable ); } //--------------------------------------------------------- void CESRI_E00_Import::info_Skip_Table(struct info_Table info) { char *buffer_record; int iRecord; buffer_record = (char *)malloc(info.length + 3); for(iRecord=0; iRecordGet_Field_Count() <= 0 || !m_pPAT || m_pPAT->Get_Field_Count() <= 2 ) { return( false ); } Process_Set_Text(_TL("Assign attributes to shapes...")); int iField, off_Field = pShapes->Get_Field_Count(); for(iField=0; iFieldGet_Field_Count(); iField++) { pShapes->Add_Field(m_pPAT->Get_Field_Name(iField), m_pPAT->Get_Field_Type(iField)); } for(int i=0; iGet_Count() && Set_Progress(i, m_pPAT->Get_Count()); i++) { CSG_Table_Record *pRecord = m_pPAT->Get_Record(i); CSG_Shape *pShape = pShapes->Get_Shape(pRecord->asInt(2)); if( pShape ) { for(iField=0; iFieldGet_Field_Count(); iField++) { if( SG_Data_Type_is_Numeric(m_pPAT->Get_Field_Type(iField)) ) pShape->Set_Value(off_Field + iField, pRecord->asDouble(iField)); else pShape->Set_Value(off_Field + iField, pRecord->asString(iField)); } } } return( true ); /* pShapes->Set_Index(0, TABLE_INDEX_Ascending); m_pPAT ->Set_Index(3, TABLE_INDEX_Ascending); for(int iShape=0, off_Record=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape_byIndex(iShape); int id = pShape->asInt(0); for(int iRecord=off_Record; iRecordGet_Record_Count(); iRecord++) { CSG_Table_Record *pRecord = m_pPAT->Get_Record_byIndex(iRecord); if( id == pRecord->asInt(3) ) { for(iField=0; iFieldGet_Field_Count(); iField++) { if( SG_Data_Type_is_Numeric(m_pPAT->Get_Field_Type(iField)) ) pShape->Set_Value(off_Field + iField, pRecord->asDouble(iField)); else pShape->Set_Value(off_Field + iField, pRecord->asString(iField)); } off_Record++; break; } } } return( true );/**/ } /////////////////////////////////////////////////////////// // // // Skips // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CESRI_E00_Import::skip(char *end) { const char *line; int l = strlen(end); while( (line = E00_Read_Line()) != NULL && strncmp(line, end, l) ); } //--------------------------------------------------------- void CESRI_E00_Import::skip_dat(void) { const char *line; int i = 0; while( (line = E00_Read_Line()) != NULL && i != -1 ) { sscanf(line, "%d", &i); } } //--------------------------------------------------------- void CESRI_E00_Import::skip_msk(void) { const char *line; double xmin, ymin, xmax, ymax, res, sk; long xsize, ysize, nskip; if( (line = E00_Read_Line()) != NULL ) { sscanf(line, "%lf %lf %lf", &xmin, &ymin, &xmax); if( (line = E00_Read_Line()) != NULL ) { sscanf(line, "%lf %lf %ld %ld", &ymax, &res, &xsize, &ysize); sk = ((ymax - ymin) / res) * ((xmax - xmin) / res) / 32.0; nskip = (long)ceil(sk / 7.0); while( nskip-- ) { E00_Read_Line(); } } } } //--------------------------------------------------------- void CESRI_E00_Import::skip_arc(int prec) { const char *line; int i, covnum, nPoints; while( (line = E00_Read_Line()) != NULL ) { sscanf(line, "%d %*d %*d %*d %*d %*d %d", &covnum, &nPoints); if( covnum == -1 ) break; if( prec == 0 ) nPoints = (nPoints + 1) / 2; // number of coordinate lines for(i=0; i //--------------------------------------------------------- #ifdef io_esri_e00_EXPORTS #define io_esri_e00_EXPORT _SAGA_DLL_EXPORT #else #define io_esri_e00_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__io_esri_e00_H saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/Makefile.am000066400000000000000000000015101224124640700240300ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libio_esri_e00.la libio_esri_e00_la_SOURCES =\ ESRI_E00_Import.cpp\ MLB_Interface.cpp\ e00compr/cpl_conv.c\ e00compr/cpl_error.c\ e00compr/cpl_vsisimple.c\ e00compr/e00read.c\ e00compr/e00write.c\ ESRI_E00_Import.h\ MLB_Interface.h\ e00compr/cpl_conv.h\ e00compr/cpl_error.h\ e00compr/cpl_port.h\ e00compr/cpl_vsi.h\ e00compr/e00compr.h libio_esri_e00_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/Makefile.in000066400000000000000000000607701224124640700240560ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/esri_e00/io_esri_e00 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libio_esri_e00_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libio_esri_e00_la_OBJECTS = ESRI_E00_Import.lo MLB_Interface.lo \ cpl_conv.lo cpl_error.lo cpl_vsisimple.lo e00read.lo \ e00write.lo libio_esri_e00_la_OBJECTS = $(am_libio_esri_e00_la_OBJECTS) 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) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libio_esri_e00_la_SOURCES) DIST_SOURCES = $(libio_esri_e00_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libio_esri_e00.la libio_esri_e00_la_SOURCES = \ ESRI_E00_Import.cpp\ MLB_Interface.cpp\ e00compr/cpl_conv.c\ e00compr/cpl_error.c\ e00compr/cpl_vsisimple.c\ e00compr/e00read.c\ e00compr/e00write.c\ ESRI_E00_Import.h\ MLB_Interface.h\ e00compr/cpl_conv.h\ e00compr/cpl_error.h\ e00compr/cpl_port.h\ e00compr/cpl_vsi.h\ e00compr/e00compr.h libio_esri_e00_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .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) --gnu src/modules_io/esri_e00/io_esri_e00/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/esri_e00/io_esri_e00/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libio_esri_e00.la: $(libio_esri_e00_la_OBJECTS) $(libio_esri_e00_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libio_esri_e00_la_OBJECTS) $(libio_esri_e00_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ESRI_E00_Import.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpl_conv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpl_error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpl_vsisimple.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/e00read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/e00write.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< cpl_conv.lo: e00compr/cpl_conv.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpl_conv.lo -MD -MP -MF $(DEPDIR)/cpl_conv.Tpo -c -o cpl_conv.lo `test -f 'e00compr/cpl_conv.c' || echo '$(srcdir)/'`e00compr/cpl_conv.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cpl_conv.Tpo $(DEPDIR)/cpl_conv.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='e00compr/cpl_conv.c' object='cpl_conv.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpl_conv.lo `test -f 'e00compr/cpl_conv.c' || echo '$(srcdir)/'`e00compr/cpl_conv.c cpl_error.lo: e00compr/cpl_error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpl_error.lo -MD -MP -MF $(DEPDIR)/cpl_error.Tpo -c -o cpl_error.lo `test -f 'e00compr/cpl_error.c' || echo '$(srcdir)/'`e00compr/cpl_error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cpl_error.Tpo $(DEPDIR)/cpl_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='e00compr/cpl_error.c' object='cpl_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpl_error.lo `test -f 'e00compr/cpl_error.c' || echo '$(srcdir)/'`e00compr/cpl_error.c cpl_vsisimple.lo: e00compr/cpl_vsisimple.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpl_vsisimple.lo -MD -MP -MF $(DEPDIR)/cpl_vsisimple.Tpo -c -o cpl_vsisimple.lo `test -f 'e00compr/cpl_vsisimple.c' || echo '$(srcdir)/'`e00compr/cpl_vsisimple.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cpl_vsisimple.Tpo $(DEPDIR)/cpl_vsisimple.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='e00compr/cpl_vsisimple.c' object='cpl_vsisimple.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpl_vsisimple.lo `test -f 'e00compr/cpl_vsisimple.c' || echo '$(srcdir)/'`e00compr/cpl_vsisimple.c e00read.lo: e00compr/e00read.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT e00read.lo -MD -MP -MF $(DEPDIR)/e00read.Tpo -c -o e00read.lo `test -f 'e00compr/e00read.c' || echo '$(srcdir)/'`e00compr/e00read.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/e00read.Tpo $(DEPDIR)/e00read.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='e00compr/e00read.c' object='e00read.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o e00read.lo `test -f 'e00compr/e00read.c' || echo '$(srcdir)/'`e00compr/e00read.c e00write.lo: e00compr/e00write.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT e00write.lo -MD -MP -MF $(DEPDIR)/e00write.Tpo -c -o e00write.lo `test -f 'e00compr/e00write.c' || echo '$(srcdir)/'`e00compr/e00write.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/e00write.Tpo $(DEPDIR)/e00write.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='e00compr/e00write.c' object='e00write.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o e00write.lo `test -f 'e00compr/e00write.c' || echo '$(srcdir)/'`e00compr/e00write.c .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/e00compr/000077500000000000000000000000001224124640700234245ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_conv.c000066400000000000000000000154771224124640700254110ustar00rootroot00000000000000/********************************************************** * Version $Id: cpl_conv.c 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * Copyright (c) 1998, Frank Warmerdam * * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************** * * cpl_conv.c: Various CPL convenience functions (from cpl_conv.h). * * $Log: not supported by cvs2svn $ * Revision 1.1.1.1 2005/08/31 14:00:59 oconrad * no message * * Revision 1.1.1.1 2005/08/17 08:25:16 oconrad * no message * * Revision 1.1.1.1 2005/08/15 13:35:12 oconrad * no message * * Revision 1.1 2004/04/16 13:36:45 oconrad * no message * * Revision 1.4 1999/01/02 20:29:53 warmerda * Allow zero length allocations * * Revision 1.3 1998/12/15 19:01:07 warmerda * Added CPLReadLine(). * * Revision 1.2 1998/12/03 18:30:04 warmerda * Use CPLError() instead of GPSError(). * * Revision 1.1 1998/12/02 19:33:23 warmerda * New * */ #include "cpl_conv.h" /************************************************************************/ /* CPLCalloc() */ /************************************************************************/ void *CPLCalloc( size_t nCount, size_t nSize ) { void *pReturn; if( nSize == 0 ) return NULL; pReturn = VSICalloc( nCount, nSize ); if( pReturn == NULL ) { CPLError( CE_Fatal, CPLE_OutOfMemory, "CPLCalloc(): Out of memory allocating %d bytes.\n", nSize * nCount ); } return pReturn; } /************************************************************************/ /* CPLMalloc() */ /************************************************************************/ void *CPLMalloc( size_t nSize ) { void *pReturn; if( nSize == 0 ) return NULL; pReturn = VSIMalloc( nSize ); if( pReturn == NULL ) { CPLError( CE_Fatal, CPLE_OutOfMemory, "CPLMalloc(): Out of memory allocating %d bytes.\n", nSize ); } return pReturn; } /************************************************************************/ /* CPLRealloc() */ /************************************************************************/ void * CPLRealloc( void * pData, size_t nNewSize ) { void *pReturn; if( pData == NULL ) pReturn = VSIMalloc( nNewSize ); else pReturn = VSIRealloc( pData, nNewSize ); if( pReturn == NULL ) { CPLError( CE_Fatal, CPLE_OutOfMemory, "CPLRealloc(): Out of memory allocating %d bytes.\n", nNewSize ); } return pReturn; } /************************************************************************/ /* CPLStrdup() */ /************************************************************************/ char *CPLStrdup( const char * pszString ) { char *pszReturn; if( pszString == NULL ) pszString = ""; pszReturn = VSIStrdup( pszString ); if( pszReturn == NULL ) { CPLError( CE_Fatal, CPLE_OutOfMemory, "CPLStrdup(): Out of memory allocating %d bytes.\n", strlen(pszString) ); } return( pszReturn ); } /************************************************************************/ /* CPLReadLine() */ /* */ /* Read a line of text from the given file handle, taking care */ /* to capture CR and/or LF and strip off ... equivelent of */ /* DKReadLine(). Pointer to an internal buffer is returned. */ /* The application shouldn't free it, or depend on it's value */ /* past the next call to CPLReadLine() */ /* */ /* TODO: Allow arbitrarily long lines ... currently limited to */ /* 512 characters. */ /************************************************************************/ const char *CPLReadLine( FILE * fp ) { static char *pszRLBuffer = NULL; static int nRLBufferSize = 0; int nLength; /* -------------------------------------------------------------------- */ /* Allocate our working buffer. Eventually this should grow as */ /* needed ... we will implement that aspect later. */ /* -------------------------------------------------------------------- */ if( nRLBufferSize < 512 ) { nRLBufferSize = 512; pszRLBuffer = (char *) CPLRealloc(pszRLBuffer, nRLBufferSize); } /* -------------------------------------------------------------------- */ /* Do the actual read. */ /* -------------------------------------------------------------------- */ if( VSIFGets( pszRLBuffer, nRLBufferSize, fp ) == NULL ) return NULL; /* -------------------------------------------------------------------- */ /* Clear CR and LF off the end. */ /* -------------------------------------------------------------------- */ nLength = strlen(pszRLBuffer); if( nLength > 0 && (pszRLBuffer[nLength-1] == 10 || pszRLBuffer[nLength-1] == 13) ) { pszRLBuffer[--nLength] = '\0'; } if( nLength > 0 && (pszRLBuffer[nLength-1] == 10 || pszRLBuffer[nLength-1] == 13) ) { pszRLBuffer[--nLength] = '\0'; } return( pszRLBuffer ); } saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_conv.h000066400000000000000000000061471224124640700254100ustar00rootroot00000000000000/********************************************************** * Version $Id: cpl_conv.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * Copyright (c) 1998, Frank Warmerdam * * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************** * * cpl_conv.h * * Prototypes, and stuff for various convenience functions. This is intended * to remain light weight. * * $Log: * Revision 1.1 1998/10/18 06:15:11 warmerda * Initial implementation. * */ #ifndef CPL_CONV_H_INCLUDED #define CPL_CONV_H_INCLUDED #include "cpl_port.h" #include "cpl_vsi.h" #include "cpl_error.h" /* -------------------------------------------------------------------- */ /* Safe malloc() API. Thin cover over VSI functions with fatal */ /* error reporting if memory allocation fails. */ /* -------------------------------------------------------------------- */ CPL_C_START void CPL_DLL *CPLMalloc( size_t ); void CPL_DLL *CPLCalloc( size_t, size_t ); void CPL_DLL *CPLRealloc( void *, size_t ); char CPL_DLL *CPLStrdup( const char * ); #define CPLFree VSIFree /* -------------------------------------------------------------------- */ /* Read a line from a text file, and strip of CR/LF. */ /* -------------------------------------------------------------------- */ const char *CPLReadLine( FILE * ); /* -------------------------------------------------------------------- */ /* Fetch a function from DLL / so. */ /* -------------------------------------------------------------------- */ void CPL_DLL *CPLGetSymbol( const char *, const char * ); /* -------------------------------------------------------------------- */ /* Read a directory (cpl_dir.c) */ /* -------------------------------------------------------------------- */ char CPL_DLL **CPLReadDir( const char *pszPath ); CPL_C_END #endif /* ndef CPL_CONV_H_INCLUDED */ saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_error.c000066400000000000000000000132031224124640700255560ustar00rootroot00000000000000/********************************************************** * Version $Id: cpl_error.c 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /********************************************************************** * $Id: cpl_error.c 911 2011-02-14 16:38:15Z reklov_w $ * * Name: cpl_error.cpp * Project: CPL - Common Portability Library * Purpose: Error handling functions. * Author: Daniel Morissette, danmo@videotron.ca * ********************************************************************** * Copyright (c) 1998, Daniel Morissette * * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ********************************************************************** * * $Log: not supported by cvs2svn $ * Revision 1.1.1.1 2005/08/31 14:00:59 oconrad * no message * * Revision 1.1.1.1 2005/08/17 08:25:16 oconrad * no message * * Revision 1.1.1.1 2005/08/15 13:35:12 oconrad * no message * * Revision 1.1 2004/04/16 13:36:45 oconrad * no message * * Revision 1.3 1998/12/15 19:02:27 warmerda * Avoid use of errno as a variable * * Revision 1.2 1998/12/06 02:52:52 warmerda * Implement assert support * * Revision 1.1 1998/12/03 18:26:02 warmerda * New * **********************************************************************/ #include "cpl_error.h" /* static buffer to store the last error message. We'll assume that error * messages cannot be longer than 2000 chars... which is quite reasonable * (that's 25 lines of 80 chars!!!) */ static char gszCPLLastErrMsg[2000] = ""; static int gnCPLLastErrNo = 0; static void (*gpfnCPLErrorHandler)(CPLErr, int, const char *) = NULL; /********************************************************************** * CPLError() * * This function records an error code and displays the error message * to stderr. * * The error code can be accessed later using CPLGetLastErrNo() **********************************************************************/ void CPLError(CPLErr eErrClass, int err_no, const char *fmt, ...) { va_list args; /* Expand the error message */ va_start(args, fmt); vsprintf(gszCPLLastErrMsg, fmt, args); va_end(args); /* If the user provided his own error handling function, then call * it, otherwise print the error to stderr and return. */ gnCPLLastErrNo = err_no; if (gpfnCPLErrorHandler != NULL) { gpfnCPLErrorHandler(eErrClass, err_no, gszCPLLastErrMsg); } else { fprintf(stderr, "ERROR %d: %s\n", gnCPLLastErrNo, gszCPLLastErrMsg); } if( eErrClass == CE_Fatal ) abort(); } /********************************************************************** * CPLErrorReset() * * Erase any traces of previous errors. **********************************************************************/ void CPLErrorReset() { gnCPLLastErrNo = 0; gszCPLLastErrMsg[0] = '\0'; } /********************************************************************** * CPLGetLastErrorNo() * **********************************************************************/ int CPLGetLastErrorNo() { return gnCPLLastErrNo; } /********************************************************************** * CPLGetLastErrorMsg() * **********************************************************************/ const char* CPLGetLastErrorMsg() { return gszCPLLastErrMsg; } /********************************************************************** * CPLSetErrorHandler() * * Allow the library's user to specify his own error handler function. * * A valid error handler is a C function with the following prototype: * * void MyErrorHandler(int errno, const char *msg) * * Pass NULL to come back to the default behavior. **********************************************************************/ void CPLSetErrorHandler(void (*pfnErrorHandler)(CPLErr, int, const char *)) { gpfnCPLErrorHandler = pfnErrorHandler; } /************************************************************************/ /* _CPLAssert() */ /* */ /* This function is called only when an assertion fails. */ /************************************************************************/ void _CPLAssert( const char * pszExpression, const char * pszFile, int iLine ) { CPLError( CE_Fatal, CPLE_AssertionFailed, "Assertion `%s' failed\n" "in file `%s', line %d\n", pszExpression, pszFile, iLine ); } saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_error.h000066400000000000000000000077301224124640700255730ustar00rootroot00000000000000/********************************************************** * Version $Id: cpl_error.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /********************************************************************** * $Id: cpl_error.h 911 2011-02-14 16:38:15Z reklov_w $ * * Name: cpl_error.h * Project: CPL - Common Portability Library * Purpose: CPL Error handling * Author: Daniel Morissette, danmo@videotron.ca * ********************************************************************** * Copyright (c) 1998, Daniel Morissette * * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ********************************************************************** * * $Log: not supported by cvs2svn $ * Revision 1.1.1.1 2005/08/31 14:00:59 oconrad * no message * * Revision 1.1.1.1 2005/08/17 08:25:16 oconrad * no message * * Revision 1.1.1.1 2005/08/15 13:35:12 oconrad * no message * * Revision 1.1 2004/04/16 13:36:45 oconrad * no message * * Revision 1.6 1999/02/17 05:40:47 danmo * Fixed CPLAssert() macro to work with EGCS. * * Revision 1.5 1999/01/11 15:34:29 warmerda * added reserved range comment * * Revision 1.4 1998/12/15 19:02:27 warmerda * Avoid use of errno as a variable * * Revision 1.3 1998/12/06 22:20:42 warmerda * Added error code. * * Revision 1.2 1998/12/06 02:52:52 warmerda * Implement assert support * * Revision 1.1 1998/12/03 18:26:02 warmerda * New * **********************************************************************/ #ifndef _CPL_ERROR_H_INCLUDED_ #define _CPL_ERROR_H_INCLUDED_ #include "cpl_port.h" /*===================================================================== Error handling functions (cpl_error.c) =====================================================================*/ CPL_C_START typedef enum { CE_None = 0, CE_Log = 1, CE_Warning = 2, CE_Failure = 3, CE_Fatal = 4 } CPLErr; void CPL_DLL CPLError(CPLErr eErrClass, int err_no, const char *fmt, ...); void CPL_DLL CPLErrorReset(); int CPL_DLL CPLGetLastErrorNo(); const char CPL_DLL * CPLGetLastErrorMsg(); void CPL_DLL CPLSetErrorHandler(void(*pfnErrorHandler)(CPLErr,int, const char *)); void CPL_DLL _CPLAssert( const char *, const char *, int ); #ifdef DEBUG # define CPLAssert(expr) ((expr) ? (void)(0) : _CPLAssert(#expr,__FILE__,__LINE__)) #else # define CPLAssert(expr) #endif CPL_C_END /* ==================================================================== */ /* Well known error codes. */ /* ==================================================================== */ #define CPLE_AppDefined 1 #define CPLE_OutOfMemory 2 #define CPLE_FileIO 3 #define CPLE_OpenFailed 4 #define CPLE_IllegalArg 5 #define CPLE_NotSupported 6 #define CPLE_AssertionFailed 7 #define CPLE_NoWriteAccess 8 /* 100 - 299 reserved for GDAL */ #endif /* _CPL_ERROR_H_INCLUDED_ */ saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_port.h000066400000000000000000000203201224124640700254140ustar00rootroot00000000000000/********************************************************** * Version $Id: cpl_port.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * Copyright (c) 1998, Frank Warmerdam * * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************** * * cpl_port.h * * Include file providing low level portability services for CPL. This * should be the first include file for any CPL based code. It provides the * following: * * o Includes some standard system include files, such as stdio, and stdlib. * * o Defines CPL_C_START, CPL_C_END macros. * * o Ensures that some other standard macros like NULL are defined. * * o Defines some portability stuff like CPL_MSB, or CPL_LSB. * * o Ensures that core types such as GBool, GInt32, GInt16, GUInt32, * GUInt16, and GByte are defined. * * $Log: not supported by cvs2svn $ * Revision 1.1.1.1 2005/08/31 14:01:00 oconrad * no message * * Revision 1.1.1.1 2005/08/17 08:25:16 oconrad * no message * * Revision 1.1.1.1 2005/08/15 13:35:12 oconrad * no message * * Revision 1.1 2004/04/16 13:36:45 oconrad * no message * * Revision 1.9 1999/02/17 01:41:17 warmerda * Added NULL. * * Revision 1.8 1999/02/02 21:32:38 warmerda * Added CPL_{MSB,LSB}WORD{16,32} macros. * * Revision 1.7 1999/02/02 19:02:36 warmerda * Removed duplicates of base types, and CPL_LSB * * Revision 1.6 1999/01/28 18:36:06 warmerda * Ensure WIN32 is defined on Windows. * * Revision 1.5 1999/01/28 05:26:12 danmo * Added byte swapping macros. * * Revision 1.4 1998/12/15 19:05:30 warmerda * added errno.h * * Revision 1.3 1998/12/14 04:50:07 warmerda * Added DBMALLOC support * * Revision 1.2 1998/12/04 21:38:40 danmo * Changed str*casecmp() to str*icmp() for WIN32 * * Revision 1.1 1998/12/03 18:26:02 warmerda * New * */ #ifndef CPL_BASE_H_INCLUDED #define CPL_BASE_H_INCLUDED /* ==================================================================== */ /* We will use WIN32 as a standard windows define. */ /* ==================================================================== */ #if defined(_WIN32) && !defined(WIN32) # define WIN32 #endif /* ==================================================================== */ /* Standard include files. */ /* ==================================================================== */ #include #include #include #include #include #include #ifdef DBMALLOC #include #endif /* ==================================================================== */ /* Base portability stuff ... this stuff may need to be */ /* modified for new platforms. */ /* ==================================================================== */ /*--------------------------------------------------------------------- * types for 16 and 32 bits integers, etc... *--------------------------------------------------------------------*/ #if UINT_MAX == 65535 typedef long GInt32; typedef unsigned long GUInt32; #else typedef int GInt32; typedef unsigned int GUInt32; #endif typedef short GInt16; typedef unsigned short GUInt16; typedef unsigned char GByte; typedef int GBool; /* ==================================================================== */ /* Other standard services. */ /* ==================================================================== */ #ifdef __cplusplus # define CPL_C_START extern "C" { # define CPL_C_END } #else # define CPL_C_START # define CPL_C_END #endif /* # define CPL_DLL __declspec(dllexport) */ #define CPL_DLL #ifndef NULL # define NULL 0 #endif #ifndef FALSE # define FALSE 0 #endif #ifndef TRUE # define TRUE 1 #endif #ifndef MAX # define MIN(a,b) ((ab) ? a : b) #endif #ifndef NULL #define NULL 0 #endif #ifndef ABS # define ABS(x) ((x<0) ? (-1*(x)) : x) #endif #ifndef EQUAL #ifdef WIN32 # define EQUALN(a,b,n) (strnicmp(a,b,n)==0) # define EQUAL(a,b) (stricmp(a,b)==0) #else # define EQUALN(a,b,n) (strncasecmp(a,b,n)==0) # define EQUAL(a,b) (strcasecmp(a,b)==0) #endif #endif /*--------------------------------------------------------------------- * CPL_LSB and CPL_MSB * Only one of these 2 macros should be defined and specifies the byte * ordering for the current platform. * This should be defined in the Makefile, but if it is not then * the default is CPL_LSB (Intel ordering, LSB first). *--------------------------------------------------------------------*/ #if ! ( defined(CPL_LSB) || defined(CPL_MSB) ) #define CPL_LSB #endif /*--------------------------------------------------------------------- * Little endian <==> big endian byte swap macros. *--------------------------------------------------------------------*/ #define CPL_SWAP16(x) \ ((GUInt16)( \ (((GUInt16)(x) & 0x00ffU) << 8) | \ (((GUInt16)(x) & 0xff00U) >> 8) )) #define CPL_SWAP32(x) \ ((GUInt32)( \ (((GUInt32)(x) & (GUInt32)0x000000ffUL) << 24) | \ (((GUInt32)(x) & (GUInt32)0x0000ff00UL) << 8) | \ (((GUInt32)(x) & (GUInt32)0x00ff0000UL) >> 8) | \ (((GUInt32)(x) & (GUInt32)0xff000000UL) >> 24) )) /* Until we have a safe 64 bits integer data type defined, we'll replace m * this version of the CPL_SWAP64() macro with a less efficient one. */ /* #define CPL_SWAP64(x) \ ((uint64)( \ (uint64)(((uint64)(x) & (uint64)0x00000000000000ffULL) << 56) | \ (uint64)(((uint64)(x) & (uint64)0x000000000000ff00ULL) << 40) | \ (uint64)(((uint64)(x) & (uint64)0x0000000000ff0000ULL) << 24) | \ (uint64)(((uint64)(x) & (uint64)0x00000000ff000000ULL) << 8) | \ (uint64)(((uint64)(x) & (uint64)0x000000ff00000000ULL) >> 8) | \ (uint64)(((uint64)(x) & (uint64)0x0000ff0000000000ULL) >> 24) | \ (uint64)(((uint64)(x) & (uint64)0x00ff000000000000ULL) >> 40) | \ (uint64)(((uint64)(x) & (uint64)0xff00000000000000ULL) >> 56) )) */ #define CPL_SWAPDOUBLE(p) { \ double _tmp = *(double *)(p); \ ((GByte *)(p))[0] = ((GByte *)&_tmp)[7]; \ ((GByte *)(p))[1] = ((GByte *)&_tmp)[6]; \ ((GByte *)(p))[2] = ((GByte *)&_tmp)[5]; \ ((GByte *)(p))[3] = ((GByte *)&_tmp)[4]; \ ((GByte *)(p))[4] = ((GByte *)&_tmp)[3]; \ ((GByte *)(p))[5] = ((GByte *)&_tmp)[2]; \ ((GByte *)(p))[6] = ((GByte *)&_tmp)[1]; \ ((GByte *)(p))[7] = ((GByte *)&_tmp)[0]; \ } #ifdef CPL_MSB # define CPL_MSBWORD16(x) (x) # define CPL_LSBWORD16(x) CPL_SWAP16(x) # define CPL_MSBWORD32(x) (x) # define CPL_LSBWORD32(x) CPL_SWAP32(x) #else # define CPL_LSBWORD16(x) (x) # define CPL_MSBWORD16(x) CPL_SWAP16(x) # define CPL_LSBWORD32(x) (x) # define CPL_MSBWORD32(x) CPL_SWAP32(x) #endif #endif /* ndef CPL_BASE_H_INCLUDED */ saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_vsi.h000066400000000000000000000120041224124640700252310ustar00rootroot00000000000000/********************************************************** * Version $Id: cpl_vsi.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * Copyright (c) 1998, Frank Warmerdam * * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************** * * cpl_vsi.h * * Include file defining the Virtual System Interface (VSI) functions. This * should normally be included by all translators using VSI functions for * accessing system services. It is also used by the GDAL core, and can be * used by higher level applications which adhere to VSI use. * * Most VSI functions are direct analogs of Posix C library functions. * VSI exists to allow ``hooking'' these functions to provide application * specific checking, io redirection and so on. * * $Log: not supported by cvs2svn $ * Revision 1.1.1.1 2005/08/31 14:01:00 oconrad * no message * * Revision 1.1.1.1 2005/08/17 08:25:16 oconrad * no message * * Revision 1.1.1.1 2005/08/15 13:35:12 oconrad * no message * * Revision 1.1 2004/04/16 13:36:45 oconrad * no message * * Revision 1.4 1999/02/25 04:48:11 danmo * Added VSIStat() macros specific to _WIN32 (for MSVC++) * * Revision 1.3 1999/01/28 18:31:25 warmerda * Test on _WIN32 rather than WIN32. It seems to be more reliably defined. * * Revision 1.2 1998/12/04 21:42:57 danmo * Added #ifndef WIN32 arounf #include * * Revision 1.1 1998/12/03 18:26:02 warmerda * New * */ #ifndef CPL_VSI_H_INCLUDED #define CPL_VSI_H_INCLUDED #include "cpl_port.h" /* -------------------------------------------------------------------- */ /* We need access to ``struct stat''. */ /* -------------------------------------------------------------------- */ #ifndef _WIN32 # include #endif #include CPL_C_START /* ==================================================================== */ /* stdio file access functions. */ /* ==================================================================== */ FILE CPL_DLL * VSIFOpen( const char *, const char * ); int CPL_DLL VSIFClose( FILE * ); int CPL_DLL VSIFSeek( FILE *, long, int ); long CPL_DLL VSIFTell( FILE * ); void CPL_DLL VSIRewind( FILE * ); size_t CPL_DLL VSIFRead( void *, size_t, size_t, FILE * ); size_t CPL_DLL VSIFWrite( void *, size_t, size_t, FILE * ); char CPL_DLL *VSIFGets( char *, int, FILE * ); int CPL_DLL VSIFPuts( const char *, FILE * ); int CPL_DLL VSIFPrintf( FILE *, const char *, ... ); int CPL_DLL VSIFGetc( FILE * ); int CPL_DLL VSIFPutc( int, FILE * ); int CPL_DLL VSIUngetc( int, FILE * ); int CPL_DLL VSIFEof( FILE * ); /* ==================================================================== */ /* VSIStat() related. */ /* ==================================================================== */ typedef struct stat VSIStatBuf; int CPL_DLL VSIStat( const char *, VSIStatBuf * ); #ifdef _WIN32 # define VSI_ISLNK(x) ( 0 ) /* N/A on Windows */ # define VSI_ISREG(x) ((x) & S_IFREG) # define VSI_ISDIR(x) ((x) & S_IFDIR) # define VSI_ISCHR(x) ((x) & S_IFCHR) # define VSI_ISBLK(x) ( 0 ) /* N/A on Windows */ #else # define VSI_ISLNK(x) S_ISLNK(x) # define VSI_ISREG(x) S_ISREG(x) # define VSI_ISDIR(x) S_ISDIR(x) # define VSI_ISCHR(x) S_ISCHR(x) # define VSI_ISBLK(x) S_ISBLK(x) #endif /* ==================================================================== */ /* Memory allocation */ /* ==================================================================== */ void CPL_DLL *VSICalloc( size_t, size_t ); void CPL_DLL *VSIMalloc( size_t ); void CPL_DLL VSIFree( void * ); void CPL_DLL *VSIRealloc( void *, size_t ); char CPL_DLL *VSIStrdup( const char * ); CPL_C_END #endif /* ndef CPL_VSI_H_INCLUDED */ saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/e00compr/cpl_vsisimple.c000066400000000000000000000217021224124640700264430ustar00rootroot00000000000000/********************************************************** * Version $Id: cpl_vsisimple.c 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /****************************************************************************** * Copyright (c) 1998, Frank Warmerdam * * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************** * * cpl_vsisimple.cpp * * This is a simple implementation (direct to Posix) of the Virtual System * Interface (VSI). See gdal_vsi.h. * * TODO: * - add some assertions to ensure that arguments are widely legal. For * instance validation of access strings to fopen(). * * $Log: not supported by cvs2svn $ * Revision 1.1.1.1 2005/08/31 14:01:00 oconrad * no message * * Revision 1.1.1.1 2005/08/17 08:25:16 oconrad * no message * * Revision 1.1.1.1 2005/08/15 13:35:12 oconrad * no message * * Revision 1.1 2004/04/16 13:36:45 oconrad * no message * * Revision 1.3 1998/12/14 04:50:33 warmerda * Avoid C++ comments so it will be C compilable as well. * * Revision 1.2 1998/12/04 21:42:57 danmo * Added #ifndef WIN32 arounf #include * * Revision 1.1 1998/12/03 18:26:03 warmerda * New * */ #include "cpl_vsi.h" /* for stat() */ #ifndef WIN32 # include #endif #include /************************************************************************/ /* VSIFOpen() */ /************************************************************************/ FILE *VSIFOpen( const char * pszFilename, const char * pszAccess ) { return( fopen( (char *) pszFilename, (char *) pszAccess ) ); } /************************************************************************/ /* VSIFClose() */ /************************************************************************/ int VSIFClose( FILE * fp ) { return( fclose(fp) ); } /************************************************************************/ /* VSIFSeek() */ /************************************************************************/ int VSIFSeek( FILE * fp, long nOffset, int nWhence ) { return( fseek( fp, nOffset, nWhence ) ); } /************************************************************************/ /* VSIFTell() */ /************************************************************************/ long VSIFTell( FILE * fp ) { return( ftell( fp ) ); } /************************************************************************/ /* VSIRewind() */ /************************************************************************/ void VSIRewind( FILE * fp ) { rewind( fp ); } /************************************************************************/ /* VSIFRead() */ /************************************************************************/ size_t VSIFRead( void * pBuffer, size_t nSize, size_t nCount, FILE * fp ) { return( fread( pBuffer, nSize, nCount, fp ) ); } /************************************************************************/ /* VSIFWrite() */ /************************************************************************/ size_t VSIFWrite( void * pBuffer, size_t nSize, size_t nCount, FILE * fp ) { return( fwrite( pBuffer, nSize, nCount, fp ) ); } /************************************************************************/ /* VSIFGets() */ /************************************************************************/ char *VSIFGets( char *pszBuffer, int nBufferSize, FILE * fp ) { return( fgets( pszBuffer, nBufferSize, fp ) ); } /************************************************************************/ /* VSIFGetc() */ /************************************************************************/ int VSIFGetc( FILE * fp ) { return( fgetc( fp ) ); } /************************************************************************/ /* VSIUngetc() */ /************************************************************************/ int VSIUngetc( int c, FILE * fp ) { return( ungetc( c, fp ) ); } /************************************************************************/ /* VSIFPrintf() */ /* */ /* This is a little more complicated than just calling */ /* fprintf() because of the variable arguments. Instead we */ /* have to use vfprintf(). */ /************************************************************************/ int VSIFPrintf( FILE * fp, const char * pszFormat, ... ) { va_list args; int nReturn; va_start( args, pszFormat ); nReturn = vfprintf( fp, pszFormat, args ); va_end( args ); return( nReturn ); } /************************************************************************/ /* VSIFEof() */ /************************************************************************/ int VSIFEof( FILE * fp ) { return( feof( fp ) ); } /************************************************************************/ /* VSIFPuts() */ /************************************************************************/ int VSIFPuts( const char * pszString, FILE * fp ) { return fputs( pszString, fp ); } /************************************************************************/ /* VSIFPutc() */ /************************************************************************/ int VSIFPutc( int nChar, FILE * fp ) { return( fputc( nChar, fp ) ); } /************************************************************************/ /* VSICalloc() */ /************************************************************************/ void *VSICalloc( size_t nCount, size_t nSize ) { return( calloc( nCount, nSize ) ); } /************************************************************************/ /* VSIMalloc() */ /************************************************************************/ void *VSIMalloc( size_t nSize ) { return( malloc( nSize ) ); } /************************************************************************/ /* VSIRealloc() */ /************************************************************************/ void * VSIRealloc( void * pData, size_t nNewSize ) { return( realloc( pData, nNewSize ) ); } /************************************************************************/ /* VSIFree() */ /************************************************************************/ void VSIFree( void * pData ) { if( pData != NULL ) free( pData ); } /************************************************************************/ /* VSIStrdup() */ /************************************************************************/ char *VSIStrdup( const char * pszString ) { return( strdup( pszString ) ); } /************************************************************************/ /* VSIStat() */ /************************************************************************/ int VSIStat( const char * pszFilename, VSIStatBuf * pStatBuf ) { return( stat( pszFilename, pStatBuf ) ); } saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/e00compr/e00compr.h000066400000000000000000000150651224124640700252310ustar00rootroot00000000000000/********************************************************** * Version $Id: e00compr.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /********************************************************************** * $Id: e00compr.h 911 2011-02-14 16:38:15Z reklov_w $ * * Name: e00compr.h * Project: Compressed E00 Read/Write library * Language: ANSI C * Purpose: Header file containing all definitions for the library. * Author: Daniel Morissette, danmo@videotron.ca * * $Log: not supported by cvs2svn $ * Revision 1.1.1.1 2005/08/31 14:01:00 oconrad * no message * * Revision 1.1.1.1 2005/08/17 08:25:16 oconrad * no message * * Revision 1.1.1.1 2005/08/15 13:35:12 oconrad * no message * * Revision 1.1 2004/04/16 13:36:45 oconrad * no message * * Revision 1.7 1999/02/25 18:47:40 daniel * Now use CPL for Error handling, Memory allocation, and File access. * * Revision 1.6 1999/01/08 17:40:33 daniel * Added E00Read/WriteCallbakcOpen() * * Revision 1.5 1998/11/13 15:39:45 daniel * Added functions for write support. * * Revision 1.4 1998/11/02 18:37:03 daniel * New file header, and added E00ErrorReset() * * Revision 1.1 1998/10/29 13:26:00 daniel * Initial revision * ********************************************************************** * Copyright (c) 1998, 1999, Daniel Morissette * * All rights reserved. This software may be copied or reproduced, in * all or in part, without the prior written consent of its author, * Daniel Morissette (danmo@videotron.ca). However, any material copied * or reproduced must bear the original copyright notice (above), this * original paragraph, and the original disclaimer (below). * * The entire risk as to the results and performance of the software, * supporting text and other information contained in this file * (collectively called the "Software") is with the user. Although * considerable efforts have been used in preparing the Software, the * author does not warrant the accuracy or completeness of the Software. * In no event will the author be liable for damages, including loss of * profits or consequential damages, arising out of the use of the * Software. * **********************************************************************/ #ifndef _E00COMPR_H_INCLUDED_ #define _E00COMPR_H_INCLUDED_ #ifdef __cplusplus extern "C" { #endif #include #include "cpl_port.h" #include "cpl_conv.h" #include "cpl_error.h" /*===================================================================== Data types and constants =====================================================================*/ #define E00_READ_BUF_SIZE 256 /* E00 lines are always 80 chars or less */ /* for both compressed and uncompressed */ /* files, except the first line (the EXP)*/ /* for which there is no known limit */ /* We'll assume that it can't be longer */ /* than 256 chars */ #define E00_WRITE_BUF_SIZE 256 /* This buffer must be big enough to hold*/ /* at least 2 lines of compressed output */ /* (i.e. 160 chars)... but just in case */ /* compressing a line would ever result */ /* in it becoming bigger than its source */ /* we'll set the size to 256 chars! */ #define E00_COMPR_NONE 0 /* Compression levels to use when writing*/ #define E00_COMPR_PARTIAL 1 #define E00_COMPR_FULL 2 /*--------------------------------------------------------------------- * E00ReadPtr * * A E00ReadPtr handle is used to hold information about the compressed * file currently being read. *--------------------------------------------------------------------*/ struct _E00ReadInfo { FILE *fp; /* Input file handle */ int bEOF; /* Reached EOF? */ int bIsCompressed; /* 1 if file is compressed, 0 if not */ int nInputLineNo; int iInBufPtr; /* Last character processed in szInBuf */ char szInBuf[E00_READ_BUF_SIZE]; /* compressed input buffer */ char szOutBuf[E00_READ_BUF_SIZE];/* uncompressed output buffer */ /* pRefData, pfnReadNextLine() and pfnReadRewind() are used only * when the file is opened with E00ReadCallbackOpen() * (and in this case the FILE *fp defined above is not used) */ void * pRefData; const char * (*pfnReadNextLine)(void *); void (*pfnReadRewind)(void *); }; typedef struct _E00ReadInfo *E00ReadPtr; /*--------------------------------------------------------------------- * E00WritePtr * * A E00WritePtr handle is used to hold information about the * file currently being written. *--------------------------------------------------------------------*/ struct _E00WriteInfo { FILE *fp; /* Output file handle */ int nComprLevel; int nSrcLineNo; int iOutBufPtr; /* Current position in szOutBuf */ char szOutBuf[E00_WRITE_BUF_SIZE]; /* compressed output buffer */ /* pRefData and pfnWriteNextLine() are used only * when the file is opened with E00WriteCallbackOpen() * (and in this case the FILE *fp defined above is not used) */ void *pRefData; int (*pfnWriteNextLine)(void *, const char *); }; typedef struct _E00WriteInfo *E00WritePtr; /*===================================================================== Function prototypes =====================================================================*/ E00ReadPtr E00ReadOpen(const char *pszFname); E00ReadPtr E00ReadCallbackOpen(void *pRefData, const char * (*pfnReadNextLine)(void *), void (*pfnReadRewind)(void *)); void E00ReadClose(E00ReadPtr psInfo); const char *E00ReadNextLine(E00ReadPtr psInfo); void E00ReadRewind(E00ReadPtr psInfo); E00WritePtr E00WriteOpen(const char *pszFname, int nComprLevel); E00WritePtr E00WriteCallbackOpen(void *pRefData, int (*pfnWriteNextLine)(void *, const char *), int nComprLevel); void E00WriteClose(E00WritePtr psInfo); int E00WriteNextLine(E00WritePtr psInfo, const char *pszLine); #ifdef __cplusplus } #endif #endif /* _E00COMPR_H_INCLUDED_ */ saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/e00compr/e00read.c000066400000000000000000000536651224124640700250270ustar00rootroot00000000000000/********************************************************** * Version $Id: e00read.c 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /********************************************************************** * $Id: e00read.c 911 2011-02-14 16:38:15Z reklov_w $ * * Name: e00read.c * Project: Compressed E00 Read/Write library * Language: ANSI C * Purpose: Functions to read Compressed E00 files and return a stream * of uncompressed lines. * Author: Daniel Morissette, danmo@videotron.ca * * $Log: not supported by cvs2svn $ * Revision 1.1.1.1 2005/08/31 14:01:00 oconrad * no message * * Revision 1.1.1.1 2005/08/17 08:25:16 oconrad * no message * * Revision 1.1.1.1 2005/08/15 13:35:12 oconrad * no message * * Revision 1.1 2004/04/16 13:36:45 oconrad * no message * * Revision 1.8 1999/02/25 18:45:56 daniel * Now use CPL for Error handling, Memory allocation, and File access * * Revision 1.7 1999/01/08 17:39:08 daniel * Added E00ReadCallbackOpen() * * Revision 1.6 1998/11/13 16:34:08 daniel * Fixed '\r' problem when reading E00 files from a PC under Unix * * Revision 1.5 1998/11/13 15:48:08 daniel * Simplified the decoding of the compression codes for numbers * (use a logical rule instead of going case by case) * * Revision 1.4 1998/11/02 18:34:29 daniel * Added E00ErrorReset() calls. Replace "EXP 1" by "EXP 0" on read. * * Revision 1.1 1998/10/29 13:26:00 daniel * Initial revision * ********************************************************************** * Copyright (c) 1998, 1999, Daniel Morissette * * All rights reserved. This software may be copied or reproduced, in * all or in part, without the prior written consent of its author, * Daniel Morissette (danmo@videotron.ca). However, any material copied * or reproduced must bear the original copyright notice (above), this * original paragraph, and the original disclaimer (below). * * The entire risk as to the results and performance of the software, * supporting text and other information contained in this file * (collectively called the "Software") is with the user. Although * considerable efforts have been used in preparing the Software, the * author does not warrant the accuracy or completeness of the Software. * In no event will the author be liable for damages, including loss of * profits or consequential damages, arising out of the use of the * Software. * **********************************************************************/ #include #include #include #include #include "e00compr.h" static void _ReadNextSourceLine(E00ReadPtr psInfo); static const char *_UncompressNextLine(E00ReadPtr psInfo); /********************************************************************** * _E00ReadTestOpen() * * Given a pre-initialized E00ReadPtr, this function will make sure * that the file is really a E00 file, and also establish if it is * compressed or not... setting the structure members by the same way. * * Returns NULL (and destroys the E00ReadPtr) if the file does not * appear to be a valid E00 file. **********************************************************************/ static E00ReadPtr _E00ReadTestOpen(E00ReadPtr psInfo) { /* Check that the file is in E00 format. */ _ReadNextSourceLine(psInfo); if (!psInfo->bEOF && strncmp(psInfo->szInBuf, "EXP ", 4) == 0) { /* We should be in presence of a valid E00 file... * Is the file compressed or not? * * Note: we cannot really rely on the number that follows the EXP to * establish if the file is compressed since we sometimes encounter * uncompressed files that start with a "EXP 1" line!!! * * The best test is to read the first non-empty line: if the file is * compressed, the first line of data should be 79 or 80 characters * long and contain several '~' characters. */ do { _ReadNextSourceLine(psInfo); }while(!psInfo->bEOF && (psInfo->szInBuf[0] == '\0' || isspace(psInfo->szInBuf[0])) ); if (!psInfo->bEOF && (strlen(psInfo->szInBuf)==79 || strlen(psInfo->szInBuf)==80) && strchr(psInfo->szInBuf, '~') != NULL ) psInfo->bIsCompressed = 1; /* Move the Read ptr ready to read at the beginning of the file */ E00ReadRewind(psInfo); } else { CPLFree(psInfo); psInfo = NULL; } return psInfo; } /********************************************************************** * E00ReadOpen() * * Try to open a E00 file given its filename and return a E00ReadPtr handle. * * Returns NULL if the file could not be opened or if it does not * appear to be a valid E00 file. **********************************************************************/ E00ReadPtr E00ReadOpen(const char *pszFname) { E00ReadPtr psInfo = NULL; FILE *fp; CPLErrorReset(); /* Open the file */ fp = VSIFOpen(pszFname, "rt"); if (fp == NULL) { CPLError(CE_Failure, CPLE_OpenFailed, "Failed to open %s: %s", pszFname, strerror(errno)); return NULL; } /* File was succesfully opened, allocate and initialize a * E00ReadPtr handle and check that the file is valid. */ psInfo = (E00ReadPtr)CPLCalloc(1, sizeof(struct _E00ReadInfo)); psInfo->fp = fp; psInfo = _E00ReadTestOpen(psInfo); if (psInfo == NULL) { CPLError(CE_Failure, CPLE_OpenFailed, "%s is not a valid E00 file.", pszFname); } return psInfo; } /********************************************************************** * E00ReadCallbackOpen() * * This is an alternative to E00ReadOpen() for cases where you want to * do all the file management yourself. You open/close the file yourself * and provide 2 callback functions: to read from the file and rewind the * file pointer. pRefData is your handle on the physical file and can * be whatever you want... it is not used by the library, it will be * passed directly to your 2 callback functions when they are called. * * The callback functions must have the following C prototype: * * const char *myReadNextLine(void *pRefData); * void myReadRewind(void *pRefData); * * myReadNextLine() should return a reference to its own internal * buffer, or NULL if an error happens or EOF is reached. * * E00ReadCallbackOpen() returns a E00ReadPtr handle or NULL if the file * does not appear to be a valid E00 file. **********************************************************************/ E00ReadPtr E00ReadCallbackOpen(void *pRefData, const char * (*pfnReadNextLine)(void *), void (*pfnReadRewind)(void *)) { E00ReadPtr psInfo = NULL; CPLErrorReset(); /* Make sure we received valid function pointers */ if (pfnReadNextLine == NULL || pfnReadRewind == NULL) { CPLError(CE_Failure, CPLE_IllegalArg, "Invalid function pointers!"); return NULL; } /* Allocate and initialize a * E00ReadPtr handle and check that the file is valid. */ psInfo = (E00ReadPtr)CPLCalloc(1, sizeof(struct _E00ReadInfo)); psInfo->pRefData = pRefData; psInfo->pfnReadNextLine = pfnReadNextLine; psInfo->pfnReadRewind = pfnReadRewind; psInfo = _E00ReadTestOpen(psInfo); if (psInfo == NULL) { CPLError(CE_Failure, CPLE_OpenFailed, "This is not a valid E00 file."); } return psInfo; } /********************************************************************** * E00ReadClose() * * Close input file and release any memory used by the E00ReadPtr. **********************************************************************/ void E00ReadClose(E00ReadPtr psInfo) { CPLErrorReset(); if (psInfo) { if (psInfo->fp) VSIFClose(psInfo->fp); CPLFree(psInfo); } } /********************************************************************** * E00ReadRewind() * * Rewind the E00ReadPtr. Allows to start another read pass on the * input file. **********************************************************************/ void E00ReadRewind(E00ReadPtr psInfo) { CPLErrorReset(); psInfo->szInBuf[0] = psInfo->szOutBuf[0] = '\0'; psInfo->iInBufPtr = 0; psInfo->nInputLineNo = 0; if (psInfo->pfnReadRewind == NULL) VSIRewind(psInfo->fp); else psInfo->pfnReadRewind(psInfo->pRefData); psInfo->bEOF = 0; } /********************************************************************** * E00ReadNextLine() * * Return the next line of input from the E00 file or NULL if we reached EOF. * * Returns a reference to an internal buffer whose contents will be valid * only until the next call to this function. **********************************************************************/ const char *E00ReadNextLine(E00ReadPtr psInfo) { const char *pszLine = NULL; char *pszPtr; CPLErrorReset(); if (psInfo && !psInfo->bEOF) { if (!psInfo->bIsCompressed) { /* Uncompressed file... return line directly. */ _ReadNextSourceLine(psInfo); pszLine = psInfo->szInBuf; } else if (psInfo->bIsCompressed && psInfo->nInputLineNo == 0) { /* Header line in a compressed file... return line * after replacing "EXP 1" with "EXP 0". E00ReadOpen() * has already verified that this line starts with "EXP " */ _ReadNextSourceLine(psInfo); if ( (pszPtr = strstr(psInfo->szInBuf, " 1")) != NULL) pszPtr[1] = '0'; pszLine = psInfo->szInBuf; } else { if (psInfo->nInputLineNo == 1) { /* We just read the header line... reload the input buffer */ _ReadNextSourceLine(psInfo); } /* Uncompress the next line of input and return it */ pszLine = _UncompressNextLine(psInfo); } /* If we just reached EOF then make sure we don't add an extra * empty line at the end of the uncompressed oputput. */ if (psInfo->bEOF && strlen(pszLine) == 0) pszLine = NULL; } return pszLine; } /********************************************************************** * _ReadNextSourceLine() * * Loads the next line from the source file in psInfo. * * psInfo->bEOF should be checked after this call. **********************************************************************/ static void _ReadNextSourceLine(E00ReadPtr psInfo) { if (!psInfo->bEOF) { psInfo->iInBufPtr = 0; psInfo->szInBuf[0] = '\0'; /* Read either using fgets() or psInfo->pfnReadNextLine() * depending on the way the file was opened... */ if (psInfo->pfnReadNextLine == NULL) { if (VSIFGets(psInfo->szInBuf,E00_READ_BUF_SIZE,psInfo->fp) == NULL) { /* We reached EOF */ psInfo->bEOF = 1; } } else { const char *pszLine; pszLine = psInfo->pfnReadNextLine(psInfo->pRefData); if (pszLine) { strncpy(psInfo->szInBuf, pszLine, E00_READ_BUF_SIZE); } else { /* We reached EOF */ psInfo->bEOF = 1; } } if (!psInfo->bEOF) { /* A new line was succesfully read. Remove trailing '\n' if any. * (Note: For Unix systems, we also have to check for '\r') */ int nLen; nLen = strlen(psInfo->szInBuf); while(nLen > 0 && (psInfo->szInBuf[nLen-1] == '\n' || psInfo->szInBuf[nLen-1] == '\r' ) ) { nLen--; psInfo->szInBuf[nLen] = '\0'; } psInfo->nInputLineNo++; } } } /********************************************************************** * _GetNextSourceChar() * * Returns the next char from the source file input buffer... and * reload the input buffer when necessary... this function makes the * whole input file appear as one huge null-terminated string with * no line delimiters. * * Will return '\0' when EOF is reached. **********************************************************************/ static char _GetNextSourceChar(E00ReadPtr psInfo) { char c = '\0'; if (!psInfo->bEOF) { if (psInfo->szInBuf[psInfo->iInBufPtr] == '\0') { _ReadNextSourceLine(psInfo); c = _GetNextSourceChar(psInfo); } else { c = psInfo->szInBuf[psInfo->iInBufPtr++]; } } return c; } /********************************************************************** * _UngetSourceChar() * * Reverse the effect of the previous call to _GetNextSourceChar() by * moving the input buffer pointer back 1 character. * * This function can be called only once per call to _GetNextSourceChar() * (i.e. you cannot unget more than one character) otherwise the pointer * could move before the beginning of the input buffer. **********************************************************************/ static void _UngetSourceChar(E00ReadPtr psInfo) { if (psInfo->iInBufPtr > 0) psInfo->iInBufPtr--; else { /* This error can happen only if _UngetSourceChar() is called * twice in a row (which should never happen!). */ CPLError(CE_Failure, CPLE_AssertionFailed, "UNEXPECTED INTERNAL ERROR: _UngetSourceChar() " "failed while reading line %d.", psInfo->nInputLineNo); } } /********************************************************************** * _UncompressNextLine() * * Uncompress one line of input and return a reference to an internal * buffer containing the uncompressed output. **********************************************************************/ static const char *_UncompressNextLine(E00ReadPtr psInfo) { char c; int bEOL = 0; /* Set to 1 when End of Line reached */ int iOutBufPtr = 0, i, n; int iDecimalPoint, bOddNumDigits, iCurDigit; char *pszExp; int bPreviousCodeWasNumeric = 0; while(!bEOL && (c=_GetNextSourceChar(psInfo)) != '\0') { if (c != '~') { /* Normal character... just copy it */ psInfo->szOutBuf[iOutBufPtr++] = c; bPreviousCodeWasNumeric = 0; } else /* c == '~' */ { /* ======================================================== * Found an encoded sequence. * =======================================================*/ c = _GetNextSourceChar(psInfo); /* -------------------------------------------------------- * Compression level 1: only spaces, '~' and '\n' are encoded * -------------------------------------------------------*/ if (c == ' ') { /* "~ " followed by number of spaces */ c = _GetNextSourceChar(psInfo); n = c - ' '; for(i=0; iszOutBuf[iOutBufPtr++] = ' '; bPreviousCodeWasNumeric = 0; } else if (c == '}') { /* "~}" == '\n' */ bEOL = 1; bPreviousCodeWasNumeric = 0; } else if (bPreviousCodeWasNumeric) { /* If the previous code was numeric, then the only valid code * sequences are the ones above: "~ " and "~}". If we end up * here, it is because the number was followed by a '~' but * this '~' was not a code, it only marked the end of a * number that was not followed by any space. * * We should simply ignore the '~' and return the character * that follows it directly. */ psInfo->szOutBuf[iOutBufPtr++] = c; bPreviousCodeWasNumeric = 0; } else if (c == '~' || c == '-') { /* "~~" and "~-" are simple escape sequences for '~' and '-' */ psInfo->szOutBuf[iOutBufPtr++] = c; } /* -------------------------------------------------------- * Compression level 2: numeric values are encoded. * * All codes for this level are in the form "~ c0 c1 c2 ... cn" * where: * * ~ marks the beginning of a new code sequence * * c0 is a single character code defining the format * of the number (decimal position, exponent, * and even or odd number of digits) * * c1 c2 ... cn each of these characters represent a pair of * digits of the encoded value with '!' == 00 * values 92..99 are encoded on 2 chars that * must be added to each other * (i.e. 92 == }!, 93 == }", ...) * * The sequence ends with a ' ' or a '~' character * -------------------------------------------------------*/ else if (c >= '!' && c <= 'z') { /* The format code defines 3 characteristics of the final number: * - Presence of a decimal point and its position * - Presence of an exponent, and its sign * - Odd or even number of digits */ n = c - '!'; iDecimalPoint = n % 15; /* 0 = no decimal point */ bOddNumDigits = n / 45; /* 0 = even num.digits, 1 = odd */ n = n / 15; if ( n % 3 == 1 ) pszExp = "E+"; else if (n % 3 == 2 ) pszExp = "E-"; else pszExp = NULL; /* Decode the c1 c2 ... cn value and apply the format. * Read characters until we encounter a ' ' or a '~' */ iCurDigit = 0; while((c=_GetNextSourceChar(psInfo)) != '\0' && c != ' ' && c != '~') { n = c - '!'; if (n == 92 && (c=_GetNextSourceChar(psInfo)) != '\0') n += c - '!'; psInfo->szOutBuf[iOutBufPtr++] = '0' + n/10; if (++iCurDigit == iDecimalPoint) psInfo->szOutBuf[iOutBufPtr++] = '.'; psInfo->szOutBuf[iOutBufPtr++] = '0' + n%10; if (++iCurDigit == iDecimalPoint) psInfo->szOutBuf[iOutBufPtr++] = '.'; } if (c == '~' || c == ' ') { bPreviousCodeWasNumeric = 1; _UngetSourceChar(psInfo); } /* If odd number of digits, then flush the last one */ if (bOddNumDigits) iOutBufPtr--; /* Insert the exponent string before the 2 last digits * (we assume the exponent string is 2 chars. long) */ if (pszExp) { for(i=0; i<2;i++) { psInfo->szOutBuf[iOutBufPtr] = psInfo->szOutBuf[iOutBufPtr-2]; psInfo->szOutBuf[iOutBufPtr-2] = pszExp[i]; iOutBufPtr++; } } } else { /* Unsupported code sequence... this is a possibility * given the fact that this library was written by * reverse-engineering the format! * * Send an error to the user and abort. * * If this error ever happens, and you are convinced that * the input file is not corrupted, then please report it to * me at danmo@videotron.ca, quoting the section of the input * file that produced it, and I'll do my best to add support * for this code sequence. */ CPLError(CE_Failure, CPLE_NotSupported, "Unexpected code \"~%c\" encountered in line %d.", c, psInfo->nInputLineNo); /* Force the program to abort by simulating a EOF */ psInfo->bEOF = 1; bEOL = 1; } }/* if c == '~' */ /* E00 lines should NEVER be longer than 80 chars. if we passed * that limit, then the input file is likely corrupt. */ if (iOutBufPtr > 80) { CPLError(CE_Failure, CPLE_FileIO, "Uncompressed line longer than 80 chars. " "Input file possibly corrupt around line %d.", psInfo->nInputLineNo); /* Force the program to abort by simulating a EOF */ psInfo->bEOF = 1; bEOL = 1; } }/* while !EOL */ psInfo->szOutBuf[iOutBufPtr++] = '\0'; return psInfo->szOutBuf; } saga-2.1.0+dfsg/src/modules_io/esri_e00/io_esri_e00/e00compr/e00write.c000066400000000000000000000520641224124640700252360ustar00rootroot00000000000000/********************************************************** * Version $Id: e00write.c 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /********************************************************************** * $Id: e00write.c 911 2011-02-14 16:38:15Z reklov_w $ * * Name: e00write.c * Project: Compressed E00 Read/Write library * Language: ANSI C * Purpose: Functions to write Compressed E00 files from a stream of * uncompressed lines. * Author: Daniel Morissette, danmo@videotron.ca * * $Log: not supported by cvs2svn $ * Revision 1.1.1.1 2005/08/31 14:01:00 oconrad * no message * * Revision 1.1.1.1 2005/08/17 08:25:16 oconrad * no message * * Revision 1.1.1.1 2005/08/15 13:35:12 oconrad * no message * * Revision 1.1 2004/04/16 13:36:45 oconrad * no message * * Revision 1.5 1999/02/25 18:46:41 daniel * Now use CPL for Error handling, Memory allocation, and File access. * * Revision 1.4 1999/01/08 17:40:01 daniel * Added E00WriteCallbackOpen() * * Revision 1.3 1998/11/13 16:54:23 daniel * Check for '\r' and '\n' at end of input line while compressing, just * in case... * * Revision 1.2 1998/11/13 15:48:42 daniel * Simplified the generation of the compression codes for numbers * (use a logical rule instead of going case by case) * * Revision 1.1 1998/11/13 14:19:51 daniel * Initial revision * ********************************************************************** * Copyright (c) 1998, 1999, Daniel Morissette * * All rights reserved. This software may be copied or reproduced, in * all or in part, without the prior written consent of its author, * Daniel Morissette (danmo@videotron.ca). However, any material copied * or reproduced must bear the original copyright notice (above), this * original paragraph, and the original disclaimer (below). * * The entire risk as to the results and performance of the software, * supporting text and other information contained in this file * (collectively called the "Software") is with the user. Although * considerable efforts have been used in preparing the Software, the * author does not warrant the accuracy or completeness of the Software. * In no event will the author be liable for damages, including loss of * profits or consequential damages, arising out of the use of the * Software. * **********************************************************************/ #include #include #include #include #include #include "e00compr.h" static int _CompressLine(E00WritePtr psInfo, const char *pszLine); static int _WriteNextCompressedLine(E00WritePtr psInfo, int nMaxChars); static int _PrintfNextLine(E00WritePtr psInfo, const char *pszFmt, ...); /********************************************************************** * E00WriteOpen() * * Try to open output file, and alloc/initialize a new E00WritePtr * handle. * * nComprLevel must be one of: * E00_COMPR_NONE, E00_COMPR_PARTIAL or E00_COMPR_FULL * * Returns the new handle, or NULL if the file could not be opened. * E00WriteClose() will eventually have to be called to release * the resources used by the new handle. **********************************************************************/ E00WritePtr E00WriteOpen(const char *pszFname, int nComprLevel) { E00WritePtr psInfo = NULL; FILE *fp; CPLErrorReset(); /* Open the file */ fp = VSIFOpen(pszFname, "wt"); if (fp == NULL) { CPLError(CE_Failure, CPLE_OpenFailed, "Failed to open %s: %s", pszFname, strerror(errno)); return NULL; } /* Allocate and initialize a E00ReadPtr handle. */ psInfo = (E00WritePtr)CPLCalloc(1, sizeof(struct _E00WriteInfo)); psInfo->fp = fp; psInfo->nComprLevel = nComprLevel; return psInfo; } /********************************************************************** * E00WriteCallbackOpen() * * This is an alternative to E00WriteOpen() for cases where you want to * do all the file management yourself. You open/close the file yourself * and provide a callback functions to write one line at a time to the * file. pRefData is your handle on the physical file and can * be whatever you want... it is not used by the library, it will be * passed directly to your callback function when it is called. * * The callback function must have the following C prototype: * * int myWriteNextLine(void *pRefData, const char *pszLine); * * Like printf() does, myWriteNextLine() should return a positive * value on success (the number of chars written) * or -1 if an error happened. * The value passed by the library in pszLine will not be terminated * by a '\n' character... it is assumed that the myWriteNextLine() * implementation will take care of terminating the line with a * '\n' if necessary. * * nComprLevel must be one of: * E00_COMPR_NONE, E00_COMPR_PARTIAL or E00_COMPR_FULL * * E00WriteCallbackOpen() returns a new E00ReadWritePtr handle. * E00WriteClose() will eventually have to be called to release * the resources used by the new handle. **********************************************************************/ E00WritePtr E00WriteCallbackOpen(void *pRefData, int (*pfnWriteNextLine)(void *, const char *), int nComprLevel) { E00WritePtr psInfo = NULL; CPLErrorReset(); /* Make sure we received a valid function pointer */ if (pfnWriteNextLine == NULL) { CPLError(CE_Failure, CPLE_IllegalArg, "Invalid function pointer!"); return NULL; } /* Allocate and initialize a E00ReadPtr handle. */ psInfo = (E00WritePtr)CPLCalloc(1, sizeof(struct _E00WriteInfo)); psInfo->pRefData = pRefData; psInfo->pfnWriteNextLine = pfnWriteNextLine; psInfo->nComprLevel = nComprLevel; return psInfo; } /********************************************************************** * E00WriteClose() * * Close output file and release any memory used by the E00WritePtr. **********************************************************************/ void E00WriteClose(E00WritePtr psInfo) { CPLErrorReset(); if (psInfo) { /* Flush output buffer before closing file. */ if (psInfo->iOutBufPtr > 0) _WriteNextCompressedLine(psInfo, 1); if (psInfo->fp) fclose(psInfo->fp); CPLFree(psInfo); } } /********************************************************************** * E00WriteNextLine() * * Take a line of what should be headed to a uncompressed E00 file, * convert it to the requested compression level, and write the * compressed result to the output file. * * Returns 0 if the line was processed succesfully, or an error number * (> 0) if an error happened. **********************************************************************/ int E00WriteNextLine(E00WritePtr psInfo, const char *pszLine) { char *pszPtr; int nStatus = 0; CPLErrorReset(); if (psInfo && (psInfo->fp || psInfo->pfnWriteNextLine)) { psInfo->nSrcLineNo++; if (psInfo->nComprLevel == E00_COMPR_NONE) { /* Uncompressed file... write line directly. */ nStatus = _PrintfNextLine(psInfo, "%s", pszLine); } else if (psInfo->nSrcLineNo == 1) { /* Header line in a compressed file... write line * after replacing "EXP 0" with "EXP 1". */ if ((pszPtr = strstr(pszLine, " 0")) != NULL) { nStatus = _PrintfNextLine(psInfo, "EXP 1%s", pszPtr+2); } else { /* Write line directly... assume that it contains a valid * EXP prefix! */ nStatus = _PrintfNextLine(psInfo, "%s", pszLine); } } else { /* FULL or PARTIAL compression... compress the current line, * (output goes in psInfo->szOutBuf) */ nStatus = _CompressLine(psInfo, pszLine); while (nStatus == 0 && psInfo->iOutBufPtr >= 80) { /* Time to write the first 80 chars from the output buffer */ nStatus = _WriteNextCompressedLine(psInfo, 0); } } } else { /* This should never happen unless the lib is not properly used * or if an error happened in previous calls and was ignored by * the caller */ CPLError(CE_Failure, CPLE_IllegalArg, "Invalid E00WritePtr handle!"); nStatus = 203; } return nStatus; } /********************************************************************** * _CompressLine() * * Compress one line of input, and store the compressed copy at the * end of psInfo->pszOutBuf. * * Returns 0 if the line was compressed succesfully, or an error number * (> 0) if an error happened. **********************************************************************/ static int _CompressLine(E00WritePtr psInfo, const char *pszLine) { int nStatus = 0; int nDigits, nExpSign, nDotPosition, iCurPos; int numTotalDigits, numExpDigits; char n, *pszCodePos; int nStartOutBufPtr; const char *pszStartSrcPtr; while(*pszLine != '\0' && *pszLine != '\n' && *pszLine != '\r') { /*------------------------------------------------------------- * By default, apply PARTIAL compression * Note that PARTIAL is a subset of FULL compression. *------------------------------------------------------------*/ if (*pszLine == '~') { /* The '~' char is encoded as "~~" */ strcpy( psInfo->szOutBuf+psInfo->iOutBufPtr, "~~"); psInfo->iOutBufPtr += 2; } else if (strncmp(pszLine, " ", 3) == 0) { /* A stream of at least 3 spaces. * Count number of spaces and replace with a "~ n" code */ n=1; while(*(pszLine+1) == ' ') { n++; pszLine++; } strcpy( psInfo->szOutBuf+psInfo->iOutBufPtr, "~ "); psInfo->iOutBufPtr += 2; psInfo->szOutBuf[psInfo->iOutBufPtr++] = ' ' + n; } /*------------------------------------------------------------- * The cases below are specific to FULL compression. *------------------------------------------------------------*/ else if (psInfo->nComprLevel == E00_COMPR_FULL && isdigit(*pszLine)) { /* Keep track of current input/output buffer positions in case * we would have to revert the encoding. This could happen if * the numeric value is less than 4 characters. */ nStartOutBufPtr = psInfo->iOutBufPtr; pszStartSrcPtr = pszLine; /* Reset flags used for parsing numeric format */ nDigits = 0; nDotPosition = 0; /* 0 means no decimal point */ nExpSign = 0; /* 0 means no exponent */ numExpDigits = 0; numTotalDigits = 0; n = 0; /* Prepare the code sequence in the output buffer. * The code value will be set only after the number * is finished parsing. */ psInfo->szOutBuf[psInfo->iOutBufPtr++] = '~'; pszCodePos = psInfo->szOutBuf+psInfo->iOutBufPtr++; /* Scan the numeric sequence, encoding the digits as we read, * and keeping track of decimal point position and exponent. */ for(iCurPos=0; *pszLine != '\0' && numExpDigits<2; pszLine++, iCurPos++) { if (isdigit(*pszLine)) { /* Accumulate pairs of digits */ numTotalDigits++; if (numTotalDigits % 2 == 1) { n = (*pszLine - '0')*10; } else { n += (*pszLine - '0'); if (n >= 92) { /* Pairs of digits > 92 are encoded on 2 chars */ psInfo->szOutBuf[psInfo->iOutBufPtr++] = 92 + '!'; n -= 92; } psInfo->szOutBuf[psInfo->iOutBufPtr++] = n + '!'; } /* Count number of exponent digits to end the loop * once we've read 2 exponent digits */ if (nExpSign != 0) numExpDigits++; } else if (*pszLine == '.' && nDotPosition == 0 && iCurPos < 15) { /* Decimal point position... make sure that we have only * one decimal point, and that it is not beyond the 14th * position. If these conditions are not met then end the * numeric sequence here. */ nDotPosition = iCurPos; } else if (*pszLine == 'E' && (*(pszLine+1) == '-' || *(pszLine+1)=='+') && isdigit(*(pszLine+2)) && isdigit(*(pszLine+3)) && !isdigit(*(pszLine+4)) ) { /* Exponent ... fetch sign, and read only 2 more digits * A "E+" or "E-" MUST be followed by 2 and only 2 digits. * If it's not the case, then the numeric sequence ends * here. */ pszLine++; nExpSign = (*pszLine=='-') ? -1: 1; } else { /* Numeric sequence finished ... stop parsing. */ break; } }/*for ... parsing numeric value*/ /* If the numeric value contains an even number of digits, * then pad the last pair of digits with a zero and encode it. */ if (numTotalDigits % 2 == 1) { psInfo->szOutBuf[psInfo->iOutBufPtr++] = n + '!'; } /* If the character that ends the number is NOT a '~', a ' ' * or a 'end of line' then add a '~' to mark the end of the * number. This extra '~' will be ignored by the uncompress * algorithm. */ if (*(pszLine) != '~' && *(pszLine) != ' ' && *(pszLine) != '\0') { psInfo->szOutBuf[psInfo->iOutBufPtr++] = '~'; } /* At the end of the loop, the read pointer is located on the char * that follows the numeric value. Move it back 1 char so that * processing can continue later with the outer loop. */ pszLine--; /* Check that the parsed value contains enough characters to * justify encoding it. The encoded value should not be * bigger than the original. If the encoded value is the same * size as the original then it is still encoded (a bit silly!). * All numbers < 4 chars are not encoded, and some, such as * "1092" won't either because it would require 5 chars to * encode them. * * If the value should not be encoded, then overwrite the sutff * we started encoding with a direct copy of the numeric value. * * (At this point, iCurPos is equal to the number of chars in the * source value.) */ if ( iCurPos < psInfo->iOutBufPtr - nStartOutBufPtr ) { strncpy(psInfo->szOutBuf+ nStartOutBufPtr, pszStartSrcPtr, iCurPos); psInfo->iOutBufPtr = nStartOutBufPtr + iCurPos; } else { /* Now that we have parsed the numeric value, set the code * based on the characteristics we found. */ *pszCodePos = '!' + ((numTotalDigits % 2 == 1)? 45:0) + (nExpSign?((nExpSign>0)?15:30):0) + nDotPosition; } } else { /* This char cannot be compressed ... output directly. */ psInfo->szOutBuf[psInfo->iOutBufPtr++] = *pszLine; } /* Check for buffer overflow... just in case!!! */ if (psInfo->iOutBufPtr >= E00_WRITE_BUF_SIZE) { /* The buffer size has been set big enough to prevent this error * from ever happening. So if it ever happens, then it's likely * that the input lines were longer than 80 chars, which is the * maximum length of a uncompressed line in a E00 file. */ CPLError(CE_Failure, CPLE_FileIO, "Output buffer overflow!!!."); nStatus = 205; break; } /* Get ready to proceed with next char from input string */ pszLine++; } /* Terminate this line with a newline code * This code applies to both PARTIAL and FULL compresion. */ strcpy( psInfo->szOutBuf+psInfo->iOutBufPtr, "~}"); psInfo->iOutBufPtr += 2; return nStatus; } /********************************************************************** * _WriteNextCompressedLine() * * If bFlushWholeBuffer == 0, write the first 80 characters from * psInfo->szOutBuf, and remove the written chars from szOutBuf. * A '\n' (not counted in nMaxChars) will be written to terminate the * output line. * * Pass bFlushBuffer == 1 to force writing the whole contents of szOutBuf * at once. * * Returns 0 if the line was written succesfully, or an error number * (> 0) if an error happened. **********************************************************************/ static int _WriteNextCompressedLine(E00WritePtr psInfo, int bFlushWholeBuffer) { int nStatus = 0, nToWrite; char *pszSrc, *pszDst; psInfo->szOutBuf[psInfo->iOutBufPtr] = '\0'; if (!bFlushWholeBuffer && psInfo->iOutBufPtr > 80) { /* Write the first 80 chars * Note that a compressed line cannot end with spaces... spaces should * be reported on the next line. */ nToWrite = 80; while(nToWrite > 1 && psInfo->szOutBuf[nToWrite-1] == ' ') nToWrite--; nStatus = _PrintfNextLine(psInfo, "%-.*s", nToWrite, psInfo->szOutBuf); /* Remove these chars from the output buffer */ pszDst = psInfo->szOutBuf; pszSrc = psInfo->szOutBuf+nToWrite; while(*pszSrc != '\0') { *pszDst = *pszSrc; pszDst++; pszSrc++; } psInfo->iOutBufPtr -= nToWrite; } else { /* Just write the buffer contents directly */ nStatus = _PrintfNextLine(psInfo, "%s", psInfo->szOutBuf); psInfo->iOutBufPtr = 0; } return nStatus; } /********************************************************************** * _PrintfNextLine() * * Cover function for fprintf() that will do error checking and * reporting, and either call fprintf() directly or call the callback * provided by the caller if E00WriteCallbackOpen() was used. * * A \n will be automatically appended to the string when it is * written, so no \n should be included at the end of pszFmt. * * Returns 0 on success, or error 204 if it failed. **********************************************************************/ static int _PrintfNextLine(E00WritePtr psInfo, const char *pszFmt, ...) { va_list args; static char szBuf[E00_WRITE_BUF_SIZE]; int nStatus = 0; /* Expand the string to print */ va_start(args, pszFmt); vsprintf(szBuf, pszFmt, args); va_end(args); /* Write the line using the right method */ if (psInfo->pfnWriteNextLine == NULL) { /* Use fprintf() directly */ if ( VSIFPrintf(psInfo->fp, "%s\n", szBuf) < 0) { CPLError(CE_Failure, CPLE_FileIO, "Error writing to file: %s", strerror(errno)); nStatus = 204; } } else { /* Use pfnWritenextLine() callback */ if ( psInfo->pfnWriteNextLine(psInfo->pRefData, szBuf) < 0) { CPLError(CE_Failure, CPLE_FileIO, "Error writing to file."); nStatus = 204; } } return nStatus; } saga-2.1.0+dfsg/src/modules_io/gdal/000077500000000000000000000000001224124640700172035ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/gdal/Makefile.am000066400000000000000000000000231224124640700212320ustar00rootroot00000000000000SUBDIRS = io_gdal saga-2.1.0+dfsg/src/modules_io/gdal/Makefile.in000066400000000000000000000424331224124640700212560ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/gdal DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = io_gdal all: all-recursive .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) --gnu src/modules_io/gdal/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/gdal/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/000077500000000000000000000000001224124640700206015ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/MLB_Interface.cpp000066400000000000000000000123071224124640700237020ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1706 2013-05-29 11:06:43Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO_GDAL // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Author // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: author@email.de // // // // contact: Author // // Sesame Street 7 // // 12345 Metropolis // // Nirwana // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "gdal_driver.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Import/Export - GDAL/OGR") ); case MLB_INFO_Author: return( _TL("SAGA User Group Associaton (c) 2008" )); case MLB_INFO_Description: return( CSG_String::Format(SG_T("%s\n%s %s\n%s: %s"), _TL("Interface to Frank Warmerdam's Geospatial Data Abstraction Library (GDAL)."), _TL("Version"), SG_Get_GDAL_Drivers().Get_Version().c_str(), _TL("Homepage"), SG_T("www.gdal.org\n") )); case MLB_INFO_Version: return( SG_T("2.0") ); case MLB_INFO_Menu_Path: return( _TL("File|GDAL/OGR") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "gdal_import.h" #include "gdal_export.h" #include "gdal_export_geotiff.h" #include "gdal_import_netcdf.h" #include "ogr_import.h" #include "ogr_export.h" #include "ogr_export_kml.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CGDAL_Import ); case 1: return( new CGDAL_Export ); case 2: return( new CGDAL_Export_GeoTIFF ); case 3: return( new COGR_Import ); case 4: return( new COGR_Export ); case 5: return( new COGR_Export_KML ); case 6: return( SG_Get_GDAL_Drivers().Get_Driver("netCDF") ? new CGDAL_Import_NetCDF : NULL ); //----------------------------------------------------- case 9: return( NULL ); default: return( MLB_INTERFACE_SKIP_MODULE ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/MLB_Interface.h000066400000000000000000000074011224124640700233460ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2007 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__io_gdal_H #define HEADER_INCLUDED__io_gdal_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef io_gdal_EXPORTS #define io_gdal_EXPORT _SAGA_DLL_EXPORT #else #define io_gdal_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__io_gdal_H saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/Makefile.am000066400000000000000000000016741224124640700226450ustar00rootroot00000000000000# # $Id: Makefile.am 1465 2012-08-23 09:20:00Z oconrad $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEP_LIBS = `gdal-config --libs` DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core `gdal-config --cflags` AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LIBS) pkglib_LTLIBRARIES = libio_gdal.la libio_gdal_la_SOURCES =\ gdal_driver.cpp\ gdal_export.cpp\ gdal_export_geotiff.cpp\ gdal_import.cpp\ gdal_import_netcdf.cpp\ MLB_Interface.cpp\ ogr_driver.cpp\ ogr_export.cpp\ ogr_export_kml.cpp\ ogr_import.cpp\ gdal_driver.h\ gdal_export.h\ gdal_export_geotiff.h\ gdal_import.h\ gdal_import_netcdf.h\ MLB_Interface.h\ ogr_driver.h\ ogr_export.h\ ogr_export_kml.h\ ogr_import.h libio_gdal_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/Makefile.in000066400000000000000000000462201224124640700226520ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/gdal/io_gdal DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libio_gdal_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libio_gdal_la_OBJECTS = gdal_driver.lo gdal_export.lo \ gdal_export_geotiff.lo gdal_import.lo gdal_import_netcdf.lo \ MLB_Interface.lo ogr_driver.lo ogr_export.lo ogr_export_kml.lo \ ogr_import.lo libio_gdal_la_OBJECTS = $(am_libio_gdal_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libio_gdal_la_SOURCES) DIST_SOURCES = $(libio_gdal_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1465 2012-08-23 09:20:00Z oconrad $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEP_LIBS = `gdal-config --libs` DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core `gdal-config --cflags` AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LIBS) pkglib_LTLIBRARIES = libio_gdal.la libio_gdal_la_SOURCES = \ gdal_driver.cpp\ gdal_export.cpp\ gdal_export_geotiff.cpp\ gdal_import.cpp\ gdal_import_netcdf.cpp\ MLB_Interface.cpp\ ogr_driver.cpp\ ogr_export.cpp\ ogr_export_kml.cpp\ ogr_import.cpp\ gdal_driver.h\ gdal_export.h\ gdal_export_geotiff.h\ gdal_import.h\ gdal_import_netcdf.h\ MLB_Interface.h\ ogr_driver.h\ ogr_export.h\ ogr_export_kml.h\ ogr_import.h libio_gdal_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_io/gdal/io_gdal/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/gdal/io_gdal/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libio_gdal.la: $(libio_gdal_la_OBJECTS) $(libio_gdal_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libio_gdal_la_OBJECTS) $(libio_gdal_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdal_driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdal_export.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdal_export_geotiff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdal_import.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdal_import_netcdf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogr_driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogr_export.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogr_export_kml.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogr_import.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/gdal_driver.cpp000066400000000000000000000563651224124640700236060ustar00rootroot00000000000000/********************************************************** * Version $Id: gdal_driver.cpp 1751 2013-06-26 08:03:18Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // gdal_driver.cpp // // // // Copyright (C) 2007 by O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gdal_driver.h" #include #include #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_GDAL_Drivers gSG_GDAL_Drivers; const CSG_GDAL_Drivers & SG_Get_GDAL_Drivers (void) { return( gSG_GDAL_Drivers ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_GDAL_Drivers::CSG_GDAL_Drivers(void) { GDALAllRegister(); // affects Windows only, might be appropriate for applications // that treat filenames as being in the local encoding. // for more info see: http://trac.osgeo.org/gdal/wiki/ConfigOptions CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "NO"); m_pDrivers = GetGDALDriverManager(); } //--------------------------------------------------------- CSG_GDAL_Drivers::~CSG_GDAL_Drivers(void) { GDALDestroyDriverManager(); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_String CSG_GDAL_Drivers::Get_Version(void) const { return( GDALVersionInfo("RELEASE_NAME") ); } //--------------------------------------------------------- int CSG_GDAL_Drivers::Get_Count(void) const { return( m_pDrivers->GetDriverCount() ); } //--------------------------------------------------------- GDALDriver * CSG_GDAL_Drivers::Get_Driver(const CSG_String &Name) const { return( (GDALDriver *)GDALGetDriverByName(Name) ); } //--------------------------------------------------------- GDALDriver * CSG_GDAL_Drivers::Get_Driver(int Index) const { return( (GDALDriver *)GDALGetDriver(Index) ); } //--------------------------------------------------------- CSG_String CSG_GDAL_Drivers::Get_Name(int Index) const { return( Get_Driver(Index)->GetMetadataItem(GDAL_DMD_LONGNAME) ); } //--------------------------------------------------------- CSG_String CSG_GDAL_Drivers::Get_Description(int Index) const { return( Get_Driver(Index)->GetDescription() ); } //--------------------------------------------------------- CSG_String CSG_GDAL_Drivers::Get_Extension(int Index) const { return( Get_Driver(Index)->GetMetadataItem(GDAL_DMD_EXTENSION) ); } //--------------------------------------------------------- bool CSG_GDAL_Drivers::Can_Read(int Index) const { return( Index >= 0 && Index < Get_Count() ); // ? CSLFetchBoolean(Get_Driver(Index)->GetMetadata(), GDAL_DCAP_CREATE, false) != 0 : false ); } //--------------------------------------------------------- bool CSG_GDAL_Drivers::Can_Write(int Index) const { return( Index >= 0 && Index < Get_Count() ? CSLFetchBoolean(Get_Driver(Index)->GetMetadata(), GDAL_DCAP_CREATE, false) != 0 : false ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CSG_GDAL_Drivers::Get_GDAL_Type(TSG_Data_Type Type) { switch( Type ) { case SG_DATATYPE_Bit: return( GDT_Byte ); // Eight bit unsigned integer case SG_DATATYPE_Byte: return( GDT_Byte ); // Eight bit unsigned integer case SG_DATATYPE_Char: return( GDT_Byte ); // Eight bit unsigned integer case SG_DATATYPE_Word: return( GDT_UInt16 ); // Sixteen bit unsigned integer case SG_DATATYPE_Short: return( GDT_Int16 ); // Sixteen bit signed integer case SG_DATATYPE_DWord: return( GDT_UInt32 ); // Thirty two bit unsigned integer case SG_DATATYPE_Int: return( GDT_Int32 ); // Thirty two bit signed integer case SG_DATATYPE_Float: return( GDT_Float32 ); // Thirty two bit floating point case SG_DATATYPE_Double: return( GDT_Float64 ); // Sixty four bit floating point default: return( GDT_Float64 ); } } //--------------------------------------------------------- TSG_Data_Type CSG_GDAL_Drivers::Get_SAGA_Type(int Type) { switch( Type ) { case GDT_Byte: return( SG_DATATYPE_Byte ); // Eight bit unsigned integer case GDT_UInt16: return( SG_DATATYPE_Word ); // Sixteen bit unsigned integer case GDT_Int16: return( SG_DATATYPE_Short ); // Sixteen bit signed integer case GDT_UInt32: return( SG_DATATYPE_DWord ); // Thirty two bit unsigned integer case GDT_Int32: return( SG_DATATYPE_Int ); // Thirty two bit signed integer case GDT_Float32: return( SG_DATATYPE_Float ); // Thirty two bit floating point case GDT_Float64: return( SG_DATATYPE_Double ); // Sixty four bit floating point case GDT_CInt16: return( SG_DATATYPE_Undefined ); // Complex Int16 case GDT_CInt32: return( SG_DATATYPE_Undefined ); // Complex Int32 case GDT_CFloat32: return( SG_DATATYPE_Undefined ); // Complex Float32 case GDT_CFloat64: return( SG_DATATYPE_Undefined ); // Complex Float64 default: return( SG_DATATYPE_Undefined ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_GDAL_DataSet::CSG_GDAL_DataSet(void) { m_pDataSet = NULL; m_TF_A.Create(2); m_TF_B.Create(2, 2); } //--------------------------------------------------------- CSG_GDAL_DataSet::CSG_GDAL_DataSet(const CSG_String &File_Name) { m_pDataSet = NULL; m_TF_A.Create(2); m_TF_B.Create(2, 2); Open_Read(File_Name); } //--------------------------------------------------------- CSG_GDAL_DataSet::~CSG_GDAL_DataSet(void) { Close(); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_GDAL_DataSet::Open_Read(const CSG_String &File_Name) { Close(); if( (m_pDataSet = (GDALDataset *)GDALOpen(File_Name, GA_ReadOnly)) == NULL ) { return( false ); } //----------------------------------------------------- double Transform[6]; m_Access = SG_GDAL_IO_READ; m_NX = m_pDataSet->GetRasterXSize(); m_NY = m_pDataSet->GetRasterYSize(); if( m_pDataSet->GetGeoTransform(Transform) != CE_None ) { m_bTransform = false; m_Cellsize = 1.0; m_xMin = 0.5; m_yMin = 0.5; } else if( Transform[1] == -Transform[5] && Transform[2] == 0.0 && Transform[4] == 0.0 ) // nothing to transform { m_bTransform = false; m_Cellsize = Transform[1]; // pixel width (== pixel height) m_xMin = Transform[0] + m_Cellsize * 0.5; // center (x) of left edge pixels m_yMin = Transform[3] + m_Cellsize * (0.5 - m_NY); // center (y) of lower edge pixels } else { m_bTransform = true; m_Cellsize = 1.0; m_xMin = 0.5; m_yMin = 0.5; } m_TF_A[0] = Transform[0]; m_TF_A[1] = Transform[3]; m_TF_B[0][0] = Transform[1]; m_TF_B[0][1] = Transform[2]; m_TF_B[1][0] = Transform[4]; m_TF_B[1][1] = Transform[5]; m_TF_BInv = m_TF_B.Get_Inverse(); return( true ); } //--------------------------------------------------------- bool CSG_GDAL_DataSet::Open_Write(const CSG_String &File_Name, const CSG_String &Driver, const CSG_String &Options,TSG_Data_Type Type, int NBands, const CSG_Grid_System &System, const CSG_Projection &Projection) { char **pOptions = NULL; char **pTokens = NULL; GDALDriver *pDriver; if (!Options.is_Empty()){ pTokens = CSLTokenizeString2( Options, " ", CSLT_STRIPLEADSPACES); for( int i = 0; pTokens != NULL && pTokens[i] != NULL; i++ ){ pOptions = CSLAddString( pOptions, pTokens[i] ); } } Close(); //-------------------------------------------------------- if( (pDriver = gSG_GDAL_Drivers.Get_Driver(Driver)) == NULL ) { SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("%s: %s"), _TL("driver not found."), Driver.c_str())); return( false ); } if( !GDALValidateCreationOptions (pDriver, pOptions)) { SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("%s: %s"), _TL("Creation option(s) not supported by the driver"), Options.c_str() )); return false; } if( CSLFetchBoolean(pDriver->GetMetadata(), GDAL_DCAP_CREATE, false) == false ) { SG_UI_Msg_Add_Error(_TL("Driver does not support file creation.")); return( false ); } if( (m_pDataSet = pDriver->Create(File_Name, System.Get_NX(), System.Get_NY(), NBands, (GDALDataType)gSG_GDAL_Drivers.Get_GDAL_Type(Type), pOptions)) == NULL ) { SG_UI_Msg_Add_Error(_TL("Could not create dataset.")); return( false ); } //-------------------------------------------------------- m_Access = SG_GDAL_IO_WRITE; if( Projection.is_Okay() ) { m_pDataSet->SetProjection(Projection.Get_WKT()); } double Transform[6] = { System.Get_XMin() - 0.5 * System.Get_Cellsize(), System.Get_Cellsize(), 0.0, System.Get_YMax() + 0.5 * System.Get_Cellsize(), 0.0, -System.Get_Cellsize() }; m_pDataSet->SetGeoTransform(Transform); m_NX = m_pDataSet->GetRasterXSize(); m_NY = m_pDataSet->GetRasterYSize(); m_bTransform = false; m_Cellsize = 1.0; m_xMin = 0.5; m_yMin = 0.5; return( true ); } //--------------------------------------------------------- bool CSG_GDAL_DataSet::Close(void) { if( m_pDataSet ) { GDALClose(m_pDataSet); m_pDataSet = NULL; } m_Access = SG_GDAL_IO_CLOSED; if (strlen(CPLGetLastErrorMsg()) > 3) { SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("%s: %s"),_TL("Dataset creation failed") , SG_STR_MBTOSG(CPLGetLastErrorMsg()))); CPLErrorReset(); return false; } return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- GDALDriver * CSG_GDAL_DataSet::Get_Driver(void) const { return( m_pDataSet ? m_pDataSet->GetDriver() : NULL ); } //--------------------------------------------------------- CSG_String CSG_GDAL_DataSet::Get_DriverID(void) const { return( m_pDataSet && m_pDataSet->GetDriver() && m_pDataSet->GetDriver()->GetDescription() ? m_pDataSet->GetDriver()->GetDescription() : "" ); } //--------------------------------------------------------- const char * CSG_GDAL_DataSet::Get_Projection(void) const { return( m_pDataSet && m_pDataSet->GetProjectionRef() ? m_pDataSet->GetProjectionRef() : "" ); } //--------------------------------------------------------- CSG_String CSG_GDAL_DataSet::Get_Name(void) const { return( m_pDataSet ? m_pDataSet->GetMetadataItem(GDAL_DMD_LONGNAME) : "" ); } //--------------------------------------------------------- CSG_String CSG_GDAL_DataSet::Get_Description(void) const { return( m_pDataSet ? m_pDataSet->GetDescription() : "" ); } //--------------------------------------------------------- const char * CSG_GDAL_DataSet::Get_MetaData_Item(const char *pszName, const char *pszDomain) const { return( m_pDataSet ? m_pDataSet->GetMetadataItem(pszName, pszDomain) : "" ); } //--------------------------------------------------------- const char ** CSG_GDAL_DataSet::Get_MetaData(const char *pszDomain) const { return( m_pDataSet ? (const char **)m_pDataSet->GetMetadata(pszDomain) : NULL ); } //--------------------------------------------------------- bool CSG_GDAL_DataSet::Get_MetaData_Item(CSG_String &MetaData, const char *pszName, const char *pszDomain) const { const char *Item = Get_MetaData_Item(pszName, pszDomain); if( Item && *Item ) { MetaData = Item; return( true ); } return( false ); } //--------------------------------------------------------- bool CSG_GDAL_DataSet::Get_MetaData(CSG_MetaData &MetaData) const { if( m_pDataSet && is_Reading() ) { char **pMetaData = m_pDataSet->GetMetadata() + 0; if( pMetaData ) { while( *pMetaData ) { CSG_String s(*pMetaData); MetaData.Add_Child(s.BeforeFirst(SG_T('=')), s.AfterFirst(SG_T('='))); pMetaData++; } return( true ); } } return( false ); } //--------------------------------------------------------- bool CSG_GDAL_DataSet::Get_MetaData(CSG_MetaData &MetaData, const char *pszDomain) const { if( m_pDataSet && is_Reading() ) { char **pMetaData = m_pDataSet->GetMetadata(pszDomain) + 0; if( pMetaData ) { while( *pMetaData ) { CSG_String s(*pMetaData); MetaData.Add_Child(s.BeforeFirst(SG_T('=')), s.AfterFirst(SG_T('='))); pMetaData++; } return( true ); } } return( false ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CSG_GDAL_DataSet::Get_Count(void) const { return( m_pDataSet ? m_pDataSet->GetRasterCount() : 0 ); } //--------------------------------------------------------- CSG_String CSG_GDAL_DataSet::Get_Name(int i) const { CSG_String Name; GDALRasterBand *pBand; if( is_Reading() && (pBand = m_pDataSet->GetRasterBand(i + 1)) != NULL ) { const char *s; //------------------------------------------------- if( !SG_STR_CMP(m_pDataSet->GetDriver()->GetDescription(), "GRIB") ) { if( (s = pBand->GetMetadataItem("GRIB_COMMENT")) != NULL && *s ) { Name = s; if( (s = pBand->GetMetadataItem("GRIB_ELEMENT" )) != NULL && *s ) { Name += "["; Name += s; Name += "]"; } if( (s = pBand->GetMetadataItem("GRIB_SHORT_NAME")) != NULL && *s ) { Name += "["; Name += s; Name += "]"; } if( (s = pBand->GetMetadataItem("GRIB_VALID_TIME")) != NULL && *s ) { Name += CSG_String::Format(SG_T("[%s]"), CSG_Time_Converter::Get_String(atoi(s), SG_TIME_FMT_Seconds_Unix).c_str()); } } } //------------------------------------------------- if( !SG_STR_CMP(m_pDataSet->GetDriver()->GetDescription(), "netCDF") ) { if( (s = pBand->GetMetadataItem("NETCDF_VARNAME" )) != NULL && *s ) { Name += "["; Name += s; Name += "]"; } if( (s = pBand->GetMetadataItem("NETCDF_DIMENSION_time" )) != NULL && *s ) { Name += "["; Name += s; Name += "]"; } if( (s = pBand->GetMetadataItem("NETCDF_DIMENSION_level")) != NULL && *s ) { Name += "["; Name += s; Name += "]"; } } //------------------------------------------------- if( Name.is_Empty() ) { if( (s = pBand->GetMetadataItem(GDAL_DMD_LONGNAME)) != NULL && *s ) { Name = s; } Name.Printf(SG_T("%s %02d"), Get_Name().c_str(), i + 1); } } return( Name ); } //--------------------------------------------------------- CSG_String CSG_GDAL_DataSet::Get_Description(int i) const { CSG_String Description; GDALRasterBand *pBand; if( is_Reading() && (pBand = m_pDataSet->GetRasterBand(i + 1)) != NULL ) { char **pMetaData = pBand->GetMetadata() + 0; if( pMetaData ) { while( *pMetaData ) { CSG_String s(*pMetaData); Description += s + SG_T("\n"); pMetaData++; } } } return( Description ); } //--------------------------------------------------------- bool CSG_GDAL_DataSet::Get_MetaData(int i, CSG_MetaData &MetaData) const { GDALRasterBand *pBand; if( is_Reading() && (pBand = m_pDataSet->GetRasterBand(i + 1)) != NULL ) { char **pMetaData = pBand->GetMetadata() + 0; if( pMetaData ) { while( *pMetaData ) { CSG_String s(*pMetaData); MetaData.Add_Child(s.BeforeFirst(SG_T('=')), s.AfterFirst(SG_T('='))); pMetaData++; } return( true ); } } return( false ); } //--------------------------------------------------------- const char * CSG_GDAL_DataSet::Get_MetaData_Item(int i, const char *pszName) const { GDALRasterBand *pBand = m_pDataSet->GetRasterBand(i + 1); return( pBand ? pBand->GetMetadataItem(pszName) : "" ); } bool CSG_GDAL_DataSet::Get_MetaData_Item(int i, const char *pszName, CSG_String &MetaData) const { GDALRasterBand *pBand; if( (pBand = m_pDataSet->GetRasterBand(i + 1)) != NULL ) { const char *pMetaData = pBand->GetMetadataItem(pszName); if( pMetaData && *pMetaData ) { MetaData = pMetaData; return( true ); } } return( false ); } //--------------------------------------------------------- CSG_Grid * CSG_GDAL_DataSet::Read(int i) { //------------------------------------------------- if( !is_Reading() ) { return( NULL ); } //------------------------------------------------- GDALRasterBand *pBand = m_pDataSet->GetRasterBand(i + 1); if( !pBand ) { return( NULL ); } //------------------------------------------------- int bSuccess; double zScale = pBand->GetScale (&bSuccess); if( !bSuccess || !zScale ) zScale = 1.0; double zMin = pBand->GetOffset(&bSuccess); if( !bSuccess ) zMin = 0.0; TSG_Data_Type Type = gSG_GDAL_Drivers.Get_SAGA_Type(pBand->GetRasterDataType()); if( SG_Get_Significant_Decimals(zScale) > 0 && (Type != SG_DATATYPE_Float || Type != SG_DATATYPE_Double) ) { Type = SG_DATATYPE_Float; // force to float, we will rescale data in any case! } //------------------------------------------------- CSG_Grid *pGrid = SG_Create_Grid(Type, Get_NX(), Get_NY(), Get_Cellsize(), Get_xMin(), Get_yMin()); if( !pGrid ) { return( NULL ); } //------------------------------------------------- pGrid->Set_Name (Get_Name (i)); pGrid->Set_Description (Get_Description(i)); pGrid->Set_Unit (CSG_String(pBand->GetUnitType())); pBand->GetNoDataValue(&bSuccess); if( bSuccess ) { pGrid->Set_NoData_Value(pBand->GetNoDataValue(&bSuccess)); } pGrid->Get_Projection().Create(Get_Projection(), SG_PROJ_FMT_WKT); Get_MetaData(i, pGrid->Get_MetaData()); //------------------------------------------------- double *zLine = (double *)SG_Malloc(Get_NX() * sizeof(double)); for(int y=0; yRasterIO(GF_Read, 0, y, Get_NX(), 1, zLine, Get_NX(), 1, GDT_Float64, 0, 0) == CE_None ) { for(int x=0; xSet_NoData(x, yy); else pGrid->Set_Value(x, yy, zMin + zScale * zLine[x]); } } } SG_Free(zLine); return( pGrid ); } //--------------------------------------------------------- bool CSG_GDAL_DataSet::Write(int i, CSG_Grid *pGrid, double noDataValue) { if( !m_pDataSet || !pGrid || pGrid->Get_NX() != Get_NX() || pGrid->Get_NY() != Get_NY() || i < 0 || i >= Get_Count() ) { return( false ); } GDALRasterBand *pBand = m_pDataSet->GetRasterBand(i + 1); //----------------------------------------------------- CPLErr Error = CE_None; double *zLine = (double *)SG_Malloc(Get_NX() * sizeof(double)); for(int y=0, yy=Get_NY()-1; Error==CE_None && yis_NoData(x, yy) ? noDataValue : pGrid->asDouble(x, yy); } Error = pBand->RasterIO(GF_Write, 0, y, Get_NX(), 1, zLine, Get_NX(), 1, GDT_Float64, 0, 0); } SG_Free(zLine); //----------------------------------------------------- if( Error != CE_None ) { SG_UI_Msg_Add_Error(CSG_String::Format(SG_T("%s"), _TL("Writing dataset failed."))); return( false ); } //----------------------------------------------------- pBand->SetNoDataValue (noDataValue); pBand->SetStatistics (pGrid->Get_ZMin(), pGrid->Get_ZMax(), pGrid->Get_ArithMean(), pGrid->Get_StdDev()); return( true ); } //--------------------------------------------------------- bool CSG_GDAL_DataSet::Write(int i, CSG_Grid *pGrid) { return (CSG_GDAL_DataSet::Write (i, pGrid, pGrid->Get_NoData_Value())); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- TSG_Data_Type SG_Get_Grid_Type (CSG_Parameter_Grid_List *pGrids) { TSG_Data_Type Type = SG_DATATYPE_Byte; if( pGrids ) { for(int i=0; iGet_Count(); i++) { if( SG_Data_Type_Get_Size(Type) <= SG_Data_Type_Get_Size(pGrids->asGrid(i)->Get_Type()) ) { Type = pGrids->asGrid(i)->Get_Type(); } } } return( Type ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/gdal_driver.h000066400000000000000000000211711224124640700232360ustar00rootroot00000000000000/********************************************************** * Version $Id: gdal_driver.h 1680 2013-05-04 12:06:43Z benducke $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // gdal_driver.h // // // // Copyright (C) 2007 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gdal_driver_H #define HEADER_INCLUDED__gdal_driver_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class io_gdal_EXPORT CSG_GDAL_Drivers { public: CSG_GDAL_Drivers(void); virtual ~CSG_GDAL_Drivers(void); CSG_String Get_Version (void) const; int Get_Count (void) const; class GDALDriver * Get_Driver (const CSG_String &Name) const; class GDALDriver * Get_Driver (int Index) const; CSG_String Get_Name (int Index) const; CSG_String Get_Description (int Index) const; CSG_String Get_Extension (int Index) const; bool Can_Read (int Index) const; bool Can_Write (int Index) const; static int Get_GDAL_Type (TSG_Data_Type Type); static TSG_Data_Type Get_SAGA_Type (int Type); private: class GDALDriverManager *m_pDrivers; }; //--------------------------------------------------------- io_gdal_EXPORT const CSG_GDAL_Drivers & SG_Get_GDAL_Drivers (void); /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define SG_GDAL_IO_CLOSED 0x00 #define SG_GDAL_IO_READ 0x01 #define SG_GDAL_IO_WRITE 0x02 #define SG_GDAL_IO_READWRITE (SG_GDAL_IO_READ|IO_WRITE) //--------------------------------------------------------- class io_gdal_EXPORT CSG_GDAL_DataSet { public: CSG_GDAL_DataSet(void); CSG_GDAL_DataSet(const CSG_String &File_Name); virtual ~CSG_GDAL_DataSet(void); bool Open_Read (const CSG_String &File_Name); bool Open_Write (const CSG_String &File_Name, const CSG_String &Driver, const CSG_String &Options, TSG_Data_Type Type, int NBands, const CSG_Grid_System &System, const CSG_Projection &Projection); bool Close (void); bool is_Okay (void) const { return( m_pDataSet != NULL ); } bool is_Reading (void) const { return( m_pDataSet != NULL && m_Access & SG_GDAL_IO_READ ); } bool is_Writing (void) const { return( m_pDataSet != NULL && m_Access & SG_GDAL_IO_WRITE ); } int Get_NX (void) const { return( m_NX ); } int Get_NY (void) const { return( m_NY ); } double Get_Cellsize (void) const { return( m_Cellsize ); } double Get_xMin (void) const { return( m_xMin ); } double Get_yMin (void) const { return( m_yMin ); } double Get_xMax (void) const { return( m_xMin + m_NX * m_Cellsize ); } double Get_yMax (void) const { return( m_yMin + m_NY * m_Cellsize ); } bool Needs_Transform (void) const { return( m_bTransform ); } void Get_Transform (CSG_Vector &A, CSG_Matrix &B) const { A = m_TF_A; B = m_TF_B; } class GDALDriver * Get_Driver (void) const; CSG_String Get_DriverID (void) const; CSG_String Get_Name (void) const; CSG_String Get_Description (void) const; const char * Get_Projection (void) const; const char * Get_MetaData_Item (const char *pszName, const char *pszDomain = "") const; const char ** Get_MetaData (const char *pszDomain = "") const; bool Get_MetaData_Item (CSG_String &MetaData, const char *pszName, const char *pszDomain = "") const; bool Get_MetaData (CSG_MetaData &MetaData) const; bool Get_MetaData (CSG_MetaData &MetaData, const char *pszDomain) const; int Get_Count (void) const; CSG_String Get_Name (int i) const; CSG_String Get_Description (int i) const; bool Get_MetaData (int i, CSG_MetaData &MetaData) const; const char * Get_MetaData_Item (int i, const char *pszName) const; bool Get_MetaData_Item (int i, const char *pszName, CSG_String &MetaData) const; CSG_Grid * Read (int i); bool Write (int i, CSG_Grid *pGrid, double NoDataValue); bool Write (int i, CSG_Grid *pGrid); private: bool m_bTransform; int m_Access, m_NX, m_NY; double m_xMin, m_yMin, m_Cellsize; CSG_Vector m_TF_A; CSG_Matrix m_TF_B, m_TF_BInv; class GDALDataset *m_pDataSet; public: bool to_World (double x, double y, double &xWorld, double &yWorld) { if( m_pDataSet ) { xWorld = m_TF_A[0] + x * m_TF_B[0][1] + y * m_TF_B[0][1]; yWorld = m_TF_A[1] + x * m_TF_B[1][0] + y * m_TF_B[1][1]; return( true ); } return( false ); } bool from_World (double xWorld, double yWorld, double &x, double &y) { if( m_pDataSet ) { xWorld -= m_TF_A[0]; yWorld -= m_TF_A[1]; x = xWorld * m_TF_BInv[0][0] + yWorld * m_TF_BInv[0][1]; y = xWorld * m_TF_BInv[1][0] + yWorld * m_TF_BInv[1][1]; return( true ); } return( false ); } }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- io_gdal_EXPORT TSG_Data_Type SG_Get_Grid_Type (CSG_Parameter_Grid_List *pGrids); /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gdal_driver_H saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/gdal_export.cpp000066400000000000000000000203541224124640700236210ustar00rootroot00000000000000/********************************************************** * Version $Id: gdal_export.cpp 1680 2013-05-04 12:06:43Z benducke $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // gdal_export.cpp // // // // Copyright (C) 2007 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gdal_export.h" #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGDAL_Export::CGDAL_Export(void) { Set_Name (_TL("GDAL: Export Raster")); Set_Author (SG_T("O.Conrad (c) 2007")); CSG_String Description, Formats; Description = _TW( "The \"GDAL Raster Export\" module exports one or more grids to various file formats using the " "\"Geospatial Data Abstraction Library\" (GDAL) by Frank Warmerdam. " "For more information have a look at the GDAL homepage:\n" " " " http://www.gdal.org\n" ); Description += CSG_String::Format(SG_T("\nGDAL %s:%s\n\n"), _TL("Version"), SG_Get_GDAL_Drivers().Get_Version().c_str()); Description += _TW( "Following raster formats are currently supported:\n" "\n" ); for(int i=0; i\n"), SG_Get_GDAL_Drivers().Get_Description(i).c_str(), SG_Get_GDAL_Drivers().Get_Name (i).c_str() ); Formats += CSG_String::Format(SG_T("{%s}%s|"), SG_Get_GDAL_Drivers().Get_Description(i).c_str(), SG_Get_GDAL_Drivers().Get_Name (i).c_str() ); } } Description += SG_T("
    IDName
    %s%s
    "); Set_Description(Description); //----------------------------------------------------- Parameters.Add_Grid_List( NULL, "GRIDS" , _TL("Grid(s)"), _TL("The SAGA grids to be exported."), PARAMETER_INPUT ); Parameters.Add_FilePath( NULL, "FILE" , _TL("File"), _TL("The GDAL dataset to be created."), NULL, NULL, true ); Parameters.Add_Choice( NULL, "FORMAT" , _TL("Format"), _TL("The GDAL raster format (driver) to be used."), Formats ); Parameters.Add_Choice( NULL, "TYPE" , _TL("Data Type"), _TL("The GDAL datatype of the created dataset."), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|"), _TL("match input data"), _TL("8 bit unsigned integer"), _TL("16 bit unsigned integer"), _TL("16 bit signed integer"), _TL("32 bit unsigned integer"), _TL("32 bit signed integer"), _TL("32 bit floating point"), _TL("64 bit floating point") ), 0 ); Parameters.Add_Value( NULL, "SET_NODATA" , _TL("Set Custom NoData"), _TL(""), PARAMETER_TYPE_Bool, 0.0 ); Parameters.Add_Value( NULL, "NODATA" , _TL("NoData Value"), _TL(""), PARAMETER_TYPE_Double, 0.0 ); Parameters.Add_String( NULL, "OPTIONS" , _TL("Creation Options"), _TL("A space separated list of key-value pairs (K=V)."), _TL("") ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGDAL_Export::On_Execute(void) { TSG_Data_Type Type; CSG_String File_Name, Driver, Options; CSG_Projection Projection; CSG_Parameter_Grid_List *pGrids; CSG_GDAL_DataSet DataSet; //----------------------------------------------------- pGrids = Parameters("GRIDS") ->asGridList(); File_Name = Parameters("FILE") ->asString(); Options = Parameters("OPTIONS") ->asString(); Get_Projection(Projection); //----------------------------------------------------- switch( Parameters("TYPE")->asInt() ) { default: case 0: Type = SG_Get_Grid_Type(pGrids); break; // match input data case 1: Type = SG_DATATYPE_Byte; break; // Eight bit unsigned integer case 2: Type = SG_DATATYPE_Word; break; // Sixteen bit unsigned integer case 3: Type = SG_DATATYPE_Short; break; // Sixteen bit signed integer case 4: Type = SG_DATATYPE_DWord; break; // Thirty two bit unsigned integer case 5: Type = SG_DATATYPE_Int; break; // Thirty two bit signed integer case 6: Type = SG_DATATYPE_Float; break; // Thirty two bit floating point case 7: Type = SG_DATATYPE_Double; break; // Sixty four bit floating point } //----------------------------------------------------- if( !Parameters("FORMAT")->asChoice()->Get_Data(Driver) ) { return( false ); } //----------------------------------------------------- if( !DataSet.Open_Write(File_Name, Driver, Options, Type, pGrids->Get_Count(), *Get_System(), Projection) ) { return( false ); } //----------------------------------------------------- for(int i=0; iGet_Count(); i++) { Process_Set_Text(CSG_String::Format(SG_T("%s %d"), _TL("Band"), i + 1)); if ( Parameters("SET_NODATA")->asBool() ) { DataSet.Write(i, pGrids->asGrid(i), Parameters("NODATA")->asDouble()); } else { DataSet.Write(i, pGrids->asGrid(i)); } } if( !DataSet.Close() ) { return( false ); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/gdal_export.h000066400000000000000000000077011224124640700232670ustar00rootroot00000000000000/********************************************************** * Version $Id: gdal_export.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // gdal_export.h // // // // Copyright (C) 2007 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gdal_export_H #define HEADER_INCLUDED__gdal_export_H //--------------------------------------------------------- #include "gdal_driver.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class io_gdal_EXPORT CGDAL_Export : public CSG_Module_Grid { public: CGDAL_Export(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gdal_export_H saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/gdal_export_geotiff.cpp000066400000000000000000000135211224124640700253220ustar00rootroot00000000000000/********************************************************** * Version $Id: gdal_export_geotiff.cpp 1379 2012-04-26 11:58:47Z manfred-e $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // gdal_export_geotiff.cpp // // // // Copyright (C) 2007 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gdal_export_geotiff.h" #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGDAL_Export_GeoTIFF::CGDAL_Export_GeoTIFF(void) { Set_Name (_TL("GDAL: Export Raster to GeoTIFF")); Set_Author (SG_T("O.Conrad (c) 2007")); Set_Description (_TW( "The \"GDAL GeoTIFF Export\" module exports one or more grids to a Geocoded Tagged Image File Format using the " "\"Geospatial Data Abstraction Library\" (GDAL) by Frank Warmerdam. " "For more information have a look at the GDAL homepage:\n" " " " http://www.gdal.org\n" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL, "GRIDS" , _TL("Grid(s)"), _TL("The SAGA grids to be exported."), PARAMETER_INPUT ); Parameters.Add_FilePath( NULL, "FILE" , _TL("File"), _TL("The GeoTIFF File to be created."), CSG_String::Format( SG_T("%s|*.tif;*.tiff|%s|*.*"), _TL("TIFF files (*.tif)"), _TL("All Files") ), NULL, true ); Parameters.Add_String( NULL, "OPTIONS" , _TL("Creation Options"), _TL("A space separated list of key-value pairs (K=V)."), _TL("") ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGDAL_Export_GeoTIFF::On_Execute(void) { CSG_String File_Name, Options; CSG_Projection Projection; CSG_Parameter_Grid_List *pGrids; CSG_GDAL_DataSet DataSet; //----------------------------------------------------- pGrids = Parameters("GRIDS") ->asGridList(); File_Name = Parameters("FILE") ->asString(); Options = Parameters("OPTIONS") ->asString(); Get_Projection(Projection); //----------------------------------------------------- if( !DataSet.Open_Write(File_Name, SG_T("GTiff"), Options, SG_Get_Grid_Type(pGrids), pGrids->Get_Count(), *Get_System(), Projection) ) { return( false ); } //----------------------------------------------------- for(int i=0; iGet_Count(); i++) { Process_Set_Text(CSG_String::Format(SG_T("%s %d"), _TL("Band"), i + 1)); DataSet.Write(i, pGrids->asGrid(i)); } if( !DataSet.Close() ) { return( false ); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/gdal_export_geotiff.h000066400000000000000000000077601224124640700247770ustar00rootroot00000000000000/********************************************************** * Version $Id: gdal_export_geotiff.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // gdal_export_geotiff.h // // // // Copyright (C) 2007 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gdal_export_geotiff_H #define HEADER_INCLUDED__gdal_export_geotiff_H //--------------------------------------------------------- #include "gdal_driver.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class io_gdal_EXPORT CGDAL_Export_GeoTIFF : public CSG_Module_Grid { public: CGDAL_Export_GeoTIFF(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gdal_export_geotiff_H saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/gdal_import.cpp000066400000000000000000000400541224124640700236110ustar00rootroot00000000000000/********************************************************** * Version $Id: gdal_import.cpp 1642 2013-03-25 12:59:06Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // gdal_import.cpp // // // // Copyright (C) 2007 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gdal_import.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGDAL_Import::CGDAL_Import(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("GDAL: Import Raster")); Set_Author (SG_T("O.Conrad (c) 2007 (A.Ringeler)")); CSG_String Description; Description = _TW( "The \"GDAL Raster Import\" module imports grid data from various file formats using the " "\"Geospatial Data Abstraction Library\" (GDAL) by Frank Warmerdam. " "For more information have a look at the GDAL homepage:\n" " " " http://www.gdal.org\n" ); Description += CSG_String::Format(SG_T("\nGDAL %s:%s\n\n"), _TL("Version"), SG_Get_GDAL_Drivers().Get_Version().c_str()); Description += _TW( "Following raster formats are currently supported:\n" "\n" ); for(int i=0; i\n"), SG_Get_GDAL_Drivers().Get_Description(i).c_str(), SG_Get_GDAL_Drivers().Get_Name (i).c_str() ); } Description += SG_T("
    IDName
    %s%s
    "); Set_Description(Description); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_OUTPUT, false ); Parameters.Add_FilePath( NULL , "FILES" , _TL("Files"), _TL(""), NULL, NULL, false, false, true ); //----------------------------------------------------- if( SG_UI_Get_Window_Main() ) { Parameters.Add_Value( NULL , "SELECT" , _TL("Select from Multiple Bands"), _TL(""), PARAMETER_TYPE_Bool, true ); } //----------------------------------------------------- pNode = Parameters.Add_Value( NULL , "TRANSFORM" , _TL("Transformation"), _TL("align grid to coordinate system"), PARAMETER_TYPE_Bool, true ); Parameters.Add_Choice( pNode , "INTERPOL" , _TL("Interpolation"), _TL("interpolation method to use if grid needs to be aligned to coordinate system"), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|"), _TL("Nearest Neighbor"), _TL("Bilinear Interpolation"), _TL("Inverse Distance Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 4 ); //----------------------------------------------------- Add_Parameters("SELECTION", _TL("Select from Multiple Bands"), _TL("")); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGDAL_Import::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TRANSFORM")) ) { pParameters->Get_Parameter("INTERPOL")->Set_Enabled(pParameter->asBool()); } if( !SG_STR_CMP(pParameters->Get_Identifier(), SG_T("SELECTION")) && !SG_STR_CMP(pParameter ->Get_Identifier(), SG_T("ALL")) && pParameters->Get_Parameter("BANDS") ) { pParameters->Get_Parameter("BANDS")->Set_Enabled(!pParameter->asBool()); } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGDAL_Import::On_Execute(void) { CSG_Strings Files; CSG_GDAL_DataSet DataSet; //----------------------------------------------------- if( !Parameters("FILES")->asFilePath()->Get_FilePaths(Files) ) { return( false ); } //----------------------------------------------------- m_pGrids = Parameters("GRIDS")->asGridList(); m_pGrids ->Del_Items(); for(int i=0; iGet_Count() > 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGDAL_Import::Load_Sub(CSG_GDAL_DataSet &DataSet) { CSG_MetaData MetaData; if( !DataSet.Get_MetaData(MetaData, "SUBDATASETS") ) { return( false ); } //----------------------------------------------------- int i, n; CSG_Parameters P; for(i=0, n=0; i==n; i++) { CSG_MetaData *pName = MetaData.Get_Child(CSG_String::Format(SG_T("SUBDATASET_%d_NAME"), i + 1)); CSG_MetaData *pDesc = MetaData.Get_Child(CSG_String::Format(SG_T("SUBDATASET_%d_DESC"), i + 1)); if( pName ) { n++; Message_Add(CSG_String::Format(SG_T("\n%s"), pName->Get_Content().c_str()), false); P.Add_Value(NULL, pName->Get_Content(), pDesc ? pDesc->Get_Content().c_str() : _TL("unnamed"), SG_T(""), PARAMETER_TYPE_Bool, SG_UI_Get_Window_Main() == NULL); } } if( SG_UI_Get_Window_Main() && !Dlg_Parameters(&P, _TL("Select from Subdatasets...")) ) // with gui { return( false ); } //----------------------------------------------------- for(i=0, n=0; iasBool() && DataSet.Open_Read(P(i)->Get_Identifier()) && Load(DataSet, P(i)->Get_Name()) ) { n++; } } //--------------------------------------------- return( n > 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGDAL_Import::Load(CSG_GDAL_DataSet &DataSet, const CSG_String &Name) { if( !DataSet.is_Reading() ) { return( false ); } //----------------------------------------------------- if( DataSet.Get_Count() <= 0 ) { return( Load_Sub(DataSet) ); } //----------------------------------------------------- CSG_Vector A; CSG_Matrix B; DataSet.Get_Transform(A, B); //----------------------------------------------------- Message_Add( SG_T("Driver: ") + DataSet.Get_Description() + SG_T("/") + DataSet.Get_Name(), false); if( DataSet.Get_Count() > 1 ) { Message_Add(CSG_String::Format(SG_T("%d %s\n"), DataSet.Get_Count(), _TL("Bands")), false); } Message_Add(CSG_String::Format( SG_T("%s: x %d, y %d\n%s: %d\n%s x' = %.6f + x * %.6f + y * %.6f\n%s y' = %.6f + x * %.6f + y * %.6f"), _TL("Cells") , DataSet.Get_NX(), DataSet.Get_NY(), _TL("Bands") , DataSet.Get_Count(), _TL("Transformation") , A[0], B[0][0], B[0][1], _TL("Transformation") , A[1], B[1][0], B[1][1] ), false); //----------------------------------------------------- int i, n; CSG_Table Bands; Bands.Add_Field("NAME", SG_DATATYPE_String); for(i=0; iSet_Value(0, DataSet.Get_Name(i)); } Bands.Set_Index(0, TABLE_INDEX_Ascending); //----------------------------------------------------- if( Parameters("SELECT") && Parameters("SELECT")->asBool() && DataSet.Get_Count() > 1 ) { CSG_Parameters *pSelection = Get_Parameters("SELECTION"); pSelection->Add_Value(NULL, "ALL", _TL("Load all bands"), _TL(""), PARAMETER_TYPE_Bool, false); CSG_Parameter *pNode = pSelection->Add_Node(NULL, "BANDS", _TL("Bands"), _TL("")); for(i=0; iAdd_Value(pNode, SG_Get_String(i, 0), pBand->asString(0), _TL(""), PARAMETER_TYPE_Bool, false); } if( Dlg_Parameters("SELECTION") ) { for(i=0; iGet_Parameter(0)->asBool() || pSelection->Get_Parameter(i + 2)->asBool() ) { Bands.Select(Bands.Get_Record_byIndex(i)->Get_Index(), true); } } } pSelection->Del_Parameters(); if( Bands.Get_Selection_Count() <= 0 ) { return( false ); } } //----------------------------------------------------- CSG_Grid_System Transform; if( Parameters("TRANSFORM")->asBool() && DataSet.Needs_Transform() ) { CSG_Vector v(2); CSG_Rect r; v[0] = DataSet.Get_xMin(); v[1] = DataSet.Get_yMin(); v = B * v + A; r.Assign(v[0], v[1], v[0], v[1]); v[0] = DataSet.Get_xMin(); v[1] = DataSet.Get_yMax(); v = B * v + A; r.Union(CSG_Point(v[0], v[1])); v[0] = DataSet.Get_xMax(); v[1] = DataSet.Get_yMax(); v = B * v + A; r.Union(CSG_Point(v[0], v[1])); v[0] = DataSet.Get_xMax(); v[1] = DataSet.Get_yMin(); v = B * v + A; r.Union(CSG_Point(v[0], v[1])); Transform.Assign(DataSet.Get_Cellsize() * SG_Get_Length(B[0][0], B[0][1]), r); } //----------------------------------------------------- for(i=0, n=0; iis_Selected() ) { Process_Set_Text(CSG_String::Format(SG_T("%s [%d/%d]"), _TL("loading band"), i + 1, DataSet.Get_Count())); CSG_Grid *pGrid = DataSet.Read(pBand->Get_Index()); if( pGrid != NULL ) { n++; if( Transform.is_Valid() ) { Process_Set_Text(CSG_String::Format(SG_T("%s [%d/%d]"), _TL("band transformation"), i + 1, DataSet.Get_Count())); Set_Transformation(&pGrid, Transform, A, B); } pGrid->Set_Name(DataSet.Get_Count() > 1 ? CSG_String::Format(SG_T("%s [%s]"), Name.c_str(), pGrid->Get_Name()).c_str() : Name.c_str() ); m_pGrids->Add_Item(pGrid); DataObject_Add (pGrid); DataObject_Set_Colors (pGrid, CSG_Colors(100, SG_COLORS_BLACK_WHITE, false)); } } } //----------------------------------------------------- return( n > 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGDAL_Import::Set_Transformation(CSG_Grid **ppGrid, const CSG_Grid_System &System, const CSG_Vector &A, const CSG_Matrix &B) { //----------------------------------------------------- TSG_Grid_Interpolation Interpolation; switch( Parameters("INTERPOL")->asInt() ) { default: case 0: Interpolation = GRID_INTERPOLATION_NearestNeighbour; break; case 1: Interpolation = GRID_INTERPOLATION_Bilinear; break; case 2: Interpolation = GRID_INTERPOLATION_InverseDistance; break; case 3: Interpolation = GRID_INTERPOLATION_BicubicSpline; break; case 4: Interpolation = GRID_INTERPOLATION_BSpline; break; } //----------------------------------------------------- CSG_Matrix BInv(B.Get_Inverse()); CSG_Grid *pImage = *ppGrid; CSG_Grid *pWorld = *ppGrid = SG_Create_Grid(System, pImage->Get_Type()); pWorld->Set_Name (pImage->Get_Name ()); pWorld->Set_Description (pImage->Get_Description()); pWorld->Set_Unit (pImage->Get_Unit ()); pWorld->Set_ZFactor (pImage->Get_ZFactor ()); pWorld->Set_NoData_Value_Range(pImage->Get_NoData_Value(), pImage->Get_NoData_hiValue()); pWorld->Get_MetaData() = pImage->Get_MetaData (); pWorld->Get_Projection() = pImage->Get_Projection (); //----------------------------------------------------- // #pragma omp parallel for // for(int y=0; yGet_NY(); y++) // { // Process_Get_Okay(); for(int y=0; yGet_NY() && Set_Progress(y, pWorld->Get_NY()); y++) { #pragma omp parallel for for(int x=0; xGet_NX(); x++) { double z; CSG_Vector vWorld(2), vImage; vWorld[0] = pWorld->Get_XMin() + x * pWorld->Get_Cellsize(); vWorld[1] = pWorld->Get_YMin() + y * pWorld->Get_Cellsize(); vImage = BInv * (vWorld - A); if( pImage->Get_Value(vImage[0], vImage[1], z, Interpolation, false, false, true) ) { pWorld->Set_Value(x, y, z); } else { pWorld->Set_NoData(x, y); } } } delete(pImage); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool SG_GDAL_Import (const CSG_String &File_Name) { CGDAL_Import Import; if( !Import.Get_Parameters()->Set_Parameter(SG_T("FILES"), File_Name, PARAMETER_TYPE_FilePath) ) { return( false ); } if( !Import.Execute() ) { return( false ); } CSG_Parameter_Grid_List *pGrids = Import.Get_Parameters()->Get_Parameter(SG_T("GRIDS"))->asGridList(); for(int i=0; iGet_Count(); i++) { SG_UI_DataObject_Add(pGrids->asGrid(i), SG_UI_DATAOBJECT_UPDATE_ONLY); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/gdal_import.h000066400000000000000000000111331224124640700232520ustar00rootroot00000000000000/********************************************************** * Version $Id: gdal_import.h 1642 2013-03-25 12:59:06Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // gdal_import.h // // // // Copyright (C) 2007 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gdal_import_H #define HEADER_INCLUDED__gdal_import_H //--------------------------------------------------------- #include "gdal_driver.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class io_gdal_EXPORT CGDAL_Import : public CSG_Module { public: CGDAL_Import(void); protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: CSG_Parameter_Grid_List *m_pGrids; bool Load_Sub (CSG_GDAL_DataSet &DataSet); bool Load (CSG_GDAL_DataSet &DataSet, const CSG_String &Name); void Set_Transformation (CSG_Grid **ppGrid, const CSG_Grid_System &System, const CSG_Vector &A, const CSG_Matrix &B); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- io_gdal_EXPORT bool SG_GDAL_Import (const CSG_String &File_Name); /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gdal_import_H saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/gdal_import_netcdf.cpp000066400000000000000000000323661224124640700251430ustar00rootroot00000000000000/********************************************************** * Version $Id: gdal_import_netcdf.cpp 1379 2012-04-26 11:58:47Z manfred-e $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // gdal_import_netcdf.cpp // // // // Copyright (C) 2012 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gdal_import_netcdf.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGDAL_Import_NetCDF::CGDAL_Import_NetCDF(void) { CSG_Parameter *pNode; //----------------------------------------------------- Set_Name (_TL("GDAL: Import NetCDF")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "This module imports grids NetCDF Format using the " "\"Geospatial Data Abstraction Library\" (GDAL) by Frank Warmerdam. " "For more information have a look at the GDAL homepage:\n" " " " http://www.gdal.org\n" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), CSG_String::Format( SG_T("%s|*.nc|%s|*.*"), _TL("NetCDF Files (*.nc)"), _TL("All Files") ), NULL, false ); pNode = Parameters.Add_Value( NULL , "SAVE_FILE" , _TL("Save to File"), _TL("save output to file instead of memory"), PARAMETER_TYPE_Bool, false ); Parameters.Add_FilePath( pNode , "SAVE_PATH" , _TL("Save to Path"), _TL(""), NULL, NULL, true, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CGDAL_Import_NetCDF::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("SAVE_FILE")) ) { pParameters->Get_Parameter("SAVE_PATH")->Set_Enabled(pParameter->asBool()); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("VARS_ALL" )) && pParameters->Get_Parameter("VARS") ) { pParameters->Get_Parameter("VARS" )->Set_Enabled(!pParameter->asBool()); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("TIME_ALL" )) && pParameters->Get_Parameter("TIME") ) { pParameters->Get_Parameter("TIME" )->Set_Enabled(!pParameter->asBool()); } if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("LEVEL_ALL")) && pParameters->Get_Parameter("LEVEL") ) { pParameters->Get_Parameter("LEVEL")->Set_Enabled(!pParameter->asBool()); } return( 1 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- const char * CGDAL_Import_NetCDF::Get_Variable(CSG_GDAL_DataSet &DataSet, int iBand) { const char *s = DataSet.Get_MetaData_Item(iBand, "NETCDF_VARNAME"); return( s ); } //--------------------------------------------------------- const char * CGDAL_Import_NetCDF::Get_Time(CSG_GDAL_DataSet &DataSet, int iBand) { const char *s = DataSet.Get_MetaData_Item(iBand, "NETCDF_DIMENSION_time"); if( !s ) s = DataSet.Get_MetaData_Item(iBand, "NETCDF_DIM_time"); return( s ); } //--------------------------------------------------------- const char * CGDAL_Import_NetCDF::Get_Level(CSG_GDAL_DataSet &DataSet, int iBand) { const char *s = DataSet.Get_MetaData_Item(iBand, "NETCDF_DIMENSION_level"); if( !s ) s = DataSet.Get_MetaData_Item(iBand, "NETCDF_DIM_level"); if( !s ) s = DataSet.Get_MetaData_Item(iBand, "NETCDF_DIM_lev"); return( s ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_String CGDAL_Import_NetCDF::Get_Time_String(const CSG_String &Time, int Format) { switch( Format ) { case 0: return( CSG_Time_Converter::Get_String(Time.asInt(), SG_TIME_FMT_Hours_AD) ); default: return( Time ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGDAL_Import_NetCDF::On_Execute(void) { //----------------------------------------------------- m_pGrids = Parameters("GRIDS")->asGridList(); m_pGrids ->Del_Items(); if( (m_bSaveFile = Parameters("SAVE_FILE")->asBool()) == true ) { m_SavePath = Parameters("SAVE_PATH")->asString(); if( !SG_Dir_Exists(m_SavePath) ) { m_SavePath = SG_File_Get_Path(Parameters("FILE")->asString()); } } //----------------------------------------------------- CSG_GDAL_DataSet DataSet; if( !DataSet.Open_Read(Parameters("FILE")->asString()) ) { Error_Set(CSG_String::Format(SG_T("%s [%s]"), _TL("could not open file"), Parameters("FILE")->asString())); return( false ); } if( DataSet.Get_DriverID().Cmp("netCDF") ) { Error_Set(CSG_String::Format(SG_T("%s [%s]"), _TL("invalid NetCDF file"), Parameters("FILE")->asString())); return( false ); } //----------------------------------------------------- CSG_MetaData MetaData; if( DataSet.Get_Count() <= 0 && DataSet.Get_MetaData(MetaData, "SUBDATASETS") ) { int i, n; for(i=0, n=0; i==n; i++) { CSG_MetaData *pEntry = MetaData.Get_Child(CSG_String::Format(SG_T("SUBDATASET_%d_NAME"), i + 1)); if( pEntry && DataSet.Open_Read(pEntry->Get_Content()) ) { CSG_String Desc = _TL("unknown"); if( (pEntry = MetaData.Get_Child(CSG_String::Format(SG_T("SUBDATASET_%d_DESC"), i + 1))) != NULL ) { Desc = pEntry->Get_Content(); } if( Load(DataSet, Desc) ) { n++; } } } return( n > 0 ); } return( Load(DataSet, SG_File_Get_Name(Parameters("FILE")->asString(), false)) ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGDAL_Import_NetCDF::Load(CSG_GDAL_DataSet &DataSet, const CSG_String &Description) { const char *s; int i; //----------------------------------------------------- CSG_MetaData MetaData, *pChild; DataSet.Get_MetaData(MetaData); //----------------------------------------------------- int tFmt = -1; if( (pChild = MetaData.Get_Child("time#units")) != NULL ) { if( pChild->Get_Content().Find("hours since 1-1-1 00:00:0.0") >= 0 ) { tFmt = 0; } } //----------------------------------------------------- CSG_Parameters P, *pVars = NULL, *pTime = NULL, *pLevel = NULL; //----------------------------------------------------- if( SG_UI_Get_Window_Main() ) { CSG_Parameter *pNode; P.Create(this, _TL("Import NetCDF"), _TL("")); P.Set_Callback_On_Parameter_Changed(Get_Parameter_Changed()); P.Add_Info_String(NULL , "METADATA", _TL("Metadata"), _TL(""), MetaData.asText(), true); pNode = P.Add_Value (NULL , "VARS_ALL" , _TL("All Variables"), _TL(""), PARAMETER_TYPE_Bool, true); pVars = P.Add_Parameters(pNode, "VARS" , _TL("Selection") , _TL(""))->asParameters(); pNode = P.Add_Value (NULL , "TIME_ALL" , _TL("All Times") , _TL(""), PARAMETER_TYPE_Bool, true); pTime = P.Add_Parameters(pNode, "TIME" , _TL("Selection") , _TL(""))->asParameters(); pNode = P.Add_Value (NULL , "LEVEL_ALL" , _TL("All Levels") , _TL(""), PARAMETER_TYPE_Bool, true); pLevel = P.Add_Parameters(pNode, "LEVEL" , _TL("Selection") , _TL(""))->asParameters(); for(i=0; iGet_Parameter(s) ) pVars ->Add_Value(NULL, s, s, _TL(""), PARAMETER_TYPE_Bool, false); if( (s = Get_Time (DataSet, i)) != NULL && !pTime ->Get_Parameter(s) ) pTime ->Add_Value(NULL, s, Get_Time_String(s, tFmt), _TL(""), PARAMETER_TYPE_Bool, false); if( (s = Get_Level (DataSet, i)) != NULL && !pLevel->Get_Parameter(s) ) pLevel ->Add_Value(NULL, s, s, _TL(""), PARAMETER_TYPE_Bool, false); } P("VARS_ALL" )->Set_Enabled(pVars ->Get_Count() > 1); P("TIME_ALL" )->Set_Enabled(pTime ->Get_Count() > 1); P("LEVEL_ALL")->Set_Enabled(pLevel->Get_Count() > 1); //------------------------------------------------- if( !Dlg_Parameters(&P, CSG_String::Format(SG_T("%s: %s"), _TL("Import NetCDF"), Description.c_str())) ) { return( false ); } //------------------------------------------------- if( !P("VARS_ALL" )->is_Enabled() || P("VARS_ALL" )->asBool() ) pVars = NULL; if( !P("TIME_ALL" )->is_Enabled() || P("TIME_ALL" )->asBool() ) pTime = NULL; if( !P("LEVEL_ALL")->is_Enabled() || P("LEVEL_ALL")->asBool() ) pLevel = NULL; } //----------------------------------------------------- for(i=0; iasBool())) && (!pTime || (!!(pLoad = (*pTime )(Get_Time (DataSet, i))) && pLoad->asBool())) && (!pLevel || (!!(pLoad = (*pLevel)(Get_Level (DataSet, i))) && pLoad->asBool())) ) { SG_UI_Progress_Lock(true); if( (pGrid = DataSet.Read(i)) != NULL ) { CSG_String Name(_TL("unknown")); if( (s = Get_Variable(DataSet, i)) != NULL && *s ) Name = s; if( (s = Get_Time (DataSet, i)) != NULL && *s ) Name += " [" + Get_Time_String(s, tFmt) + "]"; if( (s = Get_Level (DataSet, i)) != NULL && *s ) Name += " [" + CSG_String(s) + "]"; pGrid->Set_Name(Name); if( m_bSaveFile ) { Name.Replace(".", "_"); Name.Replace(":", "-"); pGrid->Save(SG_File_Make_Path(m_SavePath, Name)); delete(pGrid); } else { m_pGrids->Add_Item(pGrid); } } SG_UI_Progress_Lock(false); } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/gdal_import_netcdf.h000066400000000000000000000110401224124640700245720ustar00rootroot00000000000000/********************************************************** * Version $Id: gdal_import_netcdf.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // gdal_import_netcdf.h // // // // Copyright (C) 2012 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__gdal_import_netcdf_H #define HEADER_INCLUDED__gdal_import_netcdf_H //--------------------------------------------------------- #include "gdal_driver.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class io_gdal_EXPORT CGDAL_Import_NetCDF : public CSG_Module { public: CGDAL_Import_NetCDF(void); protected: virtual bool On_Execute (void); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); private: bool m_bSaveFile; CSG_String m_SavePath; CSG_Parameter_Grid_List *m_pGrids; bool Load (CSG_GDAL_DataSet &DataSet, const CSG_String &Description); const char * Get_Variable (CSG_GDAL_DataSet &DataSet, int iBand); const char * Get_Time (CSG_GDAL_DataSet &DataSet, int iBand); const char * Get_Level (CSG_GDAL_DataSet &DataSet, int iBand); CSG_String Get_Time_String (const CSG_String &Time, int Format); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__gdal_import_netcdf_H saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/ogr_driver.cpp000066400000000000000000000552231224124640700234560ustar00rootroot00000000000000/********************************************************** * Version $Id: ogr_driver.cpp 1261 2011-12-16 15:12:15Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // ogr_driver.cpp // // // // Copyright (C) 2008 by O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "ogr_driver.h" #include #include #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_OGR_Drivers gSG_OGR_Drivers; const CSG_OGR_Drivers & SG_Get_OGR_Drivers (void) { return( gSG_OGR_Drivers ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_OGR_Drivers::CSG_OGR_Drivers(void) { OGRRegisterAll(); m_pDrivers = OGRSFDriverRegistrar::GetRegistrar(); } //--------------------------------------------------------- CSG_OGR_Drivers::~CSG_OGR_Drivers(void) { // OGRCleanupAll(); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CSG_OGR_Drivers::Get_Count(void) const { return( m_pDrivers->GetDriverCount() ); } //--------------------------------------------------------- OGRSFDriver * CSG_OGR_Drivers::Get_Driver(int Index) const { return( m_pDrivers->GetDriver(Index) ); } //--------------------------------------------------------- OGRSFDriver * CSG_OGR_Drivers::Get_Driver(const CSG_String &Name) const { return( m_pDrivers ? m_pDrivers->GetDriverByName(Name) : NULL ); } //--------------------------------------------------------- CSG_String CSG_OGR_Drivers::Get_Name(int Index) const { return( m_pDrivers->GetDriver(Index)->GetName() ); } //--------------------------------------------------------- CSG_String CSG_OGR_Drivers::Get_Description(int Index) const { OGRSFDriver *pDriver = m_pDrivers->GetDriver(Index); CSG_String s; s += pDriver->TestCapability(ODrCCreateDataSource) ? SG_T("\n[x] ") : SG_T("\n[ ] "); s += _TL("create data source"); s += pDriver->TestCapability(ODrCDeleteDataSource) ? SG_T("\n[x] ") : SG_T("\n[ ] "); s += _TL("delete data source"); /* s += pDriver->TestCapability(ODsCCreateLayer) ? SG_T("\n[x]") : SG_T("\n[ ]"); s += _TL("create layer"); s += pDriver->TestCapability(ODsCDeleteLayer) ? SG_T("\n[x]") : SG_T("\n[ ]"); s += _TL("delete layer"); s += pDriver->TestCapability(OLCDeleteFeature) ? SG_T("\n[x]") : SG_T("\n[ ]"); s += _TL("delete feature"); s += pDriver->TestCapability(OLCRandomRead) ? SG_T("\n[x]") : SG_T("\n[ ]"); s += _TL("random read"); s += pDriver->TestCapability(OLCRandomWrite) ? SG_T("\n[x]") : SG_T("\n[ ]"); s += _TL("random write"); s += pDriver->TestCapability(OLCSequentialWrite) ? SG_T("\n[x]") : SG_T("\n[ ]"); s += _TL("sequential write"); /**/ return( s ); } //--------------------------------------------------------- bool CSG_OGR_Drivers::Can_Read(int Index) const { return( Get_Driver(Index) != NULL ); } //--------------------------------------------------------- bool CSG_OGR_Drivers::Can_Write(int Index) const { return( Get_Driver(Index) != NULL );//&& Get_Driver(Index)->TestCapability(ODrCCreateDataSource) ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- TSG_Vertex_Type CSG_OGR_Drivers::Get_Vertex_Type(int Type) { switch( Type ) { case wkbPoint25D: // 2.5D extension as per 99-402 case wkbMultiPoint25D: // 2.5D extension as per 99-402 case wkbLineString25D: // 2.5D extension as per 99-402 case wkbMultiLineString25D: // 2.5D extension as per 99-402 case wkbPolygon25D: // 2.5D extension as per 99-402 case wkbMultiPolygon25D: // 2.5D extension as per 99-402 case wkbGeometryCollection25D: // 2.5D extension as per 99-402 return( SG_VERTEX_TYPE_XYZ ); default: return( SG_VERTEX_TYPE_XY ); } } //--------------------------------------------------------- TSG_Shape_Type CSG_OGR_Drivers::Get_Shape_Type(int Type) { switch( Type ) { case wkbPoint: // 0-dimensional geometric object, standard WKB case wkbPoint25D: // 2.5D extension as per 99-402 return( SHAPE_TYPE_Point ); case wkbMultiPoint: // GeometryCollection of Points, standard WKB case wkbMultiPoint25D: // 2.5D extension as per 99-402 return( SHAPE_TYPE_Points ); case wkbLineString: // 1-dimensional geometric object with linear interpolation between Points, standard WKB case wkbMultiLineString: // GeometryCollection of LineStrings, standard WKB case wkbLineString25D: // 2.5D extension as per 99-402 case wkbMultiLineString25D: // 2.5D extension as per 99-402 return( SHAPE_TYPE_Line ); case wkbPolygon: // planar 2-dimensional geometric object defined by 1 exterior boundary and 0 or more interior boundaries, standard WKB case wkbMultiPolygon: // GeometryCollection of Polygons, standard WKB case wkbPolygon25D: // 2.5D extension as per 99-402 case wkbMultiPolygon25D: // 2.5D extension as per 99-402 return( SHAPE_TYPE_Polygon ); default: case wkbUnknown: // unknown type, non-standard case wkbNone: // non-standard, for pure attribute records case wkbLinearRing: // non-standard, just for createGeometry() case wkbGeometryCollection: // geometric object that is a collection of 1 or more geometric objects, standard WKB case wkbGeometryCollection25D: // 2.5D extension as per 99-402 return( SHAPE_TYPE_Undefined ); } } //--------------------------------------------------------- int CSG_OGR_Drivers::Get_Shape_Type(TSG_Shape_Type Type, bool bZ) { switch( Type ) { case SHAPE_TYPE_Point: return( bZ ? wkbPoint25D : wkbPoint ); // point case SHAPE_TYPE_Points: return( bZ ? wkbMultiPoint25D : wkbMultiPoint ); // points case SHAPE_TYPE_Line: return( bZ ? wkbMultiLineString25D : wkbMultiLineString ); // line case SHAPE_TYPE_Polygon: return( bZ ? wkbMultiPolygon25D : wkbMultiPolygon ); // polygon default: return( wkbUnknown ); } } //--------------------------------------------------------- TSG_Data_Type CSG_OGR_Drivers::Get_Data_Type(int Type) { switch( Type ) { case OFTInteger: // Simple 32bit integer return( SG_DATATYPE_Int ); case OFTReal: // Double Precision floating point return( SG_DATATYPE_Double ); case OFTString: // String of ASCII chars return( SG_DATATYPE_String ); case OFTDateTime: // Date and Time return( SG_DATATYPE_Date ); default: case OFTIntegerList: // List of 32bit integers case OFTRealList: // List of doubles case OFTStringList: // Array of strings case OFTWideString: // deprecated case OFTWideStringList: // deprecated case OFTBinary: // Raw Binary data case OFTDate: // Date case OFTTime: // Time return( SG_DATATYPE_Undefined ); } } //--------------------------------------------------------- int CSG_OGR_Drivers::Get_Data_Type(TSG_Data_Type Type) { switch( Type ) { default: case SG_DATATYPE_String: case SG_DATATYPE_Date: return( OFTString ); case SG_DATATYPE_Byte: case SG_DATATYPE_Char: case SG_DATATYPE_Word: case SG_DATATYPE_Short: case SG_DATATYPE_DWord: case SG_DATATYPE_Int: case SG_DATATYPE_ULong: case SG_DATATYPE_Long: case SG_DATATYPE_Color: return( OFTInteger ); case SG_DATATYPE_Float: case SG_DATATYPE_Double: return( OFTReal ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_OGR_DataSource::CSG_OGR_DataSource(void) { m_pDataSource = NULL; } CSG_OGR_DataSource::CSG_OGR_DataSource(const CSG_String &File) { m_pDataSource = NULL; Create(File); } //--------------------------------------------------------- CSG_OGR_DataSource::~CSG_OGR_DataSource(void) { Destroy(); } //--------------------------------------------------------- bool CSG_OGR_DataSource::Create(const CSG_String &File) { Destroy(); m_pDataSource = OGRSFDriverRegistrar::Open(File); return( m_pDataSource != NULL ); } bool CSG_OGR_DataSource::Create(const CSG_String &File, const CSG_String &DriverName) { OGRSFDriver *pDriver; Destroy(); if( (pDriver = gSG_OGR_Drivers.Get_Driver(DriverName)) != NULL ) { m_pDataSource = pDriver->CreateDataSource(File, NULL); } return( m_pDataSource != NULL ); } //--------------------------------------------------------- bool CSG_OGR_DataSource::Destroy(void) { if( m_pDataSource ) { OGRDataSource::DestroyDataSource(m_pDataSource); m_pDataSource = NULL; } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CSG_OGR_DataSource::Get_Count(void) { if( m_pDataSource ) { return( m_pDataSource->GetLayerCount() ); } return( 0 ); } //--------------------------------------------------------- OGRLayer * CSG_OGR_DataSource::Get_Layer(int iLayer) { if( m_pDataSource && iLayer >= 0 && iLayer < m_pDataSource->GetLayerCount() ) { return( m_pDataSource->GetLayer(iLayer) ); } return( NULL ); } //--------------------------------------------------------- TSG_Shape_Type CSG_OGR_DataSource::Get_Type(int iLayer) { if( Get_Layer(iLayer) ) { return( CSG_OGR_Drivers::Get_Shape_Type(Get_Layer(iLayer)->GetLayerDefn()->GetGeomType()) ); } return( SHAPE_TYPE_Undefined ); } //--------------------------------------------------------- TSG_Vertex_Type CSG_OGR_DataSource::Get_Coordinate_Type(int iLayer) { if( Get_Layer(iLayer) ) { return( CSG_OGR_Drivers::Get_Vertex_Type(Get_Layer(iLayer)->GetLayerDefn()->GetGeomType()) ); } return( SG_VERTEX_TYPE_XY ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Shapes * CSG_OGR_DataSource::Read(int iLayer) { OGRLayer *pLayer = Get_Layer(iLayer); //----------------------------------------------------- if( pLayer && Get_Type(iLayer) != SHAPE_TYPE_Undefined ) { int iField; OGRFeature *pFeature; OGRFeatureDefn *pDef = pLayer->GetLayerDefn(); CSG_Shapes *pShapes = SG_Create_Shapes(Get_Type(iLayer), CSG_String(pDef->GetName()), NULL, Get_Coordinate_Type(iLayer)); for(iField=0; iFieldGetFieldCount(); iField++) { OGRFieldDefn *pDefField = pDef->GetFieldDefn(iField); pShapes->Add_Field(pDefField->GetNameRef(), CSG_OGR_Drivers::Get_Data_Type(pDefField->GetType())); } pLayer->ResetReading(); //------------------------------------------------- while( (pFeature = pLayer->GetNextFeature()) != NULL && SG_UI_Process_Get_Okay(false) ) { OGRGeometry *pGeometry = pFeature->GetGeometryRef(); if( pGeometry != NULL ) { CSG_Shape *pShape = pShapes->Add_Shape(); for(iField=0; iFieldGetFieldCount(); iField++) { OGRFieldDefn *pDefField = pDef->GetFieldDefn(iField); switch( pDefField->GetType() ) { default: pShape->Set_Value(iField, pFeature->GetFieldAsString (iField)); break; case OFTString: pShape->Set_Value(iField, pFeature->GetFieldAsString (iField)); break; case OFTInteger: pShape->Set_Value(iField, pFeature->GetFieldAsInteger(iField)); break; case OFTReal: pShape->Set_Value(iField, pFeature->GetFieldAsDouble (iField)); break; } } //----------------------------------------- if( _Read_Geometry(pShape, pGeometry) == false ) { pShapes->Del_Shape(pShape); } } OGRFeature::DestroyFeature(pFeature); } return( pShapes ); } //----------------------------------------------------- return( NULL ); } //--------------------------------------------------------- bool CSG_OGR_DataSource::_Read_Geometry(CSG_Shape *pShape, OGRGeometry *pGeometry) { if( pShape && pGeometry ) { switch( pGeometry->getGeometryType() ) { //------------------------------------------------- case wkbPoint: // 0-dimensional geometric object, standard WKB case wkbPoint25D: // 2.5D extension as per 99-402 pShape->Add_Point(((OGRPoint *)pGeometry)->getX(), ((OGRPoint *)pGeometry)->getY()); return( true ); //------------------------------------------------- case wkbLineString: // 1-dimensional geometric object with linear interpolation between Points, standard WKB case wkbLineString25D: // 2.5D extension as per 99-402 return( _Read_Line(pShape, (OGRLineString *)pGeometry) ); //------------------------------------------------- case wkbPolygon: // planar 2-dimensional geometric object defined by 1 exterior boundary and 0 or more interior boundaries, standard WKB case wkbPolygon25D: // 2.5D extension as per 99-402 return( _Read_Polygon(pShape, (OGRPolygon *)pGeometry) ); //------------------------------------------------- case wkbMultiPoint: // GeometryCollection of Points, standard WKB case wkbMultiPoint25D: // 2.5D extension as per 99-402 case wkbMultiLineString: // GeometryCollection of LineStrings, standard WKB case wkbMultiLineString25D: // 2.5D extension as per 99-402 case wkbMultiPolygon: // GeometryCollection of Polygons, standard WKB case wkbMultiPolygon25D: // 2.5D extension as per 99-402 { for(int i=0; i<((OGRGeometryCollection *)pGeometry)->getNumGeometries(); i++) { if( _Read_Geometry(pShape, ((OGRGeometryCollection *)pGeometry)->getGeometryRef(i)) == false ) { return( false ); } } } return( true ); //------------------------------------------------- default: break; } } return( false ); } //--------------------------------------------------------- bool CSG_OGR_DataSource::_Read_Line(CSG_Shape *pShape, OGRLineString *pLine) { if( pShape && pLine && pLine->getNumPoints() > 0 ) { int iPart = pShape->Get_Part_Count(); for(int iPoint=0; iPointgetNumPoints(); iPoint++) { pShape->Add_Point(pLine->getX(iPoint), pLine->getY(iPoint), iPart); pShape->Set_Z(pLine->getZ(iPoint), iPoint, iPart); } return( true ); } return( false ); } //--------------------------------------------------------- bool CSG_OGR_DataSource::_Read_Polygon(CSG_Shape *pShape, OGRPolygon *pPolygon) { if( pShape && pPolygon ) { _Read_Line(pShape, pPolygon->getExteriorRing()); for(int i=0; igetNumInteriorRings(); i++) { pPolygon->getInteriorRing(i); } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSG_OGR_DataSource::Write(CSG_Shapes *pShapes) { bool bZ = pShapes->Get_Vertex_Type() != SG_VERTEX_TYPE_XY; OGRLayer *pLayer; //----------------------------------------------------- if( m_pDataSource && pShapes && pShapes->is_Valid() && (pLayer = m_pDataSource->CreateLayer(CSG_String(pShapes->Get_Name()), NULL, (OGRwkbGeometryType)gSG_OGR_Drivers.Get_Shape_Type(pShapes->Get_Type(), bZ))) != NULL ) { bool bResult = true; int iField; //------------------------------------------------- for(iField=0; iFieldGet_Field_Count() && bResult; iField++) { OGRFieldDefn DefField(CSG_String(pShapes->Get_Field_Name(iField)), (OGRFieldType)gSG_OGR_Drivers.Get_Data_Type(pShapes->Get_Field_Type(iField))); // DefField.SetWidth(32); if( pLayer->CreateField(&DefField) != OGRERR_NONE ) { bResult = false; } } //------------------------------------------------- for(int iShape=0; iShapeGet_Count() && bResult && SG_UI_Process_Set_Progress(iShape, pShapes->Get_Count()); iShape++) { CSG_Shape *pShape = pShapes->Get_Shape(iShape); OGRFeature *pFeature = OGRFeature::CreateFeature(pLayer->GetLayerDefn()); for(iField=0; iFieldGet_Field_Count(); iField++) { switch( pShapes->Get_Field_Type(iField) ) { default: case SG_DATATYPE_Char: case SG_DATATYPE_String: case SG_DATATYPE_Date: pFeature->SetField(iField, CSG_String(pShape->asString(iField))); break; case SG_DATATYPE_Short: case SG_DATATYPE_Int: case SG_DATATYPE_Long: case SG_DATATYPE_Color: pFeature->SetField(iField, pShape->asInt(iField)); break; case SG_DATATYPE_Float: case SG_DATATYPE_Double: pFeature->SetField(iField, pShape->asDouble(iField)); break; } } if( !_Write_Geometry(pShape, pFeature, bZ) || pLayer->CreateFeature(pFeature) != OGRERR_NONE ) { bResult = false; } OGRFeature::DestroyFeature(pFeature); } //------------------------------------------------- return( bResult ); } return( false ); } //--------------------------------------------------------- bool CSG_OGR_DataSource::_Write_Geometry(CSG_Shape *pShape, OGRFeature *pFeature, bool bZ) { if( pShape && pFeature ) { int iPoint, iPart; TSG_Point sgPoint; OGRPoint Point; OGRMultiPoint Points; OGRLineString Line; OGRMultiLineString Lines; OGRLinearRing Ring; OGRPolygon Polygon; switch( pShape->Get_Type() ) { //------------------------------------------------- case SHAPE_TYPE_Point: sgPoint = pShape->Get_Point(0); Point.setX(sgPoint.x); Point.setY(sgPoint.y); if( bZ ) { Point.setZ(pShape->Get_Z(0)); } return( pFeature->SetGeometry(&Point) == OGRERR_NONE ); //------------------------------------------------- case SHAPE_TYPE_Points: for(iPart=0; iPartGet_Part_Count(); iPart++) { for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { sgPoint = pShape->Get_Point(iPoint, iPart); Point.setX(sgPoint.x); Point.setY(sgPoint.y); if( bZ ) { Point.setZ(pShape->Get_Z(0)); } Points.addGeometry(&Point); } } return( pFeature->SetGeometry(&Points) == OGRERR_NONE ); //------------------------------------------------- case SHAPE_TYPE_Line: if( pShape->Get_Part_Count() == 1 ) { _Write_Line(pShape, &Line, 0, bZ); return( pFeature->SetGeometry(&Line) == OGRERR_NONE ); } else { for(iPart=0; iPartGet_Part_Count(); iPart++) { if( _Write_Line(pShape, &Line, iPart, bZ) ) { Lines.addGeometry(&Line); } } return( pFeature->SetGeometry(&Lines) == OGRERR_NONE ); } //------------------------------------------------- case SHAPE_TYPE_Polygon: for(iPart=0; iPartGet_Part_Count(); iPart++) { if( _Write_Line(pShape, &Ring, iPart, bZ) ) { Polygon.addRing(&Ring); } } return( pFeature->SetGeometry(&Polygon) == OGRERR_NONE ); //------------------------------------------------- default: break; } } return( false ); } //--------------------------------------------------------- bool CSG_OGR_DataSource::_Write_Line(CSG_Shape *pShape, OGRLineString *pLine, int iPart, bool bZ) { if( pLine && pShape && iPart >= 0 && iPart < pShape->Get_Part_Count() ) { pLine->empty(); for(int iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { TSG_Point sgPoint = pShape->Get_Point(iPoint, iPart); if( bZ ) { pLine->addPoint(sgPoint.x, sgPoint.y); } else { pLine->addPoint(sgPoint.x, sgPoint.y, pShape->Get_Z(iPoint, iPart)); } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/ogr_driver.h000066400000000000000000000140011224124640700231100ustar00rootroot00000000000000/********************************************************** * Version $Id: ogr_driver.h 993 2011-04-14 16:05:34Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // ogr_driver.h // // // // Copyright (C) 2008 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ogr_driver_H #define HEADER_INCLUDED__ogr_driver_H //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class io_gdal_EXPORT CSG_OGR_Drivers { public: CSG_OGR_Drivers(void); virtual ~CSG_OGR_Drivers(void); int Get_Count (void) const; class OGRSFDriver * Get_Driver (const CSG_String &Name) const; class OGRSFDriver * Get_Driver (int Index) const; CSG_String Get_Name (int Index) const; CSG_String Get_Description (int Index) const; bool Can_Read (int Index) const; bool Can_Write (int Index) const; static TSG_Vertex_Type Get_Vertex_Type (int Type); static TSG_Shape_Type Get_Shape_Type (int Type); static int Get_Shape_Type (TSG_Shape_Type Type, bool bZ); static TSG_Data_Type Get_Data_Type (int Type); static int Get_Data_Type (TSG_Data_Type Type); private: class OGRSFDriverRegistrar *m_pDrivers; }; //--------------------------------------------------------- io_gdal_EXPORT const CSG_OGR_Drivers & SG_Get_OGR_Drivers (void); /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class io_gdal_EXPORT CSG_OGR_DataSource { public: CSG_OGR_DataSource(void); CSG_OGR_DataSource(const CSG_String &File); CSG_OGR_DataSource(const CSG_String &File, const CSG_String &DriverName); virtual ~CSG_OGR_DataSource(void); bool Create (const CSG_String &File); bool Create (const CSG_String &File, const CSG_String &DriverName); bool Destroy (void); int Get_Count (void); class OGRLayer * Get_Layer (int iLayer); TSG_Shape_Type Get_Type (int iLayer); TSG_Vertex_Type Get_Coordinate_Type (int iLayer); CSG_Shapes * Read (int iLayer); bool Write (CSG_Shapes *pShapes); private: class OGRDataSource *m_pDataSource; bool _Read_Geometry (CSG_Shape *pShape, class OGRGeometry *pGeometry); bool _Read_Line (CSG_Shape *pShape, class OGRLineString *pLine); bool _Read_Polygon (CSG_Shape *pShape, class OGRPolygon *pPolygon); bool _Write_Geometry (CSG_Shape *pShape, class OGRFeature *pFeature, bool bZ); bool _Write_Line (CSG_Shape *pShape, class OGRLineString *pLine, int iPart, bool bZ); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__ogr_driver_H saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/ogr_export.cpp000066400000000000000000000134301224124640700234760ustar00rootroot00000000000000/********************************************************** * Version $Id: ogr_export.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // ogr_export.cpp // // // // Copyright (C) 2008 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "ogr_export.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- COGR_Export::COGR_Export(void) { Set_Name (_TL("OGR: Export Vector Data")); Set_Author (SG_T("O.Conrad (c) 2008")); CSG_String Description, Formats; Description = _TW( "The \"GDAL Vector Data Export\" module exports vector data to various file formats using the " "\"Geospatial Data Abstraction Library\" (GDAL) by Frank Warmerdam. " "For more information have a look at the GDAL homepage:\n" " " " http://www.gdal.org\n" "\n" "Following vector formats are currently supported:\n" "\n" ); for(int i=0; i\n"), SG_Get_OGR_Drivers().Get_Name(i).c_str(), SG_Get_OGR_Drivers().Get_Description(i).c_str() ); Formats += CSG_String::Format(SG_T("%s|"), SG_Get_OGR_Drivers().Get_Name(i).c_str()); } } Description += SG_T("
    NameDescription
    %s%s
    "); Set_Description(Description); //----------------------------------------------------- Parameters.Add_Shapes( NULL, "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_FilePath( NULL, "FILE" , _TL("File"), _TL(""), NULL, NULL, true ); Parameters.Add_Choice( NULL, "FORMAT" , _TL("Format"), _TL(""), Formats ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool COGR_Export::On_Execute(void) { CSG_String File_Name; CSG_Shapes *pShapes; CSG_OGR_DataSource DataSource; //----------------------------------------------------- pShapes = Parameters("SHAPES") ->asShapes(); File_Name = Parameters("FILE") ->asString(); //----------------------------------------------------- if( DataSource.Create(File_Name, Parameters("FORMAT")->asString()) == false ) { Message_Add(_TL("Could not create data source.")); } else if( DataSource.Write(pShapes) ) { return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/ogr_export.h000066400000000000000000000076451224124640700231560ustar00rootroot00000000000000/********************************************************** * Version $Id: ogr_export.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // ogr_export.h // // // // Copyright (C) 2008 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ogr_export_H #define HEADER_INCLUDED__ogr_export_H //--------------------------------------------------------- #include "ogr_driver.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class COGR_Export : public CSG_Module { public: COGR_Export(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__ogr_export_H saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/ogr_export_kml.cpp000066400000000000000000000144621224124640700243470ustar00rootroot00000000000000/********************************************************** * Version $Id: ogr_export_kml.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // ogr_export_kml.cpp // // // // Copyright (C) 2012 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "ogr_export_kml.h" #include /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- COGR_Export_KML::COGR_Export_KML(void) { Set_Name (_TL("OGR: Export Shapes to KML")); Set_Author (SG_T("O.Conrad (c) 2012")); Set_Description (_TW( "This module exports a vector layer to a Google Earth KML Format using " "Frank Warmerdam's \"Geospatial Data Abstraction Library\" (GDAL/OGR). " "Output file will automatically re-projected to geographic coordinates " "if necessary and possible. " "For more information on GDAL/OGR have a look at the GDAL homepage:\n" " " " http://www.gdal.org\n" )); //----------------------------------------------------- Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_FilePath( NULL, "FILE" , _TL("File"), _TL(""), CSG_String::Format( SG_T("%s|*.kml;*.kml|%s|*.*"), _TL("KML files (*.kml)"), _TL("All Files") ), NULL, true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool COGR_Export_KML::On_Execute(void) { CSG_String File_Name; CSG_Shapes *pShapes, Shapes; pShapes = Parameters("SHAPES")->asShapes(); File_Name = Parameters("FILE" )->asString(); //----------------------------------------------------- if( pShapes->Get_Projection().Get_Type() == SG_PROJ_TYPE_CS_Undefined ) { Message_Add(_TL("layer uses undefined coordinate system, assuming geographic coordinates")); } else if( pShapes->Get_Projection().Get_Type() != SG_PROJ_TYPE_CS_Geographic ) { Message_Add(CSG_String::Format(SG_T("\n%s (%s: %s)\n"), _TL("re-projection to geographic coordinates"), _TL("original"), pShapes->Get_Projection().Get_Name().c_str()), false); bool bResult; SG_RUN_MODULE(bResult, "pj_proj4", 2, pModule->Get_Parameters()->Set_Parameter(SG_T("SOURCE"), pShapes) && pModule->Get_Parameters()->Set_Parameter(SG_T("TARGET"), &Shapes) && pModule->Get_Parameters()->Set_Parameter(SG_T("CRS_PROJ4"), SG_T("+proj=longlat +ellps=WGS84 +datum=WGS84")) ); if( bResult ) { pShapes = &Shapes; Message_Add(CSG_String::Format(SG_T("\n%s: %s\n"), _TL("re-projection"), _TL("success")), false); } else { Message_Add(CSG_String::Format(SG_T("\n%s: %s\n"), _TL("re-projection"), _TL("failed")), false); } } //----------------------------------------------------- CSG_OGR_DataSource DataSource; if( DataSource.Create(File_Name, "KML") == false ) { Message_Add(_TL("could not create KML file")); } else if( DataSource.Write(pShapes) ) { return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/ogr_export_kml.h000066400000000000000000000076751224124640700240240ustar00rootroot00000000000000/********************************************************** * Version $Id: ogr_export_kml.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // ogr_export_kml.h // // // // Copyright (C) 2012 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ogr_export_kml_H #define HEADER_INCLUDED__ogr_export_kml_H //--------------------------------------------------------- #include "ogr_driver.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class COGR_Export_KML : public CSG_Module { public: COGR_Export_KML(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__ogr_export_kml_H saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/ogr_import.cpp000066400000000000000000000154051224124640700234730ustar00rootroot00000000000000/********************************************************** * Version $Id: ogr_import.cpp 1200 2011-10-25 15:23:04Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // ogr_import.cpp // // // // Copyright (C) 2008 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "ogr_import.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- COGR_Import::COGR_Import(void) { Set_Name (_TL("OGR: Import Vector Data")); Set_Author (SG_T("O.Conrad (c) 2008")); CSG_String Description; Description = _TW( "The \"GDAL Vector Data Import\" module imports vector data from various file/database formats using the " "\"Geospatial Data Abstraction Library\" (GDAL) by Frank Warmerdam. " "For more information have a look at the GDAL homepage:\n" " " " http://www.gdal.org\n" "\n" "Following vector data formats are currently supported:\n" "\n" ); for(int i=0; i\n"), SG_Get_OGR_Drivers().Get_Name(i).c_str(), SG_Get_OGR_Drivers().Get_Description(i).c_str() ); } } Description += SG_T("
    NameDescription
    %s%s
    "); Set_Description(Description); //----------------------------------------------------- Parameters.Add_Shapes_List( NULL, "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_FilePath( NULL, "FILES" , _TL("Files"), _TL(""), NULL, NULL, false, false, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool COGR_Import::On_Execute(void) { CSG_Strings Files; CSG_OGR_DataSource DataSource; //----------------------------------------------------- if( !Parameters("FILES")->asFilePath()->Get_FilePaths(Files) ) { return( false ); } //----------------------------------------------------- Parameters("SHAPES")->asShapesList()->Del_Items(); for(int iFile=0; iFileasShapesList()->Add_Item(pShapes); } } } } return( Parameters("SHAPES")->asShapesList()->Get_Count() > 0 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool SG_OGR_Import (const CSG_String &File_Name) { COGR_Import Import; if( !Import.Get_Parameters()->Set_Parameter(SG_T("FILES"), File_Name, PARAMETER_TYPE_FilePath) ) { return( false ); } if( !Import.Execute() ) { return( false ); } CSG_Parameter_Shapes_List *pShapes = Import.Get_Parameters()->Get_Parameter(SG_T("SHAPES"))->asShapesList(); for(int i=0; iGet_Count(); i++) { SG_UI_DataObject_Add(pShapes->asShapes(i), SG_UI_DATAOBJECT_UPDATE_ONLY); } return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/gdal/io_gdal/ogr_import.h000066400000000000000000000102611224124640700231330ustar00rootroot00000000000000/********************************************************** * Version $Id: ogr_import.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library // // // // io_gdal // // // //-------------------------------------------------------// // // // ogr_import.h // // // // Copyright (C) 2008 O. Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Bundesstr. 55 // // D-20146 Hamburg // // Germany // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ogr_import_H #define HEADER_INCLUDED__ogr_import_H //--------------------------------------------------------- #include "ogr_driver.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class COGR_Import : public CSG_Module { public: COGR_Import(void); protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- io_gdal_EXPORT bool SG_OGR_Import (const CSG_String &File_Name); /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__ogr_import_H saga-2.1.0+dfsg/src/modules_io/gps/000077500000000000000000000000001224124640700170655ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/gps/Makefile.am000066400000000000000000000000221224124640700211130ustar00rootroot00000000000000SUBDIRS = io_gps saga-2.1.0+dfsg/src/modules_io/gps/Makefile.in000066400000000000000000000424271224124640700211430ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/gps DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = io_gps all: all-recursive .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) --gnu src/modules_io/gps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/gps/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_io/gps/io_gps/000077500000000000000000000000001224124640700203455ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/gps/io_gps/GPSBabel.cpp000066400000000000000000000104241224124640700224310ustar00rootroot00000000000000/********************************************************** * Version $Id: GPSBabel.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* GPSBabel.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "GPSBabel.h" CSG_String sGPSBabelID[] = { "geo", "gpsman", "gpx", "magellan", "mapsend", "pcx", "mapsource", "gpsutil", "tiger", "csv", "xmap", "dna", "psp", "cetus", "gpspilot", "magnav", "garmin", "mxf", "holux", "ozi", "tpg", "tmpro" }; CGPSBabel::CGPSBabel(){ Parameters.Set_Name(_TL("GPSBabel")); Parameters.Set_Description(_TW( "An interface to the GPSBabel software" "(c) 2005 by Victor Olaya\r\nemail: volaya@ya.com")); Parameters.Add_FilePath(NULL, "BASEPATH", _TL("GPSBabel path"), _TL("GPSBabel path"), _TL(""), _TL(""), false, true); Parameters.Add_FilePath(NULL, "INPUT", _TL("Input file"), _TL(""), _TL("All Files|*.*|")); Parameters.Add_Choice(NULL, "FORMATIN", _TL("Input format"), _TL(""), _TW("Geocaching.com .loc|" "GPSman|" "GPX XML|" "Magellan protocol|" "Magellan Mapsend|" "Garmin PCX5|" "Garmin Mapsource|" "gpsutil|" "U.S. Census Bureau Tiger Mapping Service|" "Comma separated values|" "Delorme Topo USA4/XMap Conduit|" "Navitrak DNA marker format|" "MS PocketStreets 2002 Pushpin|" "Cetus for Palm/OS|" "GPSPilot Tracker for Palm/OS|" "Magellan NAV Companion for PalmOS|" "Garmin serial protocol|" "MapTech Exchange Format|" "Holux (gm-100) .wpo Format|" "OziExplorer Waypoint|" "National Geographic Topo .tpg|" "TopoMapPro Places File|" ), 0); Parameters.Add_FilePath(NULL, "OUTPUT", _TL("Output file"), _TL(""), _TL("All Files|*.*|"), _TL(""), true, false); Parameters.Add_Choice(NULL, "FORMATOUT", _TL("Output format"), _TL(""), _TW("Geocaching.com .loc|" "GPSman|" "GPX XML|" "Magellan protocol|" "Magellan Mapsend|" "Garmin PCX5|" "Garmin Mapsource|" "gpsutil|" "U.S. Census Bureau Tiger Mapping Service|" "Comma separated values|" "Delorme Topo USA4/XMap Conduit|" "Navitrak DNA marker format|" "MS PocketStreets 2002 Pushpin|" "Cetus for Palm/OS|" "GPSPilot Tracker for Palm/OS|" "Magellan NAV Companion for PalmOS|" "Garmin serial protocol|" "MapTech Exchange Format|" "Holux (gm-100) .wpo Format|" "OziExplorer Waypoint|" "National Geographic Topo .tpg|" "TopoMapPro Places File|"), 0); }//constructor CGPSBabel::~CGPSBabel(){ }//destructor bool CGPSBabel::On_Execute(void){ CSG_String sCmd; CSG_String sInputFile = Parameters("INPUT")->asString(); CSG_String sOutputFile = Parameters("OUTPUT")->asString(); CSG_String sBasePath = Parameters("BASEPATH")->asString(); int iInputFormat = Parameters("FORMATIN")->asInt(); int iOutputFormat = Parameters("FORMATOUT")->asInt(); sCmd = sBasePath + SG_T("\\") + SG_T("gpsbabel.exe ") + SG_T("-i ") + sGPSBabelID[iInputFormat] + SG_T(" ") + SG_T("-f ") + sInputFile + SG_T(" ") + SG_T("-o ") + sGPSBabelID[iOutputFormat] + SG_T(" ") + SG_T("-F ") + sOutputFile + SG_T(" "); system(sCmd.b_str()); return true; }//methodsaga-2.1.0+dfsg/src/modules_io/gps/io_gps/GPSBabel.h000066400000000000000000000024761224124640700221060ustar00rootroot00000000000000/********************************************************** * Version $Id: GPSBabel.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* GPSBabel.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CGPSBabel : public CSG_Module { public: CGPSBabel(void); virtual ~CGPSBabel(void); protected: virtual bool On_Execute(void); }; saga-2.1.0+dfsg/src/modules_io/gps/io_gps/MLB_Interface.cpp000066400000000000000000000114601224124640700234450ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for an Automated Geo-Scientific Analysis // // // // Module Library: // // Models // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for an Automated // // Geo-Scientific Analysis'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // // e-mail: oconrad@saga-gis.org // // // /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Import GPS Data") ); case MLB_INFO_Author: return( SG_T("Victor Olaya (c) 2004") ); case MLB_INFO_Description: return( _TL("Modules for GPS data handling.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("File|GPS Import") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "gpx2shp.h" #include "GPSBabel.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { // Don't forget to continuously enumerate the case switches // when adding new modules! Also bear in mind that the // enumeration always has to start with [case 0:] and // that [default:] must return NULL!... CSG_Module *pModule; switch( i ) { case 0: pModule = new CGPX2SHP; break; case 1: pModule = new CGPSBabel; break; default: pModule = NULL; break; } return( pModule ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_io/gps/io_gps/MLB_Interface.h000066400000000000000000000076571224124640700231270ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Terrain_Analysis // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // // e-mail: oconrad@saga-gis.org // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__io_gps_H #define HEADER_INCLUDED__io_gps_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef io_gps_EXPORTS #define io_gps_EXPORT _SAGA_DLL_EXPORT #else #define io_gps_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__io_gps_H saga-2.1.0+dfsg/src/modules_io/gps/io_gps/Makefile.am000066400000000000000000000011541224124640700224020ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libio_gps.la libio_gps_la_SOURCES =\ GPSBabel.cpp\ gpx2shp.cpp\ MLB_Interface.cpp\ GPSBabel.h\ gpx2shp.h\ MLB_Interface.h libio_gps_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_io/gps/io_gps/Makefile.in000066400000000000000000000441751224124640700224250ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/gps/io_gps DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libio_gps_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libio_gps_la_OBJECTS = GPSBabel.lo gpx2shp.lo MLB_Interface.lo libio_gps_la_OBJECTS = $(am_libio_gps_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libio_gps_la_SOURCES) DIST_SOURCES = $(libio_gps_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libio_gps.la libio_gps_la_SOURCES = \ GPSBabel.cpp\ gpx2shp.cpp\ MLB_Interface.cpp\ GPSBabel.h\ gpx2shp.h\ MLB_Interface.h libio_gps_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_io/gps/io_gps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/gps/io_gps/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libio_gps.la: $(libio_gps_la_OBJECTS) $(libio_gps_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libio_gps_la_OBJECTS) $(libio_gps_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GPSBabel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpx2shp.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_io/gps/io_gps/gpx2shp.cpp000066400000000000000000000074401224124640700224510ustar00rootroot00000000000000/********************************************************** * Version $Id: gpx2shp.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* GPX2SHP.cpp Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #include "gpx2shp.h" CGPX2SHP::CGPX2SHP(){ Parameters.Set_Name(_TL("GPX to shapefile")); Parameters.Set_Description(_TW( "Converts a GPX file into a Shapefile (.shp)" "(c) 2005 by Victor Olaya\r\nemail: volaya@ya.com") ); Parameters.Add_FilePath(NULL, "BASEPATH", _TL("Gpx2shp path"), _TL("Gpx2shp path"), _TL(""), _TL(""), false, true); Parameters.Add_FilePath(NULL, "FILE", _TL("GPX file"), _TL(""), _TL("GPX files (*.gpx)|*.gpx|All Files|*.*") ); Parameters.Add_Value(NULL, "TRACKPOINTS", _TL("Convert track points"), _TL("Convert track points"), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(NULL, "WAYPOINTS", _TL("Convert way points"), _TL("Convert way points"), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(NULL, "ROUTES", _TL("Convert routes"), _TL("Convert routes"), PARAMETER_TYPE_Bool, true); Parameters.Add_Value(NULL, "ADD", _TL("Load shapefile"), _TL("Load shapefile after conversion"), PARAMETER_TYPE_Bool, true); }//constructor CGPX2SHP::~CGPX2SHP(){ }//destructor bool CGPX2SHP::On_Execute(void){ CSG_String sCmd; CSG_String sFile = Parameters("FILE")->asString(); CSG_String sBasePath = Parameters("BASEPATH")->asString(); CSG_String sShapefile; bool bWaypoints = Parameters("WAYPOINTS")->asBool(); bool bTrackpoints = Parameters("TRACKPOINTS")->asBool(); bool bRoutes = Parameters("ROUTES")->asBool(); bool bAdd = Parameters("ADD")->asBool(); CSG_Shapes *pShapes; sCmd = sBasePath + SG_T("\\gpx2shp "); if (bWaypoints){ sCmd += SG_T("-w "); }//if if (bTrackpoints){ sCmd += SG_T("-t "); }//if if (bRoutes){ sCmd += SG_T("-r "); }//if sCmd += sFile; system(sCmd.b_str()); if( bAdd ) { CSG_String sDir(SG_File_Get_Path(sFile)), sName(SG_File_Get_Name(sFile, false)); //------------------------------------------------- sFile = SG_File_Make_Path(sDir, sName + SG_T("_wpt"), SG_T("shp")); pShapes = SG_Create_Shapes(sFile); if( pShapes->is_Valid() ) DataObject_Add(pShapes, false); else delete(pShapes); //------------------------------------------------- sFile = SG_File_Make_Path(sDir, sName + SG_T("_trk"), SG_T("shp")); pShapes = SG_Create_Shapes(sFile); if( pShapes->is_Valid() ) DataObject_Add(pShapes, false); else delete(pShapes); //------------------------------------------------- sFile = SG_File_Make_Path(sDir, sName + SG_T("_rte"), SG_T("shp")); pShapes = SG_Create_Shapes(sFile); if( pShapes->is_Valid() ) DataObject_Add(pShapes, false); else delete(pShapes); }//if return true; }//methodsaga-2.1.0+dfsg/src/modules_io/gps/io_gps/gpx2shp.h000066400000000000000000000024711224124640700221150ustar00rootroot00000000000000/********************************************************** * Version $Id: gpx2shp.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /******************************************************************************* GPX2SHP.h Copyright (C) Victor Olaya 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. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "MLB_Interface.h" class CGPX2SHP : public CSG_Module { public: CGPX2SHP(void); virtual ~CGPX2SHP(void); protected: virtual bool On_Execute(void); }; saga-2.1.0+dfsg/src/modules_io/grid/000077500000000000000000000000001224124640700172215ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/grid/Makefile.am000066400000000000000000000001521224124640700212530ustar00rootroot00000000000000if WITH_GUI SUBDIRS = io_grid_image io_grid io_grid_grib2 else SUBDIRS = io_grid io_grid_grib2 endif saga-2.1.0+dfsg/src/modules_io/grid/Makefile.in000066400000000000000000000426171224124640700213000ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/grid DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = io_grid io_grid_grib2 io_grid_image DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @WITH_GUI_FALSE@SUBDIRS = io_grid io_grid_grib2 @WITH_GUI_TRUE@SUBDIRS = io_grid_image io_grid io_grid_grib2 all: all-recursive .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) --gnu src/modules_io/grid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/grid/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_io/grid/io_grid/000077500000000000000000000000001224124640700206355ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/grid/io_grid/MLB_Interface.cpp000066400000000000000000000124531224124640700237400ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Import/Export - Grids") ); case MLB_INFO_Author: return( _TL("SAGA User Group Associaton (c) 2002") ); case MLB_INFO_Description: return( _TL("Tools for the import and export of gridded data.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("File|Grid") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "esri_arcinfo.h" #include "surfer.h" #include "raw.h" #include "xyz.h" #include "usgs_srtm.h" #include "mola.h" #include "srtm30.h" #include "bmp_export.h" #include "erdas_lan.h" #include "grid_table.h" #include "wrf.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CESRI_ArcInfo_Export ); case 1: return( new CESRI_ArcInfo_Import ); case 2: return( new CSurfer_Export ); case 3: return( new CSurfer_Import ); case 4: return( new CRaw_Import ); case 5: return( new CXYZ_Export ); case 6: return( new CXYZ_Import ); case 7: return( new CUSGS_SRTM_Import ); case 8: return( new CMOLA_Import ); case 9: return( new CSRTM30_Import ); case 10: return( new CBMP_Export ); case 11: return( new CErdas_LAN_Import ); case 12: return( new CGrid_Table_Import ); case 13: return( new CWRF_Import ); case 14: return( new CWRF_Export ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_io/grid/io_grid/MLB_Interface.h000066400000000000000000000076651224124640700234160ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__io_grid_H #define HEADER_INCLUDED__io_grid_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef io_grid_EXPORTS #define io_grid_EXPORT _SAGA_DLL_EXPORT #else #define io_grid_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__io_grid_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid/Makefile.am000066400000000000000000000015001224124640700226650ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libio_grid.la libio_grid_la_SOURCES =\ bmp_export.cpp\ erdas_lan.cpp\ esri_arcinfo.cpp\ grid_table.cpp\ MLB_Interface.cpp\ mola.cpp\ raw.cpp\ srtm30.cpp\ surfer.cpp\ usgs_srtm.cpp\ wrf.cpp\ xyz.cpp\ bmp_export.h\ erdas_lan.h\ esri_arcinfo.h\ grid_table.h\ MLB_Interface.h\ mola.h\ raw.h\ srtm30.h\ surfer.h\ usgs_srtm.h\ wrf.h\ xyz.h libio_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_io/grid/io_grid/Makefile.in000066400000000000000000000461151224124640700227110ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/grid/io_grid DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libio_grid_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libio_grid_la_OBJECTS = bmp_export.lo erdas_lan.lo esri_arcinfo.lo \ grid_table.lo MLB_Interface.lo mola.lo raw.lo srtm30.lo \ surfer.lo usgs_srtm.lo wrf.lo xyz.lo libio_grid_la_OBJECTS = $(am_libio_grid_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libio_grid_la_SOURCES) DIST_SOURCES = $(libio_grid_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version pkglib_LTLIBRARIES = libio_grid.la libio_grid_la_SOURCES = \ bmp_export.cpp\ erdas_lan.cpp\ esri_arcinfo.cpp\ grid_table.cpp\ MLB_Interface.cpp\ mola.cpp\ raw.cpp\ srtm30.cpp\ surfer.cpp\ usgs_srtm.cpp\ wrf.cpp\ xyz.cpp\ bmp_export.h\ erdas_lan.h\ esri_arcinfo.h\ grid_table.h\ MLB_Interface.h\ mola.h\ raw.h\ srtm30.h\ surfer.h\ usgs_srtm.h\ wrf.h\ xyz.h libio_grid_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_io/grid/io_grid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/grid/io_grid/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libio_grid.la: $(libio_grid_la_OBJECTS) $(libio_grid_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libio_grid_la_OBJECTS) $(libio_grid_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmp_export.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erdas_lan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/esri_arcinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mola.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srtm30.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/surfer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usgs_srtm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xyz.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_io/grid/io_grid/bmp_export.cpp000066400000000000000000000210251224124640700235200ustar00rootroot00000000000000/********************************************************** * Version $Id: bmp_export.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for an Automated Geo-Scientific Analysis // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // bmp_export.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for an Automated // // Geo-Scientific Analysis'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@gwdg.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "bmp_export.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CBMP_Export::CBMP_Export(void) { //----------------------------------------------------- Set_Name (_TL("Export True Color Bitmap")); Set_Author (SG_T("(c) 2005 by O.Conrad")); Set_Description (_TW( "Export red-green-blue coded image grids to MS-Windows true color bitmaps. " "This module writes the data directly to the file and is hence particularly " "suitable for very large data sets. " )); //----------------------------------------------------- Parameters.Add_Grid( NULL , "IMAGE" , _TL("Image Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), _TL("MS Windows Bitmap (*.bmp)|*.bmp|All Files|*.*"), NULL, true, false ); } //--------------------------------------------------------- CBMP_Export::~CBMP_Export(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define SIZE_HEADER_FILE 14 #define SIZE_HEADER_BITMAP 40 #define SIZE_HEADER_TOTAL (SIZE_HEADER_FILE + SIZE_HEADER_BITMAP) //--------------------------------------------------------- bool CBMP_Export::On_Execute(void) { //----------------------------------------------------- char *Line, *pLine; int x, y, Value, nBytes_Image, nBytes_Line; FILE *Stream; CSG_Grid *pGrid; CSG_String FileName; //----------------------------------------------------- pGrid = Parameters("IMAGE") ->asGrid(); FileName = Parameters("FILE") ->asString(); //----------------------------------------------------- if( (Stream = fopen(FileName.b_str(), "wb")) != NULL ) { nBytes_Line = 3 * sizeof(BYTE) * Get_NX(); if( (Value = nBytes_Line % 4) != 0 ) // must be a multiple of DWORD size... { nBytes_Line += 4 - Value; } nBytes_Image = nBytes_Line * Get_NY(); //------------------------------------------------- Write_WORD (Stream, 0x4d42); // bfType - 0x42 = "B", 0x4d = "M"... Write_DWORD (Stream, SIZE_HEADER_TOTAL + nBytes_Image); // bfSize - size of the entire file... Write_WORD (Stream, 0); // bfReserved1 Write_WORD (Stream, 0); // bfReserved2 Write_DWORD (Stream, SIZE_HEADER_TOTAL); // bfOffBits - offset to the array of color indices... //------------------------------------------------- Write_DWORD (Stream, SIZE_HEADER_BITMAP); // biSize; Write_LONG (Stream, Get_NX()); // biWidth; Write_LONG (Stream, Get_NY()); // biHeight; Write_WORD (Stream, 1); // biPlanes; Write_WORD (Stream, 24); // biBitCount; Write_DWORD (Stream, 0); // biCompression; Write_DWORD (Stream, nBytes_Image); // biSizeImage; Write_LONG (Stream, 0); // biXPelsPerMeter; Write_LONG (Stream, 0); // biYPelsPerMeter; Write_DWORD (Stream, 2^24); // biClrUsed; Write_DWORD (Stream, 0); // biClrImportant; //------------------------------------------------- Line = (char *)SG_Calloc(nBytes_Line, sizeof(char)); for(y=0; yasInt(x, y); pLine[0] = SG_GET_B(Value); pLine[1] = SG_GET_G(Value); pLine[2] = SG_GET_R(Value); } fwrite(Line, sizeof(char), nBytes_Line, Stream); } SG_Free(Line); fclose(Stream); //------------------------------------------------- FileName = SG_File_Make_Path(SG_File_Get_Path(FileName), SG_File_Get_Name(FileName, false), SG_T("prj")); pGrid->Get_Projection().Save(FileName); //------------------------------------------------- FileName = SG_File_Make_Path(SG_File_Get_Path(FileName), SG_File_Get_Name(FileName, false), SG_T("bpw")); if( (Stream = fopen(FileName.b_str(), "w")) != NULL ) { fprintf(Stream, "%f\n%f\n%f\n%f\n%f\n%f\n", pGrid->Get_Cellsize(), 0.0, 0.0, -pGrid->Get_Cellsize(), pGrid->Get_XMin(), pGrid->Get_YMax() ); fclose(Stream); } return( true ); } //----------------------------------------------------- return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CBMP_Export::Write_WORD (FILE *Stream, WORD Value) { fwrite(&Value, sizeof(Value), 1, Stream); } //--------------------------------------------------------- void CBMP_Export::Write_DWORD (FILE *Stream, DWORD Value) { fwrite(&Value, sizeof(Value), 1, Stream); } //--------------------------------------------------------- void CBMP_Export::Write_LONG (FILE *Stream, long Value) { fwrite(&Value, sizeof(Value), 1, Stream); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid/bmp_export.h000066400000000000000000000110461224124640700231670ustar00rootroot00000000000000/********************************************************** * Version $Id: bmp_export.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for an Automated Geo-Scientific Analysis // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // bmp_export.h // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for an Automated // // Geo-Scientific Analysis'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@gwdg.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__bmp_export_H #define HEADER_INCLUDED__bmp_export_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CBMP_Export : public CSG_Module_Grid { public: CBMP_Export(void); virtual ~CBMP_Export(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Export") ); } protected: virtual bool On_Execute (void); private: void Write_WORD (FILE *Stream, WORD Value); void Write_DWORD (FILE *Stream, DWORD Value); void Write_LONG (FILE *Stream, long Value); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__bmp_export_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid/erdas_lan.cpp000066400000000000000000000236711224124640700233020ustar00rootroot00000000000000/********************************************************** * Version $Id: erdas_lan.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for an Automated Geo-Scientific Analysis // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // erdas_lan.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for an Automated // // Geo-Scientific Analysis'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@gwdg.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "erdas_lan.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CErdas_LAN_Import::CErdas_LAN_Import(void) { //----------------------------------------------------- Set_Name (_TL("Import Erdas LAN/GIS")); Set_Author (SG_T("(c) 2005 by O.Conrad")); Set_Description (_TW( "Import Erdas LAN/GIS files. \n" "The format analysis is based on the GRASS module i.in.erdas. " "Go to the " "GRASS GIS Hompage " "for more information.\n" )); //----------------------------------------------------- Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), _TL("Erdas LAN/GIS files (*.lan, *.gis)|*.lan;*.gis|All Files|*.*"), NULL, false, false ); } //--------------------------------------------------------- CErdas_LAN_Import::~CErdas_LAN_Import(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define SWAP(v) if( bSwap ) SG_Swap_Bytes(&v, sizeof(v)); //--------------------------------------------------------- bool CErdas_LAN_Import::On_Execute(void) { //----------------------------------------------------- bool bResult = false, bSwap = false; BYTE *Line, *pLine; char head[6], empty[56]; short vType, nBands, maptyp, nclass, unit; int x, y, i, nLine; long nx, ny, px, py; float area, dx, dy, xPos, yPos; double Cellsize, xMin, yMin, Value; FILE *Stream; TSG_Data_Type gType; CSG_Parameter_Grid_List *Grids; CSG_String FileName; //----------------------------------------------------- Grids = Parameters("GRIDS") ->asGridList(); FileName = Parameters("FILE") ->asString(); Grids->Del_Items(); //----------------------------------------------------- if( (Stream = fopen(FileName.b_str(), "rb")) != NULL ) { fread( head , 6, sizeof(char) , Stream); // "HEAD74" fread(&vType , 1, sizeof(short) , Stream); SWAP(vType); // 0 = 8 bit, 1 = 4 bit, 2 = 16 bit fread(&nBands , 1, sizeof(short) , Stream); SWAP(nBands); // number of bands fread( empty , 6, sizeof(char) , Stream); // empty fread(&nx , 1, sizeof(long) , Stream); SWAP(nx); // number of columns fread(&ny , 1, sizeof(long) , Stream); SWAP(ny); // number of rows fread(&px , 1, sizeof(long) , Stream); SWAP(px); // x position of top-left pixel "database location" fread(&py , 1, sizeof(long) , Stream); SWAP(py); // y position of top-left pixel "database location" fread( empty , 56, sizeof(char) , Stream); // empty fread(&maptyp , 1, sizeof(short) , Stream); SWAP(maptyp); // map projection fread(&nclass , 1, sizeof(short) , Stream); SWAP(nclass); // number of classes fread( empty , 14, sizeof(char) , Stream); // empty fread(&unit , 1, sizeof(short) , Stream); SWAP(unit); // units of area per pixel - 0 = none, 1 = acre, 2 = hectare, 3 = other fread(&area , 1, sizeof(float) , Stream); SWAP(area); // area per pixel fread(&xPos , 1, sizeof(float) , Stream); SWAP(xPos); // x coordinate of top-left pixel fread(&yPos , 1, sizeof(float) , Stream); SWAP(yPos); // y coordinate of top-left pixel fread(&dx , 1, sizeof(float) , Stream); SWAP(dx); // linear size of a pixel (feet/degrees/meters) fread(&dy , 1, sizeof(float) , Stream); SWAP(dy); // linear size of a pixel (feet/degrees/meters) //------------------------------------------------- CSG_File fWorld; if( fWorld.Open(SG_File_Make_Path(NULL, FileName, SG_T("lnw")), SG_FILE_R, false) ) { double d; CSG_String sLine; if( fWorld.Read_Line(sLine) ) { if( sLine.asDouble(d) ) dx = (float)d; } if( fWorld.Read_Line(sLine) ) { } if( fWorld.Read_Line(sLine) ) { } if( fWorld.Read_Line(sLine) ) { if( sLine.asDouble(d) ) dy = (float)d; } if( fWorld.Read_Line(sLine) ) { if( sLine.asDouble(d) ) xPos = (float)d; } if( fWorld.Read_Line(sLine) ) { if( sLine.asDouble(d) ) yPos = (float)d; } } //------------------------------------------------- if( feof(Stream) ) { Message_Add(_TL("File error")); } else if( strncmp(head, "HEAD74", sizeof(head)) ) { Message_Add(_TL("ERDAS files other than version 7.4 are not supported.")); } //------------------------------------------------- else { bResult = true; Cellsize = dx; xMin = xPos; yMin = yPos - ny * Cellsize; switch( vType ) { case 0: default: // 8 bit gType = SG_DATATYPE_Byte; nLine = nx; break; case 1: // 4 bit gType = SG_DATATYPE_Byte; nLine = nx / 2 + (nx % 2 ? 1 : 0); break; case 2: // 16 bit gType = SG_DATATYPE_Word; nLine = nx * 2; break; } Line = (BYTE *)SG_Malloc(nLine * sizeof(BYTE)); for(i=0; iAdd_Item(SG_Create_Grid(gType, nx, ny, Cellsize, xMin, yMin)); Grids->asGrid(i)->Set_Name(CSG_String::Format(SG_T("%s [%d]"), SG_File_Get_Name(FileName, false).c_str(), i + 1)); } //--------------------------------------------- for(y=0; y> 4; pLine ++; } else { Value = (*pLine & 0x11); } break; case 2: if( bSwap ) { SG_Swap_Bytes(pLine, 2); } Value = *((short *)pLine); pLine += 2; break; } Grids->asGrid(i)->Set_Value(x, ny - y - 1, Value); } } } //--------------------------------------------- SG_Free(Line); for(i=0; iasGrid(i)); DataObject_Set_Colors (Grids->asGrid(i), 100, SG_COLORS_BLACK_WHITE); } } //------------------------------------------------- fclose(Stream); } //----------------------------------------------------- return( bResult ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid/erdas_lan.h000066400000000000000000000106241224124640700227410ustar00rootroot00000000000000/********************************************************** * Version $Id: erdas_lan.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for an Automated Geo-Scientific Analysis // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // erdas_lan.h // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for an Automated // // Geo-Scientific Analysis'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@gwdg.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__erdas_lan_H #define HEADER_INCLUDED__erdas_lan_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CErdas_LAN_Import : public CSG_Module { public: CErdas_LAN_Import(void); virtual ~CErdas_LAN_Import(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); private: }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__erdas_lan_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid/esri_arcinfo.cpp000066400000000000000000000442021224124640700240060ustar00rootroot00000000000000/********************************************************** * Version $Id: esri_arcinfo.cpp 1725 2013-06-11 12:52:39Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // ESRI_ArcInfo.cpp // // // // Copyright (C) 2007 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "esri_arcinfo.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define HDR_NROWS SG_T("NROWS") #define HDR_NCOLS SG_T("NCOLS") #define HDR_X_CORNER SG_T("XLLCORNER") #define HDR_Y_CORNER SG_T("YLLCORNER") #define HDR_X_CENTER SG_T("XLLCENTER") #define HDR_Y_CENTER SG_T("YLLCENTER") #define HDR_CELLSIZE SG_T("CELLSIZE") #define HDR_NODATA SG_T("NODATA_VALUE") #define HDR_BYTEORDER SG_T("BYTE_ORDER") #define HDR_BYTEORDER_HI SG_T("MSB_FIRST") #define HDR_BYTEORDER_LO SG_T("LSB_FIRST") /////////////////////////////////////////////////////////// // // // Import // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CESRI_ArcInfo_Import::CESRI_ArcInfo_Import(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Import ESRI Arc/Info Grid")); Set_Author (SG_T("O.Conrad (c) 2007")); Set_Description (_TW( "Import grid from ESRI's Arc/Info grid format.") ); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid_Output( NULL , "GRID" , _TL("Grid"), _TL("") ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), CSG_String::Format( SG_T("%s|*.asc;*.flt|%s|*.asc|%s|*.flt|%s|*.*"), _TL("ESRI Arc/Info Grids"), _TL("ESRI Arc/Info ASCII Grids (*.asc)"), _TL("ESRI Arc/Info Binary Grids (*.flt)"), _TL("All Files") ) ); CSG_Parameter *pNode; pNode = Parameters.Add_Node( NULL , "NODE_ASCII" , _TL("ASCII Grid Options"), _TL("") ); Parameters.Add_Choice( pNode , "GRID_TYPE" , _TL("Target Grid Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|"), _TL("Integer (2 byte)"), _TL("Integer (4 byte)"), _TL("Floating Point (4 byte)"), _TL("Floating Point (8 byte)") ), 2 ); Parameters.Add_Choice( pNode , "NODATA" , _TL("NoData Value"), _TL("Choose whether the input file's NoData value or a user specified NoData value is written"), CSG_String::Format(SG_T("%s|%s|"), _TL("Input File's NoData Value"), _TL("User Defined NoData Value") ), 0 ); Parameters.Add_Value( pNode , "NODATA_VAL" , _TL("User Defined NoData Value"), _TL(""), PARAMETER_TYPE_Double , -99999.0 ); } //--------------------------------------------------------- bool CESRI_ArcInfo_Import::On_Execute(void) { CSG_File Stream; CSG_String fName; CSG_Grid *pGrid; TSG_Data_Type Datatype; int iNoData; double dNoData; //----------------------------------------------------- pGrid = NULL; fName = Parameters("FILE")->asString(); iNoData = Parameters("NODATA")->asInt(); dNoData = Parameters("NODATA_VAL")->asDouble(); switch( Parameters("GRID_TYPE")->asInt() ) { case 0: Datatype = SG_DATATYPE_Short; break; case 1: Datatype = SG_DATATYPE_Int; break; case 2: default: Datatype = SG_DATATYPE_Float; break; case 3: Datatype = SG_DATATYPE_Double; break; } //------------------------------------------------- // Binary... if( Stream.Open(SG_File_Make_Path(SG_T(""), fName, SG_T("hdr")), SG_FILE_R, false) && (pGrid = Read_Header(Stream)) != NULL ) { if( Stream.Open(SG_File_Make_Path(SG_T(""), fName, SG_T("flt")), SG_FILE_R, true) ) { float *Line = (float *)SG_Malloc(pGrid->Get_NX() * sizeof(float)); for(int iy=0, y=pGrid->Get_NY()-1; iyGet_NY() && !Stream.is_EOF() && Set_Progress(iy, pGrid->Get_NY()); iy++, y--) { Stream.Read(Line, sizeof(float), pGrid->Get_NX()); for(int x=0; xGet_NX(); x++) { pGrid->Set_Value(x, y, Line[x]); } } SG_Free(Line); } else { delete(pGrid); return( false ); } } //------------------------------------------------- // ASCII... else if( Stream.Open(fName, SG_FILE_R, false) && (pGrid = Read_Header(Stream, Datatype)) != NULL ) { double dValue; for(int iy=0, y=pGrid->Get_NY()-1; iyGet_NY() && !Stream.is_EOF() && Set_Progress(iy, pGrid->Get_NY()); iy++, y--) { for(int x=0; xGet_NX(); x++) { dValue = Read_Value(Stream); if( iNoData == 1 && dValue == pGrid->Get_NoData_Value() ) dValue = dNoData; pGrid->Set_Value(x, y, dValue); } } if( iNoData == 1 ) { pGrid->Set_NoData_Value(dNoData); } } //------------------------------------------------- else { return( false ); } //------------------------------------------------- pGrid->Set_Name(SG_File_Get_Name(fName, false)); pGrid->Get_Projection().Load(SG_File_Make_Path(NULL, fName, SG_T("prj"))); Parameters("GRID")->Set_Value(pGrid); return( true ); } //--------------------------------------------------------- inline bool SG_is_Numeric(int Character) { switch( Character ) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '-': case '+': case '.': case ',': case 'e': case 'E': return( true ); } return( false ); } //--------------------------------------------------------- double CESRI_ArcInfo_Import::Read_Value(CSG_File &Stream) { int c; CSG_String s; while( !Stream.is_EOF() && !SG_is_Numeric(c = Stream.Read_Char()) ); // ignore leading white space... if( !Stream.is_EOF() && SG_is_Numeric(c) ) { do { if( c == ',' ) { c = '.'; } s += (char)c; } while( !Stream.is_EOF() && SG_is_Numeric(c = Stream.Read_Char()) ); } return( s.asDouble() ); } //--------------------------------------------------------- bool CESRI_ArcInfo_Import::Read_Header_Line(CSG_File &Stream, CSG_String &sLine) { int c; sLine.Clear(); while( !Stream.is_EOF() && (c = Stream.Read_Char()) != 0x0A ) { if( c != 0x0D ) { sLine += (char)c; } } sLine.Make_Upper(); sLine.Replace(SG_T(","), SG_T(".")); return( sLine.Length() > 0 ); } //--------------------------------------------------------- bool CESRI_ArcInfo_Import::Read_Header_Value(const CSG_String &sKey, CSG_String &sLine, int &Value) { sLine.Make_Upper(); if( sLine.Contains(sKey) ) { CSG_String sValue(sLine.c_str() + sKey.Length()); return( sValue.asInt(Value) ); } return( false ); } //--------------------------------------------------------- bool CESRI_ArcInfo_Import::Read_Header_Value(const CSG_String &sKey, CSG_String &sLine, double &Value) { sLine.Make_Upper(); if( sLine.Contains(sKey) ) { CSG_String sValue(sLine.c_str() + sKey.Length()); return( sValue.asDouble(Value) ); } return( false ); } //--------------------------------------------------------- CSG_Grid * CESRI_ArcInfo_Import::Read_Header(CSG_File &Stream, TSG_Data_Type Datatype) { bool bCorner_X, bCorner_Y; int NX, NY; double CellSize, xMin, yMin, NoData = -9999.0; CSG_String sLine; CSG_Grid *pGrid; //----------------------------------------------------- if( !Stream.is_EOF() ) { //------------------------------------------------- Read_Header_Line(Stream, sLine); if( !Read_Header_Value(HDR_NCOLS , sLine, NX) ) return( NULL ); //------------------------------------------------- Read_Header_Line(Stream, sLine); if( !Read_Header_Value(HDR_NROWS , sLine, NY) ) return( NULL ); //------------------------------------------------- Read_Header_Line(Stream, sLine); if( Read_Header_Value(HDR_X_CORNER, sLine, xMin) ) bCorner_X = true; else if( Read_Header_Value(HDR_X_CENTER, sLine, xMin) ) bCorner_X = false; else return( NULL ); //------------------------------------------------- Read_Header_Line(Stream, sLine); if( Read_Header_Value(HDR_Y_CORNER, sLine, yMin) ) bCorner_Y = true; else if( Read_Header_Value(HDR_Y_CENTER, sLine, yMin) ) bCorner_Y = false; else return( NULL ); //------------------------------------------------- Read_Header_Line(Stream, sLine); if( !Read_Header_Value(HDR_CELLSIZE, sLine, CellSize) ) return( NULL ); //------------------------------------------------- Read_Header_Line(Stream, sLine); if( !Read_Header_Value(HDR_NODATA , sLine, NoData) ) // return( NULL ); {} //------------------------------------------------- if( bCorner_X ) xMin += CellSize / 2.0; if( bCorner_Y ) yMin += CellSize / 2.0; //------------------------------------------------- if( (pGrid = SG_Create_Grid(Datatype, NX, NY, CellSize, xMin, yMin)) != NULL ) { pGrid->Set_NoData_Value(NoData); return( pGrid ); } } return( NULL ); } /////////////////////////////////////////////////////////// // // // Export // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CESRI_ArcInfo_Export::CESRI_ArcInfo_Export(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Export ESRI Arc/Info Grid")); Set_Author (SG_T("O.Conrad (c) 2007")); Set_Description (_TW( "Export grid to ESRI's Arc/Info grid format.") ); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), CSG_String::Format( SG_T("%s|*.asc;*.flt|%s|*.asc|%s|*.flt|%s|*.*"), _TL("ESRI Arc/Info Grids"), _TL("ESRI Arc/Info ASCII Grids (*.asc)"), _TL("ESRI Arc/Info Binary Grids (*.flt)"), _TL("All Files") ), NULL, true ); Parameters.Add_Choice( NULL , "FORMAT" , _TL("Format"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("binary"), _TL("ASCII") ), 1 ); Parameters.Add_Choice( NULL , "GEOREF" , _TL("Geo-Reference"), _TL("The grids geo-reference must be related either to the center or the corner of its lower left grid cell."), CSG_String::Format(SG_T("%s|%s|"), _TL("corner"), _TL("center") ), 0 ); Parameters.Add_Value( NULL , "PREC" , _TL("ASCII Precision"), _TL("Number of decimals when writing floating point values in ASCII format."), PARAMETER_TYPE_Int , 4, -1, true ); Parameters.Add_Choice( NULL , "DECSEP" , _TL("ASCII Decimal Separator"), _TL("Applies also to the binary format header file."), CSG_String::Format(SG_T("%s|%s|"), _TL("point (.)"), _TL("comma (,)") ), 0 ); // Parameters.Add_Choice( // NULL , "BYTEORD" , _TL("Binary Byte Order"), // _TL("Byte order when writing floating point values in binary format"), // // CSG_String::Format(SG_T("%s|%s|"), // _TL("most significant first"), // _TL("least significant first") // ), 0 // ); } //--------------------------------------------------------- bool CESRI_ArcInfo_Export::On_Execute(void) { bool bResult, bSwapBytes, bComma; int x, y, iy, Precision; CSG_File Stream; CSG_Grid *pGrid; CSG_String fName; //----------------------------------------------------- bResult = false; pGrid = Parameters("GRID") ->asGrid(); fName = Parameters("FILE") ->asString(); Precision = Parameters("PREC") ->asInt(); bComma = Parameters("DECSEP") ->asInt() == 1; bSwapBytes = false; // bSwapBytes = Parameters("BYTEORD") ->asInt() == 1; //----------------------------------------------------- // Binary... if( Parameters("FORMAT")->asInt() == 0 ) { if( Stream.Open(SG_File_Make_Path(SG_T(""), fName, SG_T("hdr")), SG_FILE_W, false) && Write_Header(Stream, pGrid, bComma) && Stream.Open(SG_File_Make_Path(SG_T(""), fName, SG_T("flt")), SG_FILE_W, true) ) { float *Line = (float *)SG_Malloc(pGrid->Get_NX() * sizeof(float)); for(int iy=0, y=pGrid->Get_NY()-1; iyGet_NY() && Set_Progress(iy, pGrid->Get_NY()); iy++, y--) { for(int x=0; xGet_NX(); x++) { Line[x] = pGrid->asFloat(x, y); if( bSwapBytes ) { SG_Swap_Bytes(Line + x, sizeof(float)); } } Stream.Write(Line, sizeof(float), pGrid->Get_NX()); } SG_Free(Line); pGrid->Get_Projection().Save(SG_File_Make_Path(NULL, fName, SG_T("prj"))); return( true ); } } //----------------------------------------------------- // ASCII... else if( Stream.Open(fName, SG_FILE_W, false) && Write_Header(Stream, pGrid, bComma) ) { for(iy=0, y=pGrid->Get_NY()-1; iyGet_NY() && Set_Progress(iy, pGrid->Get_NY()); iy++, y--) { for(x=0; xGet_NX(); x++) { if( x > 0 ) { fprintf(Stream.Get_Stream(), " "); } fprintf(Stream.Get_Stream(), Write_Value(pGrid->asDouble(x, y), Precision, bComma).b_str()); } fprintf(Stream.Get_Stream(), "\n"); } pGrid->Get_Projection().Save(SG_File_Make_Path(NULL, fName, SG_T("prj"))); return( true ); } //----------------------------------------------------- return( false ); } //--------------------------------------------------------- inline CSG_String CESRI_ArcInfo_Export::Write_Value(double Value, int Precision, bool bComma) { CSG_String s; if( Precision < 0 ) { s.Printf(SG_T("%f") , Value); } else if( Precision > 0 ) { s.Printf(SG_T("%.*f"), Precision, Value); } else { s.Printf(SG_T("%d") , (int)(Value > 0.0 ? Value + 0.5 : Value - 0.5)); } if( bComma ) { s.Replace(SG_T("."), SG_T(",")); } else { s.Replace(SG_T(","), SG_T(".")); } return( s ); } //--------------------------------------------------------- bool CESRI_ArcInfo_Export::Write_Header(CSG_File &Stream, CSG_Grid *pGrid, bool bComma) { if( Stream.is_Open() && pGrid && pGrid->is_Valid() ) { CSG_String s; s += CSG_String::Format(SG_T("%s %d\n") , HDR_NCOLS , pGrid->Get_NX()); s += CSG_String::Format(SG_T("%s %d\n") , HDR_NROWS , pGrid->Get_NY()); if( Parameters("GEOREF")->asInt() == 0 ) { s += CSG_String::Format(SG_T("%s %s\n") , HDR_X_CORNER , Write_Value(pGrid->Get_XMin() - 0.5 * pGrid->Get_Cellsize(), 10, bComma).c_str()); s += CSG_String::Format(SG_T("%s %s\n") , HDR_Y_CORNER , Write_Value(pGrid->Get_YMin() - 0.5 * pGrid->Get_Cellsize(), 10, bComma).c_str()); } else { s += CSG_String::Format(SG_T("%s %s\n") , HDR_X_CENTER , Write_Value(pGrid->Get_XMin(), 10, bComma).c_str()); s += CSG_String::Format(SG_T("%s %s\n") , HDR_Y_CENTER , Write_Value(pGrid->Get_YMin(), 10, bComma).c_str()); } s += CSG_String::Format(SG_T("%s %s\n") , HDR_CELLSIZE , Write_Value(pGrid->Get_Cellsize(), -1, bComma).c_str()); s += CSG_String::Format(SG_T("%s %s\n") , HDR_NODATA , Write_Value(pGrid->Get_NoData_Value(), Parameters("PREC")->asInt(), bComma).c_str()); if( Parameters("FORMAT")->asInt() == 0 ) // binary { if( Parameters("BYTEORD") ) s += CSG_String::Format(SG_T("%s %s\n") , HDR_BYTEORDER , Parameters("BYTEORD")->asInt() == 1 ? HDR_BYTEORDER_LO : HDR_BYTEORDER_HI); } fprintf(Stream.Get_Stream(), s.b_str()); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid/esri_arcinfo.h000066400000000000000000000123101224124640700234460ustar00rootroot00000000000000/********************************************************** * Version $Id: esri_arcinfo.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // ESRI_ArcInfo.h // // // // Copyright (C) 2007 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // ESRI_ArcInfo.h // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__ESRI_ArcInfo_H #define HEADER_INCLUDED__ESRI_ArcInfo_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CESRI_ArcInfo_Import : public CSG_Module { public: CESRI_ArcInfo_Import(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); private: double Read_Value (CSG_File &Stream); bool Read_Header_Value (const CSG_String &sKey, CSG_String &sLine, int &Value); bool Read_Header_Value (const CSG_String &sKey, CSG_String &sLine, double &Value); bool Read_Header_Line (CSG_File &Stream, CSG_String &sLine); CSG_Grid * Read_Header (CSG_File &Stream, TSG_Data_Type Datatype = SG_DATATYPE_Float); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CESRI_ArcInfo_Export : public CSG_Module_Grid { public: CESRI_ArcInfo_Export(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Export") ); } protected: virtual bool On_Execute (void); private: CSG_String Write_Value (double Value, int Precision, bool bComma); bool Write_Header (CSG_File &Stream, CSG_Grid *pGrid, bool bComma); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__ESRI_ArcInfo_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid/grid_table.cpp000066400000000000000000000176341224124640700234500ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_table.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // Grid_Table.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "grid_table.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Table_Import::CGrid_Table_Import(void) { //----------------------------------------------------- // 1. Info... Set_Name(_TL("Import Grid from Table")); Set_Author (SG_T("(c) 2006 by O.Conrad")); Set_Description (_TW( "Imports grid from from table.\n") ); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid_Output( NULL , "GRID" , _TL("Grid"), _TL("") ); Parameters.Add_FilePath( NULL , "FILE_DATA" , _TL("Table"), _TL("") ); //----------------------------------------------------- Parameters.Add_Value( NULL , "DXY" , _TL("Cell Size"), _TL(""), PARAMETER_TYPE_Double , 1.0 ); Parameters.Add_Value( NULL , "XMIN" , _TL("Left Border (X)"), _TL(""), PARAMETER_TYPE_Double , 0.0 ); Parameters.Add_Value( NULL , "YMIN" , _TL("Lower Border (Y)"), _TL(""), PARAMETER_TYPE_Double , 0.0 ); Parameters.Add_String( NULL , "UNIT" , _TL("Unit Name"), _TL(""), _TL("") ); Parameters.Add_Value( NULL , "ZFACTOR" , _TL("Z Multiplier"), _TL(""), PARAMETER_TYPE_Double , 1.0 ); Parameters.Add_Value( NULL , "NODATA" , _TL("No Data Value"), _TL(""), PARAMETER_TYPE_Double , -99999.0 ); Parameters.Add_Choice( NULL , "DATA_TYPE" , _TL("Data Type"), _TL(""), _TW( "1 Byte Integer (unsigned)|" "1 Byte Integer (signed)|" "2 Byte Integer (unsigned)|" "2 Byte Integer (signed)|" "4 Byte Integer (unsigned)|" "4 Byte Integer (signed)|" "4 Byte Floating Point|" "8 Byte Floating Point|") ); Parameters.Add_Choice( NULL , "TOPDOWN" , _TL("Line Order"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Bottom to Top"), _TL("Top to Bottom") ), 0 ); } //--------------------------------------------------------- CGrid_Table_Import::~CGrid_Table_Import(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Table_Import::On_Execute(void) { bool bDown; int x, y, nx, ny; double dxy, xmin, ymin, zFactor, zNoData; TSG_Data_Type data_type; CSG_String FileName, Unit; CSG_Grid *pGrid; CSG_Table Table; CSG_Table_Record *pRecord; //----------------------------------------------------- FileName = Parameters("FILE_DATA") ->asString(); dxy = Parameters("DXY") ->asDouble(); xmin = Parameters("XMIN") ->asDouble(); ymin = Parameters("YMIN") ->asDouble(); bDown = Parameters("TOPDOWN") ->asInt() == 1; Unit = Parameters("UNIT") ->asString(); zFactor = Parameters("ZFACTOR") ->asDouble(); zNoData = Parameters("NODATA") ->asDouble(); switch( Parameters("DATA_TYPE")->asInt() ) { default: data_type = SG_DATATYPE_Undefined; break; // not handled case 0: data_type = SG_DATATYPE_Byte; break; // 1 Byte Integer (unsigned) case 1: data_type = SG_DATATYPE_Char; break; // 1 Byte Integer (signed) case 2: data_type = SG_DATATYPE_Word; break; // 2 Byte Integer (unsigned) case 3: data_type = SG_DATATYPE_Short; break; // 2 Byte Integer (signed) case 4: data_type = SG_DATATYPE_DWord; break; // 4 Byte Integer (unsigned) case 5: data_type = SG_DATATYPE_Int; break; // 4 Byte Integer (signed) case 6: data_type = SG_DATATYPE_Float; break; // 4 Byte Floating Point case 7: data_type = SG_DATATYPE_Double; break; // 8 Byte Floating Point } //----------------------------------------------------- if( Table.Create(FileName) && (nx = Table.Get_Field_Count()) > 0 && (ny = Table.Get_Record_Count()) > 0 ) { pGrid = SG_Create_Grid(data_type, nx, ny, dxy, xmin, ymin); for(y=0; ySet_Value(x, y, pRecord->asDouble(x)); } } pGrid->Set_Unit (Unit); pGrid->Set_ZFactor (zFactor); pGrid->Set_NoData_Value (zNoData); pGrid->Set_Name (SG_File_Get_Name(FileName, false)); Parameters("GRID")->Set_Value(pGrid); return( true ); } //----------------------------------------------------- return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid/grid_table.h000066400000000000000000000110611224124640700231010ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_table.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // Grid_Table.h // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Table_H #define HEADER_INCLUDED__Grid_Table_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGrid_Table_Import : public CSG_Module { public: CGrid_Table_Import(void); virtual ~CGrid_Table_Import(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Grid_Table_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid/mola.cpp000066400000000000000000000223071224124640700222750ustar00rootroot00000000000000/********************************************************** * Version $Id: mola.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // MOLA.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "mola.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CMOLA_Import::CMOLA_Import(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Import MOLA Grid (MEGDR)")); Set_Author (SG_T("(c) 2003 by O.Conrad")); Set_Description (_TW( "Import Mars Orbit Laser Altimeter (MOLA) grids of the Mars Global Surveyor (MGS) Mission " "(Topographic maps, Mission Experiment Gridded Data Records - MEGDRs). " "Find more information and obtain free data from " "" "Mars Global Surveyor: MOLA (NASA)\n\n" )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid_Output( NULL , "GRID" , _TL("Grid"), _TL("") ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), _TL("MOLA Grids (*.img)|*.img|All Files|*.*") ); Parameters.Add_Choice( NULL , "TYPE" , _TL("Grid Type"), _TL(""), _TL("2 byte integer|4 byte floating point|"), 1 ); Parameters.Add_Choice( NULL , "ORIENT" , _TL("Orientation"), _TL(""), _TL("normal|down under|"), 1 ); } //--------------------------------------------------------- CMOLA_Import::~CMOLA_Import(void) {} //--------------------------------------------------------- bool CMOLA_Import::On_Execute(void) { bool bDown; int xa, xb, y, yy, NX, NY; short *sLine; double D, xMin, yMin; CSG_File Stream; TSG_Data_Type Type; CSG_Grid *pGrid; CSG_String fName, sName; //----------------------------------------------------- pGrid = NULL; switch( Parameters("TYPE")->asInt() ) { case 0: Type = SG_DATATYPE_Short; break; case 1: default: Type = SG_DATATYPE_Float; break; } bDown = Parameters("ORIENT")->asInt() == 1; //----------------------------------------------------- // MEGpxxnyyyrv // 012345678901 // p indicates the product type (A for areoid, C for counts, R for // radius, and T for topography) // xx is the latitude of the upper left corner of the image // n indicates whether the latitude is north (N) or south (S) // yyy is the east longitude of the upper left corner of the image // r is the map resolution using the pattern // c = 4 pixel per degree // e = 16 pixel per degree // f = 32 pixel per degree // g = 64 pixel per degree // h = 128 pixel per degree // (This convention is consistent with that used for the Mars Digital // Image Model [MDIM] archives.) // v is a letter indicating the product version. fName = SG_File_Get_Name(Parameters("FILE")->asString(), false); fName.Make_Upper(); if( fName.Length() < 12 ) { return( false ); } //----------------------------------------------------- switch( fName[3] ) { default: return( false ); case 'A': sName.Printf(SG_T("MOLA: Areoid v%c") , fName[11]); break; case 'C': sName.Printf(SG_T("MOLA: Counts v%c") , fName[11]); break; case 'R': sName.Printf(SG_T("MOLA: Radius v%c") , fName[11]); break; case 'T': sName.Printf(SG_T("MOLA: Topography v%c") , fName[11]); break; } //----------------------------------------------------- switch( fName[10] ) { default: return( false ); case 'C': // 1/4th degree... D = 1.0 / 4.0; NX = 4 * 360; NY = 4 * 180; yMin = - 90.0; xMin = -180.0; break; case 'D': // 1/8th degree... D = 1.0 / 8.0; NX = 8 * 360; NY = 8 * 180; yMin = - 90.0; xMin = -180.0; break; case 'E': // 1/16th degree... D = 1.0 / 16.0; NX = 16 * 360; NY = 16 * 180; yMin = - 90.0; xMin = -180.0; break; case 'F': // 1/32th degree... D = 1.0 / 32.0; NX = 32 * 360; NY = 32 * 180; yMin = - 90.0; xMin = -180.0; break; case 'G': // 1/64th degree... D = 1.0 / 64.0; NX = 64 * 180; NY = 64 * 90; yMin = (fName[6] == 'S' ? -1.0 : 1.0) * fName.Right(8).asInt(); yMin = bDown ? yMin - NY * D : -yMin; xMin = fName.Right(5).asInt(); if( xMin >= 180.0 ) { xMin -= 360.0; } break; case 'H': // 1/128th degree... D = 1.0 / 128.0; NX = 128 * 90; NY = 128 * 44; yMin = (fName[6] == 'S' ? -1.0 : 1.0) * fName.Right(8).asInt(); yMin = bDown ? yMin - NY * D : -yMin; xMin = fName.Right(5).asInt(); if( xMin >= 180.0 ) { xMin -= 360.0; } break; } //----------------------------------------------------- if( Stream.Open(Parameters("FILE")->asString(), SG_FILE_R, true) ) { if( (pGrid = SG_Create_Grid(Type, NX, NY, D, xMin + D / 2.0, yMin + D / 2.0)) != NULL ) { pGrid->Set_Name(sName); pGrid->Set_NoData_Value(-999999); pGrid->Get_Projection().Create(SG_T("+proj=lonlat +units=m +a=3396200.000000 +b=3376200.000000"), SG_PROJ_FMT_Proj4); //--------------------------------------------- sLine = (short *)SG_Malloc(NX * sizeof(short)); for(y=0; ySet_Value(xa, yy, sLine[xa]); } } else { for(xa=0, xb=NX/2; xbSet_Value(xa, yy, sLine[xb]); pGrid->Set_Value(xb, yy, sLine[xa]); } } } //--------------------------------------------- SG_Free(sLine); Parameters("GRID")->Set_Value(pGrid); } } return( pGrid != NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid/mola.h000066400000000000000000000074561224124640700217520ustar00rootroot00000000000000/********************************************************** * Version $Id: mola.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // MOLA.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // MOLA.h // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__MOLA_Import_H #define HEADER_INCLUDED__MOLA_Import_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CMOLA_Import : public CSG_Module { public: CMOLA_Import(void); virtual ~CMOLA_Import(void); virtual CSG_String Get_MenuPath(void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute(void); private: }; #endif // #ifndef HEADER_INCLUDED__MOLA_Import_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid/raw.cpp000066400000000000000000000266171224124640700221460ustar00rootroot00000000000000/********************************************************** * Version $Id: raw.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // Raw.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "raw.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CRaw_Import::CRaw_Import(void) { //----------------------------------------------------- // 1. Info... Set_Name(_TL("Import Binary Raw Data")); Set_Author (SG_T("(c) 2003 by O.Conrad")); Set_Description (_TW( "Imports grid from binary raw data.\n") ); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid_Output( NULL , "GRID" , _TL("Grid"), _TL("") ); Parameters.Add_FilePath( NULL , "FILE_DATA" , _TL("Raw Data File"), _TL("") ); //----------------------------------------------------- Parameters.Add_Value( NULL , "NX" , _TL("Cell Count (X)"), _TL(""), PARAMETER_TYPE_Int , 1 ); Parameters.Add_Value( NULL , "NY" , _TL("Cell Count (Y)"), _TL(""), PARAMETER_TYPE_Int , 1 ); Parameters.Add_Value( NULL , "DXY" , _TL("Cell Size"), _TL(""), PARAMETER_TYPE_Double , 1.0 ); Parameters.Add_Value( NULL , "XMIN" , _TL("Left Border (X)"), _TL(""), PARAMETER_TYPE_Double , 0.0 ); Parameters.Add_Value( NULL , "YMIN" , _TL("Lower Border (Y)"), _TL(""), PARAMETER_TYPE_Double , 0.0 ); Parameters.Add_String( NULL , "UNIT" , _TL("Unit Name"), _TL(""), _TL("") ); Parameters.Add_Value( NULL , "ZFACTOR" , _TL("Z Multiplier"), _TL(""), PARAMETER_TYPE_Double , 1.0 ); Parameters.Add_Value( NULL , "NODATA" , _TL("No Data Value"), _TL(""), PARAMETER_TYPE_Double , -99999.0 ); Parameters.Add_Value( NULL , "DATA_OFFSET" , _TL("Data Offset (Bytes)"), _TL(""), PARAMETER_TYPE_Int , 0.0 ); Parameters.Add_Value( NULL , "LINE_OFFSET" , _TL("Line Offset (Bytes)"), _TL(""), PARAMETER_TYPE_Int , 0.0 ); Parameters.Add_Value( NULL , "LINE_ENDSET" , _TL("Line Endset (Bytes)"), _TL(""), PARAMETER_TYPE_Int , 0.0 ); Parameters.Add_Choice( NULL , "DATA_TYPE" , _TL("Data Type"), _TL(""), _TW( "1 Byte Integer (unsigned)|" "1 Byte Integer (signed)|" "2 Byte Integer (unsigned)|" "2 Byte Integer (signed)|" "4 Byte Integer (unsigned)|" "4 Byte Integer (signed)|" "4 Byte Floating Point|" "8 Byte Floating Point|" ) ); Parameters.Add_Choice( NULL , "BYTEORDER_BIG" , _TL("Byte Order"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Little Endian (Intel)"), _TL("Big Endian (Motorola)") ), 0 ); Parameters.Add_Choice( NULL , "TOPDOWN" , _TL("Line Order"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Bottom to Top"), _TL("Top to Bottom") ), 0 ); } //--------------------------------------------------------- CRaw_Import::~CRaw_Import(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CRaw_Import::On_Execute(void) { bool bDown, bBig; int nx, ny, data_head, line_head, line_tail; double dxy, xmin, ymin, zFactor, zNoData; FILE *Stream; TSG_Data_Type data_type; CSG_String FileName, Unit; CSG_Grid *pGrid; //----------------------------------------------------- pGrid = NULL; FileName = Parameters("FILE_DATA") ->asString(); nx = Parameters("NX") ->asInt(); ny = Parameters("NY") ->asInt(); dxy = Parameters("DXY") ->asDouble(); xmin = Parameters("XMIN") ->asDouble(); ymin = Parameters("YMIN") ->asDouble(); data_head = Parameters("DATA_OFFSET") ->asInt(); line_head = Parameters("LINE_OFFSET") ->asInt(); line_tail = Parameters("LINE_ENDSET") ->asInt(); bDown = Parameters("TOPDOWN") ->asInt() == 1; bBig = Parameters("BYTEORDER_BIG") ->asInt() == 1; Unit = Parameters("UNIT") ->asString(); zFactor = Parameters("ZFACTOR") ->asDouble(); zNoData = Parameters("NODATA") ->asDouble(); switch( Parameters("DATA_TYPE")->asInt() ) { default: data_type = SG_DATATYPE_Undefined; break; // not handled case 0: data_type = SG_DATATYPE_Byte; break; // 1 Byte Integer (unsigned) case 1: data_type = SG_DATATYPE_Char; break; // 1 Byte Integer (signed) case 2: data_type = SG_DATATYPE_Word; break; // 2 Byte Integer (unsigned) case 3: data_type = SG_DATATYPE_Short; break; // 2 Byte Integer (signed) case 4: data_type = SG_DATATYPE_DWord; break; // 4 Byte Integer (unsigned) case 5: data_type = SG_DATATYPE_Int; break; // 4 Byte Integer (signed) case 6: data_type = SG_DATATYPE_Float; break; // 4 Byte Floating Point case 7: data_type = SG_DATATYPE_Double; break; // 8 Byte Floating Point } //----------------------------------------------------- if( data_type != SG_DATATYPE_Undefined && (Stream = fopen(FileName.b_str(), "rb")) != NULL ) { if( (pGrid = Load_Data(Stream, data_type, nx, ny, dxy, xmin, ymin, data_head, line_head, line_tail, bDown, bBig)) != NULL ) { pGrid->Set_Unit (Unit); pGrid->Set_ZFactor (zFactor); pGrid->Set_NoData_Value (zNoData); pGrid->Set_Name (SG_File_Get_Name(FileName, false)); Parameters("GRID")->Set_Value(pGrid); } fclose(Stream); } //----------------------------------------------------- return( pGrid != NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSG_Grid * CRaw_Import::Load_Data(FILE *Stream, TSG_Data_Type data_type, int nx, int ny, double dxy, double xmin, double ymin, int data_head, int line_head, int line_tail, bool bDown, bool bBig) { char *pLine, *pValue; int x, y, nBytes_Value, nBytes_Line; CSG_Grid *pGrid = NULL; //----------------------------------------------------- if( Stream && data_type != SG_DATATYPE_Undefined ) { for(x=0; xGet_NY() && !feof(Stream) && Set_Progress(y, pGrid->Get_NY()); y++) { for(x=0; xGet_NX(); x++, pValue+=nBytes_Value) { if( bBig ) { SG_Swap_Bytes(pValue, nBytes_Value); } switch( data_type ) { case SG_DATATYPE_Byte: pGrid->Set_Value(x, y, *(unsigned char *)pValue); break; // 1 Byte Integer (unsigned) case SG_DATATYPE_Char: pGrid->Set_Value(x, y, *(signed char *)pValue); break; // 1 Byte Integer (signed) case SG_DATATYPE_Word: pGrid->Set_Value(x, y, *(unsigned short *)pValue); break; // 2 Byte Integer (unsigned) case SG_DATATYPE_Short: pGrid->Set_Value(x, y, *(signed short *)pValue); break; // 2 Byte Integer (signed) case SG_DATATYPE_DWord: pGrid->Set_Value(x, y, *(unsigned int *)pValue); break; // 4 Byte Integer (unsigned) case SG_DATATYPE_Int: pGrid->Set_Value(x, y, *(signed int *)pValue); break; // 4 Byte Integer (signed) case SG_DATATYPE_Float: pGrid->Set_Value(x, y, *(float *)pValue); break; // 4 Byte Floating Point case SG_DATATYPE_Double: pGrid->Set_Value(x, y, *(double *)pValue); break; // 8 Byte Floating Point } } for(x=0; xFlip(); } } } //----------------------------------------------------- return( pGrid ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid/raw.h000066400000000000000000000113361224124640700216030ustar00rootroot00000000000000/********************************************************** * Version $Id: raw.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // Raw.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Raw_Import_H #define HEADER_INCLUDED__Raw_Import_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CRaw_Import : public CSG_Module { public: CRaw_Import(void); virtual ~CRaw_Import(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); private: CSG_Grid * Load_Data (FILE *Stream, TSG_Data_Type data_type, int nx, int ny, double dxy, double xmin, double ymin, int data_head, int line_head, int line_tail, bool bDown, bool bBig); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__Raw_Import_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid/srtm30.cpp000066400000000000000000000241151224124640700224740ustar00rootroot00000000000000/********************************************************** * Version $Id: srtm30.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // SRTM30.cpp // // // // Copyright (C) 2004 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "srtm30.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSRTM30_Import::CSRTM30_Import(void) { CSG_Parameter *pNode_0; CSG_Parameters *pParameters; //----------------------------------------------------- Set_Name(_TL("Import SRTM30 DEM")); Set_Author (SG_T("(c) 2004 by O.Conrad")); Set_Description (_TW( "Extracts elevation grids from SRTM30 data.\n\n" "\"SRTM30 is a near-global digital elevation model (DEM) comprising a " "combination of data from the Shuttle Radar Topography Mission, flown " "in February, 2000 and the the U.S. Geological Survey's GTOPO30 data " "set. It can be considered to be either an SRTM data set enhanced with " "GTOPO30, or as an upgrade to GTOPO30.\" (NASA)\n\n" "Further information about the GTOPO30 data set:\n" "" "http://edcdaac.usgs.gov/gtopo30/gtopo30.html\n\n" "SRTM30 data can be downloaded from:\n" "" "ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM30/\n\n" "A directory, that contains the uncompressed SRTM30 DEM files, can be located using " "the \"Path\" Parameter of this module.") ); //----------------------------------------------------- pNode_0 = Parameters.Add_Grid_Output( NULL , "GRID" , _TL("Grid"), _TL("") ); pNode_0 = Parameters.Add_FilePath( NULL , "PATH" , _TL("Path"), _TL(""), NULL, NULL, false, true ); //----------------------------------------------------- pNode_0 = Parameters.Add_Value( NULL , "XMIN" , _TL("West []"), _TL(""), PARAMETER_TYPE_Int, 60.0 ); pNode_0 = Parameters.Add_Value( NULL , "XMAX" , _TL("East []"), _TL(""), PARAMETER_TYPE_Int, 120.0 ); pNode_0 = Parameters.Add_Value( NULL , "YMIN" , _TL("South []"), _TL(""), PARAMETER_TYPE_Int, 20.0 ); pNode_0 = Parameters.Add_Value( NULL , "YMAX" , _TL("North []"), _TL(""), PARAMETER_TYPE_Int, 50.0 ); //----------------------------------------------------- pParameters = Add_Parameters("TILE", _TL(""), _TL("")); pNode_0 = pParameters->Add_Info_String( NULL , "INFO" , _TL("File does not exist:"), _TL(""), _TL("") ); pNode_0 = pParameters->Add_FilePath( NULL , "PATH" , _TL("Select file"), _TL(""), _TL("SRTM30 DEM Tiles (*.dem)|*.dem|All Files|*.*") ); } //--------------------------------------------------------- CSRTM30_Import::~CSRTM30_Import(void) {} /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define X_WIDTH 4800 #define Y_WIDTH 6000 //--------------------------------------------------------- bool CSRTM30_Import::On_Execute(void) { char x_sTile[9][5] = { "W180", "W140", "W100", "W060", "W020", "E020", "E060", "E100", "E140" }, y_sTile[3][4] = { "S10", "N40", "N90" }; double dSize = 30.0 / (60.0 * 60.0); //----------------------------------------------------- int xTile, yTile; double xMin, xMax, yMin, yMax; TSG_Rect rOut, rTile; CSG_String sTile; CSG_Grid *pOut; //----------------------------------------------------- xMin = Parameters("XMIN")->asInt(); xMax = Parameters("XMAX")->asInt(); yMin = Parameters("YMIN")->asInt(); yMax = Parameters("YMAX")->asInt(); rOut.xMin = (180 + xMin) / 40.0 * X_WIDTH; rOut.xMax = rOut.xMin + (int)((xMax - xMin) / dSize); rOut.yMin = ( 60 + yMin) / 50.0 * Y_WIDTH; rOut.yMax = rOut.yMin + (int)((yMax - yMin) / dSize); //----------------------------------------------------- pOut = SG_Create_Grid(SG_DATATYPE_Short, (int)(rOut.xMax - rOut.xMin), (int)(rOut.yMax - rOut.yMin), dSize, xMin + 0.5 * dSize, yMin + 0.5 * dSize ); pOut->Set_NoData_Value(-9999); pOut->Assign_NoData(); pOut->Set_Name(SG_T("SRTM30")); pOut->Get_Projection().Create(SG_T("GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]")); //----------------------------------------------------- for(yTile=0, rTile.yMin=0, rTile.yMax=Y_WIDTH; yTile<3; yTile++, rTile.yMin+=Y_WIDTH, rTile.yMax+=Y_WIDTH) { for(xTile=0, rTile.xMin=0, rTile.xMax=X_WIDTH; xTile<9; xTile++, rTile.xMin+=X_WIDTH, rTile.xMax+=X_WIDTH) { sTile.Printf(SG_T("Tile: %s%s"), x_sTile[xTile], y_sTile[yTile]); Process_Set_Text(sTile); sTile.Printf(SG_T("%s%s%s.dem"), Parameters("PATH")->asString(), x_sTile[xTile], y_sTile[yTile]); Tile_Load(sTile, rTile, pOut, rOut); } } //----------------------------------------------------- Parameters("GRID")->Set_Value(pOut); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CSRTM30_Import::Tile_Load(const SG_Char *sTile, TSG_Rect &rTile, CSG_Grid *pOut, TSG_Rect &rOut) { short Value; int x, y, xOut, yOut; FILE *Stream; CSG_Rect r(rTile); if( r.Intersects(rOut) != INTERSECTION_None && (Stream = Tile_Open(sTile)) != NULL ) { for(y=0, yOut=(int)(rTile.yMax-rOut.yMin); y=0 && Set_Progress(y, Y_WIDTH); y++, yOut--) { for(x=0, xOut=(int)(rTile.xMin-rOut.xMin); x= 0 && xOut < pOut->Get_NX() && yOut >= 0 && yOut < pOut->Get_NY() ) { SG_Swap_Bytes(&Value, sizeof(short)); pOut->Set_Value(xOut, yOut, Value); } } } fclose(Stream); return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- FILE * CSRTM30_Import::Tile_Open(const SG_Char *sTile) { const SG_Char *sPath; FILE *Stream; CSG_String fName; CSG_Parameters *pParameters; fName = sTile; if( (Stream = fopen(fName.b_str(), "rb")) == NULL ) { pParameters = Get_Parameters("TILE"); pParameters->Get_Parameter("INFO")->Set_Value(sTile); if( Dlg_Parameters(pParameters, _TL("Locate STRM30 Data File")) && (sPath = pParameters->Get_Parameter("PATH")->asString()) != NULL ) { fName = sPath; Stream = fopen(fName.b_str(), "rb"); } } return( Stream ); } saga-2.1.0+dfsg/src/modules_io/grid/io_grid/srtm30.h000066400000000000000000000077511224124640700221500ustar00rootroot00000000000000/********************************************************** * Version $Id: srtm30.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // SRTM30.h // // // // Copyright (C) 2004 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Import_SRTM30_H #define HEADER_INCLUDED__Import_SRTM30_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CSRTM30_Import : public CSG_Module { public: CSRTM30_Import(void); virtual ~CSRTM30_Import(void); virtual CSG_String Get_MenuPath(void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute(void); private: bool Tile_Load(const SG_Char *sTile, TSG_Rect &rTile, CSG_Grid *pOut, TSG_Rect &rOut); FILE * Tile_Open(const SG_Char *sTile); }; #endif // #ifndef HEADER_INCLUDED__Import_SRTM30_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid/surfer.cpp000066400000000000000000000322061224124640700226520ustar00rootroot00000000000000/********************************************************** * Version $Id: surfer.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // Surfer.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "surfer.h" //--------------------------------------------------------- #define NODATAVALUE 1.70141e38f /////////////////////////////////////////////////////////// // // // Import // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSurfer_Import::CSurfer_Import(void) { CSG_Parameter *pNode; //----------------------------------------------------- // 1. Info... Set_Name(_TL("Import Surfer Grid")); Set_Author (SG_T("(c) 2001 by O.Conrad")); Set_Description (_TW( "Import grid from Golden Software's Surfer grid format.\n") ); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid_Output( NULL , "GRID" , _TL("Grid"), _TL("") ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), _TL("Surfer Grid (*.grd)|*.grd|All Files|*.*") ); pNode = Parameters.Add_Choice( NULL , "NODATA" , _TL("No Data Value"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("Surfer's No Data Value"), _TL("User Defined") ), 0 ); Parameters.Add_Value( pNode , "NODATA_VAL" , _TL("User Defined No Data Value"), _TL(""), PARAMETER_TYPE_Double , -99999.0 ); } //--------------------------------------------------------- CSurfer_Import::~CSurfer_Import(void) {} //--------------------------------------------------------- bool CSurfer_Import::On_Execute(void) { int x, y, NX, NY; short sValue; long lValue; float *fLine; double *dLine, dValue, DX, DY, xMin, yMin; FILE *Stream; CSG_String fName; CSG_Grid *pGrid; //----------------------------------------------------- pGrid = NULL; fName = Parameters("FILE")->asString(); //----------------------------------------------------- if( fName.Length() > 0 && (Stream = fopen(fName.b_str(), "rb")) != NULL ) { fread(&lValue, 1, sizeof(long), Stream); //------------------------------------------------- // Surfer 7: Binary... if( !strncmp((char *)&lValue, "DSRB", 4) ) { fread(&lValue, 1, sizeof(long) , Stream); // SectionSize... fread(&lValue, 1, sizeof(long) , Stream); // Version fread(&lValue, 1, sizeof(long) , Stream); if( lValue == 0x44495247 ) // Grid-Header... { fread(&lValue , 1, sizeof(long) , Stream); // SectionSize... fread(&lValue , 1, sizeof(long) , Stream); // NX... NY = (int)lValue; fread(&lValue , 1, sizeof(long) , Stream); // NY... NX = (int)lValue; fread(&xMin , 1, sizeof(double) , Stream); // xMin... fread(&yMin , 1, sizeof(double) , Stream); // yMin... fread(&DX , 1, sizeof(double) , Stream); // DX... fread(&DY , 1, sizeof(double) , Stream); // DY... fread(&dValue , 1, sizeof(double) , Stream); // zMin... fread(&dValue , 1, sizeof(double) , Stream); // zMax... fread(&dValue , 1, sizeof(double) , Stream); // Rotation (unused)... fread(&dValue , 1, sizeof(double) , Stream); // Blank Value... fread(&lValue , 1, sizeof(long) , Stream); // ???... if( lValue == 0x41544144 ) // Load Binary Double... { fread(&lValue, 1, sizeof(long) , Stream); // SectionSize... //------------------------------------- if( !feof(Stream) && (pGrid = SG_Create_Grid(SG_DATATYPE_Double, NX, NY, DX, xMin, yMin)) != NULL ) { dLine = (double *)SG_Malloc(pGrid->Get_NX() * sizeof(double)); for(y=0; yGet_NY() && !feof(Stream) && Set_Progress(y, pGrid->Get_NY()); y++) { fread(dLine, pGrid->Get_NX(), sizeof(double), Stream); for(x=0; xGet_NX(); x++) { pGrid->Set_Value(x, y, dLine[x]); } } SG_Free(dLine); } } } } //------------------------------------------------- // Surfer 6: Binary... else if( !strncmp((char *)&lValue, "DSBB", 4) ) { fread(&sValue , 1, sizeof(short) , Stream); NX = sValue; fread(&sValue , 1, sizeof(short) , Stream); NY = sValue; fread(&xMin , 1, sizeof(double) , Stream); fread(&dValue , 1, sizeof(double) , Stream); // XMax DX = (dValue - xMin) / (NX - 1.0); fread(&yMin , 1, sizeof(double) , Stream); fread(&dValue , 1, sizeof(double) , Stream); // YMax... DY = (dValue - yMin) / (NY - 1.0); fread(&dValue , 1, sizeof(double) , Stream); // ZMin... fread(&dValue , 1, sizeof(double) , Stream); // ZMax... //--------------------------------------------- if( !feof(Stream) && (pGrid = SG_Create_Grid(SG_DATATYPE_Float, NX, NY, DX, xMin, yMin)) != NULL ) { fLine = (float *)SG_Malloc(pGrid->Get_NX() * sizeof(float)); for(y=0; yGet_NY() && !feof(Stream) && Set_Progress(y, pGrid->Get_NY()); y++) { fread(fLine, pGrid->Get_NX(), sizeof(float), Stream); for(x=0; xGet_NX(); x++) { pGrid->Set_Value(x, y, fLine[x]); } } SG_Free(fLine); } } //------------------------------------------------- // Surfer 6: ASCII... else if( !strncmp((char *)&lValue, "DSAA", 4) ) { fscanf(Stream, "%d %d" , &NX , &NY); fscanf(Stream, "%lf %lf", &xMin , &dValue); DX = (dValue - xMin) / (NX - 1.0); fscanf(Stream, "%lf %lf", &yMin , &dValue); DY = (dValue - yMin) / (NY - 1.0); fscanf(Stream, "%lf %lf", &dValue, &dValue); //--------------------------------------------- if( !feof(Stream) && (pGrid = SG_Create_Grid(SG_DATATYPE_Float, NX, NY, DX, xMin, yMin)) != NULL ) { for(y=0; yGet_NY() && !feof(Stream) && Set_Progress(y, pGrid->Get_NY()); y++) { for(x=0; xGet_NX(); x++) { fscanf(Stream, "%lf", &dValue); pGrid->Set_Value(x, y, dValue); } } } } fclose(Stream); } //----------------------------------------------------- if( pGrid ) { pGrid->Set_Name(Parameters("FILE")->asString()); pGrid->Set_NoData_Value(Parameters("NODATA")->asInt() == 0 ? NODATAVALUE : Parameters("NODATA_VAL")->asDouble()); Parameters("GRID")->Set_Value(pGrid); } return( pGrid != NULL ); } /////////////////////////////////////////////////////////// // // // Export // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CSurfer_Export::CSurfer_Export(void) { //----------------------------------------------------- // 1. Info... Set_Name(_TL("Export Surfer Grid")); Set_Author (SG_T("(c) 2001 by O.Conrad")); Set_Description (_TW( "Export grid to Golden Software's Surfer grid format.\n") ); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), _TL( "Surfer Grid (*.grd)|*.grd|All Files|*.*"), NULL, true ); Parameters.Add_Choice( NULL , "FORMAT" , _TL("Format"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("binary"), _TL("ASCII") ), 0 ); Parameters.Add_Value( NULL , "NODATA" , _TL("Use Surfer's No-Data Value"), _TL(""), PARAMETER_TYPE_Bool , false ); } //--------------------------------------------------------- CSurfer_Export::~CSurfer_Export(void) {} //--------------------------------------------------------- bool CSurfer_Export::On_Execute(void) { const char ID_BINARY[] = "DSBB"; bool bNoData; short sValue; int x, y; float *fLine; double dValue; FILE *Stream; CSG_String fName; CSG_Grid *pGrid; //----------------------------------------------------- pGrid = Parameters("GRID") ->asGrid(); fName = Parameters("FILE") ->asString(); bNoData = Parameters("NODATA") ->asBool(); switch( Parameters("FORMAT")->asInt() ) { //----------------------------------------------------- case 0: // Surfer 6 - Binary... if( (Stream = fopen(fName.b_str(), "wb")) != NULL ) { fwrite(ID_BINARY, 4, sizeof(char ), Stream); sValue = (short)pGrid->Get_NX(); fwrite(&sValue , 1, sizeof(short ), Stream); sValue = (short)pGrid->Get_NY(); fwrite(&sValue , 1, sizeof(short ), Stream); dValue = pGrid->Get_XMin(); fwrite(&dValue , 1, sizeof(double), Stream); dValue = pGrid->Get_XMax(); fwrite(&dValue , 1, sizeof(double), Stream); dValue = pGrid->Get_YMin(); fwrite(&dValue , 1, sizeof(double), Stream); dValue = pGrid->Get_YMax(); fwrite(&dValue , 1, sizeof(double), Stream); dValue = pGrid->Get_ZMin(); fwrite(&dValue , 1, sizeof(double), Stream); dValue = pGrid->Get_ZMax(); fwrite(&dValue , 1, sizeof(double), Stream); //--------------------------------------------- fLine = (float *)SG_Malloc(pGrid->Get_NX() * sizeof(float)); for(y=0; yGet_NY() && Set_Progress(y, pGrid->Get_NY()); y++) { for(x=0; xGet_NX(); x++) { fLine[x] = bNoData && pGrid->is_NoData(x, y) ? NODATAVALUE : pGrid->asFloat(x, y); } fwrite(fLine, pGrid->Get_NX(), sizeof(float), Stream); } SG_Free(fLine); fclose(Stream); return( true ); } break; //----------------------------------------------------- case 1: // Surfer - ASCII... if( (Stream = fopen(fName.b_str(), "w")) != NULL ) { fprintf(Stream, "DSAA\n" ); fprintf(Stream, "%d %d\n", pGrid->Get_NX() , pGrid->Get_NY() ); fprintf(Stream, "%f %f\n", pGrid->Get_XMin(), pGrid->Get_XMax() ); fprintf(Stream, "%f %f\n", pGrid->Get_YMin(), pGrid->Get_YMax() ); fprintf(Stream, "%f %f\n", pGrid->Get_ZMin(), pGrid->Get_ZMax() ); //--------------------------------------------- for(y=0; yGet_NY() && Set_Progress(y, pGrid->Get_NY()); y++) { for(x=0; xGet_NX(); x++) { if( bNoData && pGrid->is_NoData(x, y) ) { fprintf(Stream, "1.70141e38 "); } else { fprintf(Stream, "%f ", pGrid->asFloat(x, y)); } } fprintf(Stream, "\n"); } fclose(Stream); return( true ); } break; } //----------------------------------------------------- return( false ); } saga-2.1.0+dfsg/src/modules_io/grid/io_grid/surfer.h000066400000000000000000000101351224124640700223140ustar00rootroot00000000000000/********************************************************** * Version $Id: surfer.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // Surfer.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Surfer.h // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Surfer_H #define HEADER_INCLUDED__Surfer_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CSurfer_Import : public CSG_Module { public: CSurfer_Import(void); virtual ~CSurfer_Import(void); virtual CSG_String Get_MenuPath(void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute(void); private: }; //--------------------------------------------------------- class CSurfer_Export : public CSG_Module_Grid { public: CSurfer_Export(void); virtual ~CSurfer_Export(void); virtual CSG_String Get_MenuPath(void) { return( _TL("R:Export") ); } protected: virtual bool On_Execute(void); private: }; #endif // #ifndef HEADER_INCLUDED__Surfer_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid/usgs_srtm.cpp000066400000000000000000000175451224124640700234030ustar00rootroot00000000000000/********************************************************** * Version $Id: usgs_srtm.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // USGS_SRTM.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include "usgs_srtm.h" /////////////////////////////////////////////////////////// // // // Import // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CUSGS_SRTM_Import::CUSGS_SRTM_Import(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Import USGS SRTM Grid")); Set_Author (SG_T("O.Conrad (c) 2004")); Set_Description (_TW( "Import grid from USGS SRTM (Shuttle Radar Topography Mission) data.\n" "You find data and further information at:\n" " " " http://dds.cr.usgs.gov/srtm/\n" " " " http://www.jpl.nasa.gov/srtm/\n" "\nFarr, T.G., M. Kobrick (2000):\n" " 'Shuttle Radar Topography Mission produces a wealth of data',\n" " Amer. Geophys. Union Eos, v. 81, p. 583-585\n" "\nRosen, P.A., S. Hensley, I.R. Joughin, F.K. Li, S.N. Madsen, E. Rodriguez, R.M. Goldstein (2000):\n" " 'Synthetic aperture radar interferometry'\n" " Proc. IEEE, v. 88, p. 333-382\n" )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_OUTPUT_OPTIONAL, false ); Parameters.Add_FilePath( NULL , "FILE" , _TL("Files"), _TL(""), _TL("USGS SRTM Grids (*.hgt)|*.hgt|All Files|*.*"), NULL, false, false, true ); Parameters.Add_Choice( NULL , "RESOLUTION" , _TL("Resolution"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("1 arc-second"), _TL("3 arc-second") ), 1 ); } //--------------------------------------------------------- CUSGS_SRTM_Import::~CUSGS_SRTM_Import(void) {} //--------------------------------------------------------- bool CUSGS_SRTM_Import::On_Execute(void) { int N; double D; CSG_Strings fNames; CSG_Grid *pGrid; CSG_Parameter_Grid_List *pGrids; pGrids = Parameters("GRIDS")->asGridList(); pGrids ->Del_Items(); //----------------------------------------------------- switch( Parameters("RESOLUTION")->asInt() ) { default: return( false ); case 0: // 1 arcsec... N = 3601; D = 1.0 / 3600.0; break; case 1: // 3 arcsec... N = 1201; D = 3.0 / 3600.0; break; } //----------------------------------------------------- if( Parameters("FILE")->asFilePath()->Get_FilePaths(fNames) && fNames.Get_Count() > 0 ) { for(int i=0; iAdd_Item(pGrid); } } return( pGrids->Get_Count() > 0 ); } return( false ); } //--------------------------------------------------------- CSG_Grid * CUSGS_SRTM_Import::Load(CSG_String File, int N, double D) { int x, y; short *sLine; double xMin, yMin; CSG_File Stream; CSG_String fName; CSG_Grid *pGrid; //----------------------------------------------------- pGrid = NULL; fName = SG_File_Get_Name(File, false); if( fName.Length() >= 7 ) { fName .Make_Upper(); Process_Set_Text(CSG_String::Format(SG_T("%s: %s"), _TL("Importing"), fName.c_str())); yMin = (fName[0] == 'N' ? 1.0 : -1.0) * fName.Right(6).asInt(); xMin = (fName[3] == 'W' ? -1.0 : 1.0) * fName.Right(3).asInt(); //------------------------------------------------- if( Stream.Open(File, SG_FILE_R, true) ) { if( (pGrid = SG_Create_Grid(SG_DATATYPE_Short, N, N, D, xMin, yMin)) != NULL ) { pGrid->Set_Name (fName); pGrid->Get_Projection().Create(SG_T("GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]")); pGrid->Set_NoData_Value (-32768); //----------------------------------------- sLine = (short *)SG_Malloc(N * sizeof(short)); for(y=0; ySet_Value(x, N - 1 - y, sLine[x]); } } SG_Free(sLine); } } } return( pGrid ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid/usgs_srtm.h000066400000000000000000000075751224124640700230520ustar00rootroot00000000000000/********************************************************** * Version $Id: usgs_srtm.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // USGS_SRTM.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // USGS_SRTM.h // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__USGS_SRTM_H #define HEADER_INCLUDED__USGS_SRTM_H //--------------------------------------------------------- #include "MLB_Interface.h" //--------------------------------------------------------- class CUSGS_SRTM_Import : public CSG_Module { public: CUSGS_SRTM_Import(void); virtual ~CUSGS_SRTM_Import(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); private: CSG_Grid * Load (CSG_String fName, int N, double D); }; #endif // #ifndef HEADER_INCLUDED__USGS_SRTM_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid/wrf.cpp000066400000000000000000001045471224124640700221520ustar00rootroot00000000000000/********************************************************** * Version $Id: wrf.cpp 911 2011-11-11 11:11:11Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // wrf.cpp // // // // Copyright (C) 2011 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "wrf.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// #define VAL_CATEGORICAL 0 #define VAL_CONTINUOUS 1 #define VAL_ENDIAN_BIG 0 #define VAL_ENDIAN_LITTLE 1 #define VAL_BOTTOM_TOP 0 #define VAL_TOP_BOTTOM 1 //--------------------------------------------------------- CWRF_Index::CWRF_Index(void) { Reset(); } //--------------------------------------------------------- bool CWRF_Index::Reset(void) { m_PROJECTION = SG_T(""); // A character string specifying the projection of the data, which may be // either lambert, polar, mercator, regular_ll, albers_nad83, or polar_wgs84. // No default value. m_TYPE = 0; // A character string, either categorical or continuous, that determines // whether the data in the data files should be interpreted as a continuous field or as discrete // indices. For categorical data represented by a fractional field for each possible category, // type should be set to continuous. // No default value. m_SIGNED = false; // Either yes or no, indicating whether the values in the data files (which are // always represented as integers) are signed in two's complement form or not. // Default value is no. m_UNITS = SG_T(""); // A character string, enclosed in quotation marks ("), specifying the units of the // interpolated field; the string will be written to the geogrid output files as a variable timeindependent // attribute. // No default value. m_DESCRIPTION = SG_T(""); // A character string, enclosed in quotation marks ("), giving a short // description of the interpolated field; the string will be written to the geogrid output files // as a variable time-independent attribute. // No default value. m_DX = 0.0; // A real value giving the grid spacing in the x-direction of the data set. If // projection is one of lambert, polar, mercator, albers_nad83, or polar_wgs84, dx // gives the grid spacing in meters; if projection is regular_ll, dx gives the grid spacing // in degrees. // No default value. m_DY = 0.0; // A real value giving the grid spacing in the y-direction of the data set. If // projection is one of lambert, polar, mercator, albers_nad83, or polar_wgs84, dy // gives the grid spacing in meters; if projection is regular_ll, dy gives the grid spacing // in degrees. // No default value. m_KNOWN_X = 1.0; // A real value specifying the i-coordinate of an (i,j) location // corresponding to a (latitude, longitude) location that is known in the projection. // Default value is 1. m_KNOWN_Y = 1.0; // A real value specifying the j-coordinate of an (i,j) location // corresponding to a (latitude, longitude) location that is known in the projection. // Default value is 1. m_KNOWN_LAT = 0.0; // A real value specifying the latitude of a (latitude, longitude) // location that is known in the projection. // No default value. m_KNOWN_LON = 0.0; // A real value specifying the longitude of a (latitude, longitude) // location that is known in the projection. // No default value. m_STDLON = 0.0; // A real value specifying the longitude that is parallel with the y-axis in // conic and azimuthal projections. // No default value. m_TRUELAT1 = 0.0; // A real value specifying the first true latitude for conic projections or // the only true latitude for azimuthal projections. // No default value. m_TRUELAT2 = 0.0; // A real value specifying the second true latitude for conic projections. // No default value. m_WORDSIZE = 1; // An integer giving the number of bytes used to represent the value of // each grid point in the data files. // No default value. m_TILE_X = 0; // An integer specifying the number of grid points in the x-direction, // excluding any halo points, for a single tile of source data. // No default value. m_TILE_Y = 0; // An integer specifying the number of grid points in the y-direction, // excluding any halo points, for a single tile of source data. // No default value. m_TILE_Z = 1; // An integer specifying the number of grid points in the z-direction for a // single tile of source data; this keyword serves as an alternative to the pair of keywords // tile_z_start and tile_z_end, and when this keyword is used, the starting z-index is // assumed to be 1. // No default value. m_TILE_Z_START = 1; // An integer specifying the starting index in the z-direction of the // array in the data files. If this keyword is used, tile_z_end must also be specified. // No default value. m_TILE_Z_END = 1; // An integer specifying the ending index in the z-direction of the array // in the data files. If this keyword is used, tile_z_start must also be specified. // No default value m_CATEGORY_MIN = 0; // For categorical data (type=categorical), an integer specifying // the minimum category index that is found in the data set. If this keyword is used, // category_max must also be specified. // No default value. m_CATEGORY_MAX = 0; // For categorical data (type=categorical), an integer // specifying the maximum category index that is found in the data set. If this keyword is // used, category_min must also be specified. // No default value. m_TILE_BDR = 0; // An integer specifying the halo width, in grid points, for each tile of data. // Default value is 0. m_MISSING_VALUE = -99999.0; // A real value that, when encountered in the data set, should be interpreted as missing data. // No default value. m_SCALE_FACTOR = 1.0; // A real value that data should be scaled by (through // multiplication) after being read in as integers from tiles of the data set. // Default value is 1. m_ROW_ORDER = VAL_BOTTOM_TOP; // A character string, either bottom_top or top_bottom, specifying // whether the rows of the data set arrays were written proceeding from the lowest-index // row to the highest (bottom_top) or from highest to lowest (top_bottom). This keyword // may be useful when utilizing some USGS data sets, which are provided in top_bottom // order. // Default value is bottom_top. m_ENDIAN = VAL_ENDIAN_BIG; // A character string, either big or little, specifying whether the values in // the static data set arrays are in big-endian or little-endian byte order. // Default value is big. m_ISWATER = 16; // An integer specifying the land use category of water. // Default value is 16. m_ISLAKE = -1; // An integer specifying the land use category of inland water bodies. // Default value is -1 (i.e., no separate inland water category). m_ISICE = 24; // An integer specifying the land use category of ice. // Default value is 24. m_ISURBAN = 1; // An integer specifying the land use category of urban areas. // Default value is 1. m_ISOILWATER = 14; // An integer specifying the soil category of water. // Default value is 14. m_MMINLU = SG_T("USGS"); // A character string, enclosed in quotation marks ("), indicating which // section of WRF's LANDUSE.TBL and VEGPARM.TBL will be used when looking up // parameters for land use categories. // Default value is "USGS". return( true ); } //--------------------------------------------------------- bool CWRF_Index::Load(const CSG_String &File) { Reset(); CSG_File Stream; if( !Stream.Open(File, SG_FILE_R, false) ) { return( false ); } CSG_String sLine, sKey, sValue; while( Stream.Read_Line(sLine) ) { sKey = sLine.BeforeFirst(SG_T('=')).Make_Upper(); sKey .Trim(); sKey .Trim(true); sValue = sLine.AfterFirst (SG_T('=')).Make_Upper(); sValue.Trim(); sValue.Trim(true); if( !sKey.Cmp(SG_T("PROJECTION")) ) { m_PROJECTION = sValue; } else if( !sKey.Cmp(SG_T("TYPE")) ) { m_TYPE = sValue.Contains(SG_T("CATEGORICAL")) ? VAL_CATEGORICAL : VAL_CONTINUOUS; } else if( !sKey.Cmp(SG_T("SIGNED")) ) { m_SIGNED = sValue.Contains(SG_T("YES")); } else if( !sKey.Cmp(SG_T("UNITS")) ) { m_UNITS = sValue; } else if( !sKey.Cmp(SG_T("DESCRIPTION")) ) { m_DESCRIPTION = sValue; } else if( !sKey.Cmp(SG_T("DX")) ) { m_DX = sValue.asDouble(); } else if( !sKey.Cmp(SG_T("DY")) ) { m_DY = sValue.asDouble(); } else if( !sKey.Cmp(SG_T("KNOWN_X")) ) { m_KNOWN_X = sValue.asDouble(); } else if( !sKey.Cmp(SG_T("KNOWN_Y")) ) { m_KNOWN_Y = sValue.asDouble(); } else if( !sKey.Cmp(SG_T("KNOWN_LAT")) ) { m_KNOWN_LAT = sValue.asDouble(); } else if( !sKey.Cmp(SG_T("KNOWN_LON")) ) { m_KNOWN_LON = sValue.asDouble(); } else if( !sKey.Cmp(SG_T("STDLON")) ) { m_STDLON = sValue.asDouble(); } else if( !sKey.Cmp(SG_T("TRUELAT1")) ) { m_TRUELAT1 = sValue.asDouble(); } else if( !sKey.Cmp(SG_T("TRUELAT2")) ) { m_TRUELAT2 = sValue.asDouble(); } else if( !sKey.Cmp(SG_T("WORDSIZE")) ) { m_WORDSIZE = sValue.asInt(); } else if( !sKey.Cmp(SG_T("TILE_X")) ) { m_TILE_X = sValue.asInt(); } else if( !sKey.Cmp(SG_T("TILE_Y")) ) { m_TILE_Y = sValue.asInt(); } else if( !sKey.Cmp(SG_T("TILE_Z")) ) { m_TILE_Z = sValue.asInt(); } else if( !sKey.Cmp(SG_T("TILE_Z_START")) ) { m_TILE_Z_START = sValue.asInt(); } else if( !sKey.Cmp(SG_T("TILE_Z_END")) ) { m_TILE_Z_END = sValue.asInt(); } else if( !sKey.Cmp(SG_T("CATEGORY_MIN")) ) { m_CATEGORY_MIN = sValue.asInt(); } else if( !sKey.Cmp(SG_T("CATEGORY_MAX")) ) { m_CATEGORY_MAX = sValue.asInt(); } else if( !sKey.Cmp(SG_T("TILE_BDR")) ) { m_TILE_BDR = sValue.asInt(); } else if( !sKey.Cmp(SG_T("MISSING_VALUE")) ) { m_MISSING_VALUE = sValue.asDouble(); } else if( !sKey.Cmp(SG_T("SCALE_FACTOR")) ) { m_SCALE_FACTOR = sValue.asDouble(); } else if( !sKey.Cmp(SG_T("ROW_ORDER")) ) { m_ROW_ORDER = sValue.Contains(SG_T("BOTTOM_TOP")) ? VAL_BOTTOM_TOP : VAL_TOP_BOTTOM; } else if( !sKey.Cmp(SG_T("ENDIAN")) ) { m_ENDIAN = sValue.Contains(SG_T("BIG")) ? VAL_ENDIAN_BIG : VAL_ENDIAN_LITTLE; } else if( !sKey.Cmp(SG_T("ISWATER")) ) { m_ISWATER = sValue.asInt(); } else if( !sKey.Cmp(SG_T("ISLAKE")) ) { m_ISLAKE = sValue.asInt(); } else if( !sKey.Cmp(SG_T("ISICE")) ) { m_ISICE = sValue.asInt(); } else if( !sKey.Cmp(SG_T("ISURBAN")) ) { m_ISURBAN = sValue.asInt(); } else if( !sKey.Cmp(SG_T("ISOILWATER")) ) { m_ISOILWATER = sValue.asInt(); } else if( !sKey.Cmp(SG_T("MMINLU")) ) { m_MMINLU = sValue; } } return( true ); } //--------------------------------------------------------- bool CWRF_Index::Save(const CSG_String &File) { CSG_File Stream; if( !Stream.Open(File, SG_FILE_W, false) ) { return( false ); } //----------------------------------------------------- Stream.Printf(SG_T("%s=%s\n"), SG_T("TYPE") , m_TYPE == VAL_CATEGORICAL ? SG_T("CATEGORICAL") : SG_T("CONTINUOUS")); if( m_CATEGORY_MIN < m_CATEGORY_MAX ) { Stream.Printf(SG_T("%s=%d\n"), SG_T("CATEGORY_MIN") , m_CATEGORY_MIN); Stream.Printf(SG_T("%s=%d\n"), SG_T("CATEGORY_MAX") , m_CATEGORY_MAX); } Stream.Printf(SG_T("%s=%s\n"), SG_T("PROJECTION") , m_PROJECTION.c_str()); if( m_PROJECTION.CmpNoCase(SG_T("regular_ll")) ) { Stream.Printf(SG_T("%s=%f\n"), SG_T("STDLON") , m_STDLON); Stream.Printf(SG_T("%s=%f\n"), SG_T("TRUELAT1") , m_TRUELAT1); Stream.Printf(SG_T("%s=%f\n"), SG_T("TRUELAT2") , m_TRUELAT2); } Stream.Printf(SG_T("%s=%.8f\n"), SG_T("DX") , m_DX); Stream.Printf(SG_T("%s=%.8f\n"), SG_T("DY") , m_DY); Stream.Printf(SG_T("%s=%f\n"), SG_T("KNOWN_X") , m_KNOWN_X); Stream.Printf(SG_T("%s=%f\n"), SG_T("KNOWN_Y") , m_KNOWN_Y); Stream.Printf(SG_T("%s=%.5f\n"), SG_T("KNOWN_LAT") , m_KNOWN_LAT); Stream.Printf(SG_T("%s=%.5f\n"), SG_T("KNOWN_LON") , m_KNOWN_LON); if( m_SIGNED ) { Stream.Printf(SG_T("%s=%s\n"), SG_T("SIGNED") , SG_T("YES")); } Stream.Printf(SG_T("%s=%d\n"), SG_T("WORDSIZE") , m_WORDSIZE); Stream.Printf(SG_T("%s=%d\n"), SG_T("TILE_X") , m_TILE_X); Stream.Printf(SG_T("%s=%d\n"), SG_T("TILE_Y") , m_TILE_Y); if( m_TILE_Z == 1 ) { Stream.Printf(SG_T("%s=%d\n"), SG_T("TILE_Z") , m_TILE_Z); } else { Stream.Printf(SG_T("%s=%d\n"), SG_T("TILE_Z_START") , m_TILE_Z_START); Stream.Printf(SG_T("%s=%d\n"), SG_T("TILE_Z_END") , m_TILE_Z_END); } if( m_TILE_BDR > 0 ) { Stream.Printf(SG_T("%s=%d\n"), SG_T("TILE_BDR") , m_TILE_BDR); } Stream.Printf(SG_T("%s=%f\n"), SG_T("MISSING_VALUE") , m_MISSING_VALUE); if( m_SCALE_FACTOR != 1.0 ) { Stream.Printf(SG_T("%s=%f\n"), SG_T("SCALE_FACTOR") , m_SCALE_FACTOR); } if( m_ROW_ORDER == VAL_TOP_BOTTOM ) { Stream.Printf(SG_T("%s=%s\n"), SG_T("ROW_ORDER") , SG_T("TOP_BOTTOM")); } if( m_ENDIAN == VAL_ENDIAN_LITTLE ) { Stream.Printf(SG_T("%s=%s\n"), SG_T("ENDIAN") , SG_T("LITTLE")); } if( m_TYPE == VAL_CATEGORICAL ) { Stream.Printf(SG_T("%s=\"%s\"\n"), SG_T("UNITS") , SG_T("CATEGORY")); } else if( m_UNITS.Length() > 0 ) { Stream.Printf(SG_T("%s=\"%s\"\n"), SG_T("UNITS") , m_UNITS.c_str()); } if( m_DESCRIPTION.Length() > 0 ) { Stream.Printf(SG_T("%s=\"%s\"\n"), SG_T("DESCRIPTION") , m_DESCRIPTION.c_str()); } if( m_MMINLU.CmpNoCase(SG_T("USGS")) ) { Stream.Printf(SG_T("%s=%s\n"), SG_T("MMINLU") , m_MMINLU.c_str()); } if( m_ISWATER != 16 ) Stream.Printf(SG_T("%s=%d\n"), SG_T("ISWATER") , m_ISWATER); if( m_ISLAKE != -1 ) Stream.Printf(SG_T("%s=%d\n"), SG_T("ISLAKE") , m_ISLAKE); if( m_ISICE != 24 ) Stream.Printf(SG_T("%s=%d\n"), SG_T("_ISICE") , m_ISICE); if( m_ISURBAN != 1 ) Stream.Printf(SG_T("%s=%d\n"), SG_T("m_ISURBAN") , m_ISURBAN); if( m_ISOILWATER != 14 ) Stream.Printf(SG_T("%s=%d\n"), SG_T("m_ISOILWATER"), m_ISOILWATER); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CWRF_Import::CWRF_Import(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Import WRF Geogrid Binary Format")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Imports grid(s) from Weather Research and Forcasting Model (WRF) geogrid binary format." "\n" "WRF Homepage" )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_OUTPUT ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL("") ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWRF_Import::On_Execute(void) { CSG_String File; //----------------------------------------------------- File = Parameters("FILE") ->asString(); Parameters("GRIDS")->asGridList()->Del_Items(); //----------------------------------------------------- if( !m_Index.Load(SG_File_Make_Path(SG_File_Get_Path(File), SG_T("index"))) ) { Error_Set(_TL("error reading index file")); return( false ); } //----------------------------------------------------- if( !Load(File) ) { Error_Set(_TL("error loading data file")); return( false ); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWRF_Import::Load(const CSG_String &File) { //----------------------------------------------------- // 00001-00600.00001-00600 // 01234567890123456789012 CSG_String Name = SG_File_Get_Name(File, true); if( Name.Length() != 23 || Name[5] != SG_T('-') || Name[11] != SG_T('.') || Name[17] != SG_T('-') ) { Error_Set(_TL("invalid geogrid file name")); return( false ); } int xOffset = Name.asInt() - 1; int yOffset = Name.AfterFirst(SG_T('.')).asInt() - 1; //----------------------------------------------------- CSG_File Stream; if( !Stream.Open(File, SG_FILE_R) ) { Error_Set(_TL("data file could not be openend")); return( false ); } //----------------------------------------------------- TSG_Data_Type Type; switch( m_Index.m_WORDSIZE ) { default: Error_Set(_TL("invalid word size")); return( false ); case 1: Type = m_Index.m_SIGNED == false ? SG_DATATYPE_Byte : SG_DATATYPE_Char; break; case 2: Type = m_Index.m_SIGNED == false ? SG_DATATYPE_Word : SG_DATATYPE_Short; break; case 4: Type = m_Index.m_SIGNED == false ? SG_DATATYPE_DWord : SG_DATATYPE_Int; break; } //----------------------------------------------------- char *pLine, *pValue; int x, y, nBytes_Line; nBytes_Line = (m_Index.m_TILE_X + 2 * m_Index.m_TILE_BDR) * m_Index.m_WORDSIZE; pLine = (char *)SG_Malloc(nBytes_Line); //----------------------------------------------------- for(int z=m_Index.m_TILE_Z_START; z<=m_Index.m_TILE_Z_END && !Stream.is_EOF() && Process_Get_Okay(); z++) { CSG_Grid *pGrid = SG_Create_Grid( Type, m_Index.m_TILE_X + 2 * m_Index.m_TILE_BDR, m_Index.m_TILE_Y + 2 * m_Index.m_TILE_BDR, m_Index.m_DX, m_Index.m_KNOWN_LON + (xOffset - m_Index.m_TILE_BDR) * m_Index.m_DX, m_Index.m_KNOWN_LAT + (yOffset - m_Index.m_TILE_BDR) * m_Index.m_DY ); pGrid->Set_Name (CSG_String::Format(SG_T("%s_%02d"), SG_File_Get_Name(File, false).c_str(), z)); pGrid->Set_Description (m_Index.m_DESCRIPTION); pGrid->Set_Unit (m_Index.m_UNITS); pGrid->Set_NoData_Value (m_Index.m_MISSING_VALUE); pGrid->Set_ZFactor (m_Index.m_SCALE_FACTOR); Parameters("GRIDS")->asGridList()->Add_Item(pGrid); //------------------------------------------------- for(y=0; yGet_NY() && !Stream.is_EOF() && Set_Progress(y, pGrid->Get_NY()); y++) { int yy = m_Index.m_ROW_ORDER == VAL_TOP_BOTTOM ? pGrid->Get_NY() - 1 - y : y; Stream.Read(pLine, sizeof(char), nBytes_Line); for(x=0, pValue=pLine; xGet_NX(); x++, pValue+=m_Index.m_WORDSIZE) { if( m_Index.m_ENDIAN == VAL_ENDIAN_BIG ) { SG_Swap_Bytes(pValue, m_Index.m_WORDSIZE); } switch( pGrid->Get_Type() ) { case SG_DATATYPE_Byte: pGrid->Set_Value(x, yy, *(unsigned char *)pValue); break; // 1 Byte Integer (unsigned) case SG_DATATYPE_Char: pGrid->Set_Value(x, yy, *(signed char *)pValue); break; // 1 Byte Integer (signed) case SG_DATATYPE_Word: pGrid->Set_Value(x, yy, *(unsigned short *)pValue); break; // 2 Byte Integer (unsigned) case SG_DATATYPE_Short: pGrid->Set_Value(x, yy, *(signed short *)pValue); break; // 2 Byte Integer (signed) case SG_DATATYPE_DWord: pGrid->Set_Value(x, yy, *(unsigned int *)pValue); break; // 4 Byte Integer (unsigned) case SG_DATATYPE_Int: pGrid->Set_Value(x, yy, *(signed int *)pValue); break; // 4 Byte Integer (signed) } } } } //----------------------------------------------------- SG_Free(pLine); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CWRF_Export::CWRF_Export(void) { CSG_Parameter *pNode; //----------------------------------------------------- // 1. Info... Set_Name (_TL("Export WRF Geogrid Binary Format")); Set_Author (SG_T("O.Conrad (c) 2011")); Set_Description (_TW( "Exports grid(s) to Weather Research and Forcasting Model (WRF) geogrid binary format." "\n" "WRF Homepage" )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_FilePath( NULL , "FILE" , _TL("Directory"), _TL(""), NULL, NULL, true, true ); //----------------------------------------------------- pNode = Parameters.Add_Node(NULL, "NODE_TYPE", _TL("Projection"), _TL("")); Parameters.Add_Choice( pNode , "DATATYPE" , _TL("Data Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"), _TL("1 byte unsigned"), _TL("1 byte signed"), _TL("2 byte unsigned"), _TL("2 byte signed"), _TL("4 byte unsigned"), _TL("4 byte signed") ), 0 ); Parameters.Add_Choice( pNode , "TYPE" , _TL("Type"), _TL(""), CSG_String::Format(SG_T("%s|%s|"), _TL("categorical"), _TL("continuous") ), 0 ); Parameters.Add_Value(pNode , "MISSING" , _TL("Missing Value") , _TL(""), PARAMETER_TYPE_Double, m_Index.m_MISSING_VALUE); Parameters.Add_Value(pNode , "SCALE" , _TL("Scale Factor") , _TL(""), PARAMETER_TYPE_Double, m_Index.m_SCALE_FACTOR); Parameters.Add_String(pNode , "UNITS" , _TL("Units") , _TL(""), m_Index.m_UNITS); Parameters.Add_String(pNode , "DESCRIPTION" , _TL("Description") , _TL(""), m_Index.m_DESCRIPTION); Parameters.Add_String(pNode , "MMINLU" , _TL("Look Up Section") , _TL(""), m_Index.m_MMINLU); Parameters.Add_Value(pNode , "TILE_BDR" , _TL("Halo Width") , _TL(""), PARAMETER_TYPE_Int, 0, 0, true); //----------------------------------------------------- pNode = Parameters.Add_Node(NULL, "NODE_PRJ", _TL("Projection"), _TL("")); Parameters.Add_Choice( pNode , "PROJECTION" , _TL("Projection"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|"), SG_T("lambert"), SG_T("polar"), SG_T("mercator"), SG_T("regular_ll"), SG_T("albers_nad83"), SG_T("polar_wgs84") ), 3 ); Parameters.Add_Value(pNode , "SDTLON" , _TL("Standard Longitude") , _TL(""), PARAMETER_TYPE_Double, 0.0); Parameters.Add_Value(pNode , "TRUELAT1" , _TL("True Latitude 1") , _TL(""), PARAMETER_TYPE_Double, 45.0); Parameters.Add_Value(pNode , "TRUELAT2" , _TL("True Latitude 2") , _TL(""), PARAMETER_TYPE_Double, 35.0); //----------------------------------------------------- // pNode = Parameters.Add_Node(NULL, "NODE_REF", _TL("Referencing"), _TL("")); // Parameters.Add_Value(pNode , "KNOWN_X" , _TL("Known X") , _TL(""), PARAMETER_TYPE_Double, 1.0); // Parameters.Add_Value(pNode , "KNOWN_Y" , _TL("Known Y") , _TL(""), PARAMETER_TYPE_Double, 1.0); // Parameters.Add_Value(pNode , "KNOWN_LON" , _TL("Longitude") , _TL(""), PARAMETER_TYPE_Double, -180.0); // Parameters.Add_Value(pNode , "KNOWN_LAT" , _TL("Latitude") , _TL(""), PARAMETER_TYPE_Double, -90.0); //----------------------------------------------------- pNode = Parameters.Add_Node(NULL, "NODE_CAT", _TL("Categories"), _TL("")); Parameters.Add_Value(pNode , "ISWATER" , _TL("Water") , _TL(""), PARAMETER_TYPE_Int, m_Index.m_ISWATER); Parameters.Add_Value(pNode , "ISLAKE" , _TL("Lake") , _TL(""), PARAMETER_TYPE_Int, m_Index.m_ISLAKE); Parameters.Add_Value(pNode , "ISICE" , _TL("Ice") , _TL(""), PARAMETER_TYPE_Int, m_Index.m_ISICE); Parameters.Add_Value(pNode , "ISURBAN" , _TL("Urban") , _TL(""), PARAMETER_TYPE_Int, m_Index.m_ISURBAN); Parameters.Add_Value(pNode , "ISOILWATER" , _TL("Soil Water") , _TL(""), PARAMETER_TYPE_Int, m_Index.m_ISOILWATER); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- int CWRF_Export::On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("MMINLU")) ) { if( !SG_STR_CMP(pParameter->asString(), SG_T("USGS")) ) { pParameters->Get_Parameter("DESCRIPTION")->Set_Value(SG_T("24-category USGS landuse")); } } //----------------------------------------------------- return( 1 ); } //--------------------------------------------------------- int CWRF_Export::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Parameter *pParameter) { if( !SG_STR_CMP(pParameter->Get_Identifier(), SG_T("PROJECTION")) ) { pParameters->Get_Parameter("SDTLON" )->Set_Enabled(pParameter->asInt() != 3); pParameters->Get_Parameter("TRUELAT1")->Set_Enabled(pParameter->asInt() != 3); pParameters->Get_Parameter("TRUELAT2")->Set_Enabled(pParameter->asInt() != 3); } //----------------------------------------------------- return( 1 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWRF_Export::On_Execute(void) { CSG_String Directory; CSG_Parameter_Grid_List *pGrids; //----------------------------------------------------- Directory = Parameters("FILE") ->asString(); pGrids = Parameters("GRIDS") ->asGridList(); //----------------------------------------------------- m_Index.Reset(); switch( Parameters("DATATYPE")->asInt() ) { case 0: default: m_Index.m_WORDSIZE = 1; m_Index.m_SIGNED = false; break; case 1: m_Index.m_WORDSIZE = 1; m_Index.m_SIGNED = true; break; case 2: m_Index.m_WORDSIZE = 2; m_Index.m_SIGNED = false; break; case 3: m_Index.m_WORDSIZE = 2; m_Index.m_SIGNED = true; break; case 4: m_Index.m_WORDSIZE = 4; m_Index.m_SIGNED = false; break; case 5: m_Index.m_WORDSIZE = 4; m_Index.m_SIGNED = true; break; } m_Index.m_TYPE = Parameters("TYPE") ->asInt(); m_Index.m_MISSING_VALUE = Parameters("MISSING") ->asDouble(); m_Index.m_SCALE_FACTOR = Parameters("SCALE") ->asDouble(); m_Index.m_UNITS = Parameters("UNITS") ->asString(); m_Index.m_DESCRIPTION = Parameters("DESCRIPTION") ->asString(); m_Index.m_MMINLU = Parameters("MMINLU") ->asString(); m_Index.m_TILE_BDR = Parameters("TILE_BDR") ->asInt(); m_Index.m_TILE_X = Get_NX() - 2 * m_Index.m_TILE_BDR; m_Index.m_TILE_Y = Get_NY() - 2 * m_Index.m_TILE_BDR; m_Index.m_TILE_Z = pGrids->Get_Count(); m_Index.m_TILE_Z_START = 1; m_Index.m_TILE_Z_END = pGrids->Get_Count(); m_Index.m_DX = Get_Cellsize(); m_Index.m_DY = Get_Cellsize(); m_Index.m_ENDIAN = VAL_ENDIAN_LITTLE; m_Index.m_ROW_ORDER = VAL_BOTTOM_TOP; m_Index.m_PROJECTION = Parameters("PROJECTION") ->asString(); m_Index.m_STDLON = Parameters("SDTLON") ->asDouble(); m_Index.m_TRUELAT1 = Parameters("TRUELAT1") ->asDouble(); m_Index.m_TRUELAT2 = Parameters("TRUELAT2") ->asDouble(); m_Index.m_KNOWN_LAT = - 90.0 + 0.5 * m_Index.m_DY; m_Index.m_KNOWN_LON = -180.0 + 0.5 * m_Index.m_DX; // m_Index.m_KNOWN_X = Parameters("KNOWN_X") ->asDouble(); // m_Index.m_KNOWN_Y = Parameters("KNOWN_Y") ->asDouble(); // m_Index.m_KNOWN_LAT = Parameters("KNOWN_LAT") ->asDouble(); // m_Index.m_KNOWN_LON = Parameters("KNOWN_LON") ->asDouble(); if( m_Index.m_TILE_Z == 1 ) { m_Index.m_CATEGORY_MIN = m_Index.m_TYPE == VAL_CATEGORICAL ? pGrids->asGrid(0)->Get_ZMin() : 0; m_Index.m_CATEGORY_MAX = m_Index.m_TYPE == VAL_CATEGORICAL ? pGrids->asGrid(0)->Get_ZMax() : 0; } else { m_Index.m_CATEGORY_MIN = m_Index.m_TILE_Z_START; m_Index.m_CATEGORY_MAX = m_Index.m_TILE_Z_END; } m_Index.m_ISWATER = Parameters("ISWATER") ->asInt(); m_Index.m_ISLAKE = Parameters("ISLAKE") ->asInt(); m_Index.m_ISICE = Parameters("ISICE") ->asInt(); m_Index.m_ISURBAN = Parameters("ISURBAN") ->asInt(); m_Index.m_ISOILWATER = Parameters("ISOILWATER") ->asInt(); //----------------------------------------------------- if( !m_Index.Save(SG_File_Make_Path(Directory, SG_T("index"))) ) { Error_Set(_TL("error saving index file")); return( false ); } //----------------------------------------------------- if( !Save(Directory, pGrids) ) { Error_Set(_TL("error saving data file")); return( false ); } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CWRF_Export::Save(const CSG_String &Directory, CSG_Parameter_Grid_List *pGrids) { //----------------------------------------------------- // 00001-00600.00001-00600 // 01234567890123456789012 int xOffset = m_Index.m_TILE_BDR + (int)(0.5 + (Get_XMin() - m_Index.m_KNOWN_LON) / Get_Cellsize()); int yOffset = m_Index.m_TILE_BDR + (int)(0.5 + (Get_YMin() - m_Index.m_KNOWN_LAT) / Get_Cellsize()); CSG_String Name = SG_File_Get_Name(Directory, true); Name.Printf(SG_T("%05d-%05d.%05d-%05d"), xOffset + 1, xOffset + m_Index.m_TILE_X, yOffset + 1, yOffset + m_Index.m_TILE_Y); //----------------------------------------------------- CSG_File Stream; if( !Stream.Open(SG_File_Make_Path(Directory, Name), SG_FILE_W) ) { Error_Set(_TL("data file could not be openend")); return( false ); } //----------------------------------------------------- char *pLine, *pValue; int x, y, nBytes_Line; nBytes_Line = Get_NX() * m_Index.m_WORDSIZE; pLine = (char *)SG_Malloc(nBytes_Line); //----------------------------------------------------- for(int z=0; zGet_Count() && Process_Get_Okay(); z++) { CSG_Grid *pGrid = pGrids->asGrid(z); //------------------------------------------------- for(y=0; yGet_NY() && !Stream.is_EOF() && Set_Progress(y, pGrid->Get_NY()); y++) { int yy = m_Index.m_ROW_ORDER == VAL_TOP_BOTTOM ? pGrid->Get_NY() - 1 - y : y; for(x=0, pValue=pLine; xGet_NX(); x++, pValue+=m_Index.m_WORDSIZE) { if( m_Index.m_SIGNED ) { switch( m_Index.m_WORDSIZE ) { case 1: *((signed char *)pValue) = (signed char )pGrid->asInt(x, yy); break; case 2: *((signed short *)pValue) = (signed short )pGrid->asInt(x, yy); break; case 4: *((signed int *)pValue) = (signed int )pGrid->asInt(x, yy); break; } } else { switch( m_Index.m_WORDSIZE ) { case 1: *((unsigned char *)pValue) = (unsigned char )pGrid->asInt(x, yy); break; case 2: *((unsigned short *)pValue) = (unsigned short)pGrid->asInt(x, yy); break; case 4: *((unsigned int *)pValue) = (unsigned int )pGrid->asInt(x, yy); break; } } if( m_Index.m_ENDIAN == VAL_ENDIAN_BIG ) { SG_Swap_Bytes(pValue, m_Index.m_WORDSIZE); } } Stream.Write(pLine, sizeof(char), nBytes_Line); } } //----------------------------------------------------- SG_Free(pLine); return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid/wrf.h000066400000000000000000000137361224124640700216160ustar00rootroot00000000000000/********************************************************** * Version $Id: wrf.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // wrf.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.de // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__wrf_Import_H #define HEADER_INCLUDED__wrf_Import_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CWRF_Index { public: CWRF_Index(void); bool Reset (void); bool Load (const CSG_String &File); bool Save (const CSG_String &File); bool m_SIGNED, m_ENDIAN; int m_TYPE, m_WORDSIZE, m_TILE_X, m_TILE_Y, m_TILE_Z, m_TILE_Z_START, m_TILE_Z_END, m_CATEGORY_MIN, m_CATEGORY_MAX, m_TILE_BDR, m_ROW_ORDER; int m_ISWATER, m_ISLAKE, m_ISICE, m_ISURBAN, m_ISOILWATER; double m_DX, m_DY, m_KNOWN_X, m_KNOWN_Y, m_KNOWN_LAT, m_KNOWN_LON, m_STDLON, m_TRUELAT1, m_TRUELAT2, m_MISSING_VALUE, m_SCALE_FACTOR; CSG_String m_PROJECTION, m_UNITS, m_DESCRIPTION, m_MMINLU; }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CWRF_Import : public CSG_Module { public: CWRF_Import(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); private: CWRF_Index m_Index; bool Load (const CSG_String &File); }; /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CWRF_Export : public CSG_Module_Grid { public: CWRF_Export(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Export") ); } protected: virtual int On_Parameter_Changed (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual int On_Parameters_Enable (CSG_Parameters *pParameters, CSG_Parameter *pParameter); virtual bool On_Execute (void); private: CWRF_Index m_Index; bool Save (const CSG_String &Directory, CSG_Parameter_Grid_List *pGrids); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__wrf_Import_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid/xyz.cpp000066400000000000000000000246751224124640700222110ustar00rootroot00000000000000/********************************************************** * Version $Id: xyz.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // XYZ.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "xyz.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CXYZ_Export::CXYZ_Export(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Export Grid to XYZ")); Set_Author (SG_T("O. Conrad (c) 2003")); Set_Description (_TW( "Export grid to a table (text format), that contains for each grid cell " "the x/y-coordinates and additionally data from selected grids.\n" "Optionally, it is possible to skip NoData cells from the output. In this " "case, the first input grid will perform like a mask.\n\n") ); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid_List( NULL , "GRIDS" , _TL("Grids"), _TL(""), PARAMETER_INPUT ); Parameters.Add_FilePath( NULL , "FILENAME" , _TL("File Name"), _TL(""), CSG_String::Format( SG_T("%s|*.xyz|%s|*.txt|%s|*.*"), _TL("XYZ files (*.xyz)"), _TL("Text files (*.txt)"), _TL("All Files") ), NULL, true ); Parameters.Add_Value( NULL , "CAPTION" , _TL("Write Field Names"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( NULL , "EX_NODATA" , _TL("Exclude NoData Cells"), _TL(""), PARAMETER_TYPE_Bool, false ); } //--------------------------------------------------------- bool CXYZ_Export::On_Execute(void) { bool bExNoData; int x, y, i; TSG_Point p; CSG_File Stream; CSG_String FileName; CSG_Parameter_Grid_List *pGrids; pGrids = Parameters("GRIDS") ->asGridList(); FileName = Parameters("FILENAME")->asString(); bExNoData = Parameters("EX_NODATA")->asBool(); if( pGrids->Get_Count() > 0 && Stream.Open(FileName, SG_FILE_W, false) ) { if( Parameters("CAPTION")->asBool() ) { Stream.Printf(SG_T("\"X\"\t\"Y\"")); for(i=0; iGet_Count(); i++) { Stream.Printf(SG_T("\t\"%s\""), pGrids->asGrid(i)->Get_Name()); } Stream.Printf(SG_T("\n")); } for(y=0, p.y=Get_YMin(); yasGrid(0)->is_NoData(x, y)) ) { Stream.Printf(SG_T("%f\t%f"), p.x, p.y); for(i=0; iGet_Count(); i++) { Stream.Printf(SG_T("\t%f"), pGrids->asGrid(i)->asDouble(x, y)); } Stream.Printf(SG_T("\n")); } } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CXYZ_Import::CXYZ_Import(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Import Grid from XYZ")); Set_Author (SG_T("O. Conrad (c) 2009")); Set_Description (_TW( "Import grid from a table (text format), that contains for each grid cell " "the x/y/z-coordinates and additional data from selected grids.\n" )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_Grid_Output( NULL , "GRID" , _TL("Grid"), _TL("") ); Parameters.Add_Grid_Output( NULL , "COUNT" , _TL("Count"), _TL("") ); Parameters.Add_FilePath( NULL , "FILENAME" , _TL("File Name"), _TL(""), CSG_String::Format( SG_T("%s|*.xyz|%s|*.txt|%s|*.*"), _TL("XYZ files (*.xyz)"), _TL("Text files (*.txt)"), _TL("All Files") ), NULL, false ); Parameters.Add_Value( NULL , "CAPTION" , _TL("Has Field Names"), _TL(""), PARAMETER_TYPE_Bool, true ); Parameters.Add_Value( NULL , "CELLSIZE" , _TL("Target Cellsize"), _TL(""), PARAMETER_TYPE_Double, 1.0, 0.0, true ); Parameters.Add_Choice( NULL , "SEPARATOR" , _TL("Separator"), _TL(""), CSG_String::Format(SG_T("%s|%s|,|;|"), _TL("space"), _TL("tabulator") ), 1 ); } //--------------------------------------------------------- bool CXYZ_Import::On_Execute(void) { int nx, ny, nValues, fLength; double x, y, z, xMin, yMin, xMax, yMax, Cellsize; CSG_File Stream; CSG_String FileName, sLine; CSG_Grid *pGrid, *pCount; FileName = Parameters("FILENAME")->asString(); Cellsize = Parameters("CELLSIZE")->asDouble(); switch( Parameters("SEPARATOR")->asInt() ) { case 0: m_Separator = SG_T(' '); break; case 1: m_Separator = SG_T('\t'); break; case 2: m_Separator = SG_T(','); break; case 3: m_Separator = SG_T(';'); break; } if( Cellsize > 0.0 && Stream.Open(FileName, SG_FILE_R, false) ) { if( Parameters("CAPTION")->asBool() ) { Stream.Read_Line(sLine); } fLength = Stream.Length(); nValues = 0; xMin = xMax = 0; yMin = yMax = 0; while( Read_Values(Stream, x, y, z) && Set_Progress(Stream.Tell(), fLength) ) { if( nValues == 0 ) { xMin = xMax = x; yMin = yMax = y; } else { if( xMin > x ) xMin = x; else if( xMax < x ) xMax = x; if( yMin > y ) yMin = y; else if( yMax < y ) yMax = y; } nValues++; } //------------------------------------------------- if( Process_Get_Okay() && xMin < xMax && yMin < yMax ) { nx = 1 + (int)((xMax - xMin) / Cellsize); ny = 1 + (int)((yMax - yMin) / Cellsize); Parameters("GRID" )->Set_Value(pGrid = SG_Create_Grid(SG_DATATYPE_Float, nx, ny, Cellsize, xMin, yMin)); Parameters("COUNT")->Set_Value(pCount = SG_Create_Grid(SG_DATATYPE_Byte , nx, ny, Cellsize, xMin, yMin)); if( pGrid && pCount ) { pGrid ->Set_Name(FileName = SG_File_Get_Name(FileName, false)); pCount ->Set_Name(CSG_String::Format(SG_T("%s [%s]"), FileName.c_str(), _TL("Count"))); Stream.Seek_Start(); if( Parameters("CAPTION")->asBool() ) { Stream.Read_Line(sLine); } while( Read_Values(Stream, x, y, z) && Set_Progress(Stream.Tell(), fLength) ) { if( pGrid->Get_System().Get_World_to_Grid(nx, ny, x, y) ) { pGrid ->Add_Value(nx, ny, z); pCount->Add_Value(nx, ny, 1.0); } } for(ny=0; nyGet_NY() && Set_Progress(ny, pGrid->Get_NY()); ny++) { for(nx=0; nxGet_NX(); nx++) { nValues = pCount->asInt(nx, ny); if( nValues == 0 ) { pGrid->Set_NoData(nx, ny); } else if( nValues > 1 ) { pGrid->Mul_Value(nx, ny, 1.0 / nValues); } } } return( true ); } } } return( false ); } //--------------------------------------------------------- inline bool CXYZ_Import::Read_Values(CSG_File &Stream, double &x, double &y, double &z) { CSG_String sLine; if( Stream.Read_Line(sLine) ) { sLine.Trim(); if( sLine.asDouble(x) ) { sLine = sLine.AfterFirst(m_Separator); sLine.Trim(); if( sLine.asDouble(y) ) { sLine = sLine.AfterFirst(m_Separator); if( sLine.asDouble(z) ) { return( true ); } } } } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid/xyz.h000066400000000000000000000120741224124640700216440ustar00rootroot00000000000000/********************************************************** * Version $Id: xyz.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Grid_IO // // // //-------------------------------------------------------// // // // XYZ.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__XYZ_H #define HEADER_INCLUDED__XYZ_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CXYZ_Export : public CSG_Module_Grid { public: CXYZ_Export(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Export") ); } protected: virtual bool On_Execute (void); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CXYZ_Import : public CSG_Module { public: CXYZ_Import(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); private: SG_Char m_Separator; bool Read_Values (CSG_File &Stream, double &x, double &y, double &z); }; /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__XYZ_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid_grib2/000077500000000000000000000000001224124640700217225ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/grid/io_grid_grib2/MLB_Interface.cpp000066400000000000000000000021661224124640700250250ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /* * Thomas Schorr 2007 */ #include "MLB_Interface.h" CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Import/Export - GRIB Files") ); case MLB_INFO_Author: return( _TL("Thomas Schorr (c) 2007") ); case MLB_INFO_Description: return( _TW( "Import and export of GRIdded Binary (GRIB) files using the " "g2clib library of the National Center for Environmental Prediction (NCEP). " "Find more information at " "" "http://www.nco.ncep.noaa.gov/" )); case MLB_INFO_Version: return( _TL("0.1") ); case MLB_INFO_Menu_Path: return( _TL("File|Grid") ); } } #include "grib2_import.h" CSG_Module * Create_Module(int i) { CSG_Module *pModule; switch( i ) { case 0: pModule = new SGGrib2Import; break; default: pModule = NULL; break; } return( pModule ); } //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_io/grid/io_grid_grib2/MLB_Interface.h000066400000000000000000000010111224124640700244560ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /* * Thomas Schorr 2007 */ #ifndef HEADER_INCLUDED__io_grid_grib2_H #define HEADER_INCLUDED__io_grid_grib2_H #include #ifdef io_grid_grib2_EXPORTS #define io_grid_grib2_EXPORT _SAGA_DLL_EXPORT #else #define io_grid_grib2_EXPORT _SAGA_DLL_IMPORT #endif #endif // #ifndef HEADER_INCLUDED__io_grid_grib2_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid_grib2/Makefile.am000066400000000000000000000040471224124640700237630ustar00rootroot00000000000000# # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE UC_DEFS = -D_SAGA_UNICODE endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DUSE_JPEG2000 -DUSE_PNG CXX_INCS = -I$(top_srcdir)/src/saga_core $(LOCAL_INCS) AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) #AM_LDFLAGS = -fPIC -shared -avoid-version -lpq -ljasper AM_LDFLAGS = -fPIC -shared -avoid-version $(LOCAL_LIBS) -ljasper pkglib_LTLIBRARIES = libio_grid_grib2.la libio_grid_grib2_la_SOURCES =\ ./g2clib-1.0.4/cmplxpack.c\ ./g2clib-1.0.4/compack.c\ ./g2clib-1.0.4/comunpack.c\ ./g2clib-1.0.4/dec_jpeg2000.c\ ./g2clib-1.0.4/dec_png.c\ ./g2clib-1.0.4/drstemplates.c\ ./g2clib-1.0.4/enc_jpeg2000.c\ ./g2clib-1.0.4/enc_png.c\ ./g2clib-1.0.4/g2_addfield.c\ ./g2clib-1.0.4/g2_addgrid.c\ ./g2clib-1.0.4/g2_addlocal.c\ ./g2clib-1.0.4/g2_create.c\ ./g2clib-1.0.4/g2_free.c\ ./g2clib-1.0.4/g2_getfld.c\ ./g2clib-1.0.4/g2_gribend.c\ ./g2clib-1.0.4/g2_info.c\ ./g2clib-1.0.4/g2_miss.c\ ./g2clib-1.0.4/g2_unpack1.c\ ./g2clib-1.0.4/g2_unpack2.c\ ./g2clib-1.0.4/g2_unpack3.c\ ./g2clib-1.0.4/g2_unpack4.c\ ./g2clib-1.0.4/g2_unpack5.c\ ./g2clib-1.0.4/g2_unpack6.c\ ./g2clib-1.0.4/g2_unpack7.c\ ./g2clib-1.0.4/gbits.c\ ./g2clib-1.0.4/getdim.c\ ./g2clib-1.0.4/getpoly.c\ ./g2clib-1.0.4/gridtemplates.c\ ./g2clib-1.0.4/int_power.c\ ./g2clib-1.0.4/jpcpack.c\ ./g2clib-1.0.4/jpcunpack.c\ ./g2clib-1.0.4/misspack.c\ ./g2clib-1.0.4/mkieee.c\ ./g2clib-1.0.4/pack_gp.c\ ./g2clib-1.0.4/pdstemplates.c\ ./g2clib-1.0.4/pngpack.c\ ./g2clib-1.0.4/pngunpack.c\ ./g2clib-1.0.4/rdieee.c\ ./g2clib-1.0.4/reduce.c\ ./g2clib-1.0.4/seekgb.c\ ./g2clib-1.0.4/simpack.c\ ./g2clib-1.0.4/simunpack.c\ ./g2clib-1.0.4/specpack.c\ ./g2clib-1.0.4/specunpack.c\ ./g2clib-1.0.4/drstemplates.h\ ./g2clib-1.0.4/grib2.h\ ./g2clib-1.0.4/gridtemplates.h\ ./g2clib-1.0.4/pdstemplates.h\ grib2_import.cpp\ MLB_Interface.cpp\ grib2_import.h\ MLB_Interface.h libio_grid_grib2_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_io/grid/io_grid_grib2/Makefile.in000066400000000000000000002042011224124640700237660ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/grid/io_grid_grib2 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libio_grid_grib2_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libio_grid_grib2_la_OBJECTS = cmplxpack.lo compack.lo comunpack.lo \ dec_jpeg2000.lo dec_png.lo drstemplates.lo enc_jpeg2000.lo \ enc_png.lo g2_addfield.lo g2_addgrid.lo g2_addlocal.lo \ g2_create.lo g2_free.lo g2_getfld.lo g2_gribend.lo g2_info.lo \ g2_miss.lo g2_unpack1.lo g2_unpack2.lo g2_unpack3.lo \ g2_unpack4.lo g2_unpack5.lo g2_unpack6.lo g2_unpack7.lo \ gbits.lo getdim.lo getpoly.lo gridtemplates.lo int_power.lo \ jpcpack.lo jpcunpack.lo misspack.lo mkieee.lo pack_gp.lo \ pdstemplates.lo pngpack.lo pngunpack.lo rdieee.lo reduce.lo \ seekgb.lo simpack.lo simunpack.lo specpack.lo specunpack.lo \ grib2_import.lo MLB_Interface.lo libio_grid_grib2_la_OBJECTS = $(am_libio_grid_grib2_la_OBJECTS) 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) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libio_grid_grib2_la_SOURCES) DIST_SOURCES = $(libio_grid_grib2_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1277 2011-12-22 15:48:59Z reklov_w $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DUSE_JPEG2000 -DUSE_PNG CXX_INCS = -I$(top_srcdir)/src/saga_core $(LOCAL_INCS) AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) #AM_LDFLAGS = -fPIC -shared -avoid-version -lpq -ljasper AM_LDFLAGS = -fPIC -shared -avoid-version $(LOCAL_LIBS) -ljasper pkglib_LTLIBRARIES = libio_grid_grib2.la libio_grid_grib2_la_SOURCES = \ ./g2clib-1.0.4/cmplxpack.c\ ./g2clib-1.0.4/compack.c\ ./g2clib-1.0.4/comunpack.c\ ./g2clib-1.0.4/dec_jpeg2000.c\ ./g2clib-1.0.4/dec_png.c\ ./g2clib-1.0.4/drstemplates.c\ ./g2clib-1.0.4/enc_jpeg2000.c\ ./g2clib-1.0.4/enc_png.c\ ./g2clib-1.0.4/g2_addfield.c\ ./g2clib-1.0.4/g2_addgrid.c\ ./g2clib-1.0.4/g2_addlocal.c\ ./g2clib-1.0.4/g2_create.c\ ./g2clib-1.0.4/g2_free.c\ ./g2clib-1.0.4/g2_getfld.c\ ./g2clib-1.0.4/g2_gribend.c\ ./g2clib-1.0.4/g2_info.c\ ./g2clib-1.0.4/g2_miss.c\ ./g2clib-1.0.4/g2_unpack1.c\ ./g2clib-1.0.4/g2_unpack2.c\ ./g2clib-1.0.4/g2_unpack3.c\ ./g2clib-1.0.4/g2_unpack4.c\ ./g2clib-1.0.4/g2_unpack5.c\ ./g2clib-1.0.4/g2_unpack6.c\ ./g2clib-1.0.4/g2_unpack7.c\ ./g2clib-1.0.4/gbits.c\ ./g2clib-1.0.4/getdim.c\ ./g2clib-1.0.4/getpoly.c\ ./g2clib-1.0.4/gridtemplates.c\ ./g2clib-1.0.4/int_power.c\ ./g2clib-1.0.4/jpcpack.c\ ./g2clib-1.0.4/jpcunpack.c\ ./g2clib-1.0.4/misspack.c\ ./g2clib-1.0.4/mkieee.c\ ./g2clib-1.0.4/pack_gp.c\ ./g2clib-1.0.4/pdstemplates.c\ ./g2clib-1.0.4/pngpack.c\ ./g2clib-1.0.4/pngunpack.c\ ./g2clib-1.0.4/rdieee.c\ ./g2clib-1.0.4/reduce.c\ ./g2clib-1.0.4/seekgb.c\ ./g2clib-1.0.4/simpack.c\ ./g2clib-1.0.4/simunpack.c\ ./g2clib-1.0.4/specpack.c\ ./g2clib-1.0.4/specunpack.c\ ./g2clib-1.0.4/drstemplates.h\ ./g2clib-1.0.4/grib2.h\ ./g2clib-1.0.4/gridtemplates.h\ ./g2clib-1.0.4/pdstemplates.h\ grib2_import.cpp\ MLB_Interface.cpp\ grib2_import.h\ MLB_Interface.h libio_grid_grib2_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .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) --gnu src/modules_io/grid/io_grid_grib2/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/grid/io_grid_grib2/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libio_grid_grib2.la: $(libio_grid_grib2_la_OBJECTS) $(libio_grid_grib2_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libio_grid_grib2_la_OBJECTS) $(libio_grid_grib2_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmplxpack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comunpack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_jpeg2000.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec_png.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drstemplates.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_jpeg2000.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_png.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_addfield.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_addgrid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_addlocal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_create.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_free.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_getfld.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_gribend.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_info.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_miss.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_unpack1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_unpack2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_unpack3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_unpack4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_unpack5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_unpack6.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g2_unpack7.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gbits.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpoly.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grib2_import.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gridtemplates.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/int_power.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpcpack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpcunpack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misspack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkieee.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_gp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdstemplates.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngpack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pngunpack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdieee.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reduce.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seekgb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simunpack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/specpack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/specunpack.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< cmplxpack.lo: ./g2clib-1.0.4/cmplxpack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cmplxpack.lo -MD -MP -MF $(DEPDIR)/cmplxpack.Tpo -c -o cmplxpack.lo `test -f './g2clib-1.0.4/cmplxpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/cmplxpack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cmplxpack.Tpo $(DEPDIR)/cmplxpack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/cmplxpack.c' object='cmplxpack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cmplxpack.lo `test -f './g2clib-1.0.4/cmplxpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/cmplxpack.c compack.lo: ./g2clib-1.0.4/compack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compack.lo -MD -MP -MF $(DEPDIR)/compack.Tpo -c -o compack.lo `test -f './g2clib-1.0.4/compack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/compack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/compack.Tpo $(DEPDIR)/compack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/compack.c' object='compack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compack.lo `test -f './g2clib-1.0.4/compack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/compack.c comunpack.lo: ./g2clib-1.0.4/comunpack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT comunpack.lo -MD -MP -MF $(DEPDIR)/comunpack.Tpo -c -o comunpack.lo `test -f './g2clib-1.0.4/comunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/comunpack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/comunpack.Tpo $(DEPDIR)/comunpack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/comunpack.c' object='comunpack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o comunpack.lo `test -f './g2clib-1.0.4/comunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/comunpack.c dec_jpeg2000.lo: ./g2clib-1.0.4/dec_jpeg2000.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_jpeg2000.lo -MD -MP -MF $(DEPDIR)/dec_jpeg2000.Tpo -c -o dec_jpeg2000.lo `test -f './g2clib-1.0.4/dec_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_jpeg2000.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dec_jpeg2000.Tpo $(DEPDIR)/dec_jpeg2000.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/dec_jpeg2000.c' object='dec_jpeg2000.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_jpeg2000.lo `test -f './g2clib-1.0.4/dec_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_jpeg2000.c dec_png.lo: ./g2clib-1.0.4/dec_png.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dec_png.lo -MD -MP -MF $(DEPDIR)/dec_png.Tpo -c -o dec_png.lo `test -f './g2clib-1.0.4/dec_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_png.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dec_png.Tpo $(DEPDIR)/dec_png.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/dec_png.c' object='dec_png.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dec_png.lo `test -f './g2clib-1.0.4/dec_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/dec_png.c drstemplates.lo: ./g2clib-1.0.4/drstemplates.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT drstemplates.lo -MD -MP -MF $(DEPDIR)/drstemplates.Tpo -c -o drstemplates.lo `test -f './g2clib-1.0.4/drstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/drstemplates.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/drstemplates.Tpo $(DEPDIR)/drstemplates.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/drstemplates.c' object='drstemplates.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o drstemplates.lo `test -f './g2clib-1.0.4/drstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/drstemplates.c enc_jpeg2000.lo: ./g2clib-1.0.4/enc_jpeg2000.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_jpeg2000.lo -MD -MP -MF $(DEPDIR)/enc_jpeg2000.Tpo -c -o enc_jpeg2000.lo `test -f './g2clib-1.0.4/enc_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_jpeg2000.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/enc_jpeg2000.Tpo $(DEPDIR)/enc_jpeg2000.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/enc_jpeg2000.c' object='enc_jpeg2000.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_jpeg2000.lo `test -f './g2clib-1.0.4/enc_jpeg2000.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_jpeg2000.c enc_png.lo: ./g2clib-1.0.4/enc_png.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enc_png.lo -MD -MP -MF $(DEPDIR)/enc_png.Tpo -c -o enc_png.lo `test -f './g2clib-1.0.4/enc_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_png.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/enc_png.Tpo $(DEPDIR)/enc_png.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/enc_png.c' object='enc_png.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enc_png.lo `test -f './g2clib-1.0.4/enc_png.c' || echo '$(srcdir)/'`./g2clib-1.0.4/enc_png.c g2_addfield.lo: ./g2clib-1.0.4/g2_addfield.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_addfield.lo -MD -MP -MF $(DEPDIR)/g2_addfield.Tpo -c -o g2_addfield.lo `test -f './g2clib-1.0.4/g2_addfield.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addfield.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_addfield.Tpo $(DEPDIR)/g2_addfield.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_addfield.c' object='g2_addfield.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_addfield.lo `test -f './g2clib-1.0.4/g2_addfield.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addfield.c g2_addgrid.lo: ./g2clib-1.0.4/g2_addgrid.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_addgrid.lo -MD -MP -MF $(DEPDIR)/g2_addgrid.Tpo -c -o g2_addgrid.lo `test -f './g2clib-1.0.4/g2_addgrid.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addgrid.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_addgrid.Tpo $(DEPDIR)/g2_addgrid.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_addgrid.c' object='g2_addgrid.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_addgrid.lo `test -f './g2clib-1.0.4/g2_addgrid.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addgrid.c g2_addlocal.lo: ./g2clib-1.0.4/g2_addlocal.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_addlocal.lo -MD -MP -MF $(DEPDIR)/g2_addlocal.Tpo -c -o g2_addlocal.lo `test -f './g2clib-1.0.4/g2_addlocal.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addlocal.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_addlocal.Tpo $(DEPDIR)/g2_addlocal.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_addlocal.c' object='g2_addlocal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_addlocal.lo `test -f './g2clib-1.0.4/g2_addlocal.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_addlocal.c g2_create.lo: ./g2clib-1.0.4/g2_create.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_create.lo -MD -MP -MF $(DEPDIR)/g2_create.Tpo -c -o g2_create.lo `test -f './g2clib-1.0.4/g2_create.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_create.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_create.Tpo $(DEPDIR)/g2_create.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_create.c' object='g2_create.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_create.lo `test -f './g2clib-1.0.4/g2_create.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_create.c g2_free.lo: ./g2clib-1.0.4/g2_free.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_free.lo -MD -MP -MF $(DEPDIR)/g2_free.Tpo -c -o g2_free.lo `test -f './g2clib-1.0.4/g2_free.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_free.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_free.Tpo $(DEPDIR)/g2_free.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_free.c' object='g2_free.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_free.lo `test -f './g2clib-1.0.4/g2_free.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_free.c g2_getfld.lo: ./g2clib-1.0.4/g2_getfld.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_getfld.lo -MD -MP -MF $(DEPDIR)/g2_getfld.Tpo -c -o g2_getfld.lo `test -f './g2clib-1.0.4/g2_getfld.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_getfld.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_getfld.Tpo $(DEPDIR)/g2_getfld.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_getfld.c' object='g2_getfld.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_getfld.lo `test -f './g2clib-1.0.4/g2_getfld.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_getfld.c g2_gribend.lo: ./g2clib-1.0.4/g2_gribend.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_gribend.lo -MD -MP -MF $(DEPDIR)/g2_gribend.Tpo -c -o g2_gribend.lo `test -f './g2clib-1.0.4/g2_gribend.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_gribend.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_gribend.Tpo $(DEPDIR)/g2_gribend.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_gribend.c' object='g2_gribend.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_gribend.lo `test -f './g2clib-1.0.4/g2_gribend.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_gribend.c g2_info.lo: ./g2clib-1.0.4/g2_info.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_info.lo -MD -MP -MF $(DEPDIR)/g2_info.Tpo -c -o g2_info.lo `test -f './g2clib-1.0.4/g2_info.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_info.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_info.Tpo $(DEPDIR)/g2_info.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_info.c' object='g2_info.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_info.lo `test -f './g2clib-1.0.4/g2_info.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_info.c g2_miss.lo: ./g2clib-1.0.4/g2_miss.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_miss.lo -MD -MP -MF $(DEPDIR)/g2_miss.Tpo -c -o g2_miss.lo `test -f './g2clib-1.0.4/g2_miss.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_miss.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_miss.Tpo $(DEPDIR)/g2_miss.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_miss.c' object='g2_miss.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_miss.lo `test -f './g2clib-1.0.4/g2_miss.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_miss.c g2_unpack1.lo: ./g2clib-1.0.4/g2_unpack1.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack1.lo -MD -MP -MF $(DEPDIR)/g2_unpack1.Tpo -c -o g2_unpack1.lo `test -f './g2clib-1.0.4/g2_unpack1.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack1.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_unpack1.Tpo $(DEPDIR)/g2_unpack1.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_unpack1.c' object='g2_unpack1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack1.lo `test -f './g2clib-1.0.4/g2_unpack1.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack1.c g2_unpack2.lo: ./g2clib-1.0.4/g2_unpack2.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack2.lo -MD -MP -MF $(DEPDIR)/g2_unpack2.Tpo -c -o g2_unpack2.lo `test -f './g2clib-1.0.4/g2_unpack2.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack2.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_unpack2.Tpo $(DEPDIR)/g2_unpack2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_unpack2.c' object='g2_unpack2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack2.lo `test -f './g2clib-1.0.4/g2_unpack2.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack2.c g2_unpack3.lo: ./g2clib-1.0.4/g2_unpack3.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack3.lo -MD -MP -MF $(DEPDIR)/g2_unpack3.Tpo -c -o g2_unpack3.lo `test -f './g2clib-1.0.4/g2_unpack3.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack3.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_unpack3.Tpo $(DEPDIR)/g2_unpack3.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_unpack3.c' object='g2_unpack3.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack3.lo `test -f './g2clib-1.0.4/g2_unpack3.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack3.c g2_unpack4.lo: ./g2clib-1.0.4/g2_unpack4.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack4.lo -MD -MP -MF $(DEPDIR)/g2_unpack4.Tpo -c -o g2_unpack4.lo `test -f './g2clib-1.0.4/g2_unpack4.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack4.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_unpack4.Tpo $(DEPDIR)/g2_unpack4.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_unpack4.c' object='g2_unpack4.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack4.lo `test -f './g2clib-1.0.4/g2_unpack4.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack4.c g2_unpack5.lo: ./g2clib-1.0.4/g2_unpack5.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack5.lo -MD -MP -MF $(DEPDIR)/g2_unpack5.Tpo -c -o g2_unpack5.lo `test -f './g2clib-1.0.4/g2_unpack5.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack5.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_unpack5.Tpo $(DEPDIR)/g2_unpack5.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_unpack5.c' object='g2_unpack5.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack5.lo `test -f './g2clib-1.0.4/g2_unpack5.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack5.c g2_unpack6.lo: ./g2clib-1.0.4/g2_unpack6.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack6.lo -MD -MP -MF $(DEPDIR)/g2_unpack6.Tpo -c -o g2_unpack6.lo `test -f './g2clib-1.0.4/g2_unpack6.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack6.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_unpack6.Tpo $(DEPDIR)/g2_unpack6.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_unpack6.c' object='g2_unpack6.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack6.lo `test -f './g2clib-1.0.4/g2_unpack6.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack6.c g2_unpack7.lo: ./g2clib-1.0.4/g2_unpack7.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT g2_unpack7.lo -MD -MP -MF $(DEPDIR)/g2_unpack7.Tpo -c -o g2_unpack7.lo `test -f './g2clib-1.0.4/g2_unpack7.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack7.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/g2_unpack7.Tpo $(DEPDIR)/g2_unpack7.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/g2_unpack7.c' object='g2_unpack7.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o g2_unpack7.lo `test -f './g2clib-1.0.4/g2_unpack7.c' || echo '$(srcdir)/'`./g2clib-1.0.4/g2_unpack7.c gbits.lo: ./g2clib-1.0.4/gbits.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gbits.lo -MD -MP -MF $(DEPDIR)/gbits.Tpo -c -o gbits.lo `test -f './g2clib-1.0.4/gbits.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gbits.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gbits.Tpo $(DEPDIR)/gbits.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/gbits.c' object='gbits.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gbits.lo `test -f './g2clib-1.0.4/gbits.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gbits.c getdim.lo: ./g2clib-1.0.4/getdim.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getdim.lo -MD -MP -MF $(DEPDIR)/getdim.Tpo -c -o getdim.lo `test -f './g2clib-1.0.4/getdim.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getdim.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/getdim.Tpo $(DEPDIR)/getdim.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/getdim.c' object='getdim.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getdim.lo `test -f './g2clib-1.0.4/getdim.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getdim.c getpoly.lo: ./g2clib-1.0.4/getpoly.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getpoly.lo -MD -MP -MF $(DEPDIR)/getpoly.Tpo -c -o getpoly.lo `test -f './g2clib-1.0.4/getpoly.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getpoly.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/getpoly.Tpo $(DEPDIR)/getpoly.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/getpoly.c' object='getpoly.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getpoly.lo `test -f './g2clib-1.0.4/getpoly.c' || echo '$(srcdir)/'`./g2clib-1.0.4/getpoly.c gridtemplates.lo: ./g2clib-1.0.4/gridtemplates.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gridtemplates.lo -MD -MP -MF $(DEPDIR)/gridtemplates.Tpo -c -o gridtemplates.lo `test -f './g2clib-1.0.4/gridtemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gridtemplates.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gridtemplates.Tpo $(DEPDIR)/gridtemplates.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/gridtemplates.c' object='gridtemplates.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gridtemplates.lo `test -f './g2clib-1.0.4/gridtemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/gridtemplates.c int_power.lo: ./g2clib-1.0.4/int_power.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT int_power.lo -MD -MP -MF $(DEPDIR)/int_power.Tpo -c -o int_power.lo `test -f './g2clib-1.0.4/int_power.c' || echo '$(srcdir)/'`./g2clib-1.0.4/int_power.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/int_power.Tpo $(DEPDIR)/int_power.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/int_power.c' object='int_power.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o int_power.lo `test -f './g2clib-1.0.4/int_power.c' || echo '$(srcdir)/'`./g2clib-1.0.4/int_power.c jpcpack.lo: ./g2clib-1.0.4/jpcpack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT jpcpack.lo -MD -MP -MF $(DEPDIR)/jpcpack.Tpo -c -o jpcpack.lo `test -f './g2clib-1.0.4/jpcpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcpack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/jpcpack.Tpo $(DEPDIR)/jpcpack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/jpcpack.c' object='jpcpack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o jpcpack.lo `test -f './g2clib-1.0.4/jpcpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcpack.c jpcunpack.lo: ./g2clib-1.0.4/jpcunpack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT jpcunpack.lo -MD -MP -MF $(DEPDIR)/jpcunpack.Tpo -c -o jpcunpack.lo `test -f './g2clib-1.0.4/jpcunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcunpack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/jpcunpack.Tpo $(DEPDIR)/jpcunpack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/jpcunpack.c' object='jpcunpack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o jpcunpack.lo `test -f './g2clib-1.0.4/jpcunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/jpcunpack.c misspack.lo: ./g2clib-1.0.4/misspack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misspack.lo -MD -MP -MF $(DEPDIR)/misspack.Tpo -c -o misspack.lo `test -f './g2clib-1.0.4/misspack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/misspack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/misspack.Tpo $(DEPDIR)/misspack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/misspack.c' object='misspack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misspack.lo `test -f './g2clib-1.0.4/misspack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/misspack.c mkieee.lo: ./g2clib-1.0.4/mkieee.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mkieee.lo -MD -MP -MF $(DEPDIR)/mkieee.Tpo -c -o mkieee.lo `test -f './g2clib-1.0.4/mkieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/mkieee.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mkieee.Tpo $(DEPDIR)/mkieee.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/mkieee.c' object='mkieee.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mkieee.lo `test -f './g2clib-1.0.4/mkieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/mkieee.c pack_gp.lo: ./g2clib-1.0.4/pack_gp.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pack_gp.lo -MD -MP -MF $(DEPDIR)/pack_gp.Tpo -c -o pack_gp.lo `test -f './g2clib-1.0.4/pack_gp.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pack_gp.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pack_gp.Tpo $(DEPDIR)/pack_gp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/pack_gp.c' object='pack_gp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pack_gp.lo `test -f './g2clib-1.0.4/pack_gp.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pack_gp.c pdstemplates.lo: ./g2clib-1.0.4/pdstemplates.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pdstemplates.lo -MD -MP -MF $(DEPDIR)/pdstemplates.Tpo -c -o pdstemplates.lo `test -f './g2clib-1.0.4/pdstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pdstemplates.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pdstemplates.Tpo $(DEPDIR)/pdstemplates.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/pdstemplates.c' object='pdstemplates.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pdstemplates.lo `test -f './g2clib-1.0.4/pdstemplates.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pdstemplates.c pngpack.lo: ./g2clib-1.0.4/pngpack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngpack.lo -MD -MP -MF $(DEPDIR)/pngpack.Tpo -c -o pngpack.lo `test -f './g2clib-1.0.4/pngpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngpack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pngpack.Tpo $(DEPDIR)/pngpack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/pngpack.c' object='pngpack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngpack.lo `test -f './g2clib-1.0.4/pngpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngpack.c pngunpack.lo: ./g2clib-1.0.4/pngunpack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pngunpack.lo -MD -MP -MF $(DEPDIR)/pngunpack.Tpo -c -o pngunpack.lo `test -f './g2clib-1.0.4/pngunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngunpack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pngunpack.Tpo $(DEPDIR)/pngunpack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/pngunpack.c' object='pngunpack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pngunpack.lo `test -f './g2clib-1.0.4/pngunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/pngunpack.c rdieee.lo: ./g2clib-1.0.4/rdieee.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rdieee.lo -MD -MP -MF $(DEPDIR)/rdieee.Tpo -c -o rdieee.lo `test -f './g2clib-1.0.4/rdieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/rdieee.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/rdieee.Tpo $(DEPDIR)/rdieee.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/rdieee.c' object='rdieee.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rdieee.lo `test -f './g2clib-1.0.4/rdieee.c' || echo '$(srcdir)/'`./g2clib-1.0.4/rdieee.c reduce.lo: ./g2clib-1.0.4/reduce.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT reduce.lo -MD -MP -MF $(DEPDIR)/reduce.Tpo -c -o reduce.lo `test -f './g2clib-1.0.4/reduce.c' || echo '$(srcdir)/'`./g2clib-1.0.4/reduce.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/reduce.Tpo $(DEPDIR)/reduce.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/reduce.c' object='reduce.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reduce.lo `test -f './g2clib-1.0.4/reduce.c' || echo '$(srcdir)/'`./g2clib-1.0.4/reduce.c seekgb.lo: ./g2clib-1.0.4/seekgb.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT seekgb.lo -MD -MP -MF $(DEPDIR)/seekgb.Tpo -c -o seekgb.lo `test -f './g2clib-1.0.4/seekgb.c' || echo '$(srcdir)/'`./g2clib-1.0.4/seekgb.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/seekgb.Tpo $(DEPDIR)/seekgb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/seekgb.c' object='seekgb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o seekgb.lo `test -f './g2clib-1.0.4/seekgb.c' || echo '$(srcdir)/'`./g2clib-1.0.4/seekgb.c simpack.lo: ./g2clib-1.0.4/simpack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT simpack.lo -MD -MP -MF $(DEPDIR)/simpack.Tpo -c -o simpack.lo `test -f './g2clib-1.0.4/simpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simpack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/simpack.Tpo $(DEPDIR)/simpack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/simpack.c' object='simpack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o simpack.lo `test -f './g2clib-1.0.4/simpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simpack.c simunpack.lo: ./g2clib-1.0.4/simunpack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT simunpack.lo -MD -MP -MF $(DEPDIR)/simunpack.Tpo -c -o simunpack.lo `test -f './g2clib-1.0.4/simunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simunpack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/simunpack.Tpo $(DEPDIR)/simunpack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/simunpack.c' object='simunpack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o simunpack.lo `test -f './g2clib-1.0.4/simunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/simunpack.c specpack.lo: ./g2clib-1.0.4/specpack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT specpack.lo -MD -MP -MF $(DEPDIR)/specpack.Tpo -c -o specpack.lo `test -f './g2clib-1.0.4/specpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specpack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/specpack.Tpo $(DEPDIR)/specpack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/specpack.c' object='specpack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o specpack.lo `test -f './g2clib-1.0.4/specpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specpack.c specunpack.lo: ./g2clib-1.0.4/specunpack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT specunpack.lo -MD -MP -MF $(DEPDIR)/specunpack.Tpo -c -o specunpack.lo `test -f './g2clib-1.0.4/specunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specunpack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/specunpack.Tpo $(DEPDIR)/specunpack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='./g2clib-1.0.4/specunpack.c' object='specunpack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o specunpack.lo `test -f './g2clib-1.0.4/specunpack.c' || echo '$(srcdir)/'`./g2clib-1.0.4/specunpack.c .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_io/grid/io_grid_grib2/grib2_import.cpp000066400000000000000000000071721224124640700250340ustar00rootroot00000000000000/********************************************************** * Version $Id: grib2_import.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /* * Thomas Schorr 2007 */ #define DEBUG 1 #include "grib2_import.h" #include #include #ifdef _SAGA_LINUX #include #endif #ifdef _SAGA_MSW double rint(double x) { return( (int)(0.5 + x) ); } #endif SGGrib2Import::SGGrib2Import(void) { Set_Name (_TL("Import GRIB2 record")); Set_Author (_TL("Copyright (c) 2007 by Thomas Schorr")); Set_Description (_TW( "Import a GRIB2 record." "Under development." )); Parameters.Add_Grid_Output( NULL , "OUT_GRID" , _TL("Grid"), _TL("") ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), _TW( "GRIdded Binary (GRIB) files|*.grib*;*.grb*|" "GRIB2 files|*.grib2;*.grb2|" "All Files|*.*" ) ); } SGGrib2Import::~SGGrib2Import(void) {} bool SGGrib2Import::On_Execute(void) { size_t num_bytes; FILE *fp; CSG_String FileName; unsigned char *raw, *help; struct stat st; FileName = Parameters("FILE") ->asString(); gf = NULL; if ( stat( FileName.b_str(), &st ) == -1 ) return false; raw = ( unsigned char * ) malloc( st.st_size ); if ( raw == NULL ) return false; if( ( fp = fopen(FileName.b_str(), "rb")) != NULL ) { num_bytes = 0; help = raw; while ( feof( fp ) == 0 && ferror( fp ) == 0 ) { num_bytes = fread( help, sizeof( unsigned char ), 1024, fp ); help += num_bytes; } fclose( fp ); g2_getfld( raw, 1, 1, 1, &gf ); switch ( gf->igdtnum ) { case 0: if ( ! handle_latlon() ) return false; break; case 20: if ( ! handle_polar_stereographic() ) return false; break; default: fprintf( stderr, "unhandled grid definition template no.: %d\n", gf->igdtnum ); if ( ! handle_latlon() ) return false; } pGrid->Set_Name( SG_File_Get_Name(FileName, false) ); // no need to use wx!!! // pGrid->Set_Name( wxFileName( wxString( FileName ) ).GetName() ); Parameters( "OUT_GRID" )->Set_Value( pGrid ); g2_free( gf ); free( raw ); return( true ); } return( false ); } bool SGGrib2Import::handle_latlon( void ) { int x, y, nx, ny; double cellsize, xmin, ymin; if( gf->igdtmpl == NULL || gf->fld == NULL ) // possible if jpeg/png is not supported!? return( false ); nx = ( int ) gf->igdtmpl[ 7 ]; ny = ( int ) gf->igdtmpl[ 8 ]; cellsize = ( double ) ( gf->igdtmpl[ 16 ] * 1e-6 ); xmin = ( double ) ( gf->igdtmpl[ 12 ] * 1e-6 ) + cellsize / 2.0; ymin = ( double ) ( gf->igdtmpl[ 11 ] * 1e-6 ) - 90.0 + cellsize / 2.0; #ifdef DEBUG fprintf( stderr, "%d %d %f %f %f\n", nx, ny, cellsize, xmin, ymin ); #endif if ( ( nx == -1 ) || ( ny == -1 ) || ( ( pGrid = SG_Create_Grid( SG_DATATYPE_Float, nx, ny, cellsize, xmin, ymin ) ) == NULL ) ) return false; for ( x = 0; x < nx; x++ ) { for ( y = 0; y < ny; y ++ ) pGrid->Set_Value( x, ny - y - 1, gf->fld[ y * nx + x ] ); } return true; } bool SGGrib2Import::handle_polar_stereographic( void ) { /* XXX fix me XXX*/ int x, y, nx, ny; double cellsize, xmin, ymin; nx = ( int ) gf->igdtmpl[ 7 ]; ny = ( int ) gf->igdtmpl[ 8 ]; cellsize = ( double ) ( gf->igdtmpl[ 14 ] * 1e-3 ); xmin = ( double ) ( gf->igdtmpl[ 10 ] ); ymin = ( double ) ( gf->igdtmpl[ 9 ] ); #ifdef DEBUG fprintf( stderr, "%d %d %f %f %f\n", nx, ny, cellsize, xmin, ymin ); #endif if ( ( nx == -1 ) || ( ny == -1 ) || ( ( pGrid = SG_Create_Grid( SG_DATATYPE_Float, nx, ny, cellsize, xmin, ymin ) ) == NULL ) ) return false; for ( x = 0; x < nx; x++ ) { for ( y = 0; y < ny; y ++ ) pGrid->Set_Value( x, y, gf->fld[ y * nx + x ] ); } return true; } saga-2.1.0+dfsg/src/modules_io/grid/io_grid_grib2/grib2_import.h000066400000000000000000000014061224124640700244730ustar00rootroot00000000000000/********************************************************** * Version $Id: grib2_import.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /* * Thomas Schorr 2007 */ #ifndef HEADER_INCLUDED__grib2_import_H #define HEADER_INCLUDED__grib2_import_H #include "MLB_Interface.h" extern "C" { #include "g2clib-1.0.4/grib2.h" } class SGGrib2Import : public CSG_Module { public: SGGrib2Import(void); virtual ~SGGrib2Import(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); private: CSG_Grid *pGrid; gribfield *gf; bool handle_latlon( void ); bool handle_polar_stereographic( void ); }; #endif // #ifndef HEADER_INCLUDED__grib2_import_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid_image/000077500000000000000000000000001224124640700217775ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/grid/io_grid_image/MLB_Interface.cpp000066400000000000000000000113151224124640700250760ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1313 2012-01-18 11:08:03Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // image_io // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Import/Export - Images") ); case MLB_INFO_Author: return( SG_T("O. Conrad (c) 2005") ); case MLB_INFO_Description: return( _TL("Image Import/Export.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("File|Grid") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "grid_export.h" #include "grid_import.h" #include //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CGrid_Export ); case 1: return( new CGrid_Import ); } //------------------------------------------------------ if( !SG_UI_Get_Window_Main() ) wxInitAllImageHandlers(); return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_io/grid/io_grid_image/MLB_Interface.h000066400000000000000000000077311224124640700245520ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // image_io // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__io_grid_image_H #define HEADER_INCLUDED__io_grid_image_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef io_grid_image_EXPORTS #define io_grid_image_EXPORT _SAGA_DLL_EXPORT #else #define io_grid_image_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__io_grid_image_H saga-2.1.0+dfsg/src/modules_io/grid/io_grid_image/Makefile.am000066400000000000000000000015551224124640700240410ustar00rootroot00000000000000if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` else DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libio_grid_image.la libio_grid_image_la_SOURCES =\ grid_export.cpp\ grid_import.cpp\ MLB_Interface.cpp\ grid_export.h\ grid_import.h\ MLB_Interface.h libio_grid_image_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la saga-2.1.0+dfsg/src/modules_io/grid/io_grid_image/Makefile.in000066400000000000000000000450501224124640700240500ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/grid/io_grid_image DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libio_grid_image_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libio_grid_image_la_OBJECTS = grid_export.lo grid_import.lo \ MLB_Interface.lo libio_grid_image_la_OBJECTS = $(am_libio_grid_image_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libio_grid_image_la_SOURCES) DIST_SOURCES = $(libio_grid_image_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_FALSE@DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) @SAGA_UNICODE_TRUE@DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) @SAGA_UNICODE_FALSE@DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` @SAGA_UNICODE_TRUE@DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = $(DEP_LFLG) -avoid-version pkglib_LTLIBRARIES = libio_grid_image.la libio_grid_image_la_SOURCES = \ grid_export.cpp\ grid_import.cpp\ MLB_Interface.cpp\ grid_export.h\ grid_import.h\ MLB_Interface.h libio_grid_image_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_io/grid/io_grid_image/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/grid/io_grid_image/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libio_grid_image.la: $(libio_grid_image_la_OBJECTS) $(libio_grid_image_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libio_grid_image_la_OBJECTS) $(libio_grid_image_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_export.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid_import.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_io/grid/io_grid_image/grid_export.cpp000066400000000000000000000315521224124640700250370ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_export.cpp 1472 2012-09-12 14:01:55Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // image_io // // // //-------------------------------------------------------// // // // Grid_Export.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include #include "grid_export.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Export::CGrid_Export(void) { Set_Name (_TL("Export Image (bmp, jpg, pcx, png, tif)")); Set_Author (SG_T("O. Conrad (c) 2005")); Set_Description (_TW( "Saves a grid as image using display properties as used by the graphical user interface.\n\n" "On the command line there are further parameters available: It is possible to either use one " "of the default palettes, to use a Lookup Table for coloring or to interpret the grid as RGB coded. " "In case a shade grid is specified, it's minimum and maximum brightness values can be specified in " "percent (0 - 100\%).\n") ); Parameters.Add_Grid( NULL , "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Grid( NULL , "SHADE" , _TL("Shade"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_FilePath( NULL , "FILE" , _TL("Image File"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s"), _TL("Windows or OS/2 Bitmap (*.bmp)") , SG_T("*.bmp"), _TL("JPEG - JFIF Compliant (*.jpg, *.jif, *.jpeg)") , SG_T("*.jpg;*.jif;*.jpeg"), _TL("Zsoft Paintbrush (*.pcx)") , SG_T("*.pcx"), _TL("Portable Network Graphics (*.png)") , SG_T("*.png"), _TL("Tagged Image File Format (*.tif, *.tiff)") , SG_T("*.tif;*.tiff") ), NULL, true ); Parameters.Add_Value( NULL, "FILE_KML" , _TL("Create KML File"), _TL(""), PARAMETER_TYPE_Bool, true ); if( !SG_UI_Get_Window_Main() ) { Parameters.Add_Value( NULL , "COL_COUNT" , _TL("Number of Colors"), _TL(""), PARAMETER_TYPE_Int, 100 ); Parameters.Add_Choice( NULL , "COL_PALETTE" , _TL("Color Palette"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|"), _TL("DEFAULT"), _TL("DEFAULT_BRIGHT"), _TL("BLACK_WHITE"), _TL("BLACK_RED"), _TL("BLACK_GREEN"), _TL("BLACK_BLUE"), _TL("WHITE_RED"), _TL("WHITE_GREEN"), _TL("WHITE_BLUE"), _TL("YELLOW_RED"), _TL("YELLOW_GREEN"), _TL("YELLOW_BLUE"), _TL("RED_GREEN"), _TL("RED_BLUE"), _TL("GREEN_BLUE"), _TL("RED_GREY_BLUE"), _TL("RED_GREY_GREEN"), _TL("GREEN_GREY_BLUE"), _TL("RED_GREEN_BLUE"), _TL("RED_BLUE_GREEN"), _TL("GREEN_RED_BLUE"), _TL("RAINBOW"), _TL("NEON") ), 0 ); Parameters.Add_Value( NULL, "COL_REVERT" , _TL("Revert Palette"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Table( NULL, "LUT" , _TL("Lookup Table"), _TL(""), PARAMETER_INPUT_OPTIONAL ); Parameters.Add_Value( NULL, "IS_RGB" , _TL("RGB coded Grid"), _TL(""), PARAMETER_TYPE_Bool, false ); Parameters.Add_Range( NULL, "SHADE_BRIGHTNESS" , _TL("Shade Brightness"), _TL("Allows to scale shade brightness, [percent]"), 0.0, 100.0, 0.0, true, 100.0, true ); } } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Export::On_Execute(void) { int x, y, c, r, g, b; double d, dMinBright = 0.0, dMaxBright = 100.0; CSG_Grid *pGrid, *pShade, Grid, Shade; CSG_File Stream; CSG_String fName, fExt; wxImage img; //----------------------------------------------------- pGrid = Parameters("GRID") ->asGrid(); pShade = Parameters("SHADE") ->asGrid(); fName = Parameters("FILE") ->asString(); //----------------------------------------------------- if( !SG_UI_Get_Window_Main() && pShade != NULL) { dMinBright = Parameters("SHADE_BRIGHTNESS")->asRange()->Get_LoVal() / 100.0; dMaxBright = Parameters("SHADE_BRIGHTNESS")->asRange()->Get_HiVal() / 100.0; if( dMinBright >= dMaxBright ) { SG_UI_Msg_Add_Error(_TL("Minimum shade brightness must be lower than maximum shade brightness!")); return( false ); } } //----------------------------------------------------- if( SG_File_Cmp_Extension(fName, SG_T("bmp")) ) { fExt = SG_T("bpw"); } else if( SG_File_Cmp_Extension(fName, SG_T("jpg")) ) { fExt = SG_T("jgw"); } else if( SG_File_Cmp_Extension(fName, SG_T("pcx")) ) { fExt = SG_T("pxw"); } else if( SG_File_Cmp_Extension(fName, SG_T("png")) ) { fExt = SG_T("pgw"); } else if( SG_File_Cmp_Extension(fName, SG_T("tif")) ) { fExt = SG_T("tfw"); } else { fExt = SG_T("pgw"); fName = SG_File_Make_Path(NULL, fName, SG_T("png")); } //----------------------------------------------------- if( !pGrid || pGrid->Get_ZRange() == 0.0 ) { return( false ); } else if( !SG_UI_DataObject_asImage(pGrid, &Grid) ) { int nColors = Parameters("COL_COUNT")->asInt(); CSG_Colors Colors(nColors, Parameters("COL_PALETTE")->asInt(), Parameters("COL_REVERT")->asBool()); CSG_Table *pLUT = Parameters("LUT")->asTable(); bool bRGB = Parameters("IS_RGB")->asBool(); if( pLUT && pLUT->Get_Field_Count() < 5 ) { SG_UI_Msg_Add_Error(_TL("Improperly formatted Lookup Table.")); return( false ); } Grid.Create(*Get_System(), SG_DATATYPE_Int); for(y=0; yasDouble(x, y); for(int i=0; iGet_Record_Count(); i++) { if( d >= pLUT->Get_Record(i)->asDouble(3) && d < pLUT->Get_Record(i)->asDouble(4) ) { nColors = i; bFound = true; break; } } if( !bFound ) Grid.Set_NoData(x, Get_NY() - 1 - y); else Grid.Set_Value(x, Get_NY() - 1 - y, pLUT->Get_Record(nColors)->asInt(0)); } else { if( pGrid->is_NoData(x, y) ) Grid.Set_NoData(x, Get_NY() - 1 - y); else { if (bRGB) Grid.Set_Value(x, Get_NY() - 1 - y, pGrid->asDouble(x, y)); else Grid.Set_Value(x, Get_NY() - 1 - y, Colors[(int)( nColors * (pGrid->asDouble(x, y) - pGrid->Get_ZMin()) / pGrid->Get_ZRange() )]); } } } } } if( !pShade || pShade->Get_ZRange() == 0.0 ) { pShade = NULL; } else if( !SG_UI_DataObject_asImage(pShade, &Shade) ) { int nColors = 100; CSG_Colors Colors(nColors, SG_COLORS_BLACK_WHITE, true); Shade.Create(*Get_System(), SG_DATATYPE_Int); for(y=0; yis_NoData(x, y) ) Shade.Set_NoData(x, Get_NY() - 1 - y); else Shade.Set_Value(x, Get_NY() - 1 - y, Colors[(int)( nColors * (dMaxBright - dMinBright) * (pShade->asDouble(x, y) - pShade->Get_ZMin()) / pShade->Get_ZRange() + dMinBright )]); } } } //------------------------------------------------- img.Create(Get_NX(), Get_NY()); for(y=0; yGet_Projection().Save(SG_File_Make_Path(NULL, fName, SG_T("prj")), SG_PROJ_FMT_WKT); if( Stream.Open(SG_File_Make_Path(NULL, fName, fExt), SG_FILE_W, false) ) { Stream.Printf(SG_T("%.10f\n%f\n%f\n%.10f\n%.10f\n%.10f\n"), pGrid->Get_Cellsize(), 0.0, 0.0, -pGrid->Get_Cellsize(), pGrid->Get_XMin(), pGrid->Get_YMax() ); } if( Parameters("FILE_KML")->asBool() && Stream.Open(SG_File_Make_Path(NULL, fName, SG_T("kml")), SG_FILE_W, false) ) { Stream.Printf(SG_T("\n")); Stream.Printf(SG_T("\n")); Stream.Printf(SG_T(" \n")); Stream.Printf(SG_T(" Raster exported from SAGA\n")); Stream.Printf(SG_T(" System for Automated Geoscientific Analyses - www.saga-gis.org\n")); Stream.Printf(SG_T(" \n")); Stream.Printf(SG_T(" %s\n") , pGrid->Get_Name()); Stream.Printf(SG_T(" %s\n") , pGrid->Get_Description()); Stream.Printf(SG_T(" \n")); Stream.Printf(SG_T(" %s\n") , SG_File_Get_Name(fName, true).c_str()); Stream.Printf(SG_T(" \n")); Stream.Printf(SG_T(" \n")); Stream.Printf(SG_T(" %.10f\n") , pGrid->Get_YMax()); Stream.Printf(SG_T(" %.10f\n") , pGrid->Get_YMin()); Stream.Printf(SG_T(" %.10f\n") , pGrid->Get_XMax()); Stream.Printf(SG_T(" %.10f\n") , pGrid->Get_XMin()); Stream.Printf(SG_T(" 0.0\n")); Stream.Printf(SG_T(" \n")); Stream.Printf(SG_T(" \n")); Stream.Printf(SG_T(" \n")); Stream.Printf(SG_T("\n")); } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid_image/grid_export.h000066400000000000000000000106121224124640700244760ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_export.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // image_io // // // //-------------------------------------------------------// // // // Grid_Export.h // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Export_H #define HEADER_INCLUDED__Grid_Export_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class io_grid_image_EXPORT CGrid_Export : public CSG_Module_Grid { public: CGrid_Export(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Export") ); } protected: virtual bool On_Execute (void); private: }; #endif // #ifndef HEADER_INCLUDED__Grid_Export_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid_image/grid_import.cpp000066400000000000000000000325201224124640700250240ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_import.cpp 1355 2012-03-15 16:54:05Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // image_io // // // //-------------------------------------------------------// // // // Grid_Import.cpp // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include #include #include "grid_import.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGrid_Import::CGrid_Import(void) { //----------------------------------------------------- Set_Name (_TL("Import Image (bmp, jpg, png, tif, gif, pnm, xpm)")); Set_Author (SG_T("(c) 2005 by O.Conrad")); Set_Description (_TW( "Loads an image." )); //----------------------------------------------------- Parameters.Add_Grid_Output( NULL , "OUT_GRID" , _TL("Image"), _TL("") ); Parameters.Add_Grid_Output( NULL , "OUT_RED" , _TL("Image (Red Channel)"), _TL("") ); Parameters.Add_Grid_Output( NULL , "OUT_GREEN" , _TL("Image (Green Channel)"), _TL("") ); Parameters.Add_Grid_Output( NULL , "OUT_BLUE" , _TL("Image (Blue Channel)"), _TL("") ); //----------------------------------------------------- Parameters.Add_FilePath( NULL , "FILE" , _TL("Image File"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s"), _TL("All Recognized File Types") , SG_T("*.bmp;*.ico;*.gif;*.jpg;*.jif;*.jpeg;*.pcx;*.png;*.pnm;*.tif;*.tiff;*.xpm"), _TL("CompuServe Graphics Interchange (*.gif)") , SG_T("*.gif"), _TL("JPEG - JFIF Compliant (*.jpg, *.jif, *.jpeg)") , SG_T("*.jpg;*.jif;*.jpeg"), _TL("Portable Network Graphics (*.png)") , SG_T("*.png"), _TL("Tagged Image File Format (*.tif, *.tiff)") , SG_T("*.tif;*.tiff"), _TL("Windows or OS/2 Bitmap (*.bmp)") , SG_T("*.bmp"), _TL("Zsoft Paintbrush (*.pcx)") , SG_T("*.pcx"), _TL("All Files") , SG_T("*.*") ) ); Parameters.Add_Choice( NULL , "METHOD" , _TL("Options"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|"), _TL("Standard"), _TL("Split Channels"), _TL("Enforce True Color") ), 2 ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGrid_Import::On_Execute(void) { bool bTransform; int x, y, yy, Method; double ax, ay, dx, dy, rx, ry, xMin, yMin, Cellsize; CSG_Colors Colors; CSG_String fImage, fWorld, Name; CSG_Grid *pImage; CSG_File Stream; wxImage Image; wxImageHistogram Histogram; //----------------------------------------------------- fImage = Parameters("FILE") ->asString(); Method = Parameters("METHOD") ->asInt(); Name = SG_File_Get_Name(fImage, false); if( !Image.LoadFile(fImage.c_str()) ) { return( false ); } //----------------------------------------------------- if( SG_File_Cmp_Extension(fImage, SG_T("bmp")) ) { fWorld = SG_File_Make_Path(NULL, fImage, SG_T("bpw")); } else if( SG_File_Cmp_Extension(fImage, SG_T("jpg")) ) { fWorld = SG_File_Make_Path(NULL, fImage, SG_T("jgw")); } else if( SG_File_Cmp_Extension(fImage, SG_T("png")) ) { fWorld = SG_File_Make_Path(NULL, fImage, SG_T("pgw")); } else if( SG_File_Cmp_Extension(fImage, SG_T("tif")) ) { fWorld = SG_File_Make_Path(NULL, fImage, SG_T("tfw")); } else { fWorld = SG_File_Make_Path(NULL, fImage, SG_T("world")); } bTransform = false; xMin = 0.0; yMin = 0.0; Cellsize = 1.0; if( Stream.Open(fWorld, SG_FILE_R, false) && fscanf(Stream.Get_Stream(), "%lf %lf %lf %lf %lf %lf ", &dx, &ry, &rx, &dy, &ax, &ay) == 6 ) { if( dx != -dy || rx != 0.0 || ry != 0.0 ) { bTransform = true; } else { xMin = ax; yMin = ay + dy * (Image.GetHeight() - 1); Cellsize = dx; } } //----------------------------------------------------- // color look-up table... if( Method == 0 && (yy = Image.ComputeHistogram(Histogram)) <= 256 ) { Colors.Set_Count(yy); for(wxImageHistogram::iterator i=Histogram.begin(); i!=Histogram.end(); ++i) { Colors.Set_Color(i->second.index, SG_GET_R(i->first), SG_GET_G(i->first), SG_GET_B(i->first)); } pImage = SG_Create_Grid(yy <= 2 ? SG_DATATYPE_Bit : SG_DATATYPE_Byte, Image.GetWidth(), Image.GetHeight(), Cellsize, xMin, yMin); for(y=0; yGet_NY() && Set_Progress(y, pImage->Get_NY()); y++) { yy = bTransform ? y : pImage->Get_NY() - 1 - y; for(x=0; xGet_NX(); x++) { pImage->Set_Value(x, y, Histogram[SG_GET_RGB(Image.GetRed(x, yy), Image.GetGreen(x, yy), Image.GetBlue(x, yy))].index); } } if( bTransform ) { Set_Transformation(&pImage, ax, ay, dx, dy, rx, ry); } pImage->Set_Name(Name); pImage->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj"))); Parameters("OUT_GRID")->Set_Value(pImage); DataObject_Set_Colors(pImage, Colors); DataObject_Update(pImage, 0, Colors.Get_Count() - 1); } //----------------------------------------------------- else // true color... { pImage = SG_Create_Grid(SG_DATATYPE_Int, Image.GetWidth(), Image.GetHeight(), Cellsize, xMin, yMin); pImage ->Set_Name(Name); for(y=0; yGet_NY() && Set_Progress(y, pImage->Get_NY()); y++) { yy = bTransform ? y : pImage->Get_NY() - 1 - y; for(x=0; xGet_NX(); x++) { pImage->Set_Value(x, y, SG_GET_RGB(Image.GetRed(x, yy), Image.GetGreen(x, yy), Image.GetBlue(x, yy))); } } if( bTransform ) { Set_Transformation(&pImage, ax, ay, dx, dy, rx, ry); } //------------------------------------------------- if( Method != 1 ) // true color... { pImage->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT); pImage->Set_Name(Name); pImage->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj"))); Parameters("OUT_GRID")->Set_Value(pImage); DataObject_Set_Colors(pImage, 100, SG_COLORS_BLACK_WHITE); DataObject_Set_Parameter(pImage, "COLORS_TYPE", 6); // Color Classification Type: RGB } //------------------------------------------------- else // split channels... { CSG_Grid *pR, *pG, *pB; pR = SG_Create_Grid(pImage->Get_System(), SG_DATATYPE_Byte); pG = SG_Create_Grid(pImage->Get_System(), SG_DATATYPE_Byte); pB = SG_Create_Grid(pImage->Get_System(), SG_DATATYPE_Byte); for(y=0; yGet_NY() && Set_Progress(y, pImage->Get_NY()); y++) { for(x=0; xGet_NX(); x++) { pR->Set_Value(x, y, SG_GET_R(pImage->asInt(x, y))); pG->Set_Value(x, y, SG_GET_G(pImage->asInt(x, y))); pB->Set_Value(x, y, SG_GET_B(pImage->asInt(x, y))); } } pR->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT); pG->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT); pB->Get_Projection().Load(fImage, SG_PROJ_FMT_WKT); pR->Set_Name(CSG_String::Format(SG_T("%s [R]"), Name.c_str())); pG->Set_Name(CSG_String::Format(SG_T("%s [G]"), Name.c_str())); pB->Set_Name(CSG_String::Format(SG_T("%s [B]"), Name.c_str())); pR->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj"))); pG->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj"))); pB->Get_Projection().Load(SG_File_Make_Path(NULL, fImage, SG_T("prj"))); Parameters("OUT_RED") ->Set_Value(pR); Parameters("OUT_GREEN") ->Set_Value(pG); Parameters("OUT_BLUE") ->Set_Value(pB); DataObject_Set_Colors(pR, 100, SG_COLORS_BLACK_RED); DataObject_Set_Colors(pG, 100, SG_COLORS_BLACK_GREEN); DataObject_Set_Colors(pB, 100, SG_COLORS_BLACK_BLUE); } } //----------------------------------------------------- return( true ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- void CGrid_Import::Set_Transformation(CSG_Grid **ppImage, double ax, double ay, double dx, double dy, double rx, double ry) { int x, y; double z; TSG_Rect r; CSG_Vector A(2), XSrc(2), XTgt(2); CSG_Matrix D(2, 2), DInv; CSG_Grid *pSource, *pTarget; //----------------------------------------------------- pSource = *ppImage; A[0] = ax; A[1] = ay; D[0][0] = dx; D[0][1] = rx; D[1][0] = ry; D[1][1] = dy; DInv = D.Get_Inverse(); //----------------------------------------------------- XSrc[0] = pSource->Get_XMin(); XSrc[1] = pSource->Get_YMin(); XTgt = D * XSrc + A; r.xMin = r.xMax = XTgt[0]; r.yMin = r.yMax = XTgt[1]; XSrc[0] = pSource->Get_XMin(); XSrc[1] = pSource->Get_YMax(); XTgt = D * XSrc + A; if( r.xMin > XTgt[0] ) r.xMin = XTgt[0]; else if( r.xMax < XTgt[0] ) r.xMax = XTgt[0]; if( r.yMin > XTgt[1] ) r.yMin = XTgt[1]; else if( r.yMax < XTgt[1] ) r.yMax = XTgt[1]; XSrc[0] = pSource->Get_XMax(); XSrc[1] = pSource->Get_YMax(); XTgt = D * XSrc + A; if( r.xMin > XTgt[0] ) r.xMin = XTgt[0]; else if( r.xMax < XTgt[0] ) r.xMax = XTgt[0]; if( r.yMin > XTgt[1] ) r.yMin = XTgt[1]; else if( r.yMax < XTgt[1] ) r.yMax = XTgt[1]; XSrc[0] = pSource->Get_XMax(); XSrc[1] = pSource->Get_YMin(); XTgt = D * XSrc + A; if( r.xMin > XTgt[0] ) r.xMin = XTgt[0]; else if( r.xMax < XTgt[0] ) r.xMax = XTgt[0]; if( r.yMin > XTgt[1] ) r.yMin = XTgt[1]; else if( r.yMax < XTgt[1] ) r.yMax = XTgt[1]; z = fabs(dx) < fabs(dy) ? fabs(dx) : fabs(dy); // guess a suitable cellsize; could be improved... x = 1 + (int)((r.xMax - r.xMin) / z); y = 1 + (int)((r.yMax - r.yMin) / z); //----------------------------------------------------- pTarget = *ppImage = SG_Create_Grid(pSource->Get_Type(), x, y, z, r.xMin, r.yMin); for(y=0, XTgt[1]=pTarget->Get_YMin(); yGet_NY() && Set_Progress(y, pTarget->Get_NY()); y++, XTgt[1]+=pTarget->Get_Cellsize()) { for(x=0, XTgt[0]=pTarget->Get_XMin(); xGet_NX(); x++, XTgt[0]+=pTarget->Get_Cellsize()) { XSrc = DInv * (XTgt - A); if( pSource->Get_Value(XSrc[0], XSrc[1], z, GRID_INTERPOLATION_NearestNeighbour, false, true) ) { pTarget->Set_Value(x, y, z); } else { pTarget->Set_NoData(x, y); } } } delete(pSource); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/grid/io_grid_image/grid_import.h000066400000000000000000000107741224124640700245000ustar00rootroot00000000000000/********************************************************** * Version $Id: grid_import.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // image_io // // // //-------------------------------------------------------// // // // Grid_Import.h // // // // Copyright (C) 2005 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: SAGA User Group Association // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__Grid_Import_H #define HEADER_INCLUDED__Grid_Import_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class io_grid_image_EXPORT CGrid_Import : public CSG_Module { public: CGrid_Import(void); virtual CSG_String Get_MenuPath (void) { return( _TL("R:Import") ); } protected: virtual bool On_Execute (void); private: void Set_Transformation (CSG_Grid **ppImage, double ax, double ay, double dx, double dy, double rx, double ry); }; #endif // #ifndef HEADER_INCLUDED__Grid_Import_H /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- saga-2.1.0+dfsg/src/modules_io/shapes/000077500000000000000000000000001224124640700175575ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/shapes/Makefile.am000066400000000000000000000000611224124640700216100ustar00rootroot00000000000000SUBDIRS = io_shapes io_shapes_dxf io_shapes_las saga-2.1.0+dfsg/src/modules_io/shapes/Makefile.in000066400000000000000000000424771224124640700216420ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/shapes DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = io_shapes io_shapes_dxf io_shapes_las all: all-recursive .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) --gnu src/modules_io/shapes/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/shapes/Makefile .PRECIOUS: 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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ 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 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # 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: saga-2.1.0+dfsg/src/modules_io/shapes/io_shapes/000077500000000000000000000000001224124640700215315ustar00rootroot00000000000000saga-2.1.0+dfsg/src/modules_io/shapes/io_shapes/MLB_Interface.cpp000066400000000000000000000132001224124640700246230ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.cpp 1373 2012-04-13 09:54:30Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_shapes // // // //-------------------------------------------------------// // // // MLB_Interface.cpp // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // The Module Link Library Interface // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- // 1. Include the appropriate SAGA-API header... #include "MLB_Interface.h" //--------------------------------------------------------- // 2. Place general module library informations here... CSG_String Get_Info(int i) { switch( i ) { case MLB_INFO_Name: default: return( _TL("Import/Export - Shapes") ); case MLB_INFO_Author: return( SG_T("SAGA User Group Associaton (c) 2002-10") ); case MLB_INFO_Description: return( _TL("Tools for the import and export of vector data.") ); case MLB_INFO_Version: return( SG_T("1.0") ); case MLB_INFO_Menu_Path: return( _TL("File|Shapes") ); } } //--------------------------------------------------------- // 3. Include the headers of your modules here... #include "gstat.h" #include "xyz.h" #include "generate.h" #include "surfer_bln.h" #include "atlas_bna.h" #include "wasp_map.h" #include "stl.h" #include "gpx.h" #include "pointcloud_from_file.h" #include "pointcloud_from_text_file.h" #include "svg.h" #include "pointcloud_to_text_file.h" #include "wktb.h" //--------------------------------------------------------- // 4. Allow your modules to be created here... CSG_Module * Create_Module(int i) { switch( i ) { case 0: return( new CGStat_Export ); case 1: return( new CGStat_Import ); case 2: return( new CXYZ_Export ); case 3: return( new CXYZ_Import ); case 4: return( new CGenerate_Export ); case 5: return( new CSurfer_BLN_Export ); case 6: return( new CSurfer_BLN_Import ); case 7: return( new CAtlas_BNA_Export ); case 8: return( new CAtlas_BNA_Import ); case 9: return( new CWASP_MAP_Export ); case 10: return( new CWASP_MAP_Import ); case 11: return( new CSTL_Import ); case 12: return( new CSTL_Export ); case 13: return( new CGPX_Import ); case 14: return( new CGPX_Export ); case 15: return( new CPointCloud_From_File ); case 16: return( new CPointCloud_From_Text_File ); case 17: return( new CSVG_Export ); case 18: return( new CPointcloud_To_Text_File ); case 19: return( new CWKT_Import ); case 20: return( new CWKT_Export ); } return( NULL ); } /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- //{{AFX_SAGA MLB_INTERFACE //}}AFX_SAGA saga-2.1.0+dfsg/src/modules_io/shapes/io_shapes/MLB_Interface.h000066400000000000000000000077011224124640700243010ustar00rootroot00000000000000/********************************************************** * Version $Id: MLB_Interface.h 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_IO // // // //-------------------------------------------------------// // // // MLB_Interface.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // Include the SAGA-API here // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__io_shapes_H #define HEADER_INCLUDED__io_shapes_H //--------------------------------------------------------- #include //--------------------------------------------------------- #ifdef io_shapes_EXPORTS #define io_shapes_EXPORT _SAGA_DLL_EXPORT #else #define io_shapes_EXPORT _SAGA_DLL_IMPORT #endif /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #endif // #ifndef HEADER_INCLUDED__io_shapes_H saga-2.1.0+dfsg/src/modules_io/shapes/io_shapes/Makefile.am000066400000000000000000000024321224124640700235660ustar00rootroot00000000000000# # $Id: Makefile.am 1373 2012-04-13 09:54:30Z oconrad $ # if DEBUG DBGFLAGS = -g -DDEBUG endif if SAGA_UNICODE DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` UC_DEFS = -D_SAGA_UNICODE else DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` endif DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LFLG) pkglib_LTLIBRARIES = libio_shapes.la libio_shapes_la_SOURCES =\ atlas_bna.cpp\ generate.cpp\ gpx.cpp\ gstat.cpp\ MLB_Interface.cpp\ pointcloud_from_file.cpp\ pointcloud_from_text_file.cpp\ pointcloud_to_text_file.cpp\ stl.cpp\ surfer_bln.cpp\ svg.cpp\ wasp_map.cpp\ wktb.cpp\ xyz.cpp\ atlas_bna.h\ generate.h\ gpx.h\ gstat.h\ MLB_Interface.h\ pointcloud_from_file.h\ pointcloud_from_text_file.h\ pointcloud_to_text_file.h\ stl.h\ surfer_bln.h\ svg.h\ wasp_map.h\ wktb.h\ xyz.h libio_shapes_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS) saga-2.1.0+dfsg/src/modules_io/shapes/io_shapes/Makefile.in000066400000000000000000000476011224124640700236060ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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 = src/modules_io/shapes/io_shapes DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/ax_swig_enable_cxx.m4 \ $(top_srcdir)/m4/ax_swig_python.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) libio_shapes_la_DEPENDENCIES = \ $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la am_libio_shapes_la_OBJECTS = atlas_bna.lo generate.lo gpx.lo gstat.lo \ MLB_Interface.lo pointcloud_from_file.lo \ pointcloud_from_text_file.lo pointcloud_to_text_file.lo stl.lo \ surfer_bln.lo svg.lo wasp_map.lo wktb.lo xyz.lo libio_shapes_la_OBJECTS = $(am_libio_shapes_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libio_shapes_la_SOURCES) DIST_SOURCES = $(libio_shapes_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX_SWIG_PYTHON_CPPFLAGS = @AX_SWIG_PYTHON_CPPFLAGS@ AX_SWIG_PYTHON_OPT = @AX_SWIG_PYTHON_OPT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLELIBHARU = @DISABLELIBHARU@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GOMPFLAGS = @GOMPFLAGS@ GREP = @GREP@ HARU_LIB = @HARU_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCAL_INCS = @LOCAL_INCS@ LOCAL_LIBS = @LOCAL_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SWIG = @SWIG@ SWIG_LIB = @SWIG_LIB@ 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@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ # # $Id: Makefile.am 1373 2012-04-13 09:54:30Z oconrad $ # @DEBUG_TRUE@DBGFLAGS = -g -DDEBUG @SAGA_UNICODE_FALSE@DEP_DEFS = -fPIC `wx-config --unicode=no --static=no --cxxflags` $(DBGFLAGS) @SAGA_UNICODE_TRUE@DEP_DEFS = -fPIC `wx-config --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $(DBGFLAGS) @SAGA_UNICODE_FALSE@DEP_LFLG = -fPIC -shared `wx-config --unicode=no --static=no --libs` @SAGA_UNICODE_TRUE@DEP_LFLG = -fPIC -shared `wx-config --unicode=yes --static=no --libs` @SAGA_UNICODE_TRUE@UC_DEFS = -D_SAGA_UNICODE DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD CXX_INCS = -I$(top_srcdir)/src/saga_core AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DEP_DEFS) $(UC_DEFS) $(DBGFLAGS) $(GOMPFLAGS) AM_LDFLAGS = -fPIC -shared -avoid-version $(DEP_LFLG) pkglib_LTLIBRARIES = libio_shapes.la libio_shapes_la_SOURCES = \ atlas_bna.cpp\ generate.cpp\ gpx.cpp\ gstat.cpp\ MLB_Interface.cpp\ pointcloud_from_file.cpp\ pointcloud_from_text_file.cpp\ pointcloud_to_text_file.cpp\ stl.cpp\ surfer_bln.cpp\ svg.cpp\ wasp_map.cpp\ wktb.cpp\ xyz.cpp\ atlas_bna.h\ generate.h\ gpx.h\ gstat.h\ MLB_Interface.h\ pointcloud_from_file.h\ pointcloud_from_text_file.h\ pointcloud_to_text_file.h\ stl.h\ surfer_bln.h\ svg.h\ wasp_map.h\ wktb.h\ xyz.h libio_shapes_la_LIBADD = $(top_srcdir)/src/saga_core/saga_api/libsaga_api.la $(ADD_MLBS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .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) --gnu src/modules_io/shapes/io_shapes/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules_io/shapes/io_shapes/Makefile .PRECIOUS: 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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libio_shapes.la: $(libio_shapes_la_OBJECTS) $(libio_shapes_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libio_shapes_la_OBJECTS) $(libio_shapes_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MLB_Interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atlas_bna.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gstat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pointcloud_from_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pointcloud_from_text_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pointcloud_to_text_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/surfer_bln.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wasp_map.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wktb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xyz.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" 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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 clean-libtool clean-pkglibLTLIBRARIES \ 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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES # 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: saga-2.1.0+dfsg/src/modules_io/shapes/io_shapes/atlas_bna.cpp000066400000000000000000000250041224124640700241620ustar00rootroot00000000000000/********************************************************** * Version $Id: atlas_bna.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_shapes // // // //-------------------------------------------------------// // // // Atlas_BNA.cpp // // // // Copyright (C) 2006 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "atlas_bna.h" /////////////////////////////////////////////////////////// // // // Import // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CAtlas_BNA_Import::CAtlas_BNA_Import(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Import Atlas Boundary File")); Set_Author (SG_T("(c) 2006 by O.Conrad")); Set_Description (_TW( "\n" )); //----------------------------------------------------- // 2. Parameters... Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), _TL("Atlas Boundary Files (*.bna)|*.bna|All Files|*.*") ); } //--------------------------------------------------------- CAtlas_BNA_Import::~CAtlas_BNA_Import(void) {} //--------------------------------------------------------- bool CAtlas_BNA_Import::On_Execute(void) { bool bOk; int iPoint, nPoints; double x, y; FILE *Stream; CSG_String FileName, sLine, sName1, sName2; CSG_Shape *pShape; CSG_Shapes *pPoints, *pLines, *pPolygons; //----------------------------------------------------- FileName = Parameters("FILE") ->asString(); //----------------------------------------------------- if( (Stream = fopen(FileName.b_str(), "r")) != NULL ) { pPoints = SG_Create_Shapes(SHAPE_TYPE_Point , SG_File_Get_Name(FileName, false)); pPoints ->Add_Field("NAME1" , SG_DATATYPE_String); pPoints ->Add_Field("NAME2" , SG_DATATYPE_String); pLines = SG_Create_Shapes(SHAPE_TYPE_Line , SG_File_Get_Name(FileName, false)); pLines ->Add_Field("NAME1" , SG_DATATYPE_String); pLines ->Add_Field("NAME2" , SG_DATATYPE_String); pPolygons = SG_Create_Shapes(SHAPE_TYPE_Polygon, SG_File_Get_Name(FileName, false)); pPolygons ->Add_Field("NAME1" , SG_DATATYPE_String); pPolygons ->Add_Field("NAME2" , SG_DATATYPE_String); //------------------------------------------------- bOk = true; while( bOk && SG_Read_Line(Stream, sLine) && Process_Get_Okay(true) ) { sName1 = sLine.AfterFirst('\"').BeforeFirst('\"'); sName2 = sLine.BeforeLast('\"').AfterLast('\"'); sLine = sLine.AfterLast('\"'); if( sLine.Find(',', true) >= 0 ) sLine = sLine.AfterLast(','); nPoints = sLine.asInt(); if( nPoints == 1 ) { pShape = pPoints ->Add_Shape(); } else if( nPoints < 0 ) { pShape = pLines ->Add_Shape(); nPoints = -nPoints; } else if( nPoints > 2 ) { pShape = pPolygons ->Add_Shape(); } else { bOk = false; } if( bOk ) { pShape->Set_Value(0, sName1); pShape->Set_Value(1, sName2); for(iPoint=0; iPointAdd_Point(x, y); } } } } fclose(Stream); //------------------------------------------------- bOk = false; if( pPoints->is_Valid() && pPoints->Get_Count() > 0 ) { bOk = true; DataObject_Add(pPoints); } else { delete(pPoints); } if( pLines->is_Valid() && pLines->Get_Count() > 0 ) { bOk = true; DataObject_Add(pLines); } else { delete(pLines); } if( pPolygons->is_Valid() && pPolygons->Get_Count() > 0 ) { bOk = true; DataObject_Add(pPolygons); } else { delete(pPolygons); } return( bOk ); } //----------------------------------------------------- return( false ); } /////////////////////////////////////////////////////////// // // // Export // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CAtlas_BNA_Export::CAtlas_BNA_Export(void) { //----------------------------------------------------- // 1. Info... Set_Name (_TL("Export Atlas Boundary File")); Set_Author (SG_T("(c) 2006 by O.Conrad")); Set_Description (_TW( "\n" )); //----------------------------------------------------- // 2. Parameters... CSG_Parameter *pNode; pNode = Parameters.Add_Shapes( NULL , "SHAPES" , _TL("Shapes"), _TL(""), PARAMETER_INPUT ); Parameters.Add_Table_Field( pNode , "PNAME" , _TL("Primary Name"), _TL("") ); Parameters.Add_Table_Field( pNode , "SNAME" , _TL("Secondary Name"), _TL("") ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), _TL( "Atlas Boundary Files (*.bna)|*.bna|All Files|*.*"), NULL, true ); } //--------------------------------------------------------- CAtlas_BNA_Export::~CAtlas_BNA_Export(void) {} //--------------------------------------------------------- bool CAtlas_BNA_Export::On_Execute(void) { int iShape, iPart, iPoint, iName1, iName2; FILE *Stream; TSG_Point p; CSG_Points Pts; CSG_Shape *pShape; CSG_Shapes *pShapes; CSG_String fName; //----------------------------------------------------- pShapes = Parameters("SHAPES") ->asShapes(); fName = Parameters("FILE") ->asString(); iName1 = Parameters("PNAME") ->asInt(); iName2 = Parameters("SNAME") ->asInt(); //----------------------------------------------------- if( (Stream = fopen(fName.b_str(), "w")) != NULL ) { for(iShape=0; iShapeGet_Count() && Set_Progress(iShape, pShapes->Get_Count()); iShape++) { pShape = pShapes->Get_Shape(iShape); switch( pShapes->Get_Type() ) { default: break; //--------------------------------------------- case SHAPE_TYPE_Point: fprintf(Stream, "\"%s\",\"%s\",%d\n", pShape->asString(iName1), pShape->asString(iName2), 1 ); p = pShape->Get_Point(0); fprintf(Stream, "%f,%f\n", p.x, p.y); break; //--------------------------------------------- case SHAPE_TYPE_Line: for(iPart=0; iPartGet_Part_Count(); iPart++) { fprintf(Stream, "\"%s\",\"%s\",%d\n", pShape->asString(iName1), pShape->asString(iName2), -pShape->Get_Point_Count(iPart) ); for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { p = pShape->Get_Point(iPoint, iPart); fprintf(Stream, "%f,%f\n", p.x, p.y); } } break; //--------------------------------------------- case SHAPE_TYPE_Polygon: if( pShape->Get_Part_Count() > 0 && pShape->Get_Point_Count(0) > 2 ) { Pts.Clear(); for(iPart=0; iPartGet_Part_Count(); iPart++) { for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { Pts.Add(pShape->Get_Point(iPoint, iPart)); } if( iPart > 0 ) { Pts.Add(pShape->Get_Point(0, 0)); } } if( Pts.Get_Count() > 2 ) { fprintf(Stream, "\"%s\",\"%s\",%d\n", pShape->asString(iName1), pShape->asString(iName2), Pts.Get_Count() ); for(iPoint=0; iPointasString(); if( (pLayer = Parameters("SHAPES")->asShapes()) != NULL ) { if( (aus = fopen(fName.b_str(), "w")) != NULL ) { if( pLayer->Get_Field_Count() > 0 ) { iField = Parameters("FIELD")->asInt(); if( pLayer->Get_Field_Type(iField) == SG_DATATYPE_String ) { iField = -1; } fprintf(aus, "EXP %s\nARC ", pLayer->Get_Name()); for(iShape=0; iShapeGet_Count() && Set_Progress(iShape, pLayer->Get_Count()); iShape++) { pShape = pLayer->Get_Shape(iShape); for(iPart=0; iPartGet_Part_Count(); iPart++) { // Value... if( iField < 0 ) { fprintf(aus, "%d ", iShape + 1); } else { fprintf(aus, "%lf ", pShape->asDouble(iField)); } // dummy_I dummy_I dummy_I dummy_I dummy_I... fprintf(aus, "1 2 3 4 5 "); // I_np... fprintf(aus, "%d ", pShape->Get_Point_Count(iPart)); for(iPoint=0; iPointGet_Point_Count(iPart); iPoint++) { Point = pShape->Get_Point(iPoint, iPart); fprintf(aus, "%f %f ", Point.x, Point.y); } } } } fclose(aus); return( true ); } } return( false ); } saga-2.1.0+dfsg/src/modules_io/shapes/io_shapes/generate.h000066400000000000000000000100771224124640700235010ustar00rootroot00000000000000/********************************************************** * Version $Id: generate.h 1246 2011-11-25 13:42:38Z oconrad $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // Shapes_IO // // // //-------------------------------------------------------// // // // Generate.h // // // // Copyright (C) 2003 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Goettingen // // Goldschmidtstr. 5 // // 37077 Goettingen // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #ifndef HEADER_INCLUDED__GENERATE_H #define HEADER_INCLUDED__GENERATE_H //--------------------------------------------------------- //--------------------------------------------------------- #include "MLB_Interface.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- class CGenerate_Export : public CSG_Module { public: CGenerate_Export(void); virtual ~CGenerate_Export(void); virtual CSG_String Get_MenuPath(void) { return( _TL("R:Export") ); } protected: virtual bool On_Execute(void); }; #endif // #ifndef HEADER_INCLUDED__GENERATE_H saga-2.1.0+dfsg/src/modules_io/shapes/io_shapes/gpx.cpp000066400000000000000000000347721224124640700230500ustar00rootroot00000000000000/********************************************************** * Version $Id: gpx.cpp 911 2011-02-14 16:38:15Z reklov_w $ *********************************************************/ /////////////////////////////////////////////////////////// // // // SAGA // // // // System for Automated Geoscientific Analyses // // // // Module Library: // // io_shapes // // // //-------------------------------------------------------// // // // gpx.cpp // // // // Copyright (C) 2009 by // // Olaf Conrad // // // //-------------------------------------------------------// // // // This file is part of 'SAGA - System for Automated // // Geoscientific Analyses'. SAGA 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; version 2 of the License. // // // // SAGA 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, // // write to the Free Software Foundation, Inc., // // 59 Temple Place - Suite 330, Boston, MA 02111-1307, // // USA. // // // //-------------------------------------------------------// // // // e-mail: oconrad@saga-gis.org // // // // contact: Olaf Conrad // // Institute of Geography // // University of Hamburg // // Germany // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #include "gpx.h" /////////////////////////////////////////////////////////// // // // // // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- CGPX_Import::CGPX_Import(void) { Set_Name (_TL("Import GPX")); Set_Author (SG_T("O. Conrad (c) 2009")); Set_Description (_TW( "Imports GPS data from GPS eXchange format GPX.\n" "\n" "References:\n" "The GPS Exchange Format" )); //----------------------------------------------------- Parameters.Add_Shapes_List( NULL , "SHAPES" , _TL("GPX Import"), _TL(""), PARAMETER_OUTPUT_OPTIONAL ); Parameters.Add_FilePath( NULL , "FILE" , _TL("File"), _TL(""), CSG_String::Format(SG_T("%s|%s|%s|%s"), _TL("GPS Exchange Format (*.gpx)") , SG_T("*.gpx"), _TL("All Files") , SG_T("*.*") ), NULL, false ); Parameters.Add_Value( NULL , "TIME" , _TL("Time Stamp without date"), _TL(""), PARAMETER_TYPE_Bool, true ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- bool CGPX_Import::On_Execute(void) { CSG_Shapes *pWay; CSG_MetaData GPX; //----------------------------------------------------- m_Name = Parameters("FILE") ->asString(); m_pShapes = Parameters("SHAPES") ->asShapesList(); m_bTime = Parameters("TIME") ->asBool(); //----------------------------------------------------- if( !GPX.Create(m_Name) || GPX.Get_Name().CmpNoCase(SG_T("gpx")) ) { return( false ); } //----------------------------------------------------- pWay = SG_Create_Shapes(SHAPE_TYPE_Point, m_Name); m_Name = SG_File_Get_Name(m_Name, false); m_pShapes->Del_Items(); //----------------------------------------------------- for(int i=0; iGet_Name().CmpNoCase(SG_T("wpt")) == 0 ) { Add_Point(pChild, pWay); } else if( pChild->Get_Name().CmpNoCase(SG_T("rte")) == 0 ) { Add_Route(pChild); } else if( pChild->Get_Name().CmpNoCase(SG_T("trk")) == 0 ) { Add_Track(pChild); } } //----------------------------------------------------- if( pWay->Get_Count() > 0 ) { m_pShapes->Add_Item(pWay); } else { delete(pWay); } return( m_pShapes->Get_Count() > 0 ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define GET_CONTENT(node, child, default) (node->Get_Child(SG_T(child)) ? node->Get_Child(SG_T(child))->Get_Content() : SG_T(default)) //--------------------------------------------------------- bool CGPX_Import::Add_Route(CSG_MetaData *pRoute) { // xsd:string // xsd:string // xsd:string // xsd:string // linkType // xsd:nonNegativeInteger // xsd:string CSG_String Name(GET_CONTENT(pRoute, "name", "Route")); CSG_Shapes *pPoints = SG_Create_Shapes(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_Name.c_str(), Name.c_str())); m_pShapes->Add_Item(pPoints); for(int i=0; iGet_Children_Count(); i++) { CSG_MetaData *pChild = pRoute->Get_Child(i); if( pChild->Get_Name().CmpNoCase(SG_T("rtept")) == 0 ) { Add_Point(pChild, pPoints); } } return( true ); } //--------------------------------------------------------- bool CGPX_Import::Add_Track(CSG_MetaData *pTrack) { // xsd:string // xsd:string // xsd:string // xsd:string // linkType // xsd:nonNegativeInteger // xsd:string CSG_MetaData *pSegment = pTrack->Get_Child(SG_T("trkseg")); if( pSegment ) { CSG_String Name(GET_CONTENT(pTrack, "name", "Track Segment")); CSG_Shapes *pPoints = SG_Create_Shapes(SHAPE_TYPE_Point, CSG_String::Format(SG_T("%s [%s]"), m_Name.c_str(), Name.c_str())); m_pShapes->Add_Item(pPoints); for(int i=0; iGet_Children_Count(); i++) { CSG_MetaData *pChild = pSegment->Get_Child(i); if( pChild->Get_Name().CmpNoCase(SG_T("trkpt")) == 0 ) { Add_Point(pChild, pPoints); } } return( true ); } return( false ); } /////////////////////////////////////////////////////////// // // /////////////////////////////////////////////////////////// //--------------------------------------------------------- #define ADD_FIELD(key, type) if( pNode->Get_Child(SG_T(key)) ) { pPoints->Add_Field(SG_T(key), type); } inline bool CGPX_Import::Add_Fields(CSG_MetaData *pNode, CSG_Shapes *pPoints) { if( pPoints->Get_Field_Count() == 0 ) { ADD_FIELD("ele" , SG_DATATYPE_Double); // xsd:decimal (Hhe) ADD_FIELD("time" , SG_DATATYPE_String); //